In order to verify the online automatic backup system developed by the company, I rebuild and restore the Oracle database based on the backup file generated by the Oracle Database Online Automatic Backup System. In order to let everyone share their methods and steps (also suitable for reconstructing the re-binding databases made in other ways) are now organized as follows.
First, system environment
The system environment used in this test is as follows:
1. Hardware environment
Server: Dell PowerEdge 1300 (CPU: PII 550MHz memory: 128MB hard drive: 36GB)
2. Software Environment
Operating system: UNIXWARE 7.1
Database: Oracle 8.1.6 for UNIX Enterprise, SID: ORA816
Oracle installation path: / home / oracle
Backup file: All database files, control files, initialization files, all archive log files since database backup.
Second, recover steps
The following is based on backup data from the user, reconstruct the Oracle database in a new server. The detailed steps are as follows:
1. Creating a database to restore the environment
On the new Dell server, install the same operating system UnixWare 7.1 as the original database server; then install the same version of the original database, the Oracle 8.1.6 for UNIX Enterprise Edition.
2. Delete an Oracle instance on a new server
Start Oracle on the New Database server, in SQLPLUS, find the path to the database file, and save file file_name.txt in the current path:
$ SQLPLUS System / Manager
SQL> Spool file_name.txt
SQL> SELECT FILE_NAME from Sys.dba_Data_files;
SQL> Spool end
SQL> EXIT
Close the Oracle of the new server, then delete all database files of the newly installed Oracle instance according to the path in file file_name.txt.
Note: All operations from this step are made after logging in to the operating system (UNIX) with an Oracle user. All black bold 5 characters (except headings) can be executed directly, and the statement of black tilt bold 5 characters need to be modified.
3. Restore database files
Use all database files of the backup with the same path to the new database server on the FTP. If the original path does not exist, you can copy it to other paths, see the details method of the time to recover, see <2> in step 7.
4. Restore the initialization parameter file
Upload the backup initsid.ora file with FTP to the initsid.ora file location of the Oracle instance in the new Database server, overwritten. Its location is generally in the $ Oracle_Home / DBS directory.
5. Restore control files
Upload the backup controlfile.bak file Upload the ftp to the respective mirror paths of the Oracle instance in the new Database server, and name the location and name of the item in the initialization parameter file inIitSid.ora.
Control_files = ("/Home/Oracle/app/racle/oradata/ora816/control01.ctl", "/Home/oracle/app/oracle/oradata/ora816/control02.ctl","/home/oracle/app/oracle / ORADATA/ora816/control03.ctl ")
If there is a change, the path and name of the above content are modified in the initialization parameter file inIntSid.ora, so that the actual path is consistent with the path of the parameter.
6. Restore the archive log file
Upload the archive log after the database backup to the same path to the new database server. If there is a change, it can be modified according to the following position according to the initialization parameter file, so that its actual path is consistent with the path of the parameter.
Log_archive_dest_1 = "location = / home / oracle / app / oracle / admin / ora816 / arch"
7. Restore the database
After 6 steps, all backup files have been uploaded to the new database server. The following starts to restore and start the database based on these files, first do the following on the operating system's prompt:
$ SVRMGRL
SVRMGR> Connect Internal
SVRMGR> Startup Mount
<1> Creating a password file
If the original database is configured, the Database Times is wrong in the Mount database:
ORA-01990: Error Opening Password File '/Home/Oracle/app/racle/Product/8.1.6/dbs/orapw'
You can create a password file with the following command: You can use the following command to create a password file with the following command: 0000.
ORAPWD
The usage is as follows:
USAGE: ORAPWD File =
WHERE
File - Name of Password File (Mand), (Named in the password file is: ORAPWSID)
Password - Password for Sys and INTERNAL (MAND),
Entries - Maximum Number of Distinct DBA and OPERs (OPT),
...............
For example: ORAPWD file = ORAPWORA816 Password = manager
Then re-execute the following statement mount database:
SVRMGR> Startup Mount.
<2> Modify the path to the database file
If the path to the recovered database file is modified in step 3, the database file can be renamed with the following statement:
ALTER DATABASE RENAME FILE 'OLD_FILE' to 'New_FILE';
If the original path / ORADATA / ORA816 is changed to / u21 / oracle / app / oracle / oradata / oracle / app / oracle / oradata / oracle / app / oracle / oradata / oracle / app / oracle / oradata / oracle / app / oracle / oradata / oracle / app / oracle / ORADATA / ORA816:
Svrmgr> ALTER DATABASE RENAME FILE
'/Home/oracle/app/oracle/oradata/ora816/system01.dbf'
To '/u21/oracle/app/oracle/oradata/ora816/system01.dbf';
Rename the database files of all modified paths in accordance with the above method.
<3> Recover the database based on control files and archive log files
Below start recovering the database with the Control File and Archive Log File:
SVRMGR> Recover Database Using Backup ControlFile Until Cancel
The following tips appear:
ORA-00279: Change 50971 Generated at 08/23/2002 09:21:27 Needed for Thread 1OR-00289: Suggestion: /Home/Oracle/App/OrCle/admin/ora8/ArCh/arch_1_399.arc
ORA-00280: Change 50971 for thread 1 is in sequence # 399
Specify log: {
Auto
If there is a prompt, it means successful.
ORA-00279: Change 51007 generated at 08/23/2002 11:23:13 Needed for thread 1
ORA-00289: Suggestion: /Home/racle/app/oracle/admin/ora8/Arch/arch_1_400.arc
ORA-00280: Change 51007 for thread 1 is in sequence # 400
ORA-00278: log file '/Home/racle/app/oracle/admin/ora8/Arch/arch_1_399.arc' Noy
Log Applied.
Accidental Processing: If other tips may be required, the file does not exist, check whether the file in ORA-00289 exists.
Until the prompt appears:
ORA-00279: Change 51011 generated at 08/23/2002 11:23:45 Needed for thread 1
ORA-00289: Suggestion: /Home/oracle/app/oracle/admin/ora8/ArCh/arch_1_401.arc
ORA-00280: Change 51011 for thread 1 is in sequence # 401
ORA-00278: log file '/home/racle/app/oracle/admin/ora8/ArCh/arch_1_400.arc' Noy
ORA-00308: Cannot Open Archived log '/ Home / Oracle / App / Oracle / Admin / ORA8 / ARCH
/arch_1_401.arc '
ORA-27037: UNABLE TO OBTAIN FILE STATUS
Intel SVR4 Unix Error: 2: No Such File or Directory
AdditionAl Information: 3
<4> Reset log
SVRMGR> ALTER DATABASE OPEN RESETLOGS;
Accident: If prompted to create a path does not exist, press the prompt path to create a directory. Then reset the log.
<5> Restart the database to complete the recovery
SVRMGR> Shutdown Immediate
SVRMGR> Startup
Oracle Instance Started.
Total System Global Area 123437040 BYTES
Fixed size 69616 bytes
Variable size 106418176 bytes
Database buffers 16777216 BYTES
Redo buffers 172032 bytesdatabase mounted.
Database opened.
The database is open normally, and the database reconstruction is successful.