본문 바로가기

오라클 ADMIN

Control File, Redo Log File, Data File 관리 연습


EXAMPLE



Spfile일 경우


> alter system set control_files=’/disk3/control01.ctl’,’ ’/disk4/control02.ctl’,’ ’/disk5/control03.ctl’ scope=spfile ;


Pfile일 경우

$ vi $ORACLE_HOME/dbs/initSID.ora

Control_files=’/disk3/control01.ctl’,’ ’/disk4/control02.ctl’,’ ’/disk5/control03.ctl’ 수정


> shutdown immediate ;

> !

$ cp /home/oracle/oradata/testdb/control01.ctl /disk3/control01.ctl

$ cp /home/oracle/oradata/testdb/control01.ctl /disk4/control02.ctl

$ cp /home/oracle/oradata/testdb/control01.ctl /disk5/control03.ctl

$ exit


> startup mount ;

> !

$ cp /home/oracle/oradata/testdb/redo01.log /disk4/redo01_a.log

$ cp /home/oracle/oradata/testdb/redo02.log /disk4/redo02_a.log

$ cp /home/oracle/oradata/testdb/redo03.log /disk4/redo03_a.log

$ exit

> alter database rename file ‘/home/oracle/oradata/testdb/redo01.log’ to ‘/disk4/redo01_a.log’ ;

> alter database rename file ‘/home/oracle/oradata/testdb/redo02.log’ to ‘/disk4/redo02_a.log’ ;

> alter database rename file ‘/home/oracle/oradata/testdb/redo03.log’ to ‘/disk4/redo03_a.log’ ;

> alter database add logfile member ‘/disk5/redo01_b.log’ to group 1, 

‘/disk5/redo02_b.log’ to group 2, ‘/disk5/redo03_b.log’ to group 3 ;


> !

$ cp /home/oracle/oradata/testdb/system01.dbf /disk1/system01.dbf

$ cp /home/oracle/oradata/testdb/undotbs01.dbf /disk2/undotbs01.dbf

$ exit

> alter database rename file ‘/home/oracle/oradata/testdb/system01.dbf' to ‘/disk1/system01.dbf' ;

> alter database rename file ‘/home/oracle/oradata/testdb/undotbs01.dbf' to ‘/disk2/undotbs01.dbf' ;

> alter database open ;


> alter tablespace sysaux offline ;

> alter tablespace users offline ;

> alter tablespace example offline ;

> alter tablespace test offline ;


>!

$ cp /home/oracle/oradata/testdb/sysaux01.dbf /disk2/sysaux01.dbf 

$ cp /home/oracle/oradata/testdb/users01.dbf /disk3/users01.dbf 

$ cp /home/oracle/oradata/testdb/example01.dbf /disk3/example01.dbf 

$ cp /home/oracle/oradata/testdb/test01.dbf /disk3/test01.dbf

$ exit


> alter tablespace sysaux rename datafile ‘/home/oracle/oradata/testdb/sysaux01.dbf' to ‘/disk2/sysaux01.dbf' ;

> alter tablespace users rename datafile ‘/home/oracle/oradata/testdb/users01.dbf' to ‘/disk3/users01.dbf' ;

> alter tablespace example rename datafile ‘/home/oracle/oradata/testdb/example01.dbf' to ‘/disk3/example01.dbf' ;

> alter tablespace test rename datafile ‘/home/oracle/oradata/testdb/test01.dbf' to ‘/disk3/test01.dbf' ;


> alter tablespace sysaux online ;

> alter tablespace users online ;

> alter tablespace example online ;

> alter tablespace test online ;



'오라클 ADMIN' 카테고리의 다른 글

Undo  (0) 2013.01.17
Data Block, Extent, Segment  (0) 2013.01.16
Tablespace and Data Files  (0) 2013.01.15
Redo Log File  (0) 2013.01.14
Control file  (0) 2013.01.14