Backing Up an OPS Database

Backing up an OPS database is much the same as backing up a standalone database. There are only a few differences to be aware of. This section presents a brief review of database backup concepts and points out the differences between backing up a standalone instance and backing up an OPS database. We’ll briefly discuss ARCHIVELOG mode, cold and hot backups, and the use of standby databases and the Oracle8 Recovery Manager from an OPS.

ARCHIVELOG Mode

An Oracle database can run in either NOARCHIVELOG mode or ARCHIVELOG mode. In NOARCHIVELOG mode, the redo log files are recycled and overwritten without being saved offline. In ARCHIVELOG mode, the redo log files are archived before they are overwritten. Running in NOARCHIVELOG mode leaves open the possibility of data loss in the event of a failure. Complete and up-to-the-minute recovery from a failure is possible only when running in ARCHIVELOG mode. You must run the database in ARCHIVELOG mode if you want to do any of the following:

  • Recover completely from a media failure

  • Perform point-in-time recovery

  • Perform a hot (online) backup

The following sections describe how to enable ARCHIVELOG mode and set the corresponding initialization parameters.

Setting initialization parameters for ARCHIVELOG mode

To run a parallel server database in ARCHIVELOG mode, set the following three initialization parameters on each instance:

LOG_ARCHIVE_START

Enables automatic archiving. When this parameter is set to TRUE, Oracle will start the ARCH background process to archive the online redo logs before they are overwritten.

LOG_ARCHIVE_FORMAT

Specifies the format to use when naming the archived log files. You can specify the thread number and the log sequence number in the format. The thread number specification is useful only for an OPS database. For non-OPS databases, the thread number is always 1. It is always best to specify the thread number in the LOG_ARCHIVE_FORMAT specification so that you can easily identify the archived log files associated with each thread. An example of a LOG_ARCHIVE_FORMAT specification is:

LOG_ARCHIVE_FORMAT = TEST_%t_%s.arc

While creating the archived redo log files, Oracle replaces the %t in the name by the thread number and the %s by the log sequence number. The preceding specification will result in filenames such as TEST_1_23.arc, TEST_2_49.arc, and so forth. You can use %T and %S in place of %t and %s to get left-zero-padded thread number and log sequence numbers.

LOG_ARCHIVE_DEST

Specifies the destination to which the archived log files will be written. The archive log destination can be one of the following:

  • A separate filesystem for each instance local to each node

  • A common directory for all instances in a filesystem that is NFS-mounted on all nodes

If you are having each instance write archived redo log files to a filesystem local to the node on which that instance is running, you can take either of two approaches to naming that location. One approach is to use the same name for all the archive log filesystems. While each node will have its own filesystem, the name will be uniform across all nodes. Doing this allows you to specify the archive log destination in the common initialization parameter file. The other approach is to use a different directory for each instance’s archived log files. If your filesystem names are different on each node, you will have to specify the archived log destination in the instance-specific parameter files.

Another thing to be aware of when using local filesystems for archived log files is that the archived logs for each instance will be generated on the local node and will be accessible only to the instance that created them. During media recovery, you will have to collect the archived logs from all instances and put them in a location accessible to the instance that is actually performing the recovery.

Using an NFS-mounted directory allows all instances to archive to the same destination and also makes the archived logs of all instances accessible globally. The advantage of this approach is that, during a recovery, you don’t have to perform the extra task of collecting all the archived logs and moving them to a location accessible from the instance performing the recovery. One drawback to this approach is the unreliability of NFS filesystems. If the filesystem goes down for some reason, all the instances will hang because the archiver processes won’t be able to write to the archive log destination. The use of an NFS-mounted directory as an archive log destination requires a special setup. You should contact Oracle Support before using an NFS-mounted directory as your archive destination.

Tip

We recommend that you use a local filesystem as the archive log destination, even though you have to take extra care when performing media recovery to make the archive logs of all instances accessible from the instance performing the recovery. Do not use an NFS-mounted filesystem as the archive log destination.

Enabling ARCHIVELOG mode

Use the ALTER DATABASE command with the ARCHIVELOG option to put a database into ARCHIVELOG mode. You can do this only while the database is mounted, but not opened, by a single instance in EXCLUSIVE mode. Follow these steps to enable ARCHIVELOG mode for an OPS database:

Tip

Oracle recommends that you back up the database before changing its ARCHIVELOG mode.

  1. Shut down all running instances.

  2. Set the initialization parameters related to archiving for all instances.

  3. Set the initialization parameter PARALLEL_SERVER to FALSE.

  4. Start up an instance and mount the database. Do not open the database. Use a command such as this one:

    STARTUP MOUNT
  5. Since the PARALLEL_SERVER parameter has been set to FALSE, the database is now mounted in EXCLUSIVE mode.

  6. Issue the following command from Server Manager to put the database into ARCHIVELOG mode:

    ALTER DATABASE ARCHIVELOG;
  7. Shut down the instance.

  8. Set the initialization parameter PARALLEL_SERVER back to TRUE.

  9. Start up all instances in shared mode.

To reverse the process and put an OPS database into NOARCHIVELOG mode, follow steps 1, 3, and 4 as described earlier and then issue the following command from Server Manager:

ALTER DATABASE NOARCHIVELOG;

Follow steps 7, 8, and 9 to complete the operation.

Archiving redo logs in Oracle8i

Oracle8i introduces some changes in database archiving. You can now have as many as 10 archiver processes. These will be named ARC0, ARC1, and so forth up to ARC9. A higher number of archiver processes helps in managing high archiving loads. Oracle8i also allows you to archive to more than one destination. This is accomplished using a new form of the LOG_ARCHIVE_DEST parameter that has a number on the end. For example, you can now use LOG_ARCHIVE_DEST_1, LOG_ARCHIVE_DEST_2, and so forth to set multiple archivelog destinations.

You can take advantage of the multiple archivelog destination feature in an OPS environment to improve the recoverability of the database. Using this feature, you can configure each instance to archive redo logs to the local disk, as well as to a remote destination. To archive to a remote destination, you can use NFS to mount a directory from another OPS node, and then specify this NFS-mounted directory as the second archivelog destination in your initialization parameter file.

If you have only locally archived redo logs, you have the potential of losing data in the event of a complete node failure. Having multiple copies of archive logs in local as well as remote destinations makes recovering your database easier in the event of a node failure.

Refer to Oracle Corporation’s Oracle8i Administrator’s Guide and Oracle8i Parallel Server Setup and Configuration Guide for more details.

Cold Backup

A cold backup of an OPS database is very similar to that of a standalone database. All the instances of the parallel server database must be shut down (with normal, immediate, or transactional priority). Once all instances have been shut down and the database closed, you can proceed to copy all the datafiles, control files, and redo log files to your backup media. If the database is running in ARCHIVELOG mode, you also should back up the archived log files from all the instances. Cold backups can be made regardless of whether the database is in ARCHIVELOG mode.

If the database is running in NOARCHIVELOG mode, the database is recoverable only to the time of the most recent cold backup. When ARCHIVELOG mode is enabled, you can use the last cold backup, together with the archived redo logs, to recover every committed change up to the point of failure.

Hot Backup

The procedure for taking a hot backup of an OPS database is the same as it is for a standalone database. The database must be running in ARCHIVELOG mode, and the hot backup is taken while the database is up and running. The database will be available to all the instances and all the users during the backup process.

Follow these steps to take a hot backup of a database:

  1. Repeat these steps for each tablespace in the database:

    1. Issue the following command to place the tablespace into backup mode:

      ALTER TABLESPACE tablespace_name BEGIN BACKUP;
    2. Back up the datafiles for the tablespace using an operating system utility.

    3. Issue the following command to take the tablespace out of backup mode:

      ALTER TABLESPACE tablespace_name END BACKUP;

    You can take a hot backup of any tablespace from any instance.

  2. Back up the control file using the following command:

    ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
  3. Issue the following command to archive redo log files on all threads and then back up the archived log files:

    ALTER SYSTEM ARCHIVELOG CURRENT;

Tip

More redo information is generated during the time when table-spaces are put into backup mode. Therefore, we recommend that you take a hot backup during times when the load is light.

Standby Database for OPS

A standby database for an OPS database is similar to that of a standalone database. In an OPS environment, the archived log files from all the instances must be applied to the standby database. The following two items must be identical on the primary and the standby database systems:

  • Operating system version and patch level

  • Oracle version and patch level

The standby database need not be a parallel server database. If the standby is also a parallel server database, it need not have the same number of instances as that of the primary database.

Backup Using Recovery Manager

Oracle8 comes with a utility called Recovery Manager (RMAN) that may be used for backing up and recovering a database. You can use either operating system utilities or RMAN to back up and recover a database. When using RMAN with OPS, note the following:

  • Recovery Manager needs a read-consistent view of the control file while performing a backup. To create this view, it generates a temporary backup of the control file. This file is called a snapshot control file. You can specify the name and location of the snapshot control file using RMAN’s SET SNAPSHOT CONTROLFILE command.

    For an OPS database, each node must be able to create a snapshot control file with the same name and location. You can create the snapshot control file on a raw device, which can be shared by all the nodes in the OPS environment. Alternatively, you can create a directory on each node to hold the snapshot control file. Use a command such as the following to specify the location of the snapshot control file:

    SET SNAPSHOT CONTROLFILE TO '/u01/oracle/admin/snapshot/snap_test.cf';
  • After you finish a hot backup of all tablespaces, you must issue the command ALTER SYSTEM ARCHIVE LOGFILE CURRENT to archive the redo log files on all threads; doing so ensures a consistent set of redo in the backup set.

  • When performing recovery on multiple nodes, you must ensure that each node can access the LOG_ARCHIVE_DEST directory on all other nodes, or you must place the archive log files in a directory that’s accessible to all instances involved in the recovery.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.0.240