oracle 10G减少和增加控制文件个数

一 .减少控制文件,有一个控制文件损坏,我们要将损坏的控制文件剔除。步骤:
1.修改参数文件,并验证
2.停止数据库
3.启动数据库
4.验证,查看v$controlfile

下面是实际操作过程。
 

1 . 用sysdba用户登录数据库。

  [oracle@oracle ~]$ sqlplus oracle/oracle as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 3 01:24:57 2012

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> show user
USER is "SYS"
SQL>

2 . 先查看一下,控制文件.

  SQL> select * from v$controlfile;

STATUS  NAME                                               IS_ BLOCK_SIZE FILE_SIZE_BLKS
------- -------------------------------------------------- --- ---------- --------------
        /fantlam/oradata/fantlam/control01.ctl             NO       16384            430
        /fantlam/oradata/fantlam/control02.ctl             NO       16384            430
        /fantlam/oradata/fantlam/control03.ctl             NO       16384            430

3. 修改参数文件

  SQL> alter system set control_files=
  2  '/fantlam/oradata/fantlam/control01.ctl','/fantlam/oradata/fantlam/control02.ctl' scope=spfile;

System altered.

这个时候查看控制文件并没有改变。

  SQL> select * from v$controlfile;

STATUS  NAME                                               IS_ BLOCK_SIZE FILE_SIZE_BLKS
------- -------------------------------------------------- --- ---------- --------------
        /fantlam/oradata/fantlam/control01.ctl             NO       16384            430
        /fantlam/oradata/fantlam/control02.ctl             NO       16384            430
        /fantlam/oradata/fantlam/control03.ctl             NO       16384            430
 

4. 关闭数据库

  SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

5. 启动数据库

  SQL> startup
ORACLE instance started.

Total System Global Area  268435456 bytes
Fixed Size                  1218868 bytes
Variable Size              79693516 bytes
Database Buffers          180355072 bytes
Redo Buffers                7168000 bytes
Database mounted.
Database opened.

6. 查看控制文件是否改变

  SQL> select * from v$controlfile;

STATUS  NAME                                               IS_ BLOCK_SIZE FILE_SIZE_BLKS
------- -------------------------------------------------- --- ---------- --------------
        /fantlam/oradata/fantlam/control01.ctl             NO       16384            430
        /fantlam/oradata/fantlam/control02.ctl             NO       16384            430

已经由原来的三个变成了两个。

二. 增加控制文件的个数

主要操作步骤:

1.修改参数文件
2.停止数据库
3.复制控制文件
4.启动数据库
5.验证,查看v$controlfile

下面是实际操作步骤:

1. 修改参数文件

  SQL> alter system set control_files=
  2  '/fantlam/oradata/fantlam/control01.ctl',
  3  '/fantlam/oradata/fantlam/control02.ctl',
  4  '/fantlam/oradata/fantlam/controlfile/control03.ctl'
  5  scope=spfile;

System altered.

2. 关闭数据库

  SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

3. 复制控制文件到刚才指定的位置

  host cp /fantlam/oradata/fantlam/control02.ctl /fantlam/oradata/fantlam/controlfile/control03.ctl

4. 启动数据库

  SQL> startup
ORACLE instance started.

Total System Global Area  268435456 bytes
Fixed Size                  1218868 bytes
Variable Size              79693516 bytes
Database Buffers          180355072 bytes
Redo Buffers                7168000 bytes
Database mounted.
Database opened.

5. 查看v$controlfile视图验证

  SQL> select * from v$controlfile;

STATUS  NAME                                               IS_ BLOCK_SIZE FILE_SIZE_BLKS
------- -------------------------------------------------- --- ---------- --------------
        /fantlam/oradata/fantlam/control01.ctl             NO       16384            430
        /fantlam/oradata/fantlam/control02.ctl             NO       16384            430
        /fantlam/oradata/fantlam/controlfile/control03.ctl NO       16384            430
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(oracle,控制文件)