1. 오라클 software 설치 (single or rac)
2. 오라클 환경 설정
export ORACLE_BASE=/oracle/app
export ORACLE_HOME=/oracle/app/product/18.8.0.0/db
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=AMERICAN_AMERICA.UTF8
export ORACLE_SID=ORCL
export PATH=$ORACLE_HOME/bin:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin:$PATH
3. 오라클 init(pfile) 파일 생성 및 nomount start
startup nomount pfile='/oracle/app/product/18.8.0.0/db/dbs/initORCL.ora';
4. rman catalog db 접속 및 controlfile 백업본 검색
SELECT session_recid,
TO_CHAR (start_time, 'DD-MM-YYYY HH24:MI:SS') start_time,
input_type,
status,
ROUND (elapsed_seconds / 3600, 1) time_hr,
INPUT_BYTES/1024/1024/1024 IN_GB,
OUTPUT_BYTES/1024/1024/1024 OUT_GB ,
OUTPUT_DEVICE_TYPE
FROM v$rman_backup_job_details
WHERE START_TIME > SYSDATE - 5 ORDER BY start_time desc;
select * from v$rman_output where session_recid=29;
rman
rman > connect catalog rman/rmantest@rmanserver
rman > set dbid=12342343
rman > list backup of controlfile completed between "to_date('2020-04-01', 'YYYY-MM-DD')"
and "to_date('2020-04-06', 'YYYY-MM-DD')"
5. controfile 복구
run {
allocate channel ch1 device type 'disk';
restore controfile from 'c-~~~';
release channel ch1;
}
6. datafile명이 틀릴경우 아래와 같이 수정하여 db restore
rman target / catalog rman/rmantest@rmanserver
set dbid=12342423
run {
allocate channel ch1 device type 'disk';
set newname for datafile 220 to '+DATA/ORCL/test01.dbf';
restore database;
switch datafile all;
release channel ch1;
}
7. archive 적용을 위한 recover 수행
rman target / catalog rman/rmantest@rmanserver
set dbid=12342423
run {
allocate channel ch1 device type 'disk';
set until sequence 124 thread 1;
(or set until time "to_date('2020-04-06:10:30:00', 'yyyy-mm-dd:hh24:mi:ss')"; )
recover database;
switch datafile all;
release channel ch1;
}
8. redo 로그 위치가 틀릴경우 아래와 같이 수정
ALTER DATABASE RENAME FILE '/data/oradata/ORCL/redo01.log' to '+DATA/ORCL/onlinelog/redo01.log';
9. resetlogs 수행 및 에러발생시 조치
alter database open resetlogs;
(redo clear가 필요하면 => alter database clear unarchived logfile group 5;)
10. 새로운 temp 파일 생성
alter tablespace temp add tempfile '+DATA/ORCL/tempfile/temp01.dbf' size 5G;
11. 기타
rman으로 보조 DB생성후 test.test1 테이블 데이터를 export 수행후 보조 DB는 삭제
RECOVER TABLE test.'test1'
UNTIL TIME "to_date('2020/01/20 01:00:00','yyyy/mm/dd hh24:mi:ss')"
AUXILIARY DESTINATION '/oracle/tmp'
DATAPUMP DESTINATION '/home/oracle'
DUMP FILE 'test1.dmp'
NOTABLEIMPORT;
online 백업 정보를 catalog에 등록
RMAN> catalog start with '/oracle/backup/dailybackup/01-Oct-2018';
RMAN> catalog controlfilecopy '/oracle/backup/dailybackup/01-Oct-2018/control.bak';
'RDB > Oracle' 카테고리의 다른 글
oracle 18c rman 백업 /복구 (0) | 2020.04.24 |
---|---|
oracle 18c flashback database (1) | 2020.04.23 |
오라클 rac disk 백업 복구 (0) | 2020.01.28 |
oracle spm 사용한 sql plan 이관 (0) | 2019.11.22 |
oracle 18c acfs 기능 off (0) | 2019.11.14 |