增加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









来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29800581/viewspace-1258108/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29800581/viewspace-1258108/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值