DB

XE oradata 이동

Lawmin 2013. 8. 2. 09:59

default 로 설치하면 oradata가 오라클 프로그램 경로 밑으로 가는데 이걸 옮기고 싶다!


sqlplus "/as sysdba"


# 컨트롤 파일 새 위치 지정 (spfile)

SQL> alter system set control_files='d:\oradata\xe\control.dbf' scope=spfile;


# Shutdown

SQL> shutdown immediate;


# oradata 복사 (추후 원본 삭제)

C:/oraclexe/app/oracle/oradata/ -> D:/oradata/


# Mount

SQL> startup mount;


# Datafile과 Tempfile 위치 변경

SQL> alter database rename file 'C:/oraclexe/app/oracle/oradata/XE/SYSAUX.DBF' to 'D:/oradata/XE/SYSAUX.DBF';

SQL> alter database rename file 'C:/oraclexe/app/oracle/oradata/XE/SYSTEM.DBF' to 'D:/oradata/XE/SYSTEM.DBF';

SQL> alter database rename file 'C:/oraclexe/app/oracle/oradata/XE/TEMP.DBF' to 'D:/oradata/XE/TEMP.DBF';

SQL> alter database rename file 'C:/oraclexe/app/oracle/oradata/XE/UNDOTBS1.DBF' to 'D:/oradata/XE/UNDOTBS1.DBF';

SQL> alter database rename file 'C:/oraclexe/app/oracle/oradata/XE/USERS.DBF' to 'D:/oradata/XE/USERS.DBF';


# Startup

SQL> alter database open;


굿!