Redirected restore of an Oracle database to another Oracle Server fails with the following error "Final error: 0xe0000340 - The Database script returned an error" if the CONTROLFILE AUTOBACKUP is configured on the source server.
Problem
The redirected restore job fails with the following error:" Final error: 0xe0000340 - The Database script returned an error." if the CONTROLFILE AUTOBACKUP is configured on the source server even if the instance name and the DBID is the same on the new server.
Error Message
Redirected restore of an Oracle database to another Oracle Server fails if the CONTROLFILE AUTOBACKUP is configured on the source server with error.
“Final error: 0xe0000340 - The Database script returned an error. Refer to the Database script output section in job logs for more details.
Final error category: Resource Errors”
The RMAN output in the restore job log shows
released channel: ch0
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/23/2021 08:27:41
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece
Solution
The redirected restore job with “Restore control files only” option selected also fails with the same error.
The RMAN script used for the above restore job is
RUN {
ALLOCATE CHANNEL ch0
TYPE 'SBT_TAPE';
SEND 'BSA_SERVICE_HOST=192.168.45.130,NBBSA_TOTAL_STREAMS=1,NBBSA_JOB_COOKIE={8D22A97D-CDA6-4FE1-BF00-8E62CE2A37D7},NBBSA_DB_DEVICE_NAME=Oracle-Linux::\\192.168.45.25\PROD,NBBSA_SOURCE_MACHINE_NAME=RAC-PROD-77299223';
RESTORE CONTROLFILE FROM 'c-77299223-20110522-01';
RELEASE CHANNEL ch0;
}
Modify the above script to the following
RUN {
ALLOCATE CHANNEL ch0
TYPE 'SBT_TAPE';
SEND 'BSA_SERVICE_HOST=192.168.45.130,NBBSA_TOTAL_STREAMS=1,NBBSA_JOB_COOKIE={8D22A97D-CDA6-4FE1-BF00-8E62CE2A37D7},NBBSA_DB_DEVICE_NAME=Oracle-Linux::\\192.168.45.25\PROD,NBBSA_SOURCE_MACHINE_NAME=RAC-PROD-77299223';
RESTORE CONTROLFILE FROM autobackup;
RELEASE CHANNEL ch0;
}
Run the above script from the RMAN prompt on the new server. This will run a DBA initiated job in Backup exec and will restore the control files.
Now mount the database using “alter database mount “ from RMAN
Move to the Backup Exec Media Server.
On the navigation bar, click the arrow next to Restore, then click New Restore Job.
On the Properties pane, under Source, click Selections.
Select the appropriate Control File to restore.
On the Restore job properties pane, under Destination, click Oracle Redirection.
Check the check box for the option, Restore Oracle instance to server. Enter account credentials to access the new or alternate Oracle Server and click Run Now.
Note: The restore job will fail because the recovery portion encounters inconsistent archive logs. This is a normal occurrence during a disaster recovery.
Move to the Oracle server.
Type alter database open resetlogs;
If an error is encountered while Oracle tries to open the database document the online redo log path and then update the path
using the steps below.
To update the online redo log file path:
a. At the Oracle server, open a command prompt.
b. Type the following command:
SQLPLUS /nolog
c. Type connect<sys/password@SID>;
d. Type the following SQLPlus command:
SQLPLUS ALTER DATABASE RENAME FILE <old path from backup to any redolog file name> to <path to expected restored redolog file name>;
For example:
ALTER DATABASE RENAME FILE 'D:\ORACLE\ORADATA\JACOB\REDO01.LOG' to
'C:\ORACLE\ORADATA\JACOB\REDO01.LOG';
e. In the command prompt, type RMAN, then type the following command at the RMAN prompt:
alter database open resetlogs;
f. Close the command prompt. The recovery should now be complete.