아카이브 백업 완전 복구
시스템 테이블 스페이스를 구성하는 데이터 파일 유실
단계 1 일단 키고
[oracle@localhost ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 8 05:25:49 2007 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning and Oracle Data Mining options
JServer Release 10.2.0.1.0 - Production
단계 2 에제를 위한 테이블 생성
SQL> create table hr.empex 2 as
3 select * from scott.emp 4 ;
Table created.
SQL> commit;
Commit complete.
단계 3 위치 확인 users 테이블 스페이스 인 것 갔지만 위치를 정하지 않은 테이블은 다 우선적으로 시스템 테이블 스페이스에 가있는 다고 한다.
SQL> r 1 select 2 owner 3 ,table_name 4 ,tablespace_name 5 from dba_tables 6 where owner='HR' and 7* table_name='EMPEX' OWNER
--- TABLE_NAME
--- TABLESPACE_NAME
--- HR
EMPEX USERS
단계 4 장애 발생 시스템 테이블 스페이스 맛감
SQL> host
[oracle@localhost ~]$ rm -rf /u01/app/oracle/oradata/orcl/system01.dbf [oracle@localhost ~]$ exit
exit
단계 5 상태 확인 역시 라클이 이래서 고장이지 아닌지 잘 모른 것이다.
SQL> select 2 count(*) 3 from hr.empex;
COUNT(*) --- 14
단계 6 정전 모드 발동 디비 깨진 것을 확인
SQL> shutdown abort;
ORACLE instance shut down.
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 236000356 bytes Fixed Size 451684 bytes Variable Size 201326592 bytes Database Buffers 33554432 bytes Redo Buffers 667648 bytes Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file ORA-01110: data file 1: '/u01/app/oracle/oradata/orcl/system01.dbf'
단계 7 복구 시작 shutdown 상태가 아니라 mount 상태에서 진행한다.
에전에 받은 온라인백업 파일로 시스템 테이블 스페이스를 구성하는 데이터 파일을 복구한다.
오라클은 recover 명령을 수행하면 파일에 대해서 아키이브를 적용시킨다. 그래서 현재 시점까지 복구를 수행한다. 완전 복구 수행
SQL>
SQL> host
[oracle@localhost ~]$ cp /oracle/oradata/onbackup/system01.dbf /u01/app/oracle/oradata/orcl/
[oracle@localhost ~]$ exit exit
SQL> recover database; 중간에 머 적용하라고 나온면 AUTO 라고 한다.
Media recovery complete.
단계 8 더 복구가 필요한지 알아 본다. 아무것도 않나오는건 정상이란 뜻
SQL> select * from v$recover_file;
no rows selected
단계 8 디비를 연다.
SQL> alter database open;
Database altered.
단계 9 데이터 확인 그렀다 살아있다. 백업을 않해놓았는디………
SQL>
SQL> select 2 count(*) 3 from hr.empex;
COUNT(*) --- 14
SQL>