采用数据泵,清除表中所有数据

SQL> connect ocp/123
已连接。
SQL>
SQL>
SQL> select table_name from user_tables;


TABLE_NAME
------------------------------
OCP
OCP1
OCP13


SQL> select * from ocp;


      NAME
----------
       111





从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开







C:\Users\Administrator>expdp ocp/123 dumpfile=data_pump_dir:ocp.dmp content=metadata_only


Export: Release 11.2.0.1.0 - Production on 星期六 5月 26 15:58:44 2018


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


连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
启动 "OCP"."SYS_EXPORT_SCHEMA_01":  ocp/******** dumpfile=data_pump_dir:ocp.dmp content=metadata_only
处理对象类型 SCHEMA_EXPORT/USER
处理对象类型 SCHEMA_EXPORT/SYSTEM_GRANT
处理对象类型 SCHEMA_EXPORT/ROLE_GRANT
处理对象类型 SCHEMA_EXPORT/DEFAULT_ROLE
处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
处理对象类型 SCHEMA_EXPORT/SEQUENCE/SEQUENCE
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE
处理对象类型 SCHEMA_EXPORT/TABLE/INDEX/INDEX
处理对象类型 SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
处理对象类型 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
处理对象类型 SCHEMA_EXPORT/TABLE/COMMENT
处理对象类型 SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
已成功加载/卸载了主表 "OCP"."SYS_EXPORT_SCHEMA_01"
******************************************************************************
OCP.SYS_EXPORT_SCHEMA_01 的转储文件集为:
  D:\APP\ADMINISTRATOR\ADMIN\ORCL\DPDUMP\OCP.DMP
作业 "OCP"."SYS_EXPORT_SCHEMA_01" 已于 15:59:15 成功完成




C:\Users\Administrator>impdp  ocp/123 dumpfile=data_pump_dir:ocp.dmp  exclude=INDEX_STATISTICS,TABLE_STATISTICS table_exists_action=replace


Import: Release 11.2.0.1.0 - Production on 星期六 5月 26 16:00:08 2018


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


连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
已成功加载/卸载了主表 "OCP"."SYS_IMPORT_FULL_01"
启动 "OCP"."SYS_IMPORT_FULL_01":  ocp/******** dumpfile=data_pump_dir:ocp.dmp exclude=INDEX_STATISTICS,TABLE_STATISTICS table_exists_action=replace
处理对象类型 SCHEMA_EXPORT/USER
ORA-31684: 对象类型 USER:"OCP" 已存在
处理对象类型 SCHEMA_EXPORT/SYSTEM_GRANT
处理对象类型 SCHEMA_EXPORT/ROLE_GRANT
处理对象类型 SCHEMA_EXPORT/DEFAULT_ROLE
处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
处理对象类型 SCHEMA_EXPORT/SEQUENCE/SEQUENCE
ORA-31684: 对象类型 SEQUENCE:"OCP"."ORD_SEQ" 已存在
ORA-31684: 对象类型 SEQUENCE:"OCP"."ORD_SEQ1" 已存在
ORA-31684: 对象类型 SEQUENCE:"OCP"."SEQ1" 已存在
ORA-31684: 对象类型 SEQUENCE:"OCP"."ORD_SEQ11" 已存在
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE
处理对象类型 SCHEMA_EXPORT/TABLE/INDEX/INDEX
作业 "OCP"."SYS_IMPORT_FULL_01" 已经完成, 但是有 5 个错误 (于 16:00:11 完成)




C:\Users\Administrator>sqlplus ocp/123


SQL*Plus: Release 11.2.0.1.0 Production on 星期六 5月 26 16:00:19 2018


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




连接到:
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 ocp;


未选定行


SQL>
SQL>

猜你喜欢

转载自blog.csdn.net/oradbm/article/details/80462517