简介
A:备份源数据库,将A中某个数据进行备份
B:操作机,将A的数据备份到B机器上
在A机器上创建用户
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| create user dbexp identified by “passwd”; ````
### 在A机器上授权
```sql grant datapump_exp_full_database to dbexp; ````
### 在B机器上创建dir ```sql create directory dname as ‘/home/oracle/name’;
|
在B机器上创建访问A机器数据库的dblink
1
| create database link linkname connect to username identified by password using ‘(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = IP )(PORT = PORT )))(CONNECT_DATA =(SERVICE_NAME = SID )))’;
|
验证:
1
| select * from dual@LINKNAME;
|
在B机器上执行A数据库的导出
1 2 3
| expdp ‘/as sysdba’ directory=dname dumpfile=name.dmp logfile=name.log schemas=name network_link=dbexpdblink
|