expdp_10g_11g_相关选项测试小记

分类: Linux操作系统

2012-11-23 09:12:19

SQL> create user expdp_user identified by system account unlock;
用户已创建。
SQL> grant resource,connect to expdp_user;
授权成功。
SQL> spoof
SP2-0042: 未知命令 "spoof" - 其余行忽略。
SQL> spool
当前正假脱机至 c:\test_expdp_diff.log
SQL> spool help=y
SQL> conn expdp_user/system@orcl
已连接。
SQL> create table t_1(a int);
表已创建。
SQL> insert into t_1 values(1);
已创建 1 行。
SQL> commit;
提交完成。

SQL> create directory expdp_dir as 'c:\';
目录已创建。
SQL> host expdp expdp_user/system@orcl dumpfile=expdp_dir:expdp_user.dmp logfile
=expdp_dir:expdp_user.log
Export: Release 10.2.0.1.0 - Production on 星期四, 22 11月, 2012 18:57:23
Copyright (c) 2003, 2005, 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
启动 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01":  expdp_user/********@orcl dumpfile=exp
dp_dir:expdp_user.dmp logfile=expdp_dir:expdp_user.log
正在使用 BLOCKS 方法进行估计...
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 64 KB
处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
处理对象类型 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/POST_SCHEMA/PROCACT_SCHEMA
. . 导出了 "EXPDP_USER"."T_1"                          5.023 KB       1 行
已成功加载/卸载了主表 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01"
******************************************************************************
EXPDP_USER.SYS_EXPORT_SCHEMA_01 的转储文件集为:
  C:\EXPDP_USER.DMP
作业 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01" 已于 18:58:04 成功完成
小结:普通权限的用户不加schemas选项仅导出自己用户的数据
SQL> host expdp expdp_user/system@orcl dumpfile=expdp_dir:expdp_user.dmp logfile
=expdp_dir:expdp_user.log full=y
Export: Release 10.2.0.1.0 - Production on 星期四, 22 11月, 2012 18:59:23
Copyright (c) 2003, 2005, 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
ORA-31631: 需要权限
ORA-39161: 完整数据库作业需要权限
小结:full=y选项仅dba权限才可以操作
SQL> host expdp expdp_user/system@orcl dumpfile=expdp_dir:expdp_user.dmp logfile
=expdp_dir:expdp_user.log schemas=expdp_user
Export: Release 10.2.0.1.0 - Production on 星期四, 22 11月, 2012 19:00:17
Copyright (c) 2003, 2005, 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
ORA-39001: 参数值无效
ORA-39000: 转储文件说明错误
ORA-31641: 无法创建转储文件 "c:\expdp_user.dmp"
ORA-27038: 所创建的文件已存在
OSD-04010: 指定了 选项, 但文件已经存在
小结:如果目录已存在导出文件,再次导出会失败,说明expdp不会自动覆盖导出文件
SQL> host expdp expdp_user/system@orcl dumpfile=expdp_dir:expdp_user.dmp logfile
=expdp_dir:expdp_user.log schemas=expdp_user
Export: Release 10.2.0.1.0 - Production on 星期四, 22 11月, 2012 19:03:57
Copyright (c) 2003, 2005, 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
启动 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01":  expdp_user/********@orcl dumpfile=exp
dp_dir:expdp_user.dmp logfile=expdp_dir:expdp_user.log schemas=expdp_user
正在使用 BLOCKS 方法进行估计...
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 64 KB
处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
处理对象类型 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/POST_SCHEMA/PROCACT_SCHEMA
. . 导出了 "EXPDP_USER"."T_1"                          5.023 KB       1 行
已成功加载/卸载了主表 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01"
******************************************************************************
EXPDP_USER.SYS_EXPORT_SCHEMA_01 的转储文件集为:
  C:\EXPDP_USER.DMP
作业 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01" 已于 19:04:14 成功完成
小结;普通权限的用户加上选项schemas可导出自己用户的数据
 

SQL> host expdp expdp_user/system@orcl dumpfile=expdp_dir:expdp_user.dmp logfile
=expdp_dir:expdp_user.log schemas=expdp_user,scott
Export: Release 10.2.0.1.0 - Production on 星期四, 22 11月, 2012 19:05:59
Copyright (c) 2003, 2005, 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
启动 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01":  expdp_user/********@orcl dumpfile=exp
dp_dir:expdp_user.dmp logfile=expdp_dir:expdp_user.log schemas=expdp_user,scott
正在使用 BLOCKS 方法进行估计...
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 64 KB
处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
处理对象类型 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/POST_SCHEMA/PROCACT_SCHEMA
. . 导出了 "EXPDP_USER"."T_1"                          5.023 KB       1 行
ORA-39165: 未找到方案 SCOTT。
已成功加载/卸载了主表 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01"
******************************************************************************
EXPDP_USER.SYS_EXPORT_SCHEMA_01 的转储文件集为:
  C:\EXPDP_USER.DMP
作业 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01" 已经完成, 但是有 1 个错误 (于 19:06:17
完成)
小结:普通权限用户加上schemas选项可以导出自己的用户,如果指定要导出其它用户,导出依然可以成功,但不能导出其它用户的数据
 
SQL> host expdp expdp_user/system@orcl dumpfile=expdp_dir:expdp_user.dmp logfile
=expdp_dir:expdp_user.log schemas=expdp_user,scott
Export: Release 10.2.0.1.0 - Production on 星期四, 22 11月, 2012 19:08:02
Copyright (c) 2003, 2005, 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
启动 "EXPDP_USER"."SYS_EXPORT_SCHEMA_01":  expdp_user/********@orcl dumpfile=exp
dp_dir:expdp_user.dmp logfile=expdp_dir:expdp_user.log schemas=expdp_user,scott
正在使用 BLOCKS 方法进行估计...
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 2.085 GB
处理对象类型 SCHEMA_EXPORT/USER
处理对象类型 SCHEMA_EXPORT/SYSTEM_GRANT
处理对象类型 SCHEMA_EXPORT/ROLE_GRANT
处理对象类型 SCHEMA_EXPORT/DEFAULT_ROLE
处理对象类型 SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
处理对象类型 SCHEMA_EXPORT/TYPE/TYPE_SPEC
处理对象类型 SCHEMA_EXPORT/SEQUENCE/SEQUENCE
处理对象类型 SCHEMA_EXPORT/TABLE/TABLE
小结:具有dba权限用户加上schemas选项可以导出自己与其它用户的数据
 
SQL> host expdp expdp_user/system@orcl dumpfile=expdp_dir:expdp_user.dmp logfile
=expdp_dir:expdp_user.log full=y
Export: Release 10.2.0.1.0 - Production on 星期四, 22 11月, 2012 19:12:20
Copyright (c) 2003, 2005, 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
启动 "EXPDP_USER"."SYS_EXPORT_FULL_01":  expdp_user/********@orcl dumpfile=expdp
_dir:expdp_user.dmp logfile=expdp_dir:expdp_user.log full=y
正在使用 BLOCKS 方法进行估计...
处理对象类型 DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
使用 BLOCKS 方法的总估计: 3.329 GB
处理对象类型 DATABASE_EXPORT/TABLESPACE
处理对象类型 DATABASE_EXPORT/PROFILE
处理对象类型 DATABASE_EXPORT/SYS_USER/USER
处理对象类型 DATABASE_EXPORT/SCHEMA/USER
小结:具备dba权限用户加上full=y可以导出全库

猜你喜欢

转载自blog.csdn.net/a_222850215/article/details/80114052