Database Reference
In-Depth Information
exeRCiSe 1.4 (continued)
c:\oracle\oradata\orcl\REVEAL_INDEX_01.DBF
c:\oracle\oradata\orcl\SYSAUX01.DBF
c:\oracle\oradata\orcl\SYSTEM01.DBF
c:\oracle\oradata\orcl\TEMP01.DBF
c:\oracle\oradata\orcl\UNDOTBS01.DBF
c:\oracle\oradata\orcl\USERS01.DBF
c:\oracle\oradata\orcl\USERS02.DBF
8 file(s) copied.
8. Having patiently waited for the backup to complete, you now need to take the data-
base out of hot backup mode. Oracle Database 12 c provides the command ALTER
DATABASE END BACKUP for this purpose. You can also back up specific tablespaces
with the ALTER TABLESPACE END BACKUP command:
SQL> alter database end backup;
Database altered.
-- ALTERNATE - Run this for each tablespace to be backed up.
-- alter tablespace users end backup;
9. Next, you need to determine the current log file sequence number. You will need the
earlier log file that you identified and all log files generated during the backup up to
the current log file to be able to restore this backup. The query is the same as the
query against the V$LOG view that we showed you earlier in this chapter:
SQL> select group#, sequence#, status from v$log;
GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
1 13 INACTIVE
2 14 ACTIVE
3 15 CURRENT
In this example, you can see that during the backup you had a log file switch, from
sequence number 14 to sequence number 15. You see that 15 is the current sequence
number. You know now that you will need to back up the logs with sequence num-
bers 14 and 15 in order to be able to restore this backup.
10. You now need to force a log switch so the log with sequence number 15 (the current
online redo log sequence number) will be archived. To do this, you issue the ALTER
SYSTEM SWITCH LOGFILE command. This will cause Oracle to switch to the next log
file (sequence 16), and the current archive log (sequence 15) will be copied to the
archive-log directory by the ARC n processes.
SQL> Alter system switch logfile;
System altered.
Search WWH ::




Custom Search