Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

133

积分

0

好友

17

主题
1#
发表于 2012-5-23 16:08:37 | 查看: 8184| 回复: 3
1、怎么筛选出来job或scheduler job
我的方法,看有没有更有效的
impdp expdp/expdp dumpfile=saup.dmp directory=dir_expdp sqlfile=saup2.sql  TRANSFORM=segment_attributes:n EXCLUDE=table,index,SEQUENCE,PROCEDURE,USER


2、11g 通过 version 导出来后,报错,在medlink上有找到文章,但是没看明白。

MOS doc 780174.1  
BUG 4595736


In this Document
[size=-1]  Symptoms
  Cause
  Solution
  References



Applies to:
Oracle Server - Standard Edition - Version: 10.2.0.3

This problem can occur on any platform.

Symptoms
-- Problem Statement:


Import receives the following errors:
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCOBJ
ORA-39083: Object type PROCOBJ failed to create with error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
Failing sql is:
BEGIN
dbms_scheduler.create_job('"AUTO_EDIT_NEWACCTS"',
job_type=>'PLSQL_BLOCK', job_action=>
'begin
new_acct_mgmt.autoedit_new_records;
end;'
, number_of_arguments=>0,
start_date=>'09-DEC-08 08.30.00.000000 AM AMERICA/NEW_YORK', repeat_interval=>
'FREQ=MINUTELY;INTERVAL=15'
, end_date=>NULL,
job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_
ORA-39083: Object type PROCOBJ failed to create with error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
Failing sql is:
BEGIN
dbms_scheduler.create_job('"QUICK_BATCH_DATA"',
job_type=>'PLSQL_BLOCK', job_action=>
'begin
batch_new_accounts.quick_batch_data;
end;'
, number_of_arguments=>0,
start_date=>'09-DEC-08 08.10.00.000000 AM AMERICA/NEW_YORK', repeat_interval=>
'FREQ=MINUTELY;INTERVAL=15'
, end_date=>NULL,
job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_d


Cause
When importing job objects with logging level  set to FULL or OFF then the import for these job objects is bound to fail.
Solution
Prior to exporting these job objects, precreate these jobs with the logging level set to DBMS_SCHEDULER.LOGGING_RUNS and then export and then import the job. Then change the logging level as required.
ReferencesBUG:4595736
- ORA-6502 DURING IMPDP DUE TO WRONG LOGGING_LEVEL PUT IN EXPORT DUMP


2#
发表于 2012-5-23 18:57:33
ODM TEST:

SQL> variable v_jobno number;
SQL> exec dbms_job.submit(:v_JobNo, 'begin null; end;',TRUNC(SYSDATE)+1, 'TRUNC(SYSDATE)+1');

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

SQL>  print :v_jobno;

   V_JOBNO
----------
         2

SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options






[oracle@vrh8 ~]$ expdp system/oracle schemas=maclean dumpfile=maclean_job  include=job

Export: Release 10.2.0.5.0 - 64bit Production on Wednesday, 23 May, 2012 6:49:23

Copyright (c) 2003, 2007, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** schemas=maclean dumpfile=maclean_job include=job
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/JOB
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /s01/oracle/product/10.2.0.5/db_1/rdbms/log/maclean_job.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 06:49:26

回复 只看该作者 道具 举报

3#
发表于 2012-5-23 21:42:09

回复 2# 的帖子

怎么只有关于job或scheduler job的,schemas这个用户所有全导出来了。

看样子,只能导出元数据,再把 EXCLUDE其他对象类型, scheduler job生成SQL文本了,要不那么多scheduler jobs,也不能看dba_schedulers,一条一条的来写哈。。呵呵。

谢谢刘大

实验源数据:

create table EXPDP.rman_time(id number,rman_date date);

create sequence EXPDP.RMAN_SEQ
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;

create or replace procedure EXPDP.PRO_RMAN_TIME
as
begin

insert into rman_time values(rman_seq.nextval,sysdate);
commit;
end;
/

begin
  sys.dbms_scheduler.create_job(job_name            => 'EXPDP.RMAN_RECOVER_TIME',
                                job_type            => 'STORED_PROCEDURE',
                                job_action          => 'EXPDP.PRO_RMAN_TIME',
                                repeat_interval     => 'Freq=Minutely;Interval=1',
                                job_class           => 'DEFAULT_JOB_CLASS',
                                enabled             => true);
end;
/

[ 本帖最后由 saup007 于 2012-5-23 21:49 编辑 ]

回复 只看该作者 道具 举报

4#
发表于 2012-5-23 21:42:46
  1. [oracle@localhost bak_full]$ expdp expdp/expdp directory=dir_expdp dumpfile=expdp.dmp logfile=expdp.log schemas=expdp  EXCLUDE=PROCOBJ

  2. Export: Release 10.2.0.1.0 - Production on Wednesday, 23 May, 2012 21:37:03

  3. Copyright (c) 2003, 2005, Oracle.  All rights reserved.

  4. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
  5. With the Partitioning, OLAP and Data Mining options
  6. Starting "EXPDP"."SYS_EXPORT_SCHEMA_01":  expdp/******** directory=dir_expdp dumpfile=expdp.dmp logfile=expdp.log schemas=expdp EXCLUDE=PROCOBJ
  7. Estimate in progress using BLOCKS method...
  8. Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
  9. Total estimation using BLOCKS method: 64 KB
  10. Processing object type SCHEMA_EXPORT/USER
  11. Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
  12. Processing object type SCHEMA_EXPORT/ROLE_GRANT
  13. Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
  14. Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
  15. ORA-39127: unexpected error from call to export_string := SYS.DBMS_RMGR_GROUP_EXPORT.grant_exp(4845,1,...)
  16. ORA-06502: PL/SQL: numeric or value error: NULL index table key value
  17. ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 130
  18. ORA-06512: at line 1
  19. ORA-06512: at "SYS.DBMS_METADATA", line 5111
  20. ORA-39127: unexpected error from call to export_string := SYS.DBMS_RMGR_GROUP_EXPORT.grant_exp(4844,1,...)
  21. ORA-06502: PL/SQL: numeric or value error: NULL index table key value
  22. ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 130
  23. ORA-06512: at line 1
  24. ORA-06512: at "SYS.DBMS_METADATA", line 5111
  25. ORA-39127: unexpected error from call to export_string := SYS.DBMS_RMGR_GROUP_EXPORT.grant_exp(4843,1,...)
  26. ORA-06502: PL/SQL: numeric or value error: NULL index table key value
  27. ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 130
  28. ORA-06512: at line 1
  29. ORA-06512: at "SYS.DBMS_METADATA", line 5111
  30. Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
  31. Processing object type SCHEMA_EXPORT/TABLE/TABLE
  32. Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
  33. Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
  34. Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
  35. Processing object type SCHEMA_EXPORT/TABLE/COMMENT
  36. Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
  37. Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
  38. ORA-39127: unexpected error from call to export_string := SYS.DBMS_RMGR_GROUP_EXPORT.grant_exp(4845,1,...)
  39. ORA-06502: PL/SQL: numeric or value error: NULL index table key value
  40. ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 130
  41. ORA-06512: at line 1
  42. ORA-06512: at "SYS.DBMS_METADATA", line 5111
  43. ORA-39127: unexpected error from call to export_string := SYS.DBMS_RMGR_GROUP_EXPORT.grant_exp(4844,1,...)
  44. ORA-06502: PL/SQL: numeric or value error: NULL index table key value
  45. ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 130
  46. ORA-06512: at line 1
  47. ORA-06512: at "SYS.DBMS_METADATA", line 5111
  48. ORA-39127: unexpected error from call to export_string := SYS.DBMS_RMGR_GROUP_EXPORT.grant_exp(4843,1,...)
  49. ORA-06502: PL/SQL: numeric or value error: NULL index table key value
  50. ORA-06512: at "SYS.DBMS_RMGR_GROUP_EXPORT", line 130
  51. ORA-06512: at line 1
  52. ORA-06512: at "SYS.DBMS_METADATA", line 5111
  53. . . exported "EXPDP"."RMAN_TIME"                         5.320 KB       7 rows
  54. Master table "EXPDP"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
  55. ******************************************************************************
  56. Dump file set for EXPDP.SYS_EXPORT_SCHEMA_01 is:
  57.   /u01/backup/bak_full/expdp.dmp
  58. Job "EXPDP"."SYS_EXPORT_SCHEMA_01" completed with 6 error(s) at 21:37:26

  59. [oracle@localhost bak_full]$ impdp saup/saup dumpfile=expdp.dmp directory=dir_expdp REMAP_SCHEMA=expdp:test

  60. Import: Release 10.2.0.1.0 - Production on Wednesday, 23 May, 2012 21:37:32

  61. Copyright (c) 2003, 2005, Oracle.  All rights reserved.

  62. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
  63. With the Partitioning, OLAP and Data Mining options
  64. Master table "SAUP"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
  65. Starting "SAUP"."SYS_IMPORT_FULL_01":  saup/******** dumpfile=expdp.dmp directory=dir_expdp REMAP_SCHEMA=expdp:test
  66. Processing object type SCHEMA_EXPORT/USER
  67. Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
  68. Processing object type SCHEMA_EXPORT/ROLE_GRANT
  69. Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
  70. Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
  71. Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
  72. Processing object type SCHEMA_EXPORT/TABLE/TABLE
  73. Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
  74. . . imported "TEST"."RMAN_TIME"                          5.320 KB       7 rows
  75. Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
  76. Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
  77. Job "SAUP"."SYS_IMPORT_FULL_01" successfully completed at 21:37:36



  78. 21:35:57 expdp@SAUP10G> select * from dba_objects where owner='TEST';

  79. OWNER
  80. ------------------------------
  81. OBJECT_NAME
  82. --------------------------------------------------------------------------------------------------------------------------------
  83. SUBOBJECT_NAME                        OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE             CREATED                 LAST_DDL_TIME             TIMESTAMP                 STATUS  T G S
  84. ------------------------------ ---------- -------------- ------------------- ------------------- ------------------- ------------------- ------- - - -
  85. TEST
  86. RMAN_SEQ
  87.                                     52958                 SEQUENCE             2012-05-23 21:37:35 2012-05-23 21:37:35 2012-05-23:21:37:35 VALID         N N N

  88. TEST
  89. RMAN_TIME
  90.                                     52959           52959 TABLE                     2012-05-23 21:37:35 2012-05-23 21:37:35 2012-05-23:21:37:35 VALID         N N N

  91. TEST
  92. PRO_RMAN_TIME
  93.                                     52960                 PROCEDURE             2012-05-23 21:37:35 2012-05-23 21:37:35 2012-05-23:21:31:41 VALID         N N N

复制代码
MARK,在x86_64 11.2.0.2上是可以的expdp/******** directory=dir_expdp dumpfile=expdp.dmp logfile=expdp.log schemas=expdp EXCLUDE=PROCOBJ

[ 本帖最后由 saup007 于 2012-8-8 17:55 编辑 ]

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-26 00:21 , Processed in 0.047852 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569