Oracle DB

6장 컨트롤 파일

tommy76 2020. 5. 27. 17:07

제어 파일

작은 이진 파일 (바이너리)

· 물리적 데이터베이스의 현재 상태 정의

· 데이터베이스 무결성 유지 관리

· 필요한 경우:

    - 데이터베이스를 시작하는 동안 MOUNT 상태일때

    - 데이터베이스를 운영할때

· 손실된 경우 복구를 위해서 '미러링'해야한다 (제어 파일의 다중화)

 

교안 오라클 실습자 과정

사용 명령어

SQL> SELECT NAME FROM V$CONTROLFILE;

               - 사용 중인 control file의 목록을 조회한다.

 

실습 개요

디스크 1~4번까지만듦

 

oradata/disk1

oradata/disk2

oradata/disk3

4 redo log

5 control file

 

[ora12c@db12 dev]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Wed May 27 16:54:34 2020

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> ALTER SYSTEM SET control_files =
  2  '/app/ora12c/oradata/disk4/control.ctl',

  3  '/app/ora12c/oradata/disk5/control.ctl' scope = spfile;

 

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !mv /app/ora12c/oradata/DB12/control01.ctl /app/ora12c/oradata/disk4/control.ctl

SQL> !mv /app/ora12c/oradata/DB12/control02.ctl /app/ora12c/oradata/disk5/control.ctl


SQL> !ls /app/ora12c/oradata/disk4
control.ctl


SQL> !ls /app/ora12c/oradata/disk5
control.ctl


SQL> startup
ORACLE instance started.

Total System Global Area  830472192 bytes
Fixed Size                  8626144 bytes
Variable Size             629145632 bytes
Database Buffers          188743680 bytes
Redo Buffers                3956736 bytes
Database mounted.
Database opened.
SQL> SELECT name, value FROM v$parameter
  2  WHERE name LIKE 'control_files';

NAME
--------------------------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
control_files
/app/ora12c/oradata/disk4/control.ctl, /app/ora12c/oradata/disk5/control.ctl


SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> [root@db12 ~]# logout