[Experiment-video process] oracle control file increase and decrease

Source: Internet
Author: User

[Experiment-video process] oracle control file increase and decrease
Control File

The control file is a binary file. The control file records the structure and behavior of the database. When the database is opened during the mount operation, it is always lost and needs to be restored.
Related dictionaries
select name from v$controlfile;select TYPE,RECORD_SIZE,RECORDS_TOTAL,RECORDS_USED from V$CONTROLFILE_RECORD_SECTION;select value from V$spparameter where name='control_files';

The location of the control file is described in the parameter file.

Multiple control files are mirrored.

Up to eight, at least one

Increase the number of control files

The purpose of this experiment is to add one to eight control files to protect them.

1. Modify the parameter file
2. Stop the database
3. Copy the control file
4. Start the database
5. Verify and view v $ controlfile

Modify the control_files option in the binary initialization parameter file

SQL> alter system set control_files=3 scope=spfile;
SQL> select value from v$spparameter where name='control_files';

Verification parameter file modified

SQL> select name from v$controlfile;

Verify the number of control files in the current Memory

SQL> alter system set control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/flash_recovery_area/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl' scope=spfile;
SQL> shutdown immediate;

Copy a database parameter file

SQL> host cp /u01/app/oracle/oradata/orcl/control01.ctl /u01/app/oracle/oradata/orcl/control03.ctl

Restart the database to make the modified parameters take effect.

Overwrite the old control file with the command of the Operating System

SQL> alter database open; SQL> alter database mount; start to the mount State Database altered. SQL> alter database open; start to the open state Database altered.

Verify the value of the control_files option in the parameter file

 SQL> select value from v$spparameter where name='control_files';

Verify the number of control files in the current Memory

 SQL> select name from v$controlfile;
Reduce the number of control files

The purpose of this experiment is to first understand how to modify the parameter file and how to reduce the control file.
Reduce the control file. For the purpose of the experiment, there is a control File corrupted. We need to remove the corrupt control file.

1. Modify the parameter file and verify

2. Stop the database

3. Start the database

4. Verify and view v $ controlfile

SQL> select name from v$controlfile;

Verify the number of control files in the current Memory

/u01/app/oracle/oradata/orcl/control01.ctl/u01/app/oracle/flash_recovery_area/orcl/control02.ctl

Modify the control_files option in the binary initialization parameter file

SQL> alter system set control_files=2 '/u01/app/oracle/oradata/orcl/control01.ctl' scope=spfile;System altered.

Verification parameter file modified

SQL> select value from v$spparameter where name='control_files';

Verify that the value in the memory is not modified because control_files is a static parameter and you must restart the database to change the value.

SQL> select name from v$controlfile;

Restart the database to make the modified parameters take effect.

SQL> startup force; SQL> select name from v$controlfile;

The verification memory has been modified.

SQL> select value from v$spparameter where name='control_files';

Verify that the values in the parameter file are the same as those in the memory.

http://v.youku.com/v_show/id_XMTM2NDY3MDg4NA==.html?from=y1.7-1.2=

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.