8 Backup/Restore Oracle 8i/9iThis chapter will describe in detail how DiskSave backup your Oracle 8i/9i and how you can restore an Oracle 8i/9i database using the backup files.
8.1 Requirements
i. DiskSave must be installed onto the computer that can connect to your Oracle 8i/9i server using TCP/IP protocol.
ii. Data from Oracle 8i/9i database will be backed up to a temporary directory before they are sent to DiskSave. Please make sure you have sufficient space on your computer to store these data when you run the backup job.
iii. Database must be in archived log mode
To switch to archived log mode and enable automatic log archiving, please do the following:
a. Set the parameters below in the PFILE to enable automatic archiving
log_archive_dest = [directory where archived logs will be stored]
log_archive_format = ARCH%S.LOG
log_archive_start = TRUE
b. Switch to archived log mode
SVRMGRL> connect internal;
SVRMGRL> startup mount;
SVRMGRL> alter database archivelog;
SVRMGRL> alter database open;
c. Oracle JVM is enabled
To enable Oracle JVM for Oracle 8i/9i, please do the following:
1. Please make sure shared pool size is larger than 50MB and java pool size is larger than 20MB in the PFILE. For example:
java_pool_size = 20971520
shared_pool_size = 52428800
2. Run the scripts below
Oracle 8i Oracle 9i SVRMGRL> connect internal SVRMGRL> @?/javavm/install/initjvm.sql; SVRMGRL> @?/rdbms/admin/catalog.sql; SVRMGRL> @?/rdbms/admin/catproc.sql; SVRMGRL> @?/javavm/install/initdbj.sql; SQL> connect sys/change_on_install as sysdba SQL> @?/ javavm/install/initjvm.sql;
SQL> @?/ xdk / admin / initxml.sql;
SQL> @?/ xdk / admin / xmlja.sql;
SQL> @?/rdbms/admin/catjava.sql;
iv. JAVASYSPRIV role is granted to system account
You can grant this role to system account by executing:
SQL> grant JAVASYSPRIV to system;
8.2 OverviewDiskSave will backup your Oracle database by taking the following steps.
i. Connect to the Oracle database using SQL*NET over TCP/IP
ii. Run all Pre-Commands of this backup set
iii. If the backup type to run is [Database Backup type],
a. all data files in each of the tablespace(s) selected are copied to the temporary directory specified by this backup set
b. if there are temporary files in the database, the script to re-create the temporary files are generated to a file located in the temporary directory specified by this backup set
c. all non-default initialization parameters will be spooled to an initializing file located in the temporary directory specified by this backup set
d. all control files will be copied to the temporary directory specified by this backup set
e. all archived log files will be copied to the temporary directory specified by this backup set
iv. If the backup type to run is [Archived Log Backup type],
a. all archived log files will be copied to the temporary directory specified by this backup set
v. Run all Post-Commands of this backup set
vi. Upload all files copied to the temporary directory to the DiskSaveNote:
If your Oracle database is running on Windows, please install DiskSave onto the company running the Oracle database if DiskSave is to backup this Oracle database. This would shorten the time required to backup the Oracle database.
8.3 How to backup an Oracle DatabasePlease follow the instructions below to backup your Oracle database to the DiskSave.
i. Install DiskSave onto your computer
ii. Open DiskSave
Right click DiskSave icon available in the system tray and choose [Open]
iii. Create a backup set
a. From the Menu, Choose [Backup Set] -> [New] -> [Oracle Database Backup Set]
b.
c. Enter the system password, the Oracle Database Server Host Name, TNS Port and SID
d. Select the tablespace(s) you want to backup
e. Enter a temporary location to store the database file(s) before they are sent to an DiskSave
f. Note: You can have more than one schedule in a backup set, i.e. you can perform intra-day transaction log backup by adding more than one daily transaction log backup schedule to your backup set.
g. Set the encryption algorithm, encryption mode and encrypting key for this backup set
Hint: For maximum security, please select AES (Advanced Encryption Standard) Algorithm, CBC (Cipher Block Chaining) mode and use an encrypting key with more than 8 characters.
iv. Run Backup
a. Select the backup set you want to run on the left panel and press the [Start Backup] button (►)
b.
c. Select [Off-site Backup Server] to start backing up your files to an DiskSave.
8.4 How to restore an Oracle DatabasePlease follow the instructions below to restore your Oracle 8i/9i databases from an DiskSave.
i. Download the backup files from the DiskSave
Please refer to the [Quick Start - Backup File] section for information on how to download backup files from DiskSave.
ii. Put all data files back to their original locations
iii. Control files, data files and archived logs are stored on DiskSave along with their full path information. You just need to put all these files back to their original locations when performing a database restore.
iv. Put the PFILE back to its default location
Oracle 8i: $ORACLE_HOME/dbs/init<SID>.ora
Oracle 9i: $ORACLE_HOME/admin/<SID>/pfile/init.ora
v. Restore Database
(if Oracle 8i) Use Server Manager to restore you database by doing the following:
a. Run Oracle Server Manager (svrmgrl)
b. Connect to the target database
c. Startup mount
d. Reapply all transactions from the archived log files
e. Open database
Oracle 8i Example: $ svrmgrlSVRMGRL> connect internalSVRMGR> startup mount;ORACLE instance started.Total System Global Area 95874448 bytesFixed Size 64912 bytesVariable Size 52744192 bytesDatabase Buffers 40960000 bytesRedo Buffers 2105344 bytesDatabase mounted.SVRMGRL> recover database using backup controlfileORA-00279: change 419671 generated at 06/14/03 02:51:49 needed for thread 1ORA-00289: suggestion : /data/ora815/vin/archive/ARCH0000000225.LOGORA-00280: change 419671 for thread 1 is in sequence #225ORA-00278: log file '/data/ora815/vin/archive/ARCH0000000224.LOG' no longer needed for this recoverySpecify log: {<RET>=suggested | filename | AUTO | CANCEL}AUTOLog applied.. . . . . . . . . . .ORA-00279: change 547222 generated at 06/18/03 19:58:26 needed for thread 1ORA-00289: suggestion : /data/ora815/vin/archive/ARCH0000000384.LOGORA-00280: change 547222 for thread 1 is in sequence #384ORA-00278: log file '/data/ora815/vin/archive/ARCH0000000383.LOG' no longer needed for this recoveryORA-00308: cannot open archived log '/data/ora815/vin/archive/ARCH0000000384.LOG'ORA-27037: unable to obtain file statusLinux Error: 2: No such file or directoryAdditional information: 3SVRMGR> recover database using backup controlfile until cancelORA-00279: change 547222 generated at 06/18/03 19:58:26 needed for thread 1ORA-00289: suggestion : /data/ora815/vin/archive/ARCH0000000384.LOGORA-00280: change 547222 for thread 1 is in sequence #384Specify log: {<RET>=suggested | filename | AUTO | CANCEL}CANCELMedia recovery cancelled.SVRMGR> alter database open resetlogs;Statement processed.(if Oracle 9i) Use Recovery Manager to restore you database by doing the following:
a. Run Oracle Server Manager (rman)
b. Connect to the target database
c. Startup mount
d. Reapply all transactions from the archived log files to the last sequence
e. Open database
Oracle 9i Example: C:\>rman nocatalogRecovery Manager: Release 9.2.0.1.0 - ProductionCopyright (c) 1995, 2002, Oracle Corporation. All rights reserved.RMAN> connect targetconnected to target database (not started)RMAN> startup mountconnected to target database (not started)Oracle instance starteddatabase mountedTotal System Global Area 269556596 bytesFixed Size 453492 bytesVariable Size 243269632 bytesDatabase Buffers 25165824 bytesRedo Buffers 667648 bytesRMAN> recover database until sequence=63 thread=1;Starting recover at 24-JUN-03allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=11 devtype=DISKstarting media recoveryarchive log thread 1 sequence 56 is already on disk as file C:\ORACLE\ORADATA\VIN\ARCHIVE\1_56.DBFarchive log filename=C:\ORACLE\ORADATA\VIN\ARCHIVE\1_56.DBF thread=1 sequence=56archive log filename=C:\ORACLE\ORADATA\VIN\ARCHIVE\1_57.DBF thread=1 sequence=57archive log filename=C:\ORACLE\ORADATA\VIN\ARCHIVE\1_58.DBF thread=1 sequence=58archive log filename=C:\ORACLE\ORADATA\VIN\ARCHIVE\1_59.DBF thread=1 sequence=59archive log filename=C:\ORACLE\ORADATA\VIN\ARCHIVE\1_60.DBF thread=1 sequence=60archive log filename=C:\ORACLE\ORADATA\VIN\ARCHIVE\1_61.DBF thread=1 sequence=61archive log filename=C:\ORACLE\ORADATA\VIN\ARCHIVE\1_62.DBF thread=1 sequence=62media recovery completeFinished recover at 24-JUN-03RMAN> alter database open resetlogs;database opened