다른 설명 필요 없이 간단한 예제로 확인하기.....
정의가 궁금하다면 구글링~~~~~으로 해결하장...ㅎㅎ
$ sqlplus '/as sysdba'
SQL>startup
Database opened.
SQL>host
여기서 sqlplus가 아닌 운영체제로 돌아간다는게 포인트.....ㅎㅎ
오라클과 상관없이 백업가능하다는 얘기..
$ mkdir /oracle/exp_test/
$ cd /oracle/exp_test
$ exp hr/hr tables=employees,departments rows=y file=/oracle/exp_test/emphr.dmp
Export terminated successfully with warnings.
확인을 하면 이런 파일이 하나 생겼겠지
/oracle/exp_test/emphr.dmp
이건 hr의 2개의 테이블이 파일 형태로 빠진것....
$ exit
exit
SQL>
테스트를 위해 일단 export시킨 두개의 테이블을 drop 시키자
SQL> drop table hr.employees cascade constraint;
Table dropped.
SQL> drop table hr.departments cascade constraint;
Table dropped.
테이블 확인을 하면
ORA-00942: table or view does not exist
요딴 에러가 뜨겠징.....
이걸 import를 이용하여 복원시킨다면 오라클과 아무 상관없이 복원가능
즉, 서비스 중단이라는걸 하지 않아도 된다는 얘기가 된다
import 역시 운영체제 콘솔에서 실행한다
SQL>host
$ imp hr/hr tables=employees,departments rows=y file=/oracle/exp_test/emphr.dmp
. importing HR's objects into HR
. . importing table "EMPLOYEES" 107 rows imported
. . importing table "DEPARTMENTS" 27 rows imported
About to enable constraints...
Import terminated successfully without warnings.
$ exit
exit
SQL>
다시 해당 테이블을 확인하면 이전의 데이터가 그대로 있겠지..
정말 간단하면서도 쉬운 백업과 복원 기술이 된당.....ㅎㅎ
더군다나 DB를 stop시키지 않아도 사용할수 있는 상당히 매력있는 방법.....
이런걸 실무에서 사용할 일이 있을까나........ㅋㅎ
댓글 없음:
댓글 쓰기