expdp reuse_dumpfiles parametresi

expdp reuse_dumpfiles parametresi

11G ile gelen bu özellik sayesinde önceden var olan dump dosyasını yenisi ile ezer.expdp komutunda bu parametreye bir değer vermeseniz defaultu N’dir.Eğer export alırken ORA-27038: created file already exist hatası alıyorsanız expdp komutuna reuse_dumpfiles=y parametresini ekleyerek eski dosyayı ezmesini sağlayabilirsiniz.

Bir örnek yapalım.

1-) Önce export alacağımız bir directory oluşturalım ve Scott userına yetki verelim.

SQL> CREATE DIRECTORY EXPORT_DIR AS'/orabackup/export_backup/';
SQL> GRANT READ,WRITE ON DIRECTORY EXPORT_DIR TO SCOTT;
SQL> GRANT EXP_FULL_DATABASE TO SCOTT;

2-) Scott userı ile kendi schemasını export edelim..

-bash-3.2$ expdp scott/tiger@ractst dumpfile=scott.dmp directory=export_dir
 
Export: Release 11.2.0.2.0 - Production on Sat Oct 17 11:02:58 2015
 
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
 
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 "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/********@ractst dumpfile=scott.dmp directory=export_dir
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
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/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
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
. . exported "SCOTT"."DEPT" 5.929 KB 4 rows
. . exported "SCOTT"."EMP" 8.562 KB 14 rows
. . exported "SCOTT"."SALGRADE" 5.859 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:
/orabackup/export_backup/scott.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 11:03:42

3-) Scott userı ile kendi schemasını tekrar export etmeye çalışalım.Daha önce dosya var oldugundan ORA-27038: created file already exists hatası almamız gerekiyor.

-bash-3.2$ expdp scott/tiger@ractst dumpfile=scott.dmp directory=export_dir
 
Export: Release 11.2.0.2.0 - Production on Sat Oct 17 11:06:55 2015
 
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
 
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-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "/orabackup/export_backup/scott.dmp"
ORA-27038: created file already exists
Additional information: 1

4-) Şimdi reuse_dumpfiles=y parametresi vererek deneyelim.Eski dump dosyasını yenisi ile ezecektir.

-bash-3.2$ expdp scott/tiger@ractst dumpfile=scott.dmp directory=export_dir reuse_dumpfiles=y
 
Export: Release 11.2.0.2.0 - Production on Sat Oct 17 11:09:26 2015
 
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
 
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 "SCOTT"."SYS_EXPORT_SCHEMA_01": scott/********@ractst dumpfile=scott.dmp directory=export_dir reuse_dumpfiles=y
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
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/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
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
. . exported "SCOTT"."DEPT" 5.929 KB 4 rows
. . exported "SCOTT"."EMP" 8.562 KB 14 rows
. . exported "SCOTT"."SALGRADE" 5.859 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:
/orabackup/export_backup/scott.dmp
Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 11:09:38

Tagged: , , , , ,

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir