千家信息网

Oracle Study之案例--在RAW上controlfile多元化

发表于:2024-11-22 作者:千家信息网编辑
千家信息网最后更新 2024年11月22日,Oracle Study之案例--在RAW上controlfile多元化系统环境:操作系统: AIX 5300-08数据库: Oracle 10.2.0.1在通过dbca建库后,有两个控制文件,再添加
千家信息网最后更新 2024年11月22日Oracle Study之案例--在RAW上controlfile多元化

Oracle Study之案例--在RAW上controlfile多元化


系统环境:

操作系统: AIX 5300-08

数据库: Oracle 10.2.0.1

在通过dbca建库后,有两个控制文件,再添加一个控制文件


1、查看controlfile信息

[oracle@aix227:/home/oracle]$sqlplus '/as sysdba'SQL*Plus: Release 10.2.0.1.0 - Production on Wed Nov 19 11:15:45 2014Copyright (c) 1982, 2005, Oracle.  All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP and Data Mining optionsSQL> show parameter controlNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------control_file_record_keep_time        integer     7control_files                        string      /u01/app/oracle/oradata/prod/c                                                 ontrol01.ctl, /u01/app/oracle/                                                 oradata/prod/control02.ctl

2、添加新的控制文件

文件存储采用的是raw,建立符号链接文件,易于管理。

[oracle@aix227:/home/oracle]$ls -l /u01/app/oracle/oradata/prodtotal 0lrwxrwxrwx    1 oracle   oinstall         16 Nov 18 16:14 control01.ctl -> /dev/rcontrol1_1lrwxrwxrwx    1 oracle   oinstall         16 Nov 18 16:14 control02.ctl -> /dev/rcontrol2_2lrwxrwxrwx    1 oracle   oinstall         16 Nov 18 16:14 control03.ctl -> /dev/rcontrol3_3lrwxrwxrwx    1 oracle   oinstall         13 Nov 18 16:14 example01.dbf -> /dev/rexamplelrwxrwxrwx    1 oracle   oinstall         11 Nov 18 16:14 index01.dbf -> /dev/rindexlrwxrwxrwx    1 oracle   oinstall         13 Nov 18 16:14 log11.log -> /dev/rredo1_1lrwxrwxrwx    1 oracle   oinstall         13 Nov 18 16:14 log12.log -> /dev/rredo1_2lrwxrwxrwx    1 oracle   oinstall         12 Nov 18 16:14 spfile01 -> /dev/rspfilelrwxrwxrwx    1 oracle   oinstall         12 Nov 18 16:14 sysaux01.dbf -> /dev/rsysauxlrwxrwxrwx    1 oracle   oinstall         12 Nov 18 16:14 system01.dbf -> /dev/rsystemlrwxrwxrwx    1 oracle   oinstall         10 Nov 18 16:14 temp01.dbf -> /dev/rtemplrwxrwxrwx    1 oracle   oinstall         14 Nov 18 16:14 undotbs01.dbf -> /dev/rundotbs1lrwxrwxrwx    1 oracle   oinstall         11 Nov 18 16:14 users01.dbf -> /dev/rusers
SQL> show parameter spfile;NAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------spfile                               string      /u01/app/oracle/oradata/prod/s                                                 pfile01SQL> alter system set control_files=  2  '/u01/app/oracle/oradata/prod/control01.ctl','/u01/app/oracle/oradata/prod/control02.ctl','/u01/app/oracle/oradata/prod/control03.ctl' scope=spfile;System altered.SQL> startup force nomount;ORACLE instance started.Total System Global Area  977272832 bytesFixed Size                  2025592 bytesVariable Size             255854472 bytesDatabase Buffers          713031680 bytesRedo Buffers                6361088 bytesSQL> show parameter controlNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------control_file_record_keep_time        integer     7control_files                        string      /u01/app/oracle/oradata/prod/c                                                 ontrol01.ctl, /u01/app/oracle/                                                 oradata/prod/control02.ctl, /u                                                 01/app/oracle/oradata/prod/con                                                 trol03.ctl                                                 SQL> alter database mount;alter database mount*ERROR at line 1:ORA-00205: error in identifying control file, check alert log for more info查看告警日志,无法识别control03.ctl文件!

3、复制RAW(controlfile)

SQL> shutdown abort;ORACLE instance shut down.[oracle@aix227:/home/oracle]$dd if=/dev/rcontrol1_1 of=/dev/rcontrol3_3 bs=1024k64+0 records in64+0 records out

4、重新启动数据库

[oracle@aix227:/home/oracle]$sqlplus '/as sysdba'SQL*Plus: Release 10.2.0.1.0 - Production on Wed Nov 19 11:26:21 2014Copyright (c) 1982, 2005, Oracle.  All rights reserved.Connected to an idle instance.SQL> startup mount;ORACLE instance started.Total System Global Area  977272832 bytesFixed Size                  2025592 bytesVariable Size             255854472 bytesDatabase Buffers          713031680 bytesRedo Buffers                6361088 bytesDatabase mounted.SQL> select name from v$controlfile;NAME--------------------------------------------------------------------------------/u01/app/oracle/oradata/prod/control01.ctl/u01/app/oracle/oradata/prod/control02.ctl/u01/app/oracle/oradata/prod/control03.ctlSQL> alter database open;Database altered.

@至此,contolfile多元化成功!

0