Disaster Recovery and DR Preparedness : Back up and restore Oracle 10g+ database on Windows

Back up and restore Oracle 10g+ database on Windows
The following procedures walks you through how to back up and restore an Oracle 10g+ database on a Windows Recovery Node. These procedures assume that you are knowledgeable and comfortable with Oracle databases.
Restoring and recovering an Oracle database, after you have booted the recovery node (RN), is a unique process from that of other databases. These procedures cover the prerequisites for hot backups with Volume Shadow Copy, and the required tools developed by Quorum to recover and open your Oracle Database on your recovery node.
These procedures outline the steps to recover an Oracle database with ARCHIVELOG mode enabled and the Oracle VSS Writer service installed. Hot backups are not possible with an Oracle database using NOARCHIVELOG mode. Databases using NOARCHIVELOG mode must be put in a consistent (shutdown) state in order to perform a backup.
Recovery, maintenance and troubleshooting of Oracle databases on the protected node (PN) will not be covered in these procedures.
These procedures might not work with your specific configuration; as such, discuss your configuration with Quorum Support before you perform this procedure.
(Step 1) To prepare your environment:
1.
•
•
2.
Oracle requires that you put archive logs on a separate volume when performing backups with the Oracle VSS Writer service.
Quorum cannot recommend an architecture that violates Oracle's specifications. However, it should be noted that Quorum did not observe any adverse effects when putting the database and archive logs on the same volume while performing VSS backups and restores.
3.
From the onQ Portal’s Protection Config tab, verify that you have the following volumes protected.
•
•
4.
The Oracle VSS Writer service is installed by default with Oracle Database 11g. Oracle Database 10g releases require a manual installation of the Oracle VSS Writer service. The installation instructions for the Oracle VSS Writer service can be found here.
5.
a.
Make sure Oracle is in ARCHIVELOG mode.
b.
Configure Oracle VSS Writer service with the SYSDBA user, mode Automatic; then, test that the user account has SYSDBA set correctly:
> sqlplus user_account as SYSDBA
For example:
Where sysadm_amy is the user_account.
> sqlplus sysadm_amy as SYSDBA
c.
Configure the Volume Shadow Copy Service with Local Service account, mode Automatic.
d.
Configure the Software Shadow Copy Provider service with Local Service account, mode Automatic.
(Step 2) To back up the Oracle database:
Perform the following procedure on the PN and for each database that you want to restore.
1.
> oravssw /q /status
2.
> vssadmin list writers
3.
On the PN, unzip the Quorum Oracle database recovery scripts in the C:\Program Files\Quorum\usr folder.
4.
Modify the restore_oracle.bat batch file:
a.
Make a backup copy of the restore_oracle.bat batch file.
b.
> set DB_INSTANCES=(database_instance_name)
For example:
Where there are three database instances: orcl, orcl1, and orcl2:
> set DB_INSTANCES=(orcl oracl1 oracl2)
c.
5.
Initiate a backup of the PN, or wait for a scheduled backup to complete.
6.
Repeat Step 2: Verify that the VSS writers are Stable.
7.
8.
Check the PN’s Event Log for VSS‑related errors. If there are errors, resolve them. For troubleshooting information, see the appropriate return code in A0801.
(Step 3) To restore the Oracle database:
After the RN boots, you can now begin the Oracle Database recovery process. This process can be performed with an RN booted in test mode or production mode. Perform the following procedure on the RN and for each database instance that you want to restore. This procedure includes two ways to restore your database(s). Begin with the recommended solution.
(Recommended) Using restore_oracle.bat
This procedure uses Quorum’s restore_oracle.bat scripts. This solution is recommended.
1.
With the RN, in test or production mode, navigate to the C:\Program Files\Quorum\usr folder, then run the restore_oracle.bat file completely.
You will be prompted for your database password twice for each database instance: once for a shutdown command and once for an open resetlogs command.
2.
•
•
Using “manual” process
This procedure uses a manual process to restore your database(s). This solution is not automated as is the case with using Quorum’s restore_oracle.bat scripts, which executes the same commands in the following manual process.
1.
> set ORACLE_SID=database_instance_name
> sqlplus SYS as SYSDBA
SQL> SHUTDOWN IMMEDIATE;
SQL> EXIT;
For example:
Where orcl is the database_instance_name or Oracle System ID (SID).
> set ORACLE_SID=orcl
> sqlplus SYS as SYSDBA
SQL> SHUTDOWN IMMEDIATE;
SQL> EXIT;
2.
> qvss.exe restore
3.
> sqlplus SYS as SYSDBA
SQL> ALTER DATABASE open resetlogs;
SQL> EXIT;
4.
> sqlplus system@database_instance_name
SQL> select count (*) from table_name;
For example:
Where testtable is the table_name and where orcl is the database_instance_name or Oracle System ID (SID).
> sqlplus system@orcl
SQL> select count (*) from testtable;
5.
Check the PN’s Event Log for VSS‑related errors. If there are errors, resolve them. For troubleshooting information, see the appropriate return code in A0801.
6.
•
•
(Step 4, if necessary) To fix an incomplete database recovery:
If you attempted to restore an Oracle database either manually or using restore_oracle.bat and your database(s) fails to open, you have an incomplete database recovery. This procedure includes two ways to fix an incomplete database recovery. Begin with the recommended solution.
(Recommended) Using “recover database until cancel” method
This solution uses Oracle’s recover database until cancel recovery method to fix an incomplete database recovery. This procedure is the easiest way to fix such a problem, and is recommended before attempting any other incomplete database recovery method.
1.
Restart a fresh RN, in test or production mode. If you’re using restore_oracle.bat, execute that file now, but choose not to start the databases at the end of batch file.
2.
Set the ORACLE_SID to the database SID. Where the SID is ORCL:
C:\> SET ORACLE_SID=ORCL
3.
C:\> SQLPLUS / AS SYSDBA
4.
a.
Execute the recover database until cancel method.
b.
If the suggested log file is unavailable or there are no archive log files, type CANCEL.
SQL> RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE;
5.
SQL> alter database open resetlogs;
6.
SQL> SELECT CURRENT_SCN FROM V$DATABASE;
If the database fails to open successfully, the cause is a known bug (race condition) in Oracle’s VSS Writer. Perform the procedure outlined in Using point‑in‑time recovery method.
Using point‑in‑time recovery method
This solution uses Oracle’s point‑in‑time recovery method to restore the database to the target time (or SCN) for recovery. This procedure is guaranteed to succeed, but is more complicated; for this reason, use it as a last resort. Perform the following procedure for each database instance.
1.
Restart a fresh RN, in test or production mode. If you’re using restore_oracle.bat, execute that file now, but choose not to start the databases at the end of batch file.
2.
Set the ORACLE_SID to the database SID. Where the SID is ORCL:
C:\> SET ORACLE_SID=ORCL
3.
C:\> SQLPLUS / AS SYSDBA
4.
a.
SQL> SELECT MAX(NEXT_CHANGE#) FROM V$LOG_HISTORY;
Let’s assume the last change value is 118009.
b.
Recover to the last change number in the last archived redo log on the RN. This value is the last NEXT_CHANGE# value (see Step 4) minus 1. Where the last change value is 118009, therefore, the value is 118008 (118009 -1).
SQL> RECOVER DATABASE UNTIL CHANGE 118008 USING BACKUP CONTROLFILE;
5.
SQL> alter database open resetlogs;
6.
SQL> SELECT CURRENT_SCN FROM V$DATABASE;
If your database still fails to open successfully, contact Quorum Support.

v3.8 SP1 HF1
v3.8 SP1 HF1