Sunday, March 23, 2008

Backup Files

What To Back Up:

· Datafiles (for all tablespaces)

· Control Files (binary and textual versions)

· Redo Log Files (cold backups only, not hot backups)

· Archive Log Files (archived redo logs, if archivelog mode is enabled)

· Parameter Files (init.ora; like $ORACLE_HOME/dbs/initPROD.ora)

· Password Files (like $ORACLE_HOME/dbs/orapwdPROD, if used)

Note:- RedoLog Files not to be included in the Hot Backups

List the Data Files, Temp File, Control file and Redo Log files to be included later in the backup:
V$datafile; v$tempfile; v$controlfile; v$logfile; dba_data_files; dba_temp_files; v$archived_log;

SQL> SELECT t.name tab_name, substr(f.name,0,45) datafile

from v$tablespace t, v$datafile f

where t.ts# = f.ts#

order by t.name;

SQL> select name from v$tempfile;

SQL> select name from v$controlfile;
SQL> column member format a45

SQL> select group#, member from v$logfile order by group#;

To get the list of archive log files for the last 5 days
SQL> select name from v$archived_log
where trunc(completion_time) >= trunc(sysdate)-5;

No comments: