1、創(chuàng)建DIRECTORY
創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供雨花網(wǎng)站建設(shè)、雨花做網(wǎng)站、雨花網(wǎng)站設(shè)計(jì)、雨花網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、雨花企業(yè)網(wǎng)站模板建站服務(wù),10年雨花做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。SQL> create or replace directory dir_dp as '/fol/dir_dp'; Directory created.2、授權(quán)
SQL> grant read,write on directory dir_dp to scott; Grant succeeded.3.查看目錄及權(quán)限
SQL> set lines 200 pagesize 1000 SQL> SELECT privilege, directory_name, DIRECTORY_PATH FROM user_tab_privs t, all_directories d WHERE t.table_name(+) = d.directory_name ORDER BY 2, 1; PRIVILEGE DIRECTORY_NAME DIRECTORY_PATH --------------- ------------------------------ ---------------------------------------------------------------------------------------------------- READ DATA_FILE_DIR /fol/app/oracle/product/11.2.0/db_1/demo/schema/sales_history/ READ DATA_PUMP_DIR /fol/app/oracle/admin/CPP/dpdump/ READ DATA_PUMP_DIR /fol/app/oracle/admin/CPP/dpdump/ WRITE DATA_PUMP_DIR /fol/app/oracle/admin/CPP/dpdump/ WRITE DATA_PUMP_DIR /fol/app/oracle/admin/CPP/dpdump/ READ DIR_DP /fol/dir_dp WRITE DIR_DP /fol/dir_dp READ LOG_FILE_DIR /fol/app/oracle/product/11.2.0/db_1/demo/schema/log/ WRITE LOG_FILE_DIR /fol/app/oracle/product/11.2.0/db_1/demo/schema/log/ READ MEDIA_DIR /fol/app/oracle/product/11.2.0/db_1/demo/schema/product_media/ READ ORACLE_OCM_CONFIG_DIR /fol/app/oracle/product/11.2.0/db_1/ccr/state WRITE ORACLE_OCM_CONFIG_DIR /fol/app/oracle/product/11.2.0/db_1/ccr/state READ ORACLE_OCM_CONFIG_DIR2 /fol/app/oracle/product/11.2.0/db_1/ccr/state WRITE ORACLE_OCM_CONFIG_DIR2 /fol/app/oracle/product/11.2.0/db_1/ccr/state READ SS_OE_XMLDIR /fol/app/oracle/product/11.2.0/db_1/demo/schema/order_entry/ WRITE SS_OE_XMLDIR /fol/app/oracle/product/11.2.0/db_1/demo/schema/order_entry/ READ SUBDIR /fol/app/oracle/product/11.2.0/db_1/demo/schema/order_entry//2002/Sep WRITE SUBDIR /fol/app/oracle/product/11.2.0/db_1/demo/schema/order_entry//2002/Sep XMLDIR /fol/app/oracle/product/11.2.0/db_1/rdbms/xml 19 rows selected. SQL> select DEFAULT_TABLESPACE from dba_users where username='SCOTT'; DEFAULT_TABLESPACE ------------------------------ USERS4.執(zhí)行導(dǎo)出
expdp scott/scott@CPP schemas=scott directory=dir_dp dumpfile =expdp_scott1.dmp logfile=expdp_scott1.log; $ expdp scott/scott@CPP schemas=scott directory=dir_dp dumpfile =expdp_scott1.dmp logfile=expdp_scott1.log; Export: Release 11.2.0.4.0 - Production on Fri Sep 11 16:02:49 2015 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Starting "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/********@CPP schemas=scott directory=dir_dp dumpfile=expdp_scott1.dmp logfile=expdp_scott1.log Estimate in progress using BLOCKS method... Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 10.18 MB Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/COMMENT Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS . . exported "SCOTT"."TEST" 8.414 MB 86785 rows . . exported "SCOTT"."DEPT" 5.937 KB 4 rows . . exported "SCOTT"."EMP" 8.570 KB 14 rows . . exported "SCOTT"."SALGRADE" 5.867 KB 5 rows . . exported "SCOTT"."BONUS" 0 KB 0 rows Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is: /fol/dir_dp/expdp_scott1.dmp Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at Fri Sep 11 16:03:28 2015 elapsed 0 00:00:37目標(biāo)庫:
1、創(chuàng)建測試表空間和用戶
SQL> create tablespace LLC datafile '+DATA/phub/datafile/LLC01.dbf' size 5G; Tablespace created. SQL> create user lilc identified by lilc default tablespace LLC; User created. SQL> grant dba to lilc; Grant succeeded. SQL> conn lilc/lilc; Connected. SQL> select DEFAULT_TABLESPACE from dba_users where username='LILC'; DEFAULT_TABLESPACE ------------------------------ LLC2.創(chuàng)建DIRECTORY
SQL> create or replace directory dir_dp as '/home/oracle/dir_dp'; Directory created.3.授權(quán)
SQL> grant read,write on directory dir_dp to lilc;4.執(zhí)行導(dǎo)入:
更換表空間和更換用戶導(dǎo)入:
[oracle@cwogg dir_dp]$ impdp lilc/lilc directory=dir_dp DUMPFILE=expdp_scott1.dmp remap_schema=scott:lilc remap_tablespace=USERS:LLC exclude=USER Import: Release 11.2.0.4.0 - Production on Fri Sep 11 16:40:57 2015 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options Master table "LILC"."SYS_IMPORT_FULL_01" successfully loaded/unloaded Starting "LILC"."SYS_IMPORT_FULL_01": lilc/******** directory=dir_dp DUMPFILE=expdp_scott1.dmp remap_schema=scott:lilc remap_tablespace=USERS:LLC exclude=USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA . . imported "LILC"."TEST" 16.81 MB 173570 rows . . imported "LILC"."DEPT" 5.937 KB 4 rows . . imported "LILC"."EMP" 8.570 KB 14 rows . . imported "LILC"."SALGRADE" 5.867 KB 5 rows . . imported "LILC"."BONUS" 0 KB 0 rows Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS Processing object type SCHEMA_EXPORT/VIEW/VIEW Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS Job "LILC"."SYS_IMPORT_FULL_01" successfully completed at Fri Sep 11 16:41:05 2015 elapsed 0 00:00:07目標(biāo)庫上沒有相同的用戶導(dǎo)出和導(dǎo)入:
$ expdp system/123123@CPP schemas=test directory=dir_dp dumpfile =test.dmp logfile=test.log; Export: Release 11.2.0.4.0 - Production on Fri Sep 11 17:32:57 2015 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/********@CPP schemas=test directory=dir_dp dumpfile=test.dmp logfile=test.log Estimate in progress using BLOCKS method... Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 20.06 MB Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE . . exported "TEST"."T" 16.81 MB 173576 rows . . exported "TEST"."T2" 19.25 KB 74 rows Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is: /fol/dir_dp/test.dmp Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at Fri Sep 11 17:33:06 2015 elapsed 0 00:00:07導(dǎo)入:(更改用戶的默認(rèn)表空間)
[oracle@cwogg dir_dp]$ impdp lilc/lilc directory=dir_dp DUMPFILE=test.dmp remap_schema=test:test remap_tablespace=test:LLC logfile=test.log; Import: Release 11.2.0.4.0 - Production on Fri Sep 11 17:53:26 2015 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options Master table "LILC"."SYS_IMPORT_FULL_01" successfully loaded/unloaded Starting "LILC"."SYS_IMPORT_FULL_01": lilc/******** directory=dir_dp DUMPFILE=test.dmp remap_schema=test:test remap_tablespace=test:LLC logfile=test.log Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA . . imported "TEST"."T" 16.81 MB 173576 rows . . imported "TEST"."T2" 19.25 KB 74 rows Job "LILC"."SYS_IMPORT_FULL_01" successfully completed at Fri Sep 11 17:53:32 2015 elapsed 0 00:00:05另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
當(dāng)前文章:expdp和impdp使用之一(不同用戶和不用表空間)-創(chuàng)新互聯(lián)
當(dāng)前路徑:http://aaarwkj.com/article22/dshpcc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站內(nèi)鏈、外貿(mào)建站、全網(wǎng)營銷推廣、微信公眾號、商城網(wǎng)站、手機(jī)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容