Thursday, September 26, 2013

Export Logical Database Backup Dumps to ASM Disk

I have created both directory and folder within the ASM diskgroup.

bash-3.2$ echo $ORACLE_HOME
/oracle/grid_home
bash-3.2$
bash-3.2$ echo $ORACLE_SID
+ASM1

bash-3.2$ asmcmd -p
ASMCMD [+] >

ASMCMD [+] > ls
DATA/
FRA/

ASMCMD [+] > cd FRA
ASMCMD [+FRA] >

ASMCMD [+FRA] > mkdir dpdump
ASMCMD [+FRA] >

ASMCMD [+FRA] > cd dp*
ASMCMD [+FRA/dpdump] >

ASMCMD [+FRA/dpdump] > pwd
+FRA/dpdump
ASMCMD [+FRA/dpdump] >

bash-3.2$ sqlplus / as sysdba

SQL> create directory test_dir as '+FRA/dpdump';

Directory created.

SQL>
SQL> select * from dba_directories;

OWNER          DIRECTORY_NAME  DIRECTORY_PATH
--------------   --------------                ----------------------------------
SYS                TEST_DIR                     +FRA/dpdump
SYS                DATA_PUMP_DIR        /U04/dpdump

SQL>

bash-3.2$
bash-3.2$ expdp directory=TEST_DIR dumpfile=test_full.dmp logfile=test_full.log full=y exclude=statistics content=metadata_only

Export: Release 11.2.0.2.0 - Production on Thu Sep 26 15:43:15 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation

bash-3.2$

Here we have seen an error "unable to open log file".

So now the gimmick is, to use existing directory, such as DATA_PUMP_DIR which is placed on a local filesystem and point the logfile to that directory. Using the syntax 'logfile=directory:logfile'. An alternative option is to use the expdp parameter to nologfile=yes

bash-3.2$
bash-3.2$ expdp directory=TEST_DIR dumpfile=test_full.dmp logfile=DATA_PUMP_DIR:test_full.log full=y exclude=statistics content=metadata_only

Export: Release 11.2.0.2.0 - Production on Thu Sep 26 15:48:48 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Starting "SYS"."SYS_EXPORT_FULL_05":  /******** AS SYSDBA directory=TEST_DIR dumpfile=test_full.dmp logfile=DATA_PUMP_DIR:test_full.log full=y exclude=statistics content=metadata_only
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTION
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SYS_USER/USER
Processing object type DATABASE_EXPORT/SCHEMA/USER
.
.
.
Dump file set for SYS.SYS_EXPORT_FULL_05 is:
  +FRA/dpdump/test_full.dmp
Job "SYS"."SYS_EXPORT_FULL_05" successfully completed at 16:00:52
bash-3.2$

Hope this help you.

Best Regards,

No comments:

Post a Comment

Some Most Popular Articles