Академический Документы
Профессиональный Документы
Культура Документы
Database Recovery
Objectives
After completing this lesson, you should be able to:
Recover the control file
Explain reasons for incomplete recovery
Describe incomplete recovery methodology
Recover the database to a specific point in time
using:
User-managed backups
RMAN-managed backups
Enterprise Manager Database Control Console
8-2
Recovery Steps
Archived
log Archived
log Online
Redo log
Changes applied
Undo applied
Restored data
files
1
8-3
3
Copyright 2004, Oracle. All rights reserved.
Recovered data
files
8-4
Or
SQL> RECOVER DATAFILE
2> '/oradata/indx01.dbf'
8-5
Flash Recovery
Area
RECOVER DATABASE;
ALTER DATABASE OPEN
RESETLOGS;
Control
File
Database
8-6
SYSTEM
USERS
Redo log
file 1A
SYSAUX
INDEX
UNDO
TEMP
Control
files
Parameter
File
Password
File
Redo log
file 1B
8-8
8-9
User
process
Server
process
PGA
Server
process
PGA
SGA
8-10
Large Pool
Data
buffer
Redo log
buffer
SMON
Parameter
file
Password
file
Locks
1
Data file 1
1
Control
files
1
Data file 2
1
Data file 3
Database
Shared pool
Shared SQL
and PL/SQL
Data dict.
cache
LGWR ARCn
1
Redo log
file 1
0
Redo log
file 2
Archived
log files
8-11
8-12
8-14
8-16
146
Control
files
146
Data file 2
146
Data file 3
1
Data file 1
1
Data file 2
1
Data file 3
146
Redo log
file 1
145
Redo log
file 2
OE.ORDERS
Database
1
Control
files
1
Redo log
file 1
0
Redo log
file 2
OE.ORDERS
Recovered Database
8-17
1
2
3
144
Data file 1
144
Data file 2
144
Data file 3
146
Control
files
146
Redo log
file 1
145
Redo log
file 2
OE.ORDERS
Restored Database
144
Archived
log file
Shutdown database
Restore data files
Mount the database
Recover the database
Open database with RESETLOGS option
Backup the database
SQL>
$ cp
SQL>
SQL>
SQL>
SQL>
$ cp
8-18
shutdown immediate
/BACKUP/* /u01/db01/ORADATA
startup mount
recover database until time '2004-05-28:11:44:00';
alter database open resetlogs;
shutdown;
/u01/db01/ORADATA/* /BACKUP
8-20
8-21
8-22
8-23
8-24
RUN {
SET UNTIL TIME = '2004-05-28:11:44:00';
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS; }
8-26
RUN {
SET UNTIL SEQUENCE 120 THREAD 1;
ALTER DATABASE MOUNT;
RESTORE DATABASE;
RECOVER DATABASE; # recovers through log 119
ALTER DATABASE OPEN RESESTLOGS;
}
8-27
8-28
8-29
8-30
8-31
8-32
t1
Backup
taken
8-33
t2
t3
Incomplete
recovery
performed
Open with
RESETLOGS
t4
Full backup
t5
Recovery
needed
LOG_ARCHIVE_FORMAT="LOG%t_%s_%r.arc"
SQL> SELECT recid, thread#, sequence#,
2
resetlogs_change#, resetlogs_time
3 FROM
v$log_history;
SQL> SELECT recid, file#,
2
resetlogs_change#, resetlogs_time
3 FROM
v$offline_range;
SQL> SELECT incarnation#, resetlogs_id,
2
prior_incarnation#, status
3 FROM
v$database_incarnation;
8-34
Summary
In this lesson, you should have learned how to:
Recognize a situation that requires incomplete
recovery
Describe the incomplete recovery methodology
Recover the database to a specific point in time
using:
User-managed backups
RMAN-managed backups
Enterprise Manager Database Control Console
8-36
8-37