--创建远程数据连接
create database link DB_MZDB11 connect to YTMZTWO identified by YTMZTWO909 using ‘MZDB11‘;
--创建本地目录
create directory db_mz as ‘c:‘;
--授权用户读写
grant read,write on directory db_mz to YTMZTWO,YTMZ;
--授权用户可以创建dblink
grant create database link to YTMZTWO,YTMZ;
grant resource to YTMZTWO;
--导出命令
expdp YTMZTWO/YTMZ2.2 schemas=YTMZTWO dumpfile=YTMZTWO.DMP directory=db_mz network_link=DB_MZDB11 logfile=log.log exclude=TABLE:\" IN \(\‘PUB_ATTACHMENT\‘,\‘PUB_SIGNSEAL\‘\)\"
--在配置文件中添加内容
ORCL_rxxc =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 61.139.100.204)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORACLE)
)
)
--直接导入数据命令
impdp YTMZTWO/YTMZ2.2 directory=db_mz NETWORK_LINK=DB_MZDB11 schemas=YTMZTWO logfile=log.log exclude=TABLE:\" IN \(\‘PUB_ATTACHMENT\‘,\‘PUB_SIGNSEAL\‘\)\"
job_name=my_job