Use Oracle's hot backup to recreate the database

Source: Internet
Author: User


To verify the online backup system of the Oracle database I developed, I used the backup files generated by the Oracle database online backup system to re-build and restore the Oracle database. In order to allow everyone to share their methods and tb steps (it is also suitable for rebuilding the database using other methods for Hot Backup of Oracle), the following is an example. I. system environment the system environment used in this test is as follows: 1. hardware environment www.2cto.com server: Dell PowerEdge 1300 (CPU: P Ⅲ 550 MHz memory: 128 MB hard drive: 36 GB) 2. operating System in the software environment: UnixWare 7.1 Database: Oracle 8.1.6 for Unix Enterprise Edition, SID: ora816 Oracle installation path:/home/oracle backup file: all database files, control files, initialization files, all archive log files since database backup. 2. Follow the recovery steps below to reconstruct the Oracle database on a new server based on the backup data brought back from the user. The detailed steps are as follows: 1. create a database recovery environment on the new Dell server, install UnixWare 7.1, the same operating system as the original database server, and then install Oracle 8.1.6 for Unix Enterprise Edition of the same version as the original database. 2. delete the Oracle instance www.2cto.com on the new server: $ sqlplus system/manager SQL> spool file_name.txt SQL> select file_name from sys. dba_data_files; SQL> spool end SQL> exit shut down the Oracle of the new server. Then, delete all database files of the newly installed Oracle instance by deleting the path in the file_name.txt file. Note: Starting from this step, all operations are performed after logging on to the Operating System (Unix) with an Oracle user. All the statements of the Black-bold 5 characters (excluding the title) in this article can be executed directly. The statements of the Black-bold 5 characters need to be modified and then executed. 3. Restore the database file and upload all the backup database files to the same path on the new database server over Ftp. If the original path does not exist, you can copy it to another path. For more information, see Step 7 <2>. 4. Restore the initialization parameter file and upload the backup initSID. ora file with Ftbp to the initSID. ora File Location of the Oracle instance on the new database server, overwriting it. The location is generally in the $ ORACLE_HOME/dbs directory. Www.2cto.com 5. the recovery control file copies the backup ControlFile. the bak file is uploaded over Ftp to the image paths of the Oracle instance in the new database server, and the initSID parameter file is initialized. the location and name of the item in ora. Control_files = ("/home/oracle/app/oracle/oradata/ora816/control01.ctl", "/home/oracle/app/oracle/oradata/ora816/control02.ctl ", "/home/oracle/app/oracle/oradata/ora816/control03.ctl") if the path is changed, in the initialization parameter file initSID. in ora, modify the path and name of the preceding content to make the actual path consistent with the path of this parameter. 6. Restore the archive log file and use Ftp to upload the archived logs backed up by the database to the same path of the new database server. If the path is changed, you can modify it according to the following position in the initSID. ora file of the initialization parameter file to make the actual path consistent with the path of this parameter. Log_archive_dest_1 = "location =/home/oracle/app/oracle/admin/ora816/arch" www.2cto.com 7. after the six steps above, all the backup files have been uploaded to the new database server. Start restoring and starting the database based on these files. First, perform the following operations at the operating system prompt: $ svrmgrl SVRMGR> connect internal SVRMGR> startup mount <1> Create a password file if the password file is configured in the original database and the following error is reported in the mount database: ORA-01990: error opening password file '/home/oracle/app/oracle/product/8.1.6/dbs/orapw' can go to/home/oracle/app/oracle/product/8.1.6/dbs/path, use the following command to create a password file: orapwd Usage: orapwd file = <fname> password = <password> entries = <users> where www.2cto.com file-name of pa Ssword file (mand), (the password file is named as orapwSID) password-password for SYS and INTERNAL (mand), entries-maximum number of distinct DBA and OPERs (opt ), there are no spaces around the equal-to (=) character. for example, orapwd file = orapwora816 password = manager and then run the following statement to mount the database: SVRMGR> startup mount. <2> modify the path of the database file. If the path of the recovered database file is modified in step 3, you can rename the database file using the following statement: alter database rename file 'old _ file' to 'new _ file '; for example, change the system01.dbf file in the original path/home/oracle/app/oracle/oradata/ora816 to/u21/ oracle/app/oracle/oradata/ora816: SVRMGR> alter database rename file '/home/oracle/app/oracle/oradata/ora816/system01.dbf' to '/int32/oracle/app/oracle/oradata/ora816/system01.dbf '; rename all database files in the modified path according to the above method. <3> recover database with control files and archive log files under recovery database: SVRMGR> recover database using backup controlfile until cancel; the following prompt appears: ORA-00279: change 50971 generated at 08/23/2002 09:21:27 needed for thread 1 www.2cto.com ORA-00289: suggestion:/home/oracle/app/oracle/admin/ora8/arch/arch_1_399.arc ORA-00280: change 50971 for thread 1 is in sequence #399 Specify log: {<RET> = suggested | filename | AUTO | CANCEL} Input: auto is successful if the following prompt is displayed. ORA-00279: change 51007 generated at 08/23/2002 11:23:13 needed for thread 1 ORA-00289: suggestion:/home/oracle/app/oracle/admin/ora8/arch/arch_0000400.arc ORA-00280: change 51007 for thread 1 is in sequence #400 ORA-00278: log file '/home/oracle/app/oracle/admin/ora8/arch/arch_1_399.arc 'noy Log applied. handle unexpectedly: if other prompts might be that the required log file does not exist, check whether the file exists in the ORA-00289. Until the following 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/oracle/app/oracle/admin/ora8/arch/arch_0000400.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 www.2cto.com Intel SVR4 UNIX Error: 2: No such file or directory Additional information: 3 <4> Reset log SVRMGR> alter database open resetlogs; unexpected handling: if the log Creation Path does not exist, follow the prompts to create a directory. Then reset the log. <5> restart the database and restore 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 bytes www.2cto.com Database mounted. database opened. the database is opened normally and restored successfully. Author tbwshc

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.