RMAN: 백업과 복구 TOOL
RMAN: 백업과 복구 TOOL
TARGER DB → RMAN ← RECOVERY CATALOG DB
← Contro file →
RMAN의 장점
*Block level incremental Backup
*속도 제어
*다수의 분산 환경
--RECOVERY CATALOG DB 에 접속해본다.
RCDB:
//SYSTEM계정으로 RCDB에 접속
--RCDB: SYSTEM
C:\Documents and Settings\easy>SQLPLUS SYSTEM/ORACLE@RCDB
SQL*Plus: Release 9.2.0.1.0 - Production on 월 Jun 16 16:54:23 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
다음에 접속됨:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
--RMAN을 사용하기 위해서는
1.전용사용자
2.전용테이블스페이스
3.테이블
DOC>/*
DOC> CREATE TABLESPACE RCTBS
DOC> DATAFILE 'C:\oracle\oradata\ORCL\RCTBS01.DBF' SIZE 100M;
DOC>
DOC> CREATE USER RMAN
DOC> IDENTIFIED BY RMAN
DOC> ACCOUNT UNLOCK
DOC> DEFAULT TABLESPACE RCTBS
DOC> TEMPORARY TABLESPACE TEMP;
DOC> GRANT CONNECT, RESOURCE TO RMAN;
DOC> GRANT RECOVER_CATALOG_OWNER TO RMAN;
DOC>*/
SQL> --9i 윈도우엔 미리설정되어있다. 안해줘도된다.
--DBID 확인
--OS
C:\Documents and Settings\easy>SQLPLUS "SYS/ORACLE AS SYSDBA"
SQL*Plus: Release 9.2.0.1.0 - Production on 월 Jun 16 16:40:50 2008
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
다음에 접속됨:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> SELECT NAME,DBID FROM V$DATABASE;
NAME DBID
--------- ----------
ORCL 1185320995
--DBID:절대 중복될수없다
//OS에서 RMAN으로 접속해본다.
--OS
C:\Documents and Settings\easy>RMAN TARGET='SYS/ORACLE AS SYSDBA'
복구 관리자: 릴리스 9.2.0.1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
대상 데이터베이스에 접속합니다: ORCL (DBID=1185320995) //같은것을 확인할수있다.
RMAN> EXIT
복구 매니저가 완성되었습니다.
--이제 RECOVERY CATALOG DB 에 접속해본다.
//RCDB접속
C:\Documents and Settings\easy>RMAN RCVCAT=RMAN/RMAN@RCDB
복구 관리자: 릴리스 9.2.0.1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04004: error from recovery catalog database: ORA-28000: the account is locked
//RMAN계정이 잠겨있어서 에러를 발생한다.(DEFAULT)
--RCDB: SYSTEM
//RMAN의 계정을 풀어준다.
SQL> SHOW USER
USER은 "SYSTEM"입니다
SQL> ALTER USER RMAN
2 IDENTIFIED BY RMAN
3 ACCOUNT UNLOCK;
사용자가 변경되었습니다.
//RMAN으로 접속해본다.
SQL> CONN RMAN/RMAN@RCDB
연결되었습니다.
SQL> SELECT * FROM TAB;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
AL TABLE
BCB TABLE
BCF TABLE
BDF TABLE
BP TABLE
BRL TABLE
BS TABLE
BSF TABLE
CCB TABLE
CCF %2