oracle的expdp和impdp命令研究
--創建遠程數據連接
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