Skip Headers

Oracle8i Server Installation and Database Administration Guide
Release 3 (8.1.7) for Fujitsu Siemens Computers BS2000/OSD

Part Number A95466-01
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

6
Backing Up and Recovering a Database

This chapter supplements the generic Oracle Server documentation set with information about:

Refer to the Oracle8i Administrator's Guide and the Oracle8i Backup and Recovery manual for detailed information about database backup and recovery.

Oracle8i's Recovery Manager offers an additional method to do backup and recovery. This chapter at first discusses previously existing methods and then Recovery Manager on BS2000/OSD.

Backing Up Databases

As a security precaution, you should back up the information stored in an Oracle Server database regularly. The method you use for backing up an Oracle Server database and the frequency of backup is site-dependent.

A good approach is to establish a routine schedule. For example, you can schedule an Export immediately before or after a business activity that involves data entry, such as weekly invoicing or month-end closing of the books.

Backing up Using the Export Utility

The Export utility allows you to back up or export information stored in your Oracle Server database. We strongly recommend that you export your Oracle Server database files before installing a new version of the Oracle Server.

The Oracle Server Export utility provides you with a means to backup a table, a user, or a complete database. As this utility deals with (logical) database objects, it tends to be slower than BS2000 backup utilities. However, Export provides a great deal of flexibility. As you can export individual tables, you can back up critical tables or tables with high update activity more frequently than other data.

The following steps show one way of exporting an entire Oracle Server database. For details of the other available options, refer to the Oracle8i Utilities manual.

  1. You should have exclusive use of the Oracle Server database while you are running the Export utility for a full database export. To accomplish this, LOGON under the DBA userid, shut down the Oracle Server database and then start it with the DBA option by entering:

    	/START-PROGRAM $ORACL817.SVRMGRL
    SVRMGR> CONNECT INTERNAL
    SVRMGR> SHUTDOWN
    SVRMGR> STARTUP RESTRICT
  2. Export the Oracle Server database, using EXP.

    Refer to the Oracle8i Utilities manual for more information on how you use the Export utility.

  3. When the export is complete, bring the Oracle Server database down and back up for general use by entering:

    	/START-PROGRAM $ORACL817.SVRMGRL
    SVRMGR> CONNECT INTERNAL
    SVRMGR> SHUTDOWN
    SVRMGR> STARTUP

Using BS2000 Utilities to Back Up an Oracle Server System

You can also back up an Oracle Server database using BS2000 operating system utilities (for example, ARCHIVE). This is often preferable when the Oracle Server database is very large and frequent exports are not practical because of time restraints.

A disk file backup of the Oracle Server database is not an alternative to an EXP in all cases. Refer to the section on "Recovering Databases" for a discussion of cases when recovery must be from an Export file.

Disk file backups are appropriate as a means of securing the Oracle Server database in case of hardware or operator failure and are a necessary part of any recovery scheme that involves the use of log files.

Use the following steps to back up an Oracle Server database using a disk backup command:

  1. While the database is running, collect the names of all files which make up the Oracle Server database. You can determine the names of the log and database files by entering the following:

    	/START-PROGRAM $ORACL817.SVRMGRL
    SVRMGR> CONNECT INTERNAL
    SVRMGR> SELECT * FROM V$DATAFILE;
    SVRMGR> SELECT * FROM V$LOGFILE;
    
    
  2. To ensure that all Oracle Server database files are synchronized at the time of the backup, shut down the Oracle Server database using Oracle Server Manager.

  3. Back up all database files and log files using the BS2000 ARCHIVE utility. Note that you should always back up all files at the same time.

  4. Restart the Oracle Server database using Server Manager.

Online Backup

You can perform an online backup of individual tablespaces by using either:

The ARCHIVE method is faster, and is described in this section.

Before you can perform an online ("hot") backup of individual tablespaces, you must ensure that the ARCHIVE utility can back up open files.

The BS2000 command you enter to ensure that ARCHIVE can back up open files is given below. The INSTALL.C.OPNBACK utility calls the BS2000 macro CATAL which sets the OPNBACK file attribute to YES. For the CATAL macro to work the database must be shut down or the tablespace in question must be off line. You enter this command once per file (for example, before adding it to a tablespace), not on the occasion of each backup:

/START-PROGRAM  $ORACL817.INSTALL.C.OPNBACK
*<database filename>

You must never back up database files online without first setting the tablespace to backup mode; if you do the resulting backup files will be inconsistent. To perform an online backup of individual tablespaces or data files, use the following procedure:

  1. Enter the following command:

    	SVRMGR> ALTER TABLESPACE name BEGIN BACKUP;
    
    
  2. Backup the file(s) of the tablespace using the BS2000 utility ARCHIVE. (Make sure that the OLS parameter is set to YES.)

  3. Enter the following command:

    	SVRMGR> ALTER TABLESPACE name END BACKUP;
    


    Note:

    The Server Manager commands above operate on tablespaces, while the ARCHIVE utility operates on data files.


Recovering Databases

There are several reasons why an Oracle Server database might need to be restored. They can include planned scenarios, such as moving to a different machine or system configuration, or migrating to a later version of the Oracle Server; and unplanned scenarios, such as the loss of an Oracle Server database. How the Oracle Server database is restored depends on backup procedures in place prior to the time the Oracle Server database requires restoration. This section discusses restoration both when a full Oracle Server database export is used, and when copies of the Oracle Server database files are used.

Restoring from a Full Database Export

This section covers restoring using a full Oracle Server database export. It is assumed that you have an Export file of the entire Oracle Server database as it is to be restored, and that the Oracle Server database is shut down. Use these steps to restore an Oracle Server database:

  1. LOGON under the DBA userid and make sure that the ORASID environment variable in the ORAENV file is set to identify the Oracle Server database which is to be restored. Confirm that the Oracle Server database is shut down.

  2. Use the BS2000 FILE command to pre-allocate, and the Server Manager utility to create the files that make up the Oracle Server database. You can use existing Oracle Server database files, or take this opportunity to move or consolidate the files. If existing files are to be re-used, then they must also be pre-allocated and run through Server Manager.

  3. Initialize the Oracle Server database using the Server Manager CREATE DATABASE command.

  4. Log in to Server Manager from the Oracle Server SYSTEM account. Recreate any tablespaces outside of the SYSTEM tablespace, and add any files outside the initial Oracle Server database file.

  5. Import the Oracle Server database from the Export file using the Import utility.

    Refer to the Oracle8i Utilities manual for more information on using the Import utility.

Restoring from Disk-File Backups

An Oracle Server database may also be restored offline from disk backups of the files, using the following steps.

  1. Copy all the database files and the log files from the backup. Files must be restored with their original name.

    While the Oracle Server database is running, the names of all files which it comprises can be determined by querying the table V$DATAFILE. Enter the following when the SQL prompt is displayed:

    	SELECT * FROM V$DATAFILE;
    
    

    The following is displayed on your system:

    	File #	FILENAME
    ------ -------------------------
    1 ?.DBS.DATABASE1.DBF
    2 ?.DBS.DATABASE2.DBF
    2 ROWS SELECTED.

    You can determine the name of the log files in a similar way:

    	SQL> SELECT * FROM V$LOGFILE;
    
    

    This will result in the following being displayed on your screen:

    	File #	FILENAME
    ------ -------------------------
    1 ?.DBS.LOG1.DBF
    2 ?.DBS.LOG2.DBF

    2 ROWS SELECTED.
  2. Under the DBA userid, ensure that the ORASID environment variable identifies the Oracle Server database which is to be restored.

  3. Use the Server Manager STARTUP command to start up the Oracle Server database.

Log Archiving

This section provides information about log archiving on Oracle8i Release 3 for Fujitsu Siemens BS2000/OSD. It is assumed that you are familiar with the description of archiving in the Oracle8i Administrator's Guide.

Enabling Archiving

Please note the following points before enabling log archiving:

Automatic Archiving

After enabling archiving, you should normally enable automatic archiving, so that the Oracle Server will archive the log files automatically at each log file switch. To enable automatic archiving, the database must be mounted but not open, and must have been set in ARCHIVELOG mode. Enter the following command:

SVRMGR> ARCHIVE LOG START [dest_filename]

Alternatively, you can use the initialization parameter:

LOG_ARCHIVE_START=TRUE

which enables automatic archiving at instance startup.

You can disable Automatic archiving again by entering the following command:

SVRMGR> ARCHIVE LOG STOP

Automatic archiving copies the redo log files before they are cyclically re-used; the output filename is prefixed by the value of the initialization file parameter, LOG_ARCHIVE_DEST, if specified, and suffixed by the log sequence number, identifying a single archive file.

LOG_ARCHIVE_DEST can indicate a pubset (e.g. LOG_ARCHIVE_DEST = :PUB1:) in order to direct all archived redo logs to addressable media.

We recommend that you save the archive files to tape using an appropriate BS2000 utility (such as BS2000 ARCHIVE).


Note:

Oracle8i Release 3 for BS2000/OSD does not support archiving to tape directly.


Recovery Manager

Before using Recovery Manager refer to Oracle8i Backup and Recovery Guide.

On BS2000/OSD there is no support of tapes, backup media are disks only.

As a workaround you could use the Recovery Manager output as a first level storage to be 'migrated' by BS2000 subsystem HSMS (Hierarchical Storage Management System) to tapes. However, it is the administrator's responsibility to care for cooperation of the two systems.

Recovery Manager cannot run in single task-mode, you must use a two-task Net8 connection. For this purpose you can

This is an example of a Recovery Manager command:

/start-prog $ORACL817.rman
*target "dba1/dba1@i1" rcvcat "dba2/dba2@i2" cmdfile "b.dat" msglog "b.log"

Go to previous page Go to next page
Oracle
Copyright © 2001 Oracle Corporation.

All Rights Reserved.
Go To Table Of Contents
Contents
Go To Index
Index