본문 바로가기

Database/ORACLE

[Oracle Admin] spfile 을 사용한 control file 다중화하기

 

spfile 을 사용한 control file 다중화하기

 

SQL> show parameter spfile ;

 

NAME                         TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                          string

 

※ pfile 인지 spfile 인지를 조회

 

SQL> !ls /app/oracle/product/11g/dbs

hc_DBUA0.dat  hc_testdb.dat  init.ora  inittestdb.ora  lkTESTDB  orapwtestdb

 

SQL> create spfile  from pfile;

 

※ pfile 로부터 spfile 을 새로 생성함

 

File created.

 

SQL> !ls /app/oracle/product/11g/dbs

hc_DBUA0.dat   init.ora        lkTESTDB     spfiletestdb.ora

hc_testdb.dat  inittestdb.ora  orapwtestdb

 

※ spfile 생성 확인

 

SQL> !rm -f /app/oracle/product/11g/dbs/inittestdb.ora

 

※ 기존 parameter file 삭제

 

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

 

※ Instance 재시작

 

Total System Global Area  422670336 bytes

Fixed Size                  1344616 bytes

Variable Size             301992856 bytes

Database Buffers          113246208 bytes

Redo Buffers                6086656 bytes

Database mounted.

Database opened.

 

※ DB open!!!

 

SQL> select name from v$controlfile;

 

NAME

--------------------------------------------------------------------------------

/app/oracle/oradata/testdb/control01.ctl

/app/oracle/oradata/testdb/control02.ctl

 

※ 현재 Control file 조회

 

SQL> !mkdir disk1 disk2 disk3

 

※ 새로운 Control File 파일 경로 생성

 

SQL> alter system set control_files='/home/oracle/disk1/control01.ctl','/home/oracle/disk2/control02.ctl','/home/oracle/disk3/control03.ctl' scope=spfile;

 

※ spfile은 사용자가 집적수정할 수 없으므로 쿼리를 날려서 서버프로세서가 수정하도록 합니다.

 

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

 

※ Instance Shut Down

 

SQL> !rm -fr /app/oracle/oradata/testdb/control01.ctl

SQL> !rm -fr /app/oracle/oradata/testdb/control02.ctl

 

※ 기존 Control file 삭제

 

SQL> startup

ORACLE instance started.

 

Total System Global Area  422670336 bytes

Fixed Size                  1344616 bytes

Variable Size             301992856 bytes

Database Buffers          113246208 bytes

Redo Buffers                6086656 bytes

Database mounted.

Database opened.

 

※ Database open.

 

SQL> select name from v$controlfile;

 

NAME

--------------------------------------------------------------------------------

/home/oracle/disk1/control01.ctl

 

 

 

/home/oracle/disk2/control02.ctl

/home/oracle/disk3/control03.ctl

 

※ 현재 Control file 조회

 

-Control File 다중화하기 ( spfile 이용시 ) Posting 끝-

 

By. sTricky