We often encounter system reinstallation problems on the development machine. If ORACLE is not backed up in a timely manner before Reinstallation, it will be tangled after Reinstallation, causing a headache for data restoration. Among the various mothers, we can only find some solutions with the same directory before installing and reinstalling the ORACLE system. If the directory is different, we will not be able to find any solutions. I use oracle11G. The old version should be similar. After my attempt,
We often encounter system reinstallation problems on the development machine. If ORACLE is not backed up in a timely manner before Reinstallation, it will be tangled after Reinstallation, causing a headache for data restoration. Among the various mothers, we can only find some solutions with the same directory before installing and reinstalling the ORACLE system. If the directory is different, we will not be able to find any solutions. I use oracle11G. The old version should be similar. After my attempt,
We often encounter system reinstallation problems on the development machine. If ORACLE is not backed up in a timely manner before Reinstallation, it will be tangled after Reinstallation, causing a headache for data restoration.
Among the various mothers, we can only find some solutions with the same directory before installing and reinstalling the ORACLE system. If the directory is different, we will not be able to find any solutions.
I use oracle11G. The old version should be similar.
After my attempt, I found several key points and shared them now.
1. Control File CONTROL01.CTL
There are two control files in the oracle database. One is in oradata \ oradb and the name is CONTROL01.CTL.
In flash_recovery_area \ SDMS_DEMO, the name is CONTROL01.CTL.
The control file may also be CONTROL02.CTL or CONTROL03.CTL.
2. datafile, tempfile, and logfile in the control file
If the file paths in the original database are inconsistent with those after the reinstallation, you must modify all these paths. The specific steps are as follows:
1. manually disable all oracle services after re-creating the oracle database
2. Rename the newly created database directory in oradata, and change d: \ app \ user \ oradata \ oradb to d: \ app \ user \ oradata \ oradb_new
3. Copy the original database directory to this directory. After copying, there are d: \ app \ user \ oradata \ oradb_new and d in oradata: \ app \ user \ oradata \ oradb two directories
D: \ app \ user \ oradata \ oradb is the data folder of the database before reinstalling.
4. Start oracle services
V. Use the sqlplus/nolog command to enter the oracle command string
6. Run the connect sys/change_on_install as sysdba command to obtain system management permissions and log on to the system.
7. Use select instance_name from v $ instance; to check whether the current database instance is correct, if it is not oradb, you need to use set oracle_sid to modify the default oracle instance (if you remember correctly, this command should be used to check the problem ).
8. Copy the d: \ app \ user \ oradata \ oradb \ CONTROL02.CTL control file to d: \ app \ user \ flash_recovery_area \ oradb. Replace the original control file in the directory. Note: if the name is different, change the name.
9: Use startup nomount to start the database in load-free mode.
10. Set the database to the load mode: alter database mount;
11. view the data file list: select name from v $ datafile;
View the temporary file list: select name from v $ tempfile;
View the log file list: select * from v $ logfile;
The following result is displayed:
E: \ APP \ USER \ ORADATA \ ORADB \ SYSTEM01.DBF
E: \ APP \ USER \ ORADATA \ ORADB \ SYSAUX01.DBF
E: \ APP \ USER \ ORADATA \ ORADB \ UNDOTBS01.DBF
E: \ APP \ USER \ ORADATA \ ORADB \ USERS01.DBF
E: \ APP \ USER \ ORADATA \ ORADB \ SDMS_DATA01.DBF
12. Modify the data file path and execute the following commands in sequence:
SQL> alter database rename file 'e: \ APP \ USER \ ORADATA \ ORADB \ system01.dbf' to 'd: \ APP \ USER \ ORADATA \ ORADB \ system01.dbf'
Note that the file name is redo01 when the log file is modified. Because oracle is capitalized by default, I think it is red001, and it cannot be modified. If select * from v $ logfile is used; only one log file is displayed. We recommend that you modify several log files in the original database.
SQL> alter database rename file 'e: \ APP \ USER \ ORADATA \ ORADB \ REDO03.LOG 'to 'd: \ APP \ USER \ ORADATA \ ORADB \ REDO03.LOG ';
13. Start the database: alter database open;
Now, you can use the client to connect to the database.