oracle expdp directory参数创建,【EXPDP】不使用DIRECTORY参数完成expdp数据备份

在使用expdp工具备份数据库的时候,一般需要使用DIRECTORY参数指定备份文件和日志文件的存放位置。其实DIRECTORY参数并不是必须的。我们可以将目录写到dumpfile参数和logfile参数中以便实现同样的目的。1.创建expdp备份文件存放目录ora10g@secdb /home/oracle$ mkdir secoolerora10g@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.logExport: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 21:09:02Copyright (c) 2003, 2005, Oracle.  All rights reserved.Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsStarting "SEC"."SYS_EXPORT_SCHEMA_01":  sec/******** dumpfile=dir_secooler:sec.dmp logfile=dir_secooler:sec.logEstimate in progress using BLOCKS method...Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATATotal estimation using BLOCKS method: 64 KBProcessing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMAProcessing object type SCHEMA_EXPORT/TABLE/TABLEProcessing object type SCHEMA_EXPORT/TABLE/INDEX/INDEXProcessing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINTProcessing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICSProcessing object type SCHEMA_EXPORT/TABLE/COMMENT. . exported "SEC"."T"                                   4.921 KB       1 rowsMaster table "SEC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded******************************************************************************Dump file set for SEC.SYS_EXPORT_SCHEMA_01 is:/home/oracle/secooler/sec.dmpJob "SEC"."SYS_EXPORT_SCHEMA_01" successfully completed at 21:09:152)查看生成的备份文件及参数文件ora10g@secdb /home/oracle/secooler$ ls -tlrtotal 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.dmp4.关于日志文件的注意事项使用这种方法,日志文件参数必须指定,并且必须给出DIRECTORY名字,否则会报“ORA-39145”错误,表明找不到地方写日志文件。ora10g@secdb /home/oracle/secooler$ expdp sec/sec dumpfile=dir_secooler:sec.dmpExport: Release 10.2.0.1.0 - Production on Monday, 27 June, 2011 21:12:05Copyright (c) 2003, 2005, Oracle.  All rights reserved.Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsORA-39002: invalid operationORA-39070: Unable to open the log file.ORA-39145: directory object parameter must be specified and non-null5.小结本文虽然给出了不使用DIRECTORY参数完成expdp数据备份的方法,但是细心的您一定发现,虽然省略了DIRECTORY参数,但是必须在DUMPFILE及LOGFILE参数中指定DIRECTORY名。到底使用哪种方法只能看个人喜好了。Good luck.secooler11.06.27-- The End --

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值