ORACLE 11.2.0.4版本EXPDP不會匯出回收站中資料

還不算暈發表於2016-11-20
結論:
在ORACLE 11.2.0.4版本資料庫中,清理回收站與否,不影響EXPDP匯出檔案的大小-即EXPDP不會匯出回收站中資料。


1.正常匯出
SQL> select segment_name,bytes/1024/1024 mb from user_segments;

SEGMENT_NAME                           MB
------------------------------ ----------
T1                                  .0625
T2                                     38
PK_T                                .0625

SQL> show user
USER is "BYS"
SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

SQL> show recyclebin;
SQL>
SQL>  select sysdate from dual;

SYSDATE
-------------------
2016/10/11 10:52:52

[oracle@bys1 ~]$ expdp system/oracle DUMPFILE=test.dmp DIRECTORY=MY_DIR SCHEMAS=bys

Export: Release 11.2.0.4.0 - Production on Tue Oct 11 10:53:03 2016

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, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** DUMPFILE=test.dmp DIRECTORY=MY_DIR SCHEMAS=bys
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 38.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
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/STATISTICS/TABLE_STATISTICS
. . exported "BYS"."T2"                                  32.02 MB  152180 rows
. . exported "BYS"."T1"                                  5.437 KB       5 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /home/oracle/test.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at Tue Oct 11 10:53:17 2016 elapsed 0 00:00:12


##########################
2.刪除表至回收站,繼續匯出

SQL> drop table t2;

Table dropped.

SQL> show recyclebin;
ORIGINAL NAME    RECYCLEBIN NAME                OBJECT TYPE  DROP TIME
---------------- ------------------------------ ------------ -------------------
T2               BIN$Po7wBVOlB17gU9M5qMDlPg==$0 TABLE        2016-10-11:10:53:43
SQL>
SQL> select segment_name,bytes/1024/1024 mb from user_segments;


SEGMENT_NAME                           MB
------------------------------ ----------
T1                                  .0625
BIN$Po7wBVOlB17gU9M5qMDlPg==$0         38
PK_T                                .0625

[oracle@bys1 ~]$ expdp system/oracle DUMPFILE=test1.dmp DIRECTORY=MY_DIR SCHEMAS=bys

Export: Release 11.2.0.4.0 - Production on Tue Oct 11 10:54:10 2016

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, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** DUMPFILE=test1.dmp DIRECTORY=MY_DIR SCHEMAS=bys
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/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/STATISTICS/TABLE_STATISTICS
. . exported "BYS"."T1"                                  5.437 KB       5 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /home/oracle/test1.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at Tue Oct 11 10:54:23 2016 elapsed 0 00:00:11

[oracle@bys1 ~]$ du -sh tes*
208K    test1.dmp
4.0K    test1.log
33M     test.dmp


相關文章