티스토리 뷰
<FLASHBACK DATABASE>
Flashback 실습을 하기 위해 망가뜨릴 계획
SYS@orcl>create user tflash identified by tflash; // 새로 유저를 만들고
User created.
SYS@orcl>grant connect, resource to tflash; //권한도 주고
Grant succeeded.
SYS@orcl>conn tflash/tflash
Connected.
TFLASH@orcl>create table ftest //로그인해서 테이블도 만들어 보고
2 (a number);
Table created.
TFLASH@orcl>insert into ftest values(10); // 테이블에 값도 넣어보고
1 row created.
TFLASH@orcl>commit; //커밋!
Commit complete.
TFLASH@orcl>conn hr/hr //hr로 들어가서
Connected.
HR@orcl>create table ftest2
2 as select * from locations; // 테이블도 만들고
Table created.
HR@orcl>drop table emp2; //다른 테이블도 지워본다
Table dropped.
SYS@orcl>select current_scn from v$database; //현재 내 SCN 확인
CURRENT_SCN
-----------
1867596
SYS@orcl>drop user tflash cascade; // 아까 만든 tflash 유저 지워보기
User dropped.
SYS@orcl>shutdown immediate; // 스텝 1. shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@orcl>startup mount // 스텝 2. 마운트상태까지만 열기
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 545263184 bytes
Database Buffers 297795584 bytes
Redo Buffers 5132288 bytes
Database mounted.
SYS@orcl>flashback database to timestamp // 플래시백 명령어 사용
2 to_timestamp('2018/03/29 15:20:00','yyyy/mm/dd hh24:mi:ss');
Flashback complete. // 끝
불완전 복구와 비슷해서 그냥 못 열고 SYS@orcl>alter database open resetlogs; 이걸로 열어야 함
SYS@orcl>alter database open resetlogs;
Database altered.
SYS@orcl>conn tflash/tflash
Connected.
지운 유저가 되살아남 (짝짝짝!)
'DB Admin' 카테고리의 다른 글
SH유저에게 덤프파일 복사해서 IMPORT 하기 (0) | 2018.04.12 |
---|---|
SH 유저 덤프파일 EXPORT (0) | 2018.04.12 |
180329 FLASHBACK DB 실습 1 (환경설정) (0) | 2018.03.29 |
180328 FLASHBACK 7가지 중 FLASHBACK DB를 제외한 나머지 6개 실습 (0) | 2018.03.28 |
180326 불완전 백업(=Point Intime Recovery) (0) | 2018.03.26 |