本期将为大家分享“Oracle 19.19 数据库异机恢复八大避坑指南”。


RMAN> alter database open resetlogs;RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of sql statement command at 03/13/2024 21:50:06ORA-00349: failure obtaining block size for '+YWZD/YWZD/ONLINELOG/group1.log'
ORA-00349错误处置方法:根据文档356191.1的建议,执行resetlogs前,需要将redo日志的路径从ASM盘调整为文件系统。我们可以通过SQL命令或重建控制文件来重新指定redo日志的位置。通过SQL语句可以看到有两个日志文件状态为CLEARING_CURRENT,剩余日志文件的状态为CLEARING。
命令格式SQL> alter database rename file '<old asm path>' to '<new path>'查看redo日志位置和状态信息SQL> col member format a60SQL> select v1.thread#, v1.group#, member, sequence#, first_change#, archived, v1.status from v$log v1, v$logfile v2 where v1.group#=v2.group#;THREAD# GROUP# MEMBER SEQUENCE# FIRST_CHANGE# ARC STATUS---------- ---------- ------------------------------------------------------------ ---------- ------------- --- ----------------1 1 +YWZD/YWZD/ONLINELOG/group1.log 0 2.8433E+10 NO CLEARING_CURRENT1 2 +YWZD/YWZD/ONLINELOG/group2.log 0 2.8432E+10 YES CLEARING修改redo日志位置SQL> alter database rename file '+YWZD/YWZD/ONLINELOG/group2.log' to '/u01/app/oracle/oradata/YWZD/group2.log';查看新的位置信息THREAD# GROUP# MEMBER SEQUENCE# FIRST_CHANGE# ARC STATUS---------- ---------- ------------------------------------------------------------ ---------- ------------- --- ----------------1 1 /u01/app/oracle/oradata/YWZD/group1.log 0 2.8433E+10 NO CLEARING_CURRENT1 2 u01/app/oracle/oradata/YWZD/group2.log 0 2.8432E+10 YES CLEARING

SQL> alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-00392: log 1 of thread 1 is being cleared, operation not allowedORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/YWZD/group1.log'RMAN> alter database open resetlogs;using target database control file instead of recovery catalogRMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of sql statement command at 03/14/2024 10:43:08ORA-00392: log 1 of thread 1 is being cleared, operation not allowedORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/YWZD/group1.log'
ORA-00392错误处置方法:根据文档1352133.1的建议,执行resetlogs前,先检查redo日志的状态。通过SQL语句可以看到有两个日志文件状态为CLEARING_CURRENT,剩余日志文件的状态为CLEARING。执行alter database clear unarchived logfile group N 命令来手动清除两个未归档的日志组。
SQL> select GROUP#,THREAD#,SEQUENCE#,MEMBERS,ARCHIVED,STATUS,FIRST_CHANGE# from v$log order by first_change# ;GROUP# THREAD# SEQUENCE# MEMBERS ARC STATUS FIRST_CHANGE#---------- ---------- ---------- ---------- --- ---------------- -------------5 1 0 1 YES CLEARING 2.8433E+106 1 0 1 YES CLEARING 2.8433E+101 1 0 1 NO CLEARING_CURRENT 2.8433E+1010 2 0 1 NO CLEARING_CURRENT 2.8433E+10SQL> alter database clear unarchived logfile group 1 ;SQL> alter database clear unarchived logfile group 10 ;SQL> alter database open resetlogs;

SQL> alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-00600: internal error code, arguments: [ksvworkmsgalloc: bad reaper],[0x080040002], [], [], [], [], [], [], [], [], [], []
ORA 600错误处置方法:根据文档2728106.1的建议,由于数据文件被存放到非ASM路径,清理日志后也依旧报错。通过设置db_create_online_log_dest_1参数,指定redo到非asm路径,然后重启数据库使参数生效。
SQL> alter system set db_create_online_log_dest_1='新的路径' scope=both sid='*';SQL> alter database clear unarchived logfile group <group#>;

SQL> alter database open;alter database open*ERROR at line 1:ORA-19751: could not create the change tracking fileORA-19750: change tracking file:'+YWZD/YWZD/CHANGETRACKING/ctf.9470.1099506341'ORA-17502: ksfdcre:1 Failed to create file+YWZD/YWZD/CHANGETRACKING/ctf.9470.1099506341ORA-17501: logical block size 4294967295 is invalidORA-29701: unable to connect to Cluster Synchronization ServiceORA-17503: ksfdopn:2 Failed to open file+YWZD/YWZD/CHANGETRACKING/ctf.9470.1099506341ORA-15001: diskgroup "YWZD" does not exist or is not mountedORA-15374: invalid cluster configuration
ORA-19751错误处置方法:根据文档832496.1的建议,数据库打开过程会校验块跟踪文件是否存在。如果不存在则创建,并且会按原先的路径创建块跟踪文件。但是由于目标数据库没有对应的ASM磁盘组,从而导致SQL> alter database enable block change tracking using file '+
方法一:禁用块跟踪,alter database disable block change tracking;方法二:指定新的存储路径,alter database enable block change tracking using file '+<DGNAME>';SQL> alter database disable block change tracking;Database altered.SQL> alter database open;Database altered.

2024-03-14T11:24:18.622867+08:00******************** WARNING **************************The errors during server control file autobackup are not fatal, as it is attempted after sucessful completion of the command. However, it is recomended to take an RMANcontrol file backup as soon as possible because the autobackup failed with the following error:ORA-01580: error creating control backup file +YWZD/snap/YWZD2.ctlORA-17502: ksfdcre:3 Failed to create file +YWZD/snap/YWZD2.ctlORA-15001: diskgroup "YWZD" does not exist or is not mountedORA-15374: invalid cluster configuration******************** END OF WARNING *******************
ORA-01580错误处置方法:根据文档2614680.1的建议,数据库rman参数SNAPSHOT CONTROLFILE NAME的路径有问题,需要重新指定到正确的路径下。
1、检查rman参数,执行show all命令CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+YWZD/snap/YWZD2.ctl';2、重新调整参数RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/oradata/YWZD/snap_YWZD';RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of configure command at 03/14/2024 11:26:22RMAN-06492: control file AUTOBACKUP format "/u01/app/oracle/oradata/YWZD/snap_YWZD" must specify a "%F" format specifierRMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/oradata/YWZD/snap_YWZD%F';old RMAN configuration parameters:CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+YWZD/snap/YWZD%F';new RMAN configuration parameters:CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/app/oracle/oradata/YWZD/snap_YWZD%F';new RMAN configuration parameters are successfully storedRMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/oradata/YWZD/YWZD2.ctl';old RMAN configuration parameters:CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+YWZD/snap/YWZD2.ctl';new RMAN configuration parameters:CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/oradata/YWZD/YWZD2.ctl';new RMAN configuration parameters are successfully stored

查看表的数据量select count(*) from YWZD.TEST01;数据泵导出命令$expdp system/密码 directory=dump_dir dumpfile=TEST01.dmp logfile=TEST01.log tables=YWZD.TEST01Export: Release 19.0.0.0.0 - Production on Thu Mar 14 11:24:25 2024Version 19.3.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - ProductionORA-31626: job does not existORA-31638: cannot attach to job SYS_EXPORT_TABLE_01 for user SYSTEMORA-06512: at "SYS.KUPV$FT", line 1142ORA-06512: at "SYS.KUPV$FT", line 1744ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95ORA-06512: at "SYS.KUPV$FT_INT", line 498ORA-39077: unable to subscribe agent KUPC$A_1_112444208127000 to queue "KUPC$C_1_20240314112434_0"ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95ORA-06512: at "SYS.KUPC$QUE_INT", line 294ORA-01001: invalid cursorORA-06512: at "SYS.DBMS_AQADM_SYS", line 9562ORA-06512: at "SYS.DBMS_PRVTAQIS", line 1420ORA-06512: at "SYS.DBMS_AQADM_SYS", line 10156ORA-06512: at "SYS.DBMS_AQADM_SYS", line 9525ORA-06512: at "SYS.DBMS_AQADM", line 881ORA-06512: at "SYS.KUPC$QUE_INT", line 267ORA-06512: at "SYS.KUPC$QUE_INT", line 1360ORA-06512: at line 1ORA-06512: at "SYS.KUPC$QUEUE_INT", line 65ORA-06512: at "SYS.KUPV$FT_INT", line 465ORA-06512: at "SYS.KUPV$FT", line 1664ORA-06512: at "SYS.KUPV$FT", line 1103
ORA-06512错误处置方法:根据文档2653853.1的建议,重建datapump工具。
@$ORACLE_HOME/rdbms/admin/catdph.sql@$ORACLE_HOME/rdbms/admin/prvtdtde.plb@$ORACLE_HOME/rdbms/admin/catdpb.sql@$ORACLE_HOME/rdbms/admin/dbmspump.sql@$ORACLE_HOME/rdbms/admin/utlrp.sql

UDE-31623: operation generated ORACLE error 31623ORA-31623: a job is not attached to this session via the specified handleORA-06512: at "SYS.DBMS_DATAPUMP", line 4747ORA-06512: at "SYS.KUPV$FT_INT", line 2144ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79ORA-06512: at "SYS.KUPV$FT_INT", line 2081ORA-06512: at "SYS.DBMS_DATAPUMP", line 2263ORA-06512: at "SYS.DBMS_DATAPUMP", line 4496ORA-06512: at "SYS.DBMS_DATAPUMP", line 6127ORA-06512: at line 12024-03-14T11:47:59.297967+08:00Errors in file u01/app/oracle19/diag/rdbms/YWZD/YWZD/trace/YWZD_ora_24259.trc (incident=9667):ORA-00600: internal error code, arguments: [kwqintExeStmt: bind string failure], [1036], [ORA-01036: illegal variable name/number], [], [], [], [], [], [], [], [], []Incident details in: u01/app/oracle19/diag/rdbms/YWZD/YWZD/incident/incdir_9667/YWZD_ora_24259_i9667.trc
ORA-06512错误处置方法:根据文档2799499.1的建议,检查源与目标数据库补丁信息“Database Release Update”是否一致。即数据库的RU是19.19,但是binary文件版本是19.3,因此将对目标库进行补丁修复。
查看源与目标的RU描述信息set linesize 1000col comments for a80select action,namespace,comments from DBA_REGISTRY_HISTORY ;ACTION NAMESPACE COMMENTS----------- ------------- ---------------------------------------------------------------------BOOTSTRAP DATAPATCH RDBMS_19.19.0.0.0DBRU_LINUX.X64_230321.1RU_APPLY SERVER Patch applied on 19.11.0.0.0: Release_Update - 210413004009RU_APPLY SERVER Patch applied from 19.11.0.0.0 to 19.19.0.0.0: Release_Update - 230322020406RU_APPLY SERVER Patch applied on 19.19.0.0.0: Release_Update - 230322020406select install_id,patch_type,status,description,source_version,target_version from dba_registry_sqlpatch ;INSTALL_ID PATCH_TYPE STATUS DESCRIPTION SOURCE_VERSION TARGET_VERSION---------- ---------- ------ ------------------------------------------------------- --------------- ---------------1 RU SUCCESS Database Release Update : 19.11.0.0.210420 (32545013) 19.1.0.0.0 19.11.0.0.03 RU SUCCESS Database Release Update : 19.19.0.0.230418 (35042068) 19.11.0.0.0 19.19.0.0.0将补丁集上传到服务器,并进行解压,然后执行opatch apply命令修复。Set your current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:cd <UNZIPPED_PATCH_LOCATION>/35037840/35042068opatch apply

2024-03-14T14:54:15.623327+08:00Unable to obtain current patch information due to error: 20001, ORA-20001: Latest xml inventory is not loaded into tableORA-06512: at "SYS.DBMS_QOPATCH", line 2327ORA-06512: at "SYS.DBMS_QOPATCH", line 854ORA-06512: at "SYS.DBMS_QOPATCH", line 937ORA-06510: PL/SQL: unhandled user-defined exceptionORA-06512: at "SYS.DBMS_QOPATCH", line 932ORA-29913: error in executing ODCIEXTTABLEFETCH calloutORA-01157: cannot identify/lock data file 2002 - see DBWR trace fileORA-01110: data file 2002: '+YWZD/YWZD/TEMPFILE/temp.265'ORA-06512: at "SYS.DBMS_QOPATCH", line 919ORA-06512: at "SYS.DBMS_QOPATCH", line 2286ORA-06512: at "SYS.DBMS_QOPATCH", line 817ORA-06512: at "SYS.DBMS_QOPATCH", line 2309
ORA-01157错误处置方法:根据文档2929591.1的建议,检查临时表空间对应的数据文件信息。临时表空间TEMP包含三个数据文件,其中两个数据文件存储信息不正常。可以通过手动删除进行处理。
SQL> select file_name from dba_temp_files;select file_name from dba_temp_files*ERROR at line 1:ORA-01157: cannot identify/lock data file 2002 - see DBWR trace fileORA-01110: data file 2002: '+YWZD/YWZD/TEMPFILE/temp.265'select file#,ts#,name from v$tempfileSQL> col name for a80FILE# TS# NAME---------- ---------- --------------------------------------------------------------------------------1 3 /u01/app/oracle/oradata/YWZD/YWZD/datafile/o1_mf_temp_lz4tj527_.tmp2 3 +YWZD/YWZD/TEMPFILE/temp.2653 3 +YWZD/YWZD/TEMPFILE/temp.268SQL> alter database tempfile 2 drop;Database altered.SQL> alter database tempfile 3 drop;Database altered.


'ORA-00349: failure obtaining block size' On 'open resetlogs' During Incomplete Recovery (Doc ID 356191.1)
ALTER DATABASE OPEN RESETLOGS fails with ORA-00392 (Doc ID 1352133.1)
Open Resetlogs Fail with ORA-00600[ksvworkmsgalloc: bad reaper] (Doc ID 2728106.1)
OPEN RESETLOGS FAILS ORA-19751, ORA-15046, ASM AND BLOCK CHANGE TRACKING FILE (Doc ID 832496.1)
RMAN Resync Fails with RMAN-03009, ORA-01580 (Doc ID 2614680.1)
Expdp/Impdp Fails Due To Errors -ORA-39077,ORA-31638,ORA-24000,ORA-00972 (Doc ID 2653853.1)
ORA-31626 ORA-6512 ORA-39077 ORA-1001 Errors on Data Pump Export (EXPDP) (Doc ID 2799499.1)
ORA-00600 [kwqintExeStmt: bind string failure], [1036], [ORA-01036: illegal variable name/number] (Doc ID 2848323.1)
以上就是本期关于“Oracle 19.19 数据库异机恢复八大避坑指南”。希望能给大家带来帮助!
欢迎关注“数据库运维之道”公众号,一起学习数据库技术。






