【EXPDP】不使用DIRECTORY引數完成expdp資料備份
在使用expdp工具備份資料庫的時候,一般需要使用DIRECTORY引數指定備份檔案和日誌檔案的存放位置。其實DIRECTORY引數並不是必須的。我們可以將目錄寫到dumpfile引數和logfile引數中以便實現同樣的目的。
1.建立expdp備份檔案存放目錄
ora10g@secdb /home/oracle$ mkdir secooler
ora10g@secdb /home/oracle$ cd secooler/
ora10g@secdb /home/oracle/secooler$
2.在資料庫中建立指向secooler目錄的DIRECTORY資料庫物件
sys@ora10g> create directory dir_secooler as '/home/oracle/secooler';
Directory created.
sys@ora10g> grant read,write on directory dir_secooler to public;
Grant succeeded.
3.在DUMPFILE及LOGFILE引數中指定DIRECTORY名的備份方法
注意:DUMPFILE及LOGFILE引數均需要指定DIRECTORY名
1)備份過程
ora10g@secdb /home/oracle/secooler$ expdp sec/sec dumpfile=dir_secooler:sec.dmp logfile=dir_secooler:sec.log
Export: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 21:09:02
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "SEC"."SYS_EXPORT_SCHEMA_01": sec/******** dumpfile=dir_secooler:sec.dmp logfile=dir_secooler:sec.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
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/COMMENT
. . exported "SEC"."T" 4.921 KB 1 rows
Master table "SEC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SEC.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/secooler/sec.dmp
Job "SEC"."SYS_EXPORT_SCHEMA_01" successfully completed at 21:09:15
2)檢視生成的備份檔案及引數檔案
ora10g@secdb /home/oracle/secooler$ ls -tlr
total 156K
-rw-r--r-- 1 oracle oinstall 1.3K Jun 27 21:09 sec.log
-rw-r----- 1 oracle oinstall 148K Jun 27 21:09 sec.dmp
4.關於日誌檔案的注意事項
使用這種方法,日誌檔案引數必須指定,並且必須給出DIRECTORY名字,否則會報“ORA-39145”錯誤,表明找不到地方寫日誌檔案。
ora10g@secdb /home/oracle/secooler$ expdp sec/sec dumpfile=dir_secooler:sec.dmp
Export: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 21:12:05
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39145: directory object parameter must be specified and non-null
5.小結
本文雖然給出了不使用DIRECTORY引數完成expdp資料備份的方法,但是細心的您一定發現,雖然省略了DIRECTORY引數,但是必須在DUMPFILE及LOGFILE引數中指定DIRECTORY名。到底使用哪種方法只能看個人喜好了。
Good luck.
secooler
11.06.27
-- The End --
1.建立expdp備份檔案存放目錄
ora10g@secdb /home/oracle$ mkdir secooler
ora10g@secdb /home/oracle$ cd secooler/
ora10g@secdb /home/oracle/secooler$
2.在資料庫中建立指向secooler目錄的DIRECTORY資料庫物件
sys@ora10g> create directory dir_secooler as '/home/oracle/secooler';
Directory created.
sys@ora10g> grant read,write on directory dir_secooler to public;
Grant succeeded.
3.在DUMPFILE及LOGFILE引數中指定DIRECTORY名的備份方法
注意:DUMPFILE及LOGFILE引數均需要指定DIRECTORY名
1)備份過程
ora10g@secdb /home/oracle/secooler$ expdp sec/sec dumpfile=dir_secooler:sec.dmp logfile=dir_secooler:sec.log
Export: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 21:09:02
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "SEC"."SYS_EXPORT_SCHEMA_01": sec/******** dumpfile=dir_secooler:sec.dmp logfile=dir_secooler:sec.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
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/COMMENT
. . exported "SEC"."T" 4.921 KB 1 rows
Master table "SEC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SEC.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/secooler/sec.dmp
Job "SEC"."SYS_EXPORT_SCHEMA_01" successfully completed at 21:09:15
2)檢視生成的備份檔案及引數檔案
ora10g@secdb /home/oracle/secooler$ ls -tlr
total 156K
-rw-r--r-- 1 oracle oinstall 1.3K Jun 27 21:09 sec.log
-rw-r----- 1 oracle oinstall 148K Jun 27 21:09 sec.dmp
4.關於日誌檔案的注意事項
使用這種方法,日誌檔案引數必須指定,並且必須給出DIRECTORY名字,否則會報“ORA-39145”錯誤,表明找不到地方寫日誌檔案。
ora10g@secdb /home/oracle/secooler$ expdp sec/sec dumpfile=dir_secooler:sec.dmp
Export: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 21:12:05
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-39145: directory object parameter must be specified and non-null
5.小結
本文雖然給出了不使用DIRECTORY引數完成expdp資料備份的方法,但是細心的您一定發現,雖然省略了DIRECTORY引數,但是必須在DUMPFILE及LOGFILE引數中指定DIRECTORY名。到底使用哪種方法只能看個人喜好了。
Good luck.
secooler
11.06.27
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-700840/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- expdp 邏輯備份指令碼指令碼
- Oracle資料庫的邏輯備份工具-expdp資料泵Oracle資料庫
- [20200620]expdp impdp exclude引數.txt
- Expdp 備份到ASM之 ORA-39070ASM
- expdp/impdp 詳細引數解釋
- impdp和expdp用法及引數介紹
- Oracle 效能優化-expdp備份速度優化02Oracle優化
- Oracle 效能優化-expdp備份速度優化03Oracle優化
- Oracle 10g expdp attach引數體驗Oracle 10g
- 使用資料泵(expdp、impdp)遷移資料庫流程資料庫
- Oracle EXPDP自動備份緩慢問題解決Oracle
- oracle資料庫的impdp,expdpOracle資料庫
- 使用impdp,expdp資料泵進入海量資料遷移
- exp和expdp的filesize引數的使用--匯出多個檔案
- Java程式呼叫expdp資料泵實現自動邏輯備份Oracle資料庫的方案設計JavaOracle資料庫
- 批量按使用者expdp
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- 【Data Pump】理解expdp中的ESTIMATE和ESTIMATE_ONLY引數
- Oracle expdp資料泵遠端匯出Oracle
- expdp query用法
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- oracle按照表條件expdp匯出資料Oracle
- expdp一個例子
- 使用Exp和Expdp匯出資料的效能對比與最佳化
- 【資料泵】EXPDP匯出表結構(真實案例)
- expdp在匯出時對資料大小進行評估
- 資料泵datapump(expdp/impdp)的parfile用法,避免跳脫字元字元
- 通過dblink,資料泵expdp遠端跨版本導庫
- 【Datapump】Oracle資料泵遷移資料命令參考(expdp/impdp說明)Oracle
- expdp+compression效能測試
- 正常終止expdp作業
- expdp報錯ORA-39181
- 【Oracle】sys下缺失和無效物件導致exp、expdp和RMAN等備份功能全部報錯Oracle物件
- MySQL資料備份多種引數介紹及簡單示例MySql
- [20180628]expdp與rows=n.txt
- [20200309]expdp 與read only.txt
- expdp 匯出時指定節點
- expdp/impdp變慢 (Doc ID 2469587.1)
- 【Data Pump】expdp/impdp Job基本管理