且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

OMF添加控制文件_OCP学习笔记(3)

更新时间:2022-09-16 13:46:13

DBCA选择OMF管理方式,但没有添加多路复用。即
SQL> show parameter db_create
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_create_file_dest                  string      d:\oracle\product\10.2.0\orada
                                                 ta
db_create_online_log_dest_1          string      
db_create_online_log_dest_2          string      
db_create_online_log_dest_3          string
db_create_online_log_dest_4          string
db_create_online_log_dest_5          string
只有db_create_file_dest有值,那么ORACLE会在db_create_file_dest目录创建一份(only one)控制文件:
 
SQL> select name from v$controlfile
  2  /
  NAME                                                                     
 ------------------------------------------------------------------------
  D:\ORACLE\PRODUCT\10.2.0\ORADATA\STUDY\CONTROLFILE\O1_MF_625GL8JB_.CTL
Oracle一般建议生成三份控制文件. 下面我们添加控制文件目录:
SQL> alter system set db_create_online_log_dest_1='d:\oracle\product\10.2.0\logs'
SQL> alter system set db_create_online_log_dest_2='d:\oracle\product\10.2.0\logs2'
SQL> alter system set db_create_online_log_dest_3='d:\oracle\product\10.2.0\logs3'
以上添加三个复用目录.
然后生成控制文件脚本:
SQL> alter database backup controlfile to trace;
再就是把control_files参数去除。本来想用reset清掉control_files。很不巧总报错。
只能用生PFILE文件,手工更改的方式:
SQL> create pfile='C:\anran.ora' from spfile.
打开anran.ora,remove control_files参数行。
SQL> STARTUP NOMOUNT pfile='C:\anran.ora'
剩下就是按trace文件脚本重建控制文件就可以了,这里有一点,TRACE文件里有两处脚本,noresetlogs/resetlog.我们***选用前者。


本文转自 anranran 51CTO博客,原文链接:http://blog.51cto.com/guojuanjun/338571