data dump for sequence

[oracle@linux26 imp]$ sqlplus exp1/exp1

SQL*Plus: Release 11.2.0.1.0 Production on Tue Sep 3 19:33:59 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select table_name from user_tables;

no rows selected

SQL> create table t (id number);

Table created.


SQL> insert into t values (1);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from t;

        ID
----------
         1

SQL> select LAST_NUMBER from user_sequences;

LAST_NUMBER
-----------
         32

SQL> select seq_test.nextval from dual;

   NEXTVAL
----------
        24

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@linux26 imp]$ expdp system/oracle schemas=exp1 directory=imp content=metadata_only dumpfile=exp1.dmp logfile=exp1.log

Export: Release 11.2.0.1.0 - Production on Tue Sep 3 19:38:15 2013

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** schemas=exp1 directory=imp content=metadata_only dumpfile=exp1.dmp logfile=exp1.log
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/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /home/oracle/imp/exp1.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 19:39:17

[oracle@linux26 imp]$ sqlplus exp1/exp1

SQL*Plus: Release 11.2.0.1.0 Production on Tue Sep 3 19:39:23 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> insert into t values(2);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from t;

        ID
----------
         1
         2

SQL> select LAST_NUMBER from user_sequences;

LAST_NUMBER
-----------
         32

SQL> select seq_test.nextval from dual;                ###做完expdp 序列的变化   content=metadata_only

   NEXTVAL
----------
        32

SQL> select LAST_NUMBER from user_sequences;

LAST_NUMBER
-----------
         42

SQL> select seq_test.nextval from dual;

   NEXTVAL
----------
        33

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@linux26 imp]$ expdp system/oracle schemas=exp1 directory=imp content=metadata_only dumpfile=exp2.dmp logfile=exp2.log

Export: Release 11.2.0.1.0 - Production on Tue Sep 3 19:41:31 2013

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** schemas=exp1 directory=imp content=metadata_only dumpfile=exp2.dmp logfile=exp2.log
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/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /home/oracle/imp/exp2.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 19:42:14

[oracle@linux26 imp]$ sqlplus exp1/exp1

SQL*Plus: Release 11.2.0.1.0 Production on Tue Sep 3 19:42:21 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select LAST_NUMBER from user_sequences;

LAST_NUMBER
-----------
         42

SQL> select seq_test.nextval from dual;

   NEXTVAL
----------
        42

SQL> insert into t values(3);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from t;

        ID
----------
         1
         2
         3

SQL> select seq_test.currval from dual;

   CURRVAL
----------
        42

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@linux26 imp]$ expdp system/oracle schemas=exp1 directory=imp content=data_only dumpfile=exp3.dmp logfile=exp3.log

Export: Release 11.2.0.1.0 - Production on Tue Sep 3 19:43:57 2013

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** schemas=exp1 directory=imp content=data_only dumpfile=exp3.dmp logfile=exp3.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
. . exported "EXP1"."T"                                  5.015 KB       3 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /home/oracle/imp/exp3.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 19:44:06

[oracle@linux26 imp]$ sqlplus exp1/exp1

SQL*Plus: Release 11.2.0.1.0 Production on Tue Sep 3 19:44:13 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select LAST_NUMBER from user_sequences;

LAST_NUMBER
-----------
         52

SQL> select seq_test.nextval from dual;                       ###做完expdp 序列的变化   content=data_only

   NEXTVAL
----------
        43

SQL> conn / as sysdba
Connected.
SQL> drop user exp1 cascade;

User dropped.

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@linux26 imp]$ impdp system/oracle directory=imp dumpfile=exp2.dmp logfile=exp2imp.log

Import: Release 11.2.0.1.0 - Production on Tue Sep 3 19:47:17 2013

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** directory=imp dumpfile=exp2.dmp logfile=exp2imp.log
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/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 19:47:22

[oracle@linux26 imp]$ sqlplus exp1/exp1

SQL*Plus: Release 11.2.0.1.0 Production on Tue Sep 3 19:47:32 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from t;

no rows selected

SQL>  select LAST_NUMBER from user_sequences;

LAST_NUMBER
-----------
         42

SQL> select seq_test.nextval from dual;                ###做完impdp 序列的变化   content=metadata_only

   NEXTVAL
----------
        42

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@linux26 imp]$ impdp system/oracle directory=imp dumpfile=exp3.dmp logfile=exp3imp.log

Import: Release 11.2.0.1.0 - Production on Tue Sep 3 19:48:58 2013

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/******** directory=imp dumpfile=exp3.dmp logfile=exp3imp.log
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "EXP1"."T"                                  5.015 KB       3 rows
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 19:49:02

[oracle@linux26 imp]$ sqlplus exp1/exp1

SQL*Plus: Release 11.2.0.1.0 Production on Tue Sep 3 19:49:12 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from t;

        ID
----------
         1
         2
         3

SQL> select LAST_NUMBER from user_sequences;

LAST_NUMBER
-----------
         52

SQL> select seq_test.nextval from dual;              ###做完impdp 序列的变化   content=data_only

   NEXTVAL
----------
        43

SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

expdp 导出只要涉及metadata都会影响序列的变化,impdp在导入metadata的时候已经导入,导入数据不会影响序列。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值