Process of restoring Oracle files to an instance

Source: Internet
Author: User

The process of restoring the Oracle file to an instance 1. applicable Conditions: www.2cto.com 1. data files with the original Instance (the best full oracle path), such as oracle cold Backup recovery after the system is reinstalled or on other machines. At this time, the original oracle database file is still in progress, but the program and service cannot be enabled, you need to use the method used in this article to restore. 2. An oracle Installation File with the same version number as the original database. Note: Major versions and minor versions must be consistent. 2. solution 2.1. solution 1: Use oradim to create an instance (recommended) The ORADIM tool is a command line tool of Oracle on Windows for manual creation, modification, and deletion of Oracle services. The procedure is as follows. 2.1.1. to install the database software, you only need to install the database software of the same version without creating a database. It is best to install it in the same % ORACLE_HOME % as the original database, saving the trouble of modifying the parameter file path. Key point: the database versions must be consistent. The original oracle directory should be backed up for backup. Delete the original oracle during installation. Do not create an instance (this is the default option to create an orcl instance, which is skipped ). 2.1.2. Copy data files (including control files), log files, and spfiles to the corresponding location. Take 10.1.0.2.0 and the Instance name is orcl as an example. The data file is copied from the database \ orcl folder under % ORACLE_HOME %. Copy the admin \ orcl folder under % ORACLE_HOME %. Copy SPFILEORCL. ORA, hc_orcl.dat, and PWDorcl. ora in Db1 \ database under % ORACLE_HOME %. Key point: the directory structure is consistent. If any data file is not stored in database \ orcl, copy it together and put it in the same directory as the source file. 2.1.3. Create an instance with the same name. In cmd, use oradim-new-sid orcl to create an instance. Note that the Instance name must be the same as the original Instance name. 2.1.4. Start the instance in cmd, C: \> set oracle_sid = orcl, and then C: \> sqlplus/as sysdba. A message is displayed indicating that the instance is connected to the idle routine. Then SQL> startup. The instance is started successfully. If any prompt file cannot be found, check whether the file is not copied completely. Check: You can query the test connection and table by using the original user and password. 2.1.5. the oracle instance is set to automatically start ORACLE services, however, the database cannot automatically start ORA_SID_AUTOSTART under \ HKEY_LOCAL_MACHINES \ SOFTWARE \ ORACLE \ HOME0 in the Registry to TRUE2.1.6. start Listener to set listener under \ Db_1 \ NETWORK \ ADMIN under the source % ORACLE_HOME %.. ora and tnsnames. the ora files are copied to the corresponding directory. These two files are text files and can be opened and changed. However, we recommend that you do not perform task changes when you are not familiar with them. Then enter C: \> lsnrctl start in CMD to start Listener.2.1.7. check and follow-up processing. The operations in the preceding five steps have been restored successfully. Now, you need to check. Open the service and check whether OracleServiceORCL and OracleOraDb10g_home1TNSListener are enabled. Start is OK. Note that the two services are manually started at this time. If you need to enable automatic access. Use the program that needs to use this database for connection and testing. So far solution 1 has ended. 2.2. solution 2: Using DBCA to create instances (not recommended) DBCA is a tool for ORACLE to create and uninstall instances, generally, DBCA is used to create instances when database installation is not performed. This solution uses DBCA to create an instance with the same name. Stop the instance and replace it with a data file. Start the database again. The success rate of this solution is low, because in most cases, the parameters and data files selected during the creation of the original database are not necessarily correct. Therefore, this solution is not recommended. However, this solution can be used when the version number is different, but the operation is extremely complicated. Here we will give you a brief description. If you need more information to complete the test and then perform the operation. This solution has not been fully tested and is not recommended.

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.