Sunday, September 7, 2008

Restore operation fails with RMAN-11003 ORA-01511 ORA-01516

Error Description And Symptoms
I am performing disaster recovery operation. The new host path are different than from original host. So for the datafile I used SET NEWNAME .. clause. And for the online redo log file I used SQL "ALTER DATABASE RENAME FILE .. " clause to rename the online logfiles to a valid location on to a new host. I have already ran the restore srcipt in previous but it fails to rename third online redo logfiles due to invalid location. And after fixing location whenever I ran the script again it fails with serveral RMAN and Oracle error as below.
RMAN> @/backup03/webkey/rman_script

RMAN> run{
2> set newname for datafile 1 to '/backup03/webkey/system01.dbf';
3> set newname for datafile 2 to '/backup03/webkey/undotbs01.dbf';
4> set newname for datafile 3 to '/backup03/webkey/sysaux01.dbf';
5> set newname for datafile 4 to '/backup03/webkey/users01.dbf';
6> set newname for datafile 5 to '/backup03/webkey/data01.dbf';
7> set newname for datafile 6 to '/backup03/webkey/data02.dbf';
8> set newname for datafile 7 to '/backup03/webkey/indx01.dbf';
9> set newname for datafile 8 to '/backup03/webkey/indx02.dbf';
10> set newname for datafile 9 to '/backup03/webkey/tools01.dbf';
11> set newname for datafile 10 to '/backup03/webkey/splex_data.dbf';
12> set newname for datafile 11 to '/backup03/webkey/splex_indx.dbf';
13> set newname for datafile 12 to '/backup03/webkey/columnbia.dbf';
14> set newname for datafile 13 to '/backup03/webkey/data03.dbf';
15> set newname for datafile 14 to '/backup03/webkey/data03b.dbf';
16> set newname for datafile 15 to '/backup03/webkey/data_01_16K_01.dbf';
17> set newname for datafile 16 to '/backup03/webkey/indx_01_16K_01.dbf';
18> SQL "ALTER DATABASE RENAME FILE ''/d00/oradata/db101db/redo01a.log''
19> TO ''/backup03/webkey/redo01a.log'' ";
20> SQL "ALTER DATABASE RENAME FILE ''/d01/oradata/db101db/redo01b.log''
21> TO ''/backup03/webkey/redo01b.log'' ";
22> SQL "ALTER DATABASE RENAME FILE ''/d02/oradata/db101db/redo01c.log''
23> TO ''/backup03/webkey/redo01c.log'' ";
24> SQL "ALTER DATABASE RENAME FILE ''/d00/oradata/db101db/redo02a.log''
25> TO ''/backup03/webkey/redo02a.log'' ";
26> SQL "ALTER DATABASE RENAME FILE ''/d01/oradata/db101db/redo02b.log''
27> TO ''/backup03/webkey/redo02b.log'' ";
28> SQL "ALTER DATABASE RENAME FILE ''/d02/oradata/db101db/redo02c.log''
29> TO ''/backup03/webkey/redo02c.log'' ";
30> SQL "ALTER DATABASE RENAME FILE ''/d00/oradata/db101db/redo03a.log''
31> TO ''/backup03/webkey/redo03a.log'' ";
32> SQL "ALTER DATABASE RENAME FILE ''/d01/oradata/db101db/redo03b.log''
33> TO ''/backup03/webkey/redo03b.log'' ";
34> SQL "ALTER DATABASE RENAME FILE ''/d02/oradata/db101db/redo03c.log''
35> TO ''/backup03/webkey/redo03c.log'' ";
36> SET UNTIL TIME '06-JUN-08 15:15:00';
37> RESTORE DATABASE;
38> SWITCH DATAFILE ALL;
39> RECOVER DATABASE;
40> }
executing command: SET NEWNAME
using target database control file instead of recovery catalog

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

sql statement: ALTER DATABASE RENAME FILE ''/d00/oradata/db101db/redo01a.log'' TO ''/backup03/webkey/redo01a.log''
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 09/08/2008 02:30:42
RMAN-11003: failure during parse/execution of SQL statement: ALTER DATABASE RENAME FILE '/d00/oradata/db101db/redo01a.log' TO '/backup03/webkey/redo01a.log'
ORA-01511: error in renaming log/data files
ORA-01516: nonexistent log file, datafile, or tempfile "/d00/oradata/db101db/redo01a.log"


In previous ran of this script it could rename successfully of the first two online redo logfile and it is recorded on the controlfile but the restore operation fails. Now subsequent run of the script will fail because no log file actually exist in the controlfile as they already renamed.

In previous run m,y online redo logfile is rename from /d00/oradata/db101db/redo01a.log to /backup03/webkey/redo01a.log. In the next run(in this example) it again try to search for online redo log in the location /d00/oradata/db101db/redo01a.log inside the controlfile but did not find any as they already modified. So error appear of nonexistent log file, datafile, or tempfile.

Solution of The Problem
While make database in mount state log on to SQL*Plus and query the member column of v$logfile and see the location of the member. Suppose only 1 member is modified then in the SQL*Plus you can issue,
SQL>ALTER DATABASE RENAME FILE '/backup03/webkey/redo01a.log' TO '/d00/oradata/db101db/redo01a.log';
to rename reflected new location to old one and thus you can re-run the script without modifying any line.

If you notice that are redolog files are renamed successfully to the new location then you can simply omit/comment the lines of rename redo log command. Like in below.
tdev> vi /backup03/webkey/rman_script
run{
set newname for datafile 1 to '/backup03/webkey/system01.dbf';
set newname for datafile 2 to '/backup03/webkey/undotbs01.dbf';
set newname for datafile 3 to '/backup03/webkey/sysaux01.dbf';
set newname for datafile 4 to '/backup03/webkey/users01.dbf';
set newname for datafile 5 to '/backup03/webkey/data01.dbf';
set newname for datafile 6 to '/backup03/webkey/data02.dbf';
set newname for datafile 7 to '/backup03/webkey/indx01.dbf';
set newname for datafile 8 to '/backup03/webkey/indx02.dbf';
set newname for datafile 9 to '/backup03/webkey/tools01.dbf';
set newname for datafile 10 to '/backup03/webkey/splex_data.dbf';
set newname for datafile 11 to '/backup03/webkey/splex_indx.dbf';
set newname for datafile 12 to '/backup03/webkey/columnbia.dbf';
set newname for datafile 13 to '/backup03/webkey/data03.dbf';
set newname for datafile 14 to '/backup03/webkey/data03b.dbf';
set newname for datafile 15 to '/backup03/webkey/data_01_16K_01.dbf';
set newname for datafile 16 to '/backup03/webkey/indx_01_16K_01.dbf';
# SQL "ALTER DATABASE RENAME FILE ''/d00/oradata/db101db/redo01a.log''
# TO ''/backup03/webkey/redo01a.log'' ";
# SQL "ALTER DATABASE RENAME FILE ''/d01/oradata/db101db/redo01b.log''
# TO ''/backup03/webkey/redo01b.log'' ";
# SQL "ALTER DATABASE RENAME FILE ''/d02/oradata/db101db/redo01c.log''
# TO ''/backup03/webkey/redo01c.log'' ";
# SQL "ALTER DATABASE RENAME FILE ''/d00/oradata/db101db/redo02a.log''
# TO ''/backup03/webkey/redo02a.log'' ";
# SQL "ALTER DATABASE RENAME FILE ''/d01/oradata/db101db/redo02b.log''
# TO ''/backup03/webkey/redo02b.log'' ";
# SQL "ALTER DATABASE RENAME FILE ''/d02/oradata/db101db/redo02c.log''
# TO ''/backup03/webkey/redo02c.log'' ";
# SQL "ALTER DATABASE RENAME FILE ''/d00/oradata/db101db/redo03a.log''
# TO ''/backup03/webkey/redo03a.log'' ";
# SQL "ALTER DATABASE RENAME FILE ''/d01/oradata/db101db/redo03b.log''
# TO ''/backup03/webkey/redo03b.log'' ";
# SQL "ALTER DATABASE RENAME FILE ''/d02/oradata/db101db/redo03c.log''
# TO ''/backup03/webkey/redo03c.log'' ";

SET UNTIL TIME '06/06/2008 15:15:00';
RESTORE DATABASE;
SWITCH DATAFILE ALL;
RECOVER DATABASE;
}
"/backup03/webkey/rman_script" 41 lines, 2179 characters

And then run the script again.

No comments:

Post a Comment