Pre-requisite:
Both the source and target File system should be same.
Size of file system should be same.
Take the trace control file from source to target.
Ensure the the source working database backup.
Procedure :
1. Login to target system.
2. Shutdown the application server and database server.
3. Stop the listener
4. Delete all the files available under mirrlogA, mirrlogB, origlogA, origlogB
sapdata1, sapdata2,sapdata3 .
5. Copy the last successful backup file from source /oracle/<SOURCE_SID>/sapbackup/
<filename>.aff (offline backup) or <filename>.anf (online backup) to target
/oracle/<TGT_SID>/sapbackup
6. Create backup control on source system
alter database backup controlfile to trace as '/home/oracle/controlfile_backup.txt .
7. Copy the below content of trace and create control_sid.sql and move it to
target server under /oracle and update the SID of the system .
STARTUP NOMOUNT
CREATE CONTROLFILE SET DATABASE "<TGT_SID>" RESETLOGS ARCHIVELOG
MAXLOGFILES 255
MAXLOGMEMBERS 3
MAXDATAFILES 254
MAXINSTANCES 50
MAXLOGHISTORY 21034
LOGFILE
GROUP 1 (
'/oracle/<TGT_SID>/origlogA/log_g11m1.dbf',
'/oracle/<TGT_SID>/mirrlogA/log_g11m2.dbf'
) SIZE 50M BLOCKSIZE 512,
GROUP 2 (
'/oracle/<TGT_SID>/origlogB/log_g12m1.dbf',
'/oracle/<TGT_SID>/mirrlogB/log_g12m2.dbf'
) SIZE 50M BLOCKSIZE 512,
GROUP 3 (
'/oracle/<TGT_SID>/origlogA/log_g13m1.dbf',
'/oracle/<TGT_SID>/mirrlogA/log_g13m2.dbf'
) SIZE 50M BLOCKSIZE 512,
GROUP 4 (
'/oracle/<TGT_SID>/origlogB/log_g14m1.dbf',
'/oracle/<TGT_SID>/mirrlogB/log_g14m2.dbf'
) SIZE 50M BLOCKSIZE 512
DATAFILE
'/oracle/<TGT_SID>/sapdata1/system_1/system.data1',
'/oracle/<TGT_SID>/sapdata1/sysaux_1/sysaux.data1',
'/oracle/<TGT_SID>/sapdata1/undo_1/undo.data1',
'/oracle/<TGT_SID>/sapdata2/sr3_1/sr3.data1',
'/oracle/<TGT_SID>/sapdata2/sr3_2/sr3.data2',
'/oracle/<TGT_SID>/sapdata2/sr3_3/sr3.data3',
'/oracle/<TGT_SID>/sapdata2/sr3_4/sr3.data4',
'/oracle/<TGT_SID>/sapdata2/sr3_5/sr3.data5',
'/oracle/<TGT_SID>/sapdata2/sr3_6/sr3.data6',
'/oracle/<TGT_SID>/sapdata2/sr3_7/sr3.data7',
CHARACTER SET UTF8
;
7. Command to restore the backup from tape to system in background mode
nohup
brrestore -c force -b <file_name>.anf -p init<SID>.sap -r backup_utility.utl -m full -u /
&
8. Restore can be monitored from the subsequent log file in /oracle/<SID>/sapbackup latest <file_name>.rsb
9. Go to the path where control_<SID>.sql has been placed and create the control file with below command.
10. Now recover the database using the below sqlplus command, system will ask for archive log for the further recovery, if required.
recover database using backup controlfile until time '2020-01-27:22:53:00';
11. Now open the database with resetlogs.
12. Now the check the database mode.
13. Start the listener.
14. Switch the user to <sid>adm and check the output of R3trans -d.
Note :
If R3trans fails with error ORA-01017: invalid username/password; Check
link
15. Now start the sap system.
Suggestion :
Recovery time taken in Point 10 should be same as source backup file we copied in point 5 or less than that time.
; is mandatory in control file and it should be in individual line.