Database Reference
In-Depth Information
exeRCiSe 1.4 (continued)
3. Having determined which data files need to be backed up, you need to know where
the archived redo logs are being copied to.
SQL> show parameter log_archive_dest_1
NAME TYPE VALUE
-------------------------- ----------- ------------------------------
log_archive_dest_1 string location=c:\oracle\arch\orcl
4. You should note the current online redo log sequence number at this point. You will
need this, plus all log sequences generated during the backup, to be able to perform
your recovery. You can get this number from the V$LOG view:
SQL> select group#, sequence#, status from v$log;
GROUP# SEQUENCE# STATUS
---------- ---------- ----------------
1 13 INACTIVE
2 14 CURRENT
3 12 INACTIVE
In this case, you see that you will need all log files from sequence number 14 on in
order to restore the backup you are preparing to use.
5. You now need to put the database in hot backup mode. Oracle Database 12 c provides
the command ALTER DATABASE BEGIN BACKUP for this purpose. You can also back up
specific tablespaces with the ALTER TABLESPACE BEGIN BACKUP command:
SQL> alter database begin backup;
Database altered.
-- ALTERNATE - Run this for each tablespace to be backed up.
-- alter tablespace users begin backup;
6. The database data files are now ready to be backed up. You will copy the files to a
directory that you will create called c:\backup\orcl\backup2 :
SQL> host mkdir c:\backup\orcl\backup2
7. Now copy all the database data files to this directory. In this case, all the files are in
the directory c:\oracle\oradata\orcl , and the filenames all end with an extension
of .DBF , so the command to copy them is pretty easy. Once you have started the data
file copy, go get something to eat. It might take a while.
SQL> host copy c:\oracle\oradata\orcl\*.dbf c:\backup\orcl\backup2
c:\oracle\oradata\orcl\REVEAL_DATA_01.DBF
Search WWH ::




Custom Search