WinOracle

When Amanda is licensed and configured for Windows Oracle backup, Amanda uses the Oracle VSS writer to back up Oracle data files, control files, and archive logs.

Requirements for Windows Oracle Backup and Restore

These instructions assume you have already installed and licensed the Amanda server and the Windows client that hosts the Oracle server being backed up. There are a number of additional requirements:

  • The ZMC only supports backup of Windows Oracle 11i running on 32-bit versions of Windows 2003 server.
  • Window 2003 servers must be upgraded to Service Pack 1 (SP1) or newer.

  • The Volume Shadow Copy Service must be enabled. Although the Volume Shadow Service is enabled by default, it may have been turned off after Windows installation. To ensure that it is running:
  1. Right-click the My Computer icon and choose Manage from the popup menu.
  2. Expand the Services and Applications tree and locate the Volume Shadow Copy Service.
  3. If it is not started, do so.
  4. If necessary, change the General Properties to make the Startup Type Automatic rather than Manual.

  • The Zmanda Windows Client must be installed on the Oracle server as described here.
  • For backup in NOARCHIVELOGMODE, databases must be Mounted and in read-only state. The database cannot be open in NOARCHIVELOG mode, or the backup will fail. For backup in ARCHIVELOG mode, the database may be open and mounted. To determine the state of the database being backed up, enter ARCHIVE LOG LIST at the sql prompt, and look for the following output line:
Database log mode No Archive mode
or
Database log mode Archive mode

Configuring Oracle Backups from the ZMC Backup What Page

Managing Oracle database backup and recovery requires an experienced Oracle administrator. Before you begin configuring Oracle backups, you may want to review the following links from Oracle regarding DB administration, and backup and recovery concepts and procedures:

Oracle database control files are backed up by Volume Shadow Copy Service snapshots. The backed-up files are referred to as Snapshot Control files. For example, a control file by the name of 'CONTROL01.CTL' is backed up under the name SNCFSID_NAME.ORA (SNCFDATA.ORA if the database SID name is DATA). This snapshot control file is restored on the Oracle machine during restore and is used for manual recovery.

Once you have ensured that the databases are in the proper state for the type of backup you are creating (i.e., ARCHIVELOGMODE or NOARCHIVELOGMODE, component-based or volume-based, etc.), create a dedicated backup set for each Windows Oracle server you intend to back up. On the Backup What page you are prompted to select what type of object you want to back up. Choose Windows Oracle, and the following options are displayed:

Windows Oracle Backup What Options

Host Name
The name of the machine running the Oracle database server you intend to back up.
Compression
Check the box to compress backup images before transfer to the Amanda backup server.

After you have set the options, click Add to add the Windows Oracle object to the backup set. Click Apply changes to server to commit the changes; you can then configure the backup set just as you would any other by setting the options on Backup Where, Backup How, and Backup When, etc.

Note that the Zmanda Agent for Windows Oracle backup process only the databases, logs, and control files. If you wish to protect other Oracle-related files (such as the installation directory), create a standard backup template on the Zmanda Windows Client to include these files.

Recovering Windows Oracle Databases using the ZMC and Oracle sqlplus

Recovering an Oracle database is a two-part process:

  1. Use the ZMC to restore the backup to a temporary directory you create for this purpose.
  2. Use Oracle's sqlplus program to recover the database from the restored backup files.

Before starting the restore process, make sure that the Oracle server being restored is installed in the same location as the original backup source. Oracle databases, archive log, and control file locations should also match those on the original server.

Restoring the Backup Using the Zmanda Management Console

To restore a Windows Oracle database, follow these steps:

  1. If necessary, install the Zmanda Windows Client software on the restore client (i.e. the Windows Oracle server being restored) as described [here].
  2. Access the server with sqlplus (you will need the connect string). Ensure that the database is in shutdown state. From the SQL> prompt, enter the following:

    SQL>shutdown immediate;

     
  3. Access the ZMC console and open the Restore What page. Select all the host databases and log files for restore. Complete the restore pages as usual.

Manually Completing the Recovery

After the Oracle databases, control files, server parameter file and archive log files are restored to the Oracle server, there are a number of manual steps you must follow to complete the database recovery. The exact steps you follow will depend on what type of backup you are recovering from, and what the recovery goals are. If you are unfamiliar with Oracle backup/recovery concepts and procedures, please review this documentation from Oracle before proceeding.

The following examples are provided to show you what the steps would be for two typical scenarios.

Example NOARCHIVELOGMODE Recovery

  1. For recovery of a NOARCHIVELOGMODE backup, make two copies of the CONTROL01.CTL file: CONTROL02.CTL and CONTROL03.CTL. CONTROL01.CTL is located in the ORAHOME\ORADATA\DATABASE_SID directory). These backup control files will be used for the recovery.
  2. Connect to Oracle through sqlplus (you will need the connect string). The SQL prompt is displayed.
  3. Shutdown the database using this command:

    SQL>shutdown immediate;

     
  4. Mount the database:

    SQL> startup mount;

     
  5. Clear the redo logs:

    SQL> alter database clear unarchived logfile "full_path_to_redo_log";

    Repeat this command for all the redo log files.

     
  6. To finish, enter the following SQL command string:

    SQL>alter database open;

     

The Oracle database is now recovered. To verify that the database is in the open state (read/write mode), use the following command:

SQL> select name, open_mode from v$database;

Example ARCHIVELOGMODE Recovery

  1. For recovery of ARCHIVELOGMODE backups, make three copies of the SNCFDATABASE_SID.ORA file called CONTROL01.CTL and CONTROL02.CTL and CONTROL03.CTL. The SNCFDATABASE_SID.ORA file is located in the ORAHOME\product\db\database\ directory.
  2. Connect to Oracle through sqlplus (you will need the connect string).
  3. Shutdown the database by entering the following at the SQL prompt:

    SQL>shutdown immediate;

     
  4. Mount the database:

    SQL>startup mount

     
  5. Begin recovery of the control files with this SQL command string:

    SQL>recover database using backup controlfile until cancel;

    You are prompted for the appropriate logs (which are defined in the backup control file(s) you created in step 1); Press Enter to respond to these prompts until until the command prompt is displayed (or it errors out because it could not find a log). You may need to invoke the recover command multiple times to apply all the necessary logs. Enter Cancel when you are done to exit recovery mode and return to the SQL prompt.

     
  6. To finish, enter the following SQL command string:

    SQL>alter database open resetlogs;

The Oracle database is now recovered. To verify that the database is in the open state (read/write mode), use the following command:

SQL> select name, open_mode from v$database;

Troubleshooting

If a Windows Oracle backup fails (or you are unable to verify the client through the ZMC), follow these troubleshooting steps:

  1. Examine the Windows Event Viewer for any VSS or Oracle Writer errors. Run the command vssadmin list writers at the Windows command prompt and check that the state of the Oracle Writer is stable. If not (or if there are any VSS errors, restart the Oracle Writer and Volume Shadow Copy Service.
  2. Make sure that the Oracle Databases are in Mounted state.