Research on Oracle Control File

Source: Internet
Author: User

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:

  1. 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

  1. 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.

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.