A standby database is a special copy of the primary database. Once created, Dbvisit Standby can be used to automatically keep the standby database up to date with the primary database. Dbvisit Standby can automatically create the standby database, but in some cases it may be desirable to manually create the standby database. These steps show two different methods for manually creating the standby database. Please choose one method. |
Oracle's Rman can be used to create a standby database without shutting down the primary database. You do not need to create an Rman catalog.The easiest way to use Rman is to create the backup on disk. However, this requires significant free space if your database is very large. It is also possible to save the backup to tape. In this case you would need a tape or media manager as part of your Rman configuration. On some systems it may be possible to use an external Hard Disk (through USB) to backup the database and then use this disk to restore the database on the standby server.
Example:
This example backs up the database to disk.
1. Setup the same Windows user accounts (Oracle software owner) and groups (dba) on the standby server.
2. Recreate the same Oracle directory structure on the standby server as on the primary server.
3. Install Oracle software on the standby server preferably in the same location as on the primary server.
4. Copy the init.ora file for the production database on the production server to the standby server.
5. Copy the password file %ORACLE_HOME%\dbs\orapw<$ORACLE_SID> from the production server to the standby server. You may have to create a new password file with the orapwd utility.
6. Copy the spfile from the production server to the standby server if it is used.
7. Create an Oracle service for the standby database on the standby server with command (startmode is manual):
|
Where dbvisitp is the name of the database
8. Create a directory on the primary and standby server where the full backup of the database can be kept. In this example C:\oracle\orabase\backupfile.
9. Listener must be running on the standby server and you must be able to connect from primary server to the standby database (the SQL*Net port must be open on any firewall between the two servers).
10. Start the standby database in nomount mode.
|
11. Set the Oracle environment to the production database and start Rman:
|
12. Copy files from C:\oracle\orabase\backupfile\ to same location on standby server.
13. Create an alias entry for the standby database in the tnsnames.ora file on the production server. In this example the alias is called standbydb.
14. Start Rman and create the standby database. The password for sys must be the password from the password file.
|
15. Standby database is now complete. Rman has started the standby database in mount standby mode which is correct for Dbvisit Standby to continue. For reference the commands to start a standby database are:
|
If the following message is received from Rman: |
|
Then the following should be added (in red) to the listener.ora on the standby server:
|
The process involves making a full backup of your production database on the primary server. This can be either a hot or a cold backup. If a hot backup is used, then the archive log files created during the backup will also need to be copied to the standby database.
1. Setup the same Windows user accounts (Oracle software owner) and groups (dba) on the standby server.
2. Recreate the same Oracle directory structure on the standby server as on the primary server.
3. Install Oracle software on the standby server preferably in the same location as on the primary server.
4. Copy the init.ora file for the production database on the production server to the standby server.
5. Copy the password file %ORACLE_HOME%\dbs\orapw<$ORACLE_SID> from the production server to the standby server. You may have to create a new password file with the orapwd utility.
6. Copy the spfile from the production server to the standby server if it is used.
7. Create an Oracle service for the standby database on the standby server with command (startmode is manual):
|
On the primary server:
8. Make a standby controlfile on the production database using the following command:
|
9. Copy this standby controlfile to a temporary location on the standby server.
10. Make a cold or a hot backup of the database to either disk or tape.
11. Restore the full production database backup (including any new archive logs) to the standby server.
12. Replace the existing controlfile(s) (if any) with the new standby controlfile from the temporary location. Make sure the names of the controlfile(s) stay the same.
Example: if the existing controlfiles were named control01.ctl and control02.ctl, replace the existing controlfiles with the new standby controlfile (created in step 8 above) and make sure that new standby controlfiles are named control01.ctl and control02.ctl.
13. Set the correct Oracle environment.
14. Start sqlplus:
|
15. Apply archives until there are no more archives to be applied.
16. Standby database is now complete. The standby database is in mount standby mode which is correct for Dbvisit Standby to continue. For reference the commands to start a standby database are:
|