Oracle DB's - Windows
When Amanda is licensed and configured for Windows Oracle backup, Amanda uses the Oracle VSS writer to take the back up of 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 supports backup of Windows Oracle 12c, 18c and 19c.
Window 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 Start-up. Select 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 opened 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
Log Mode Check:
Before initiating backups, determine the log mode of your Oracle database.
There are two modes: ARCHIVELOG and NOARCHIVELOG.
a. ARCHIVELOG Mode:
Backups work with open, mounted databases in READ-WRITE mode.
b. NOARCHIVELOG Mode:
Backups work with closed, mounted databases in READ-only mode.
Checking Log Mode:
Execute the following SQL query in the SQL prompt:
Changing Database State:
Execute the following SQL query in the SQL prompt:
Note: Use SQL> startup mount;
to open the database. If you want the database to be closed but mounted, execute SQL> startup;
.
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, 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 Sources page, click on ADD SOURCE you are prompted to select what type of object you want to back up. Choose database and select the Oracle Windows from the source type. The following options are displayed:
Host Name
The name of the machine running the Oracle database server you intend to back up.
BackupSet
The name of the BackupSet for which you want to bound the Oracle Windows Source
Encryption
Select any of the encryption type from Encryption Strategy dropdown to encrypt the backup image before transfer to the Amanda backup server
Compression
Select any of the compression type from Compression Strategy dropdown to compress backup images before transfer to the Amanda backup server.
Deduplication
Select dedup option to eliminating redundant data in a data. In the process of deduplication, extra copies of the same data are deleted, leaving only one copy to be stored
After you have set the options, click SAVE to add the Windows Oracle object to the backup set. 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:
Use the ZMC to restore the backup to a temporary directory you create for this purpose.
Use Oracle's SQL Plus 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:
If necessary, install the Zmanda Windows Client software on the restore client (i.e. the Windows Oracle server being restored) as described here
Access the server with SQL Plus (you will need the connect string). Ensure that the database is in shutdown state. From the SQL> prompt, enter the following: SQL>shutdown immediate;
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 for NOARCHIVELOGMODE Recovery
For recovery of a NOARCHIVELOGMODE backup, make two copies of the CONTROL01.CTL file: CONTROL02.CTLand CONTROL03.CTL. CONTROL01.CTL is located in the ORAHOME\ORADATA\DATABASE_SID directory. These backup control files will be used for the recovery.
Connect to Oracle through sqlplus (you will need the connect string). The SQL Prompt is displayed.
Shutdown the database using this command: SQL>shutdown immediate; \
Mount the database: SQL> startup mount;
Clear the redo logs: SQL> alter database clear unarchived logfile "full_path_to_redo_log"; Repeat this command for all the redo log files. \
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
Preparation
Backup the Original Control File:
Navigate to your Oracle Home directory (e.g., ORAHOME\product\db\database\).
Note: The exact path may vary depending on your installation. Ensure you use the correct Oracle Home path as specified in your system's configuration.
Copy the control file to a secure temporary location. This ensures you have a backup in case the recovery process encounters issues.
Create Control File Copies:
In the restore directory, create three copies of SNCFDATABASE_SID. Name these copies CONTROL01.CTL, CONTROL02.CTL, and CONTROL03.CTL.
Replace the original control files in the Oracle base directory with these new copies.
Note: CONTROL01.CTL is usually located in ORAHOME/oradata, CONTROL02.CTL in the recovery area, and CONTROL03.CTL acts as an additional copy.
Restore Database Files:
Replace the original SNCFDATABASE_SID and SPFILEDATABASE_SID files in the ORAHOME\product\db\database with the versions restored from backup.
Copy the .dbf files from Zmanda Management Console (ZMC) to the Oracle base directory, replacing the existing files.
Recovery Method 1: Using SQL*Plus
Connect to Oracle:
Use sqlplus to connect to the database, which should be in an idle state after shutdown.
Mount the Database:
Execute the command: SQL> startup mount;
Recover the Database:
Start the recovery with the command: SQL> recover database using backup controlfile until cancel;
Follow the prompts to specify the log files needed for recovery, using the 'AUTO' option or providing specific paths as necessary.
Complete the Recovery:
Once all logs have been applied, enter Cancel to exit recovery mode.
Alter the database to the open state with reset logs: SQL> alter database open resetlogs;
Verify Database Recovery:
Check the database status: SQL> select name, open_mode from v$database; to ensure it is in the open (read/write) mode.
Alternative Recovery Method: Using RMAN
Prepare RMAN:
After mounting the database, exit sqlplus and connect to RMAN: rman target /
Perform RMAN Recovery:
Execute: RMAN> recover database;
If necessary, specify recovery to a point using SCN or time values.
Finalize Database State:
After recovery, alter the database to the open state: SQL> alter database open resetlogs;
Troubleshooting
If a Windows Oracle backup fails (or you are unable to verify the client through the ZMC), follow these troubleshooting steps:
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).
Make sure that the Oracle Databases are in Mounted state.
Last updated
Was this helpful?