Flying & Snaking
===========================================================
Managing Control Files
===========================================================

The current location of the controlfiles can be queried from the V$CONTROLFILE view, as shown below.
select name from v$controlfile;
NAME
---------------------------------------------------------------
/u01/app/oracle/product/9.2.0/oradata/DEVSOL/control01.ctl
/u01/app/oracle/product/9.2.0/oradata/DEVSOL/control02.ctl
/u01/app/oracle/product/9.2.0/oradata/DEVSOL/control03.ctl
In order to rename or move these files we must alter the value of the control_files instance parameter.
show parameter control_files
NAME VALUE
---------------- ------------------------------------------ ------------------------------
control_files /u01/app/oracle/product/9.2.0/oradata/DEVSOL/control01.ctl, /u01/app/oracle/product/9.2.0/oradata/DEVSOL/control02.ctl, /u01/app/oracle/product/9.2.0/oradata/DE

To move or rename a controlfile do the following:
* Alter the control_files parameter using the ALTER SYSTEM comamnd.
* Shutdown the database.
* Rename the physical file on the OS.
* Start the database.

The following SQL*Plus output shows how this is done for an instance using an spfile. For instances using a pfile replace the spfile manipulation steps with an amendment of the parameter in the init.ora file.
ALTER SYSTEM SET control_files='/new_path/control01.ctl', '/new_path/control02.ctl', '/new_path/control03.ctl' SCOPE=SPFILE;
SHUTDOWN IMMEDIATE
!mv /old_path/control01.ctl /new_path/control01.ctl!mv /old_path/control02.ctl /new_path/control02.ctl!mv /old_path/control03.ctl /new_path/control03.ctl
STARTUP

Repeating the initial query shows that the the CONTROLFILES has been renamed in the data dictionary.
select name from v$controlfile;


2jliu 发表于:2008.07.03 14:45 ::分类: ( @EBS ) ::阅读:(15次) :: 评论 (0)

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)




自我介绍
切换风格
新闻聚合
博客日历
文章归档...
最新发表...
博客统计...
Blog信息
网站链接...