ORA-01623: log xx is current log for instance xxxx (thread 1) – cannot drop

When using RMAN to duplicate/TSPITR a database on a different server with a different disk layout, the parameters db_file_name_convert and log_file_name_convert can be used.

However, when using RMAN restore, they cannot be used. Instead, “set newname for datafile” & “switch datafile” are needed for each data file to be restored with a new path and name. And for online redo log files, non current log groups can be dropped and recreated. If trying to drop the current redo log groups, you will see the ORA-01623 error:

SQL> alter database drop logfile group 4
*
ERROR at line 1:
ORA-01623: log 4 is current log for instance PROD (thread 1) - cannot drop
ORA-00312: online log 4 thread 1: '/redoa/oracle/oradata/PROD/redo04a.log'
ORA-00312: online log 4 thread 1: '/redob/oracle/oradata/PROD/redo04b.log'

Of course you can not do operations like switch log file because the database is just mounted for restore and recover. Open resetlogs would return the follwing error because of non-existence of redo log file path.

SQL> alter database open resetlogs;
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [ksvworkmsgalloc: bad reaper],
[0x080010004], [], [], [], [], [], [], [], [], [], []

Oracle won’t allow the drop the current online log even you try to clear it (alter database clear logfile group). The only way is to rename it to the new path:

SQL> alter database rename file '/redoa/oracle/oradata/PROD/redo04a.log' to '/dbase/redoa/PROD/redo04a.log';

Database altered.

SQL> alter database rename file '/redob/oracle/oradata/PROD/redo04b.log' to '/dbase/redob/PROD/redo04b.log';

Database altered.

After the rename, open resetlogs will work with all online redo log files having the correct path.

References:

Usage and Limitation of db_file_name_convert and log_file_name_convert (Doc ID 1367014.1)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s