슬라이드 1

Similar documents
슬라이드 1

슬라이드 1

<4D F736F F D205BB4EBBBF3C1A4BAB8B1E2BCFA5DB1E2BCFAB9AEBCAD2D524D414EBBE7BFEBBFB9C1A65F39695F313067>

Contents 1. Oracle Recovery Manager(RMAN) RMAN이란? RMAN의특징 RMAN의 Channel과 Media Management RMAN CONFIGURE COMMAND.

Microsoft Word - RMAN 스터디자료_공개용_ doc

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

62

Tablespace On-Offline 테이블스페이스 온라인/오프라인

Advanced Product Service

세미나(장애와복구-수강생용).ppt

Microsoft Word - 10g RAC on Win2k.doc

목 차

Document Server Information Items Description Test Date 2011 / 05 / 31 CPU Intel(R) Xeon(R) CPU 2.40GHz X 8 Main Memory 1GB O/S version OEL 5.

Simplify your Job Automatic Storage Management DB TSC

목차 BUG offline replicator 에서유효하지않은로그를읽을경우비정상종료할수있다... 3 BUG 각 partition 이서로다른 tablespace 를가지고, column type 이 CLOB 이며, 해당 table 을 truncate

Microsoft PowerPoint - Linux_10gRAC_3Node

오라클 데이터베이스 10g 핵심 요약 노트

PowerPoint Presentation

단계

Microsoft Word - dataguard_세미나_v1.8.doc

큰 제목은 18 bold

Oracle Database 10g: Self-Managing Database DB TSC

소개 TeraStation 을 구입해 주셔서 감사합니다! 이 사용 설명서는 TeraStation 구성 정보를 제공합니다. 제품은 계속 업데이트되므로, 이 설명서의 이미지 및 텍스트는 사용자가 보유 중인 TeraStation 에 표시 된 이미지 및 텍스트와 약간 다를 수

CD-RW_Advanced.PDF

The Self-Managing Database : Automatic Health Monitoring and Alerting

Microsoft PowerPoint - 가상환경에최적화된_NetBackup_Appliance

Data Guard 기본개념.doc

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

Oracle Database 12c High Availability

Jerry Held

SRC PLUS 제어기 MANUAL

Remote UI Guide

Title Slide with Name

PRO1_09E [읽기 전용]

PowerPoint Presentation

Tibero

Microsoft PowerPoint - Tech-iSeminar_Managing_Tablespace.ppt

MS-SQL SERVER 대비 기능

Microsoft Word - Oracle10gDB ±âº»¿î¿µÁöħ¼�.doc

PowerChute Personal Edition v3.1.0 에이전트 사용 설명서

목차 BUG 문법에맞지않는질의문수행시, 에러메시지에질의문의일부만보여주는문제를수정합니다... 3 BUG ROUND, TRUNC 함수에서 DATE 포맷 IW 를추가지원합니다... 5 BUG ROLLUP/CUBE 절을포함하는질의는 SUBQUE

Backup Exec

K7VT2_QIG_v3

System Recovery 사용자 매뉴얼

PowerPoint 프레젠테이션

Slide 1

문서 제목

s SINUMERIK 840C Service and User Manual DATA SAVING & LOADING & & /

MySQL-Ch10

Mango220 Android How to compile and Transfer image to Target

경우, TARGET 키워드 (AUXILIARY 키워드아님 ) 를사용하여반드시대기데이터베이스에접속해야 한다. 백업을수행하는동안, 대기데이터베이스는주데이터베이스를대체한다. 논리적대기데이터베이스의백업및복구주데이터베이스에서사용하는동일한방법으로논리적대기데이터베이스를백업할수있다.

Orcad Capture 9.x

Microsoft PowerPoint - 프레젠테이션1

Smart Power Scope Release Informations.pages

MAX+plus II Getting Started - 무작정따라하기

T100MD+

untitled

휠세미나3 ver0.4

10X56_NWG_KOR.indd

PWR PWR HDD HDD USB USB Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl Cable PC PC DDNS (


Contents Data Mart 1. 개요 실습방향 테스트위한사전설정 본격실습시작 ) 데이터파일 dd 명령어로 백업수행및유실시키기 ) 장애복구수행 결론...7 페이지 2 / 7

最即時的Sybase ASE Server資料庫診斷工具

LCD Display

목차 1. 제품 소개 특징 개요 Function table 기능 소개 Copy Compare Copy & Compare Erase

Oracle hacking 작성자 : 임동현 작성일 2008 년 10 월 11 일 ~ 2008 년 10 월 19 일 신규작성 작성내용

Oracle9i Real Application Clusters

USB USB DV25 DV25 REC SRN-475S REC SRN-475S LAN POWER LAN POWER Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl C

PCServerMgmt7

ALTIBASE HDB Patch Notes

Ç¥Áö

1217 WebTrafMon II

ETL_project_best_practice1.ppt

PRO1_02E [읽기 전용]

SMB_ICMP_UDP(huichang).PDF

PowerPoint 프레젠테이션

Oracle 11gR2 RAC to RAC Active Dataguard

untitled

본교재는수업용으로제작된게시물입니다. 영리목적으로사용할경우저작권법제 30 조항에의거법적처벌을받을수있습니다. [ 실습 ] 스위치장비초기화 1. NVRAM 에저장되어있는 'startup-config' 파일이있다면, 삭제를실시한다. SWx>enable SWx#erase sta

6주차.key

Sun Java System Messaging Server 63 64

github_introduction.key

디지털포렌식학회 논문양식

Chapter 1

10.ppt

문서 대제목

슬라이드 1

MPLAB C18 C

1. What is AX1 AX1 Program은 WIZnet 사의 Hardwired TCP/IP Chip인 iinchip 들의성능평가및 Test를위해제작된 Windows 기반의 PC Program이다. AX1은 Internet을통해 iinchip Evaluation

PowerPoint Presentation

인켈(국문)pdf.pdf

Cloud Friendly System Architecture


Oracle Regular Expression

UNIST_교원 홈페이지 관리자_Manual_V1.0

2011년 10월 초판 c 2011 Sony Corporation. All rights reserved. 서면 허가 없이 전체 또는 일부를 복제하는 것을 금합니다. 기능 및 규격은 통보 없이 변경될 수 있습니다. Sony와 Sony 로고는 Sony의 상표입니다. G L

,,,,,, (41) ( e f f e c t ), ( c u r r e n t ) ( p o t e n t i a l difference),, ( r e s i s t a n c e ) 2,,,,,,,, (41), (42) (42) ( 41) (Ohm s law),

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

Multi Channel Analysis. Multi Channel Analytics :!! - (Ad network ) Report! -! -!. Valuepotion Multi Channel Analytics! (1) Install! (2) 3 (4 ~ 6 Page

데이터베이스_오라클_부록(최종).indd

Transcription:

사례를통해본 RMAN (RMAN Case Study) 2013. 02. Seungtaek Lee( 放浪 A)

RMAN 백업 Server-Managed Backup(RMAN) Components Target : 백업대상 Catalog : 백업정보가저장되는 RMAN Repository Auxiliary : 백업또는 Target 를 Restore하여여러가지용도로사용하는 Channel : Target 에 Server Session을할당하여실제백업 / 복구를수행하게하는역할대부분의 RMAN Command는 Channel을통하여수행함 MML : RMAN Tape 백업시필요한 Library Catalog Auxiliary Target Server Server Server Session Session Session Connect channel channel channel Connect Connect RMAN MML 2

RMAN 백업 Server-Managed Backup(RMAN) 의내부작업 Restored Data File Header Block 1 Block 2 Block 3 Block 4 Block 5 Backup Set 38 37 34 37 38 36 Online Data File Header Block 1 Block 2 Block 3 Block 4 Block 5 38 37 39 37 38 36 Header Block 1 Block 2 Block 3 Block 4 Block 5 38 37 34 37 38 36 Header Block 1 Block 2 Block 3 Block 4 Block 5 Block 1 Block 2 Block 3 Block 4 34 34 37 38 36 Block 1 Block 2 Block 3 Block 5 Header Block 4 Block 5 34 34 37 38 36 Block 1 Block 2 Block 3 Block 4 34 34 37 38 Block 1 Block 2 36 38 Checkpoint Absolute Fuzzy 2 Restore Header Block 1 Block 2 Block 3 Block 4 Block 5 36 38 34 34 37 38 36 3 Recovery RMAN 은 BEGIN/END Command 없이백업을수행하기때문에 Block Image 같은추가 Redo 가발생하지않음 RMAN 은 Full Backup 뿐만아니라 Block 레벨의 Incremental Backup, Compressed Backup 등다양한방식의백업을지원 36 37 34 37 35 35 34 34 RMAN 은백업시에 Data File 의 Header Block 부터백업을수행하기때문 Header Block 1 Block 2 Block 3 Block 4 Block 5 Block 1 Header 에 User-Managed Backup 방식과달리 Header Block 의 Checkpoint 36 34 34 35 35 35 34 36 을고정시키지않음. 복구시 Redo Log 적용을 Header Block 의 Header Block 1 Block 2 Block 3 Block 4 Block 5 1 Online Backup Large Pool Checkpoint 시점부터복구를시작 31 30 34 30 34 34 RMAN 백업은 End Backup 을수행하지않기때문에백업시에 Redo Log 최소적용시점정보인 Absolute Fuzzy 값을백업 Data File Header 에기록 Absolute Fuzzy 은백업 Data File 의 Block SC 값중가장큰 3

RMAN 백업 Online Standby Backup Online Standby Backup을수행하기위해서는 Backup 정보를저장하는 Catalog 가필요 RMAN은 Catalog 가구성안되어있을시에는Catalog 대신에 Target 의 Controlfile을사용 Controlfile을사용하면 Primary 와 Standby 의 Control file이다르기때문에 Backup 정보를서로공유할수없음 Target 를 Primary 로설정하고 Catalog 로접속한다음 register database로 Catalog 에 정보를등록 Backup 수행시에는 Standby 를 Target 로설정하고 Catalog 에접속한후 Backup을수행 Standby 와 Primary 의 ID가동일하기때문에 Primary 에서 Standby 의백업을사용할수있음 Primary Standby Instance Tape Drive Instance Primary Catalog Standby 4

RMAN 백업 Catalog 생성및 Database 등록 $ rman catalog rman/rman01@rman RMAN> create catalog; rman target / catalog rman/rman01@rman RMAN> register database; Catalog 에 Primary 만등록하면됨 DataGuard 환경에서 RMAN Configuration CONFIGURE _UNIQUE_NAME PRI CONNECT IDENTIFIER PRI_SYN'; CONFIGURE _UNIQUE_NAME STB CONNECT IDENTIFIER STB_SYN'; DataGuard 환경에서는 RMAN CONFIGURE 설정값은 CATALOG 에서 Local Control File 로 Reverse Resync 가발생 각 고유의 CONFIGURE 설정을위해 _UNIQUE_NAME 생성후 FOR _UNIQUE_NAME 구문으로각각설정할수있음 CONFIGURE CONTROLFILE AUTOBACKUP ON; 백업수행시자동으로 Control File 과 spfile 백업수행 (OFF 시에는 Datafile 1 백업시에만포함됨 ) CONFIGURE BACKUP OPTIMIZATION ON; 동일 Checkpoint 에같은백업존재시백업 Skip 함 CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ALL STANY; Standby 에 Apply 된 Archive Log 만삭제 CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+FS_DG/PRI/CONTROLFILE/snapcf_PRI.f ; RAC 일경우 Snapshot Controfile 이 Shared Device 에존재해야함 (11.2.0.2 이상 ) 로컬로설정할경우 ORA-00245 에러가발생 (Bug 10263733) Standby 와 Primary 의 Snapshot Controlfile 은경로와파일명을같게설정해야함 (Bug 13829543) 5

RMAN 백업 RAC Multi Instance RMAN Backup Target 가 RAC일경우 Channel을 RAC의여러 Instance에할당하여자원을분산해서사용함으로백업수행속도를빠르게할수있음 Channel할당시 TAF나 Service를사용하면가용성이나자원사용을효율적으로할수있음 Catalog connect target /; connect rcvcat rman1/rman1@swbck2; Target Instance 1 Connect Server Server channel Server Session channel Session channel Session Connect RMAN run{ allocate channel t1 type 'SBT_TAPE' connect 'sys/q1w2e3r4@mos15k_lb'; allocate channel t2 type 'SBT_TAPE' connect 'sys/q1w2e3r4@mos15k_lb'; allocate channel t3 type 'SBT_TAPE' connect 'sys/q1w2e3r4@mos15k_lb'; allocate channel t4 type 'SBT_TAPE' connect 'sys/q1w2e3r4@mos15k_lb'; send 'NSR_ENV=(NSR_SERVER=kmesbk, NSR_CLIENT=dmos15d1, NSR_DATA_VOLUME_POOL=MOS)'; backup as backupset incremental level 0 filesperset 4 tag 'STBY_TAPE_BKST_FULL' format '%d_%u' database; Target Instance 2 Server Server Server Session Session Session channel channel channel release channel t1; release channel t2; release channel t3; release channel t4; } 6

RMAN 백업 Block Change Tracking File 과거 Backup 이후변경된 block 정보를비트맵으로저장하여 Incremental Backup 수행시변경된 Block만 Read하여빠르게 Backup(Fast Incremental Backup) 할수있게지원하는 File 각 Datafile마다최대 8개버전 (_bct_bitmaps_per_file) 의 Backup에대한변경된 block 정보를 bitmap extent에 switch하면서저장 (bitmap extent 1개에는 1개의버전정보만저장됨 ) 변경된 block은 32k(_bct_chunk_size) 크기의 Chunk 단위로관리 RAC 환경하에서는 BCT File을 ASM/Raw Device/CFS 같은공유Device에생성하여야함 11g부터 Standby 에도적용가능 SGA List of changed blocks CTWR Redo generation 1011001010110 0001110100101 1010101110011 Change tracking file Redo log 7

RMAN 백업 Incrementally Updated Backup 최초 Backup 시에는 Image Copy Full Backup 을수행하고이후 Backup 수행시에는 Incremental Backup 을 수행하여이때만들어지는 Incremental Backup 을 Image Copy Full Backup 본에 Update 하는 Backup 대용량 환경하에서 Incremental Backup 수행만으로 Full Backup 본을생성할수있으므로 Disk Full Backup 을좀더빠르게수행할수있는 Backup 방식 Tag 를설정하여여러시점의백업본을구성할수도있음 /recover1 Time A1 Time A2 Time A3 Full Backup (Image Copy) Full Backup (Image Copy) Full Backup (Image Copy) Database Update Incremental Backup (Backup Set) Update Incremental Backup (Backup Set) /recover2 Time B1 Time B2 Time B3 Full Backup (Image Copy) Full Backup (Image Copy) Full Backup (Image Copy) Update Incremental Backup (Backup Set) Update Incremental Backup (Backup Set) 8

RMAN 백업 Incrementally Updated Backup Script (/recover1) connect target / connect rcvcat rman/rman01@rman run { allocate channel f1d1 device type disk format '/recover1/rman/datafile/%u'; allocate channel f1d2 device type disk format '/recover1/rman/datafile/%u'; allocate channel f1d3 device type disk format '/recover1/rman/datafile/%u'; allocate channel f1d4 device type disk format '/recover1/rman/datafile/%u'; crosscheck backupset tag='stby_disk_copy_full1'; crosscheck copy like '/recover1/rman/%' ; delete noprompt expired backupset tag='stby_disk_copy_full1'; delete noprompt expired copy like '/recover1/rman/%' ; delete noprompt copy like '/recover1/rman/%' completed before 'sysdate-7'; delete noprompt backupset tag 'STBY_DISK_COPY_FULL1' completed before 'sysdate-2'; backup incremental level 1 for recover of copy with tag 'STBY_DISK_COPY_FULL1' database; recover copy of database with tag 'STBY_DISK_COPY_FULL1'; backup as copy current controlfile tag 'STBY_DISK_COPY_FULL1' format '/recover1/rman/controlfile/stbyctl1.cpy' reuse; backup as copy current controlfile tag 'STBY_DISK_COPY_FULL1' format '/recover2/arch/controlfile/stbyctl1.cpy' reuse; backup as backupset current controlfile tag 'STBY_DISK_COPY_FULL1' format '/recover1/rman/controlfile/stbyctl1.bkp.%u'; backup as backupset current controlfile tag 'STBY_DISK_COPY_FULL1' format '/recover2/arch/controlfile/stbyctl1.bkp.%u'; backup as backupset current controlfile tag 'STBY_DISK_COPY_FULL1' format '/recover1/rman/controlfile/stbyctl1.bkp' reuse; backup as backupset current controlfile tag 'STBY_DISK_COPY_FULL1' format '/recover2/arch/controlfile/stbyctl1.bkp' reuse; release channel f1d1; release channel f1d2; release channel f1d3; release channel f1d4; } 9

RMAN 백업 Incrementally Updated Backup Script (/recover2) connect target / connect rcvcat rman/rman01@rman run { allocate channel f2d1 device type disk format '/recover2/rman/datafile/%u'; allocate channel f2d2 device type disk format '/recover2/rman/datafile/%u'; allocate channel f2d3 device type disk format '/recover2/rman/datafile/%u'; allocate channel f2d4 device type disk format '/recover2/rman/datafile/%u'; crosscheck backupset tag='stby_disk_copy_full2'; crosscheck copy like '/recover2/rman/%' ; delete noprompt expired backupset tag='stby_disk_copy_full2'; delete noprompt expired copy like '/recover2/rman/%' ; delete noprompt copy like '/recover2/rman/%' completed before 'sysdate-7'; delete noprompt backupset tag 'STBY_DISK_COPY_FULL2' completed before 'sysdate-2'; backup incremental level 1 for recover of copy with tag 'STBY_DISK_COPY_FULL2' database; recover copy of database with tag 'STBY_DISK_COPY_FULL2'; backup as copy current controlfile tag 'STBY_DISK_COPY_FULL2' format '/recover2/rman/controlfile/stbyctl2.cpy' reuse; backup as copy current controlfile tag 'STBY_DISK_COPY_FULL2' format '/recover2/arch/controlfile/stbyctl2.cpy' reuse; backup as backupset current controlfile tag 'STBY_DISK_COPY_FULL2' format '/recover2/rman/controlfile/stbyctl2.bkp.%u'; backup as backupset current controlfile tag 'STBY_DISK_COPY_FULL2' format '/recover2/arch/controlfile/stbyctl2.bkp.%u'; backup as backupset current controlfile tag 'STBY_DISK_COPY_FULL2' format '/recover2/rman/controlfile/stbyctl2.bkp' reuse; backup as backupset current controlfile tag 'STBY_DISK_COPY_FULL2' format '/recover2/arch/controlfile/stbyctl2.bkp' reuse; release channel f2d1; release channel f2d2; release channel f2d3; release channel f2d4; } 10

Standby Image Copy 본을이용한 복구 Standby 의백업본을 Primary 서버에 NFS 로 Mount 함 Primary Control File 에는 Standby 에서수행한디스크백업정보가없기때문에 Catalog 를연결필요 Primary 에서 Standby 백업정보를접근하기위해 set backup files for device type disk to accessible 설정 Standby 에서수행한 Tape Backup 백업정보는 Catalog 만연결하면특별한설정없이 Primary 에서 Default 로볼수있음 Catalog 에있는 Standby 백업정보를이용하여 Full/Tablespace/Datafile/Block 복구를할수있음 Data Guard Primary Standby Instance Block Datafile Tablespace Full 3 RMAN Recovery Online Compress Parallel Image 1 RMAN Backup Instance Primary RMAN Image Standby 2 FS Mount/Cataloging 11

STEP 1. Primary 서버에 Standby Image Copy 본 Mount NFS 로 Mount 시 OS 별 Mount 옵션확인할것 (Note ID 359515.1 참조 ) NFS 문제시 ORA-17500: ODM err:permission denied 에러발생함 $ df kmmepz01-priv1:/export/data1 40096109568 115846144 39980263424 1% /recover2/rman/datafile/data1 kmmepz02-priv1:/export/data2 40130859008 57710592 40073148416 1% /recover2/rman/datafile/data2 kmmepz01-priv1:/export/data3 40114868224 134604800 39980263424 1% /recover2/rman/datafile/data3 kmmepz02-priv1:/export/data4 40173003776 99855360 40073148416 1% /recover2/rman/datafile/data4 STEP 2. set backup files for device type disk to accessible 설정 10gR2 까지는 Standby 에서디스크백업수행시반드시 Nocatalog 로백업 / 복구를수행하여야했고 Primary 에서복구하기위해서는 Catalog 작업이별도로필요 11gR1 부터는 Standby 에서디스크백업수행시 Catalog 로백업을수행하고 Primary 에서복구시에는 set backup files for device type disk to accessible 구문으로별도의 Catalog 작업없이복구가능 # rman target / catalog rman/rman01@rman RMAN> set backup files for device type disk to accessible RMAN> list copy; 12

STEP 3. Restore and Recovery Database/Tablespace/Datafile/Block 단위로 Restore 및 Recovery 가능 $ rman target / catalog rman/rman01@rman run { allocate channel disk1 device type disk ; allocate channel disk2 device type disk ; restore database from tag 'STBY_DISK_COPY_FULL2' ; release channel disk1; release channel disk2; } Block Recover 예 $ rman target / catalog rman/rman01@rman RMAN> blockrecover datafile 6 block 9,10 datafile 8 block 11,15 from tag 'STBY_DISK_COPY_FULL2' ; 13

Standby Image Copy 본을이용한 Test 구성 Image Copy 본은 Datafile 과구조가같기때문에 Restore 작업없이 Copy 본으로경로를수정하여 를 Open 할수있음 Open 을위해 Controlfile, Datafile, Tempfile, Redo Log File, Archive Log File, BCT File, Flashback Log 에대한경로변경작업필요 Image Copy 본은 Primary 서버나 Standby 서버가아닌별도의복구 / 테스트서버에구성할것을권고 Primary 서버나 Standby 서버에서구성할경우 Service 등록과데이터베이스파일에대한중복여부 확인작업이필요하기때문에신중하게작업을하여야함 Data Guard Primary Standby 복구 /TEST Instance Instance Instance Primary Standby RMAN Image1 RMAN Image2 복구용 Test 용 14

Standby Image Copy 본을이용한 Test 구성 STEP 1. Test 정보확인 Archive log mode 필수 #. oraenv ORACLE_SID = [TEST]? TEST The Oracle base remains unchanged with value /u01/app/oracle # /oracle/ora11g>env grep ORA ORACLE_BASE=/u01/app/oracle ORACLE_SID=TEST ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 # sqlplus / as sysdba SQL> startup nomount STEP 2. Controlfile Restore Test 생성을위해서는별도의 Oracle Home 을설치하고 를 Nomount 함 Nomount 에서 Controlfile Restore 수행 Controlfile Restore 는 Copy 본 (stbyctl2.cpy) 이아닌 Standby 에서수행한 Backupset Controlfile(stbyctl2.bkp) 을사용할것 # export ORACLE_SID=TEST # rman target / RMAN> restore controlfile from '/recover2/rman1/controlfile/stbyctl2.bkp'; RMAN> sql 'alter database mount'; sql statement: alter database mount released channel: ORA_DISK_1 15

# export ORACLE_SID=TEST # sqlplus / as sysdba SQL> select CONTROLFILE_TYPE from v$database; CONTROL ------- BACKUP STANY가아닌 BACKUP이어야함 SQL> select name from v$controlfile; STEP 3. Datafile Copy Backup 확인 # rman target / RMAN> list datafilecopy tag='stby_disk_copy_full2'; List of Datafile Copies ======================= Key File S Completion Time Ckp Ckp Time ------- ---- - -------------------- ---------- -------------------- 71 1 A 02-DEC-2012 08:54:36 1604486 01-DEC-2012 22:23:27 Name: /recover2/rman/datafile/data_d-kmmes_i-618844117_ts-system_fno-1_9jnrrbhm Tag: STBY_DISK_COPY_FULL2 73 2 A 02-DEC-2012 08:55:01 1604486 01-DEC-2012 22:23:27 Name: /recover2/rman/datafile/data_d-kmmes_i-618844117_ts-sysaux_fno-2_9inrrbhk Tag: STBY_DISK_COPY_FULL2... 16

STEP 4. Datafile Rename switch database to copy 명령어로 Datafile Rename 수행 # export ORACLE_SID=TEST # rman target / RMAN> switch database to copy; datafile 1 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-system_fno-1_9jnrrbhm" datafile 2 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-sysaux_fno-2_9inrrbhk" datafile 3 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs1_fno-3_98nrrb24" datafile 4 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs2_fno-4_99nrrb24" datafile 5 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-users_fno-5_9knrrbij" datafile 6 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs1_fno-6_9anrrb24" datafile 7 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs1_fno-7_9bnrrb24" datafile 8 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs1_fno-8_9cnrrbad" datafile 9 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs1_fno-9_9dnrrbag" datafile 10 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs2_fno-10_9enrrbai" datafile 11 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs2_fno-11_9fnrrbal" datafile 12 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs2_fno-12_9gnrrbhc" datafile 13 switched to datafile copy "/recover2/rman/datafile/data_d-kmmes_i-618844117_ts-undotbs2_fno-13_9hnrrbhi" 17

STEP 5. Tempfile Rename switch tempfile 명령어로 Tempfile Rename 수행 # rman target / run { SET NEWNAME FOR TEMPFILE 1 TO '/recover2/rman1/datafile/temp01.dbf'; SET NEWNAME FOR TEMPFILE 2 TO '/recover2/rman1/datafile/temp02.dbf'; SET NEWNAME FOR TEMPFILE 3 TO '/recover2/rman1/datafile/temp03.dbf'; SET NEWNAME FOR TEMPFILE 4 TO '/recover2/rman1/datafile/temp04.dbf'; SET NEWNAME FOR TEMPFILE 5 TO '/recover2/rman1/datafile/temp05.dbf'; switch tempfile all; } STEP 6. Redo Log File Rename alter database rename file 명령어로 Redo Log File Rename 수행 # export ORACLE_SID=TEST SQL> alter database rename file '/oracle/kmmes/redolog/1_redo01.log' to '/recover2/rman/datafile/1_redo01.log'; SQL> alter database rename file '/oracle/kmmes/mirrlog/1_redo01_m.log' to '/recover2/rman/datafile/1_redo01_m.lo g ; SQL> alter database rename file '/oracle/kmmes/redolog/stby_1_redo31.log' to '/recover2/rman/datafile/stby_1_red o31.log'; SQL> alter database rename file '/oracle/kmmes/redolog/stby_1_redo32.log' to '/recover2/rman/datafile/stby_1_red o32.log'; 18

STEP 7. Active Redo Log Drop drop logfile 에러발생 (Active Standby Log) 시해당 Log Clear 후 drop SQL> alter database clear logfile group 32; alter database clear logfile group 32 * ERROR at line 1: ORA-00344: unable to re-create online log '/oracle/kmmes/redolog/stby_1_redo32.log' ORA-27040: file create error, unable to create file IBM AIX RISC System/6000 Error: 2: No such file or directory Additional information: 1 SQL> alter database drop logfile group 32; STEP 8. BCT File Disable # export ORACLE_SID=TEST # rman target / SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING; SQL> select * from V$BLOCK_CHANGE_TRACKING; 19

STEP 9. Database File Rename 최종확인 # export ORACLE_SID=TEST # sqlplus / as sysdba SQL> select name from v$controlfile; SQL> select name from v$datafile; SQL> select file#,name from v$tempfile; SQL> select * from V$BLOCK_CHANGE_TRACKING; SQL> select member from v$logfile; STEP 10. Datafile 복구및 Open noarchivelog 로 Open RAC 백업을 Single 로 resetlog 로 Open 하기위해서 init 파일에 _no_recovery_through_resetlogs=true 설정할것 (Bug 4355382) # export ORACLE_SID=TEST # sqlplus / as sysdba SQL> recover database until cancel using backup controlfile; ORA-00279: change 1604486 generated at 12/01/2012 22:23:27 needed for thread 1 ORA-00289: suggestion : /recover3/archive/1_74_800859076.dbf ORA-00280: change 1604486 for thread 1 is in sequence #74 Specify log: {<RET>=suggested filename AUTO CANCEL} CANCEL Media recovery cancelled. SQL> select * from v$recover_file; SQL> alter database noarchivelog; SQL> alter database open resetlogs; 20

ZFS Appliance 를이용한 Test 구성 ZFS Appliance 의 Snapshot 기능을이용하여 RMAN Image Copy 본을여러시점의 Snapshot 백업을수행함 필요한 Snapshot 을 Read Write 가가능한 Clone 으로복제하여테스트서버에 Mount 함 테스트 의 Controlfile 에변경된경로정보를다시 Catalog Datafile/Redo Log File/Temp File 등을 rename 함 BCT/Flashback Log 등을 Disable 함 Reset Log 로 Open 함 Data Guard Primary Standby 복구 /TEST Instance Instance Instance Primary Standby RMAN Image Snap 1 Snap 2 Snap 3 Snap 4 Snap 5 Clone 2 Clone 5-1 Clone 5-2 복구용 Test 용 21

STEP 1. ZFS Clone 백업본 Mount /clone/recover2/rman/datafile/ STEP 2. Controlfile Restore Test 생성을위해서는별도의 Oracle Home 을설치하고 를 Nomount 함 Nomount 에서 Controlfile Restore 수행 Controlfile Restore 는 Copy 본 (stbyctl2.cpy) 이아닌 Standby 에서수행한 Backupset Controlfile(stbyctl2.bkp) 을사용할것 # sqlplus / as sysdba SQL> startup nomount # rman target / RMAN> restore controlfile from '/clone/recover2/rman1/controlfile/stbyctl2.bkp'; RMAN> sql 'alter database mount'; # sqlplus / as sysdba SQL> select CONTROLFILE_TYPE from v$database; CONTROL ------- BACKUP STANY가아닌 BACKUP이어야함 SQL> select name from v$controlfile; 22

STEP 3. Image Copy 본 Uncatalog/Catalog Backup 당시경로와달라졌기때문에 (/recover2 /clone/recover2) 백업정보삭제 (Uncatalog) 후등록 (Catalog ) # rman target / RMAN> list datafilecopy tag='stby_disk_copy_full2'; RMAN> change datafilecopy tag='stby_disk_copy_full2' uncatalog; RMAN> list datafilecopy tag='stby_disk_copy_full2'; RMAN> catalog start with '/clone/recover2/' noprompt; FILE# 로한개의 ImageCopy만존재하는지확인 RMAN> list datafilecopy tag='stby_disk_copy_full2'; RMAN> list incarnation; List of Database Incarnations Key Inc Key Name ID STATUS Reset Reset Time ------- ------- -------- ---------------- --- ---------- ---------- 1 1 KMQC 604386621 PARENT 1 10-DEC-2012 20:56:29 2 2 KMQC 604386621 PARENT 2032827 14-DEC-2012 19:17:28 3 3 KMQC 604386621 CURRENT 2033016 14-DEC-2012 19:30:57 # 운영 의 RESETLOGS_CHANGE# 과 Current Incarnation 의 Reset 과 Mismatch 시해당 Incarnation# 로 Reset RMAN> reset database to incarnation 번호 ; 23

STEP 4. Datafile Rename switch database to copy 명령어로 Datafile Rename 수행 # rman target / RMAN> switch database to copy; datafile 1 switched to datafile copy "/clone/recover2/rman/datafile/data1/data_d-kmqc_i-604386621_ts-system_fno-1 _03nspu7f" datafile 2 switched to datafile copy "/clone/recover2/rman/datafile/data4/data_d-kmqc_i-604386621_ts-sysaux_fno-2 _12nsq0kc"... STEP 5. Tempfile Rename switch tempfile 명령어로 Tempfile Rename 수행 # rman target / run { SET NEWNAME FOR TEMPFILE 1 TO '/clone/recover2/rman1/datafile/temp01.dbf'; switch tempfile all; } STEP 6. Redo Log File Rename alter database rename file 명령어로 Redo Log File Rename 수행 alter database rename file '+DATA_EXA2/kmqcdg/onlinelog/group_1.278.801940267' to '/clone/recover2/rman/datafile /1redo1.log'; alter database rename file '+DATA_EXA2/kmqcdg/onlinelog/group_1.277.801940271' to '/clone/recover2/rman/datafile /1redo2.log ; 24

STEP 7. Standby Log File Drop alter database drop logfile group 31; alter database drop logfile group 32;. drop logfile 에러발생 (Active Standby Log) 시해당 Log Clear 후 drop TEST: SYS> alter database drop logfile group 32 * ERROR at line 1: TEST: SYS> alter database clear logfile group 32; '+data_exa * ORA-29701: unable to connect to Cluster Synchronization Service SQL> alter database drop logfile group 32; STEP 8. Block Change Tracking File Disable SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING; SQL> select * from V$BLOCK_CHANGE_TRACKING; 25

STEP 9. Database File Rename 최종확인 SQL> select member from v$logfile; SQL> select file#,name from v$tempfile; SQL> select * from V$BLOCK_CHANGE_TRACKING; SQL> select name from v$controlfile; SQL> select name from v$datafile; STEP 10. Recover 및 Open noarchivelog 로 Open RAC 백업을 Single 로 resetlog 로 Open 하기위해서 init 파일에 _no_recovery_through_resetlogs=true 설정할것 (Bug 4355382) SQL> recover database until time '2013-01-28:12:30:00' using backup controlfile; SQL> alter database noarchivelog; SQL> alter database open resetlogs; 26

Duplicate Database 를이용한 Test 구성 Primary 또는 Standby 에서수행한 VTL 백업을 Restore 하여별도의 Test 를구성할수있음 Duplicate 는원본 와다른 ID 로생성됨 Data Guard Primary Standby TEST Instance Instance Instance Primary Standby Duplicate 27

Duplicate Database 를이용한 Test 구성 STEP 1. Startup Nomount Duplicate 생성을위해서는별도의 Oracle Home 을설치하고 를 Nomount 함 kmmepr02[#/oracle/ora11g] sqlplus / as sysdba TEST2: SYS> startup nomount STEP 2. Control File Restore -- Catalog 을이용한 Rman 접속 kmmepr02[#/oracle/ora11g] rman target / catalog rman/rman01@rman run { allocate channel ch00 type 'sbt_tape'; restore controlfile to '/recover3/test2/datafile/test2.ctl' from 'c-604386621-20121215-1c'; release channel ch00; } --> '/c-604386621-20121215-1c' 해당정보는 RMAN의 'list backupset;' 명령을통해해당시점확인후 "Handle" 번호입력. Handle: bk_7372_1_802112842 ==> Datafie Handle: c-604386621-20121215-1a ==> Control File & spfile Handle: al_7377_1_802113139 ==> Archivelog 28

STEP 3. Duplicate 생성 Duplicate 생성을위해서는 Taget/Catalog/Auxiliary 에접속하고 Auxiliary 에 Duplicate 가생성됨 kmmepr02[#/oracle/ora11g] rman target sys/qkrtm123@kmqcdg_imsi catalog rman/rman01@rman auxiliary / run { allocate auxiliary channel ch00 type 'SBT_TAPE' parms="env=(nb_ora_policy=kmmepe04_ora_full_kmqcdg2,nb_ora_clien T=kmmepe04_exa,NB_ORA_SERV=kmmepr01)"; allocate auxiliary channel ch01 type 'SBT_TAPE' parms="env=(nb_ora_policy=kmmepe04_ora_full_kmqcdg2,nb_ora_clien T=kmmepe04_exa,NB_ORA_SERV=kmmepr01)"; allocate auxiliary channel ch02 type 'SBT_TAPE' parms="env=(nb_ora_policy=kmmepe04_ora_full_kmqcdg2,nb_ora_clien T=kmmepe04_exa,NB_ORA_SERV=kmmepr01)"; allocate auxiliary channel ch03 type 'SBT_TAPE' parms="env=(nb_ora_policy=kmmepe04_ora_full_kmqcdg2,nb_ora_clien T=kmmepe04_exa,NB_ORA_SERV=kmmepr01)"; set until time "TO_DATE('2012/12/15 18:00:00','YYYY/MM/DD HH24:MI:SS')"; set newname for database to '/recover3/test2/datafile/%b'; duplicate target database to "TEST2" nofilenamecheck logfile '/recover3/test2/onlinelog/redo01.dbf' size 512M, '/recover3/test2/onlinelog/redo02.dbf' size 512M, '/recover3/test2/onlinelog/redo03.dbf' size 512M ; release channel ch00; release channel ch01; release channel ch02; release channel ch03; } 29

RMAN Issues STEP 4. Open -- Duplicate 생성후, TEST2 재기동 kmmepr02[#/oracle/ora11g] sqlplus / as sysdba TEST2: SYS> shutdown immediate; TEST2: SYS> startup; 30