增加control files

方法一.
首先把数据库关闭,然后由spfile创建pfile:
[oracle@localhost trace]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 26 01:28:44 2014

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> conn /as sysdba
Connected to an idle instance.
SQL> create pfile from spfile;

File created.
打开pfile,然后修改control_files的参数值:
[oracle@localhost dbs]$ vi initorcl.ora
*.control_files='/u01/app/controlfile/control01.ctl','/u01/app/oracle/flash_recovery_area
/orcl/control02.ctl'
存盘退出。
又pfile创建spfile:
SQL> create spfile from pfile;

File created.

把control01.ctl拷贝到相应目录下并改名为control02.ctl:
[oracle@localhost controlfile]$ cp ./control01.ctl /u01/app/oracle/flash_recovery_area/orcl
[oracle@localhost controlfile]$ cd /u01/app/oracle/flash_recovery_area/orcl
[oracle@localhost orcl]$ ls
control01.ctl
[oracle@localhost orcl]$ mv ./control01.ctl control02.ctl
[oracle@localhost orcl]$ ls
control02.ctl

打开数据库:
SQL> startup
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             562040400 bytes
Database Buffers          281018368 bytes
Redo Buffers                5132288 bytes
Database mounted.
Database opened.
SQL> show parameter control_files;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u01/app/controlfile/control01
                                                 .ctl, /u01/app/oracle/flash_re
                                                 covery_area/orcl/control02.ctl


方法二.
关闭数据库,重启数据库到nomount:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             562040400 bytes
Database Buffers          281018368 bytes
Redo Buffers                5132288 bytes

使用alter system set 修改参数:
SQL> alter system set control_files='/u01/app/controlfile/control01.ctl','/u01/app/oracle/flash_recovery_area/orcl/control02.ctl',
'/u01/app/oracle/flash_recovery_area/orcl/control03.ctl' scope=spfile;

System altered.

修改完之后再次关闭数据库,复制文件到相应目录:
[oracle@localhost orcl]$ ls
control02.ctl
[oracle@localhost orcl]$ cp ./control02.ctl ./control03.ctl
[oracle@localhost orcl]$ ls
control02.ctl  control03.ctl

打开数据库:
SQL> startup
ORACLE instance started.

Total System Global Area  849530880 bytes
Fixed Size                  1339824 bytes
Variable Size             562040400 bytes
Database Buffers          281018368 bytes
Redo Buffers                5132288 bytes
Database mounted.
Database opened.
SQL> show parameter control_files


NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /u01/app/controlfile/control01
                                                 .ctl, /u01/app/oracle/flash_re
                                                 covery_area/orcl/control02.ctl
                                                 , /u01/app/oracle/flash_recove
                                                 ry_area/orcl/control03.ctl









请使用浏览器的分享功能分享到微信等