【EXP】验证exp的dump包中包含procedure的创建语句

EXP后的dump包中包含procedure的定义语句,简单做一个实验验证之,供参考。

1.在sec用户下创建一个简单的procedure
sec@ora10g> CREATE OR REPLACE PROCEDURE  proc_helloworld
  2  IS
  3  BEGIN
  4     DBMS_OUTPUT.put_line ('Hello World!');
  5  END;
  6  /

Procedure created.

2.使用exp导出sec用户的数据
ora10g@secDB /exp$ exp sec/sec file=sec.dmp

Export: Release 10.2.0.3.0 - Production on Thu Mar 4 05:57:58 2010

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
Export done in AL32UTF8 character set and UTF8 NCHAR character set

About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SEC
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SEC
About to export SEC's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SEC's tables via Conventional Path ...
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.

3.导入使用“show=y”查看dump的内容
ora10g@
secDB /exp$ imp sec/sec file=sec.dmp full=y show=y

Import: Release 10.2.0.3.0 - Production on Thu Mar 4 05:58:25 2010

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options

Export file created by EXPORT:V10.02.01 via conventional path
import done in AL32UTF8 character set and UTF8 NCHAR character set
. importing SEC's objects into SEC
 "BEGIN  "
 "sys.dbms_logrep_imp.instantiate_schema(schema_name=>SYS_CONTEXT('USERENV','"
 "CURRENT_SCHEMA'), export_db_name=>'ORA10G', inst_scn=>'36988056');"
 "COMMIT; END;"
 "ALTER SESSION SET "_LOAD_WITHOUT_COMPILE" = PLSQL"
 "CREATE PROCEDURE  proc_helloworld"
 "IS"
 "BEGIN"
 "   DBMS_OUTPUT.put_line ('Hello World!');"
 "END;"
 "ALTER SESSION SET "_LOAD_WITHOUT_COMPILE" = NONE"
 "ALTER PROCEDURE "PROC_HELLOWORLD" COMPILE REUSE SETTINGS TIMESTAMP '2010-03"
 "-04:05:31:17'"
Import terminated successfully without warnings.

显然,存储过程在dump备份的内容中得到记录。

4.小结
EXP命令的“show=y”用处很大,在验证dump文件内容上功不可没。善用之。

Good luck.

secooler
10.03.11

-- The End --

请使用浏览器的分享功能分享到微信等