The control file is a very important file. Only when the instance reads the control file can it be mounted. One principle of DBA is multi-channel control files. Today I did an experiment and learned this.
The Code is as follows:
- AlterSystemSetControl_files ='D: \ app \ wings \ oradata \ testdb \ CONTROL03.CTL','D: \ app \ wings \ oradata \ testdb \ CONTROL04.CTL'Scope = spfile;
-- View
SelectValueFromV $ spparameterWhere Name='Control _ files';
At this time, we will see two pieces of data.
Then shut down the database normally:
Shutdown immediate;
Copy a control file and change it to the above name. Start the database and view the control file:
Sho parameter control_files;
Now we can see two control files.
I just made a very idiotic mistake. I may write it out. www.bkjia.com makes everyone laugh.
Step 1
AlterSystemSetControl_files ='D: \ app \ wings \ oradata \ testdb \ CONTROL04.CTL'Scope = spfile;
In this way, the system is changed. If it is started, it will start with the file 04.
Then I shut down the database, copied the file 03, named it 04, and started the database normally. Then I made another step in step 2:
Step 2
- AlterSystemSetControl_files ='D: \ app \ wings \ oradata \ testdb \ CONTROL03.CTL','D: \ app \ wings \ oradata \ testdb \ CONTROL04.CTL'Scope = spfile;
After restarting the database, unfortunately the error: ora-01219. There was no explanation. Baidu later said that I could only query specific views and tables. On EM, I checked that my database is in nomount, which means that my control file encountered a problem during loading. The solution is also simple:
AlterSystemSetControl_files ='D: \ app \ wings \ oradata \ testdb \ CONTROL04.CTL'Scope = spfile;
Then restart the instance.
At that time, I was puzzled. Why? Later, I took this step and executed step 1, but changed the control file to 03. After restarting, an error is reported, indicating that the control file is old. At this time, I had an epiphany. I ignored a very important point, that is, the control file is constantly updated after the database is started. 03 this file has been used up for a few minutes before it is loaded. I hope you will not make this low-level mistake.