07 October 2009

How to take Hot Backups without RMAN?

Source --> Production database

Target --> Test Database

Follow the Steps to perform Hot Backup:


1. On Production database or Source

Login to SQLPLUS:

sqlplus '/ as sysdba'

SQL>set echo on termout on

SQL>spool /home/oracle/hotbackup.log --- This is a good practice to trace all the errors or issues encountered during hot backup -- Optinal

SQL>select 'Hot Backup to disk started at '||to_char(sysdate, 'DD-MON-YY HH24:MI:SS') StartTime from dual; ---- Backup start indication time -- Optional

SQL> select tablespace_name from dba_data_files; -- To list all the tablespaces in the database.

SQL> Alter tablespace SYSTEM begin backup;



SQL>!cp /home/oracle/.../system.dbf /home/backup/.../

SQL>alter tablespace end backup;

Repeat and list this step until you do it for all the tablespaces in your database.

Please note that this is a manual and very basic method of doing a hot backup on the database. We can automate this process but that will be complicated for beginners.

SQL> select 'Hot Backup to disk finished at '||to_char(sysdate, 'DD-MON-YY HH24:MI:SS') FinishTime from dual; -- End of Hot backup
SQL> EXIT;

2. Copy all the Archive logs:

SQL> alter system switch logfile; -- Ensure archive switch before copy of archive files for backup.

Copy over all the archived log files from log_archive_dest location and place them in the backup directory.

3. Backup and Copy over controlfile:

SQL> alter database backup controlfile to trace as '/home/oracle/bkctl.sql';

4. Backup Init parameter from $ORACLE_HOME/dbs directory

If you use pfile then directly copy over to backup directory

If you use spfile then use:

SQL> create pfile from spfile='/home/oracle/../sptest.ora

Then copy the resulting init file to the backup area.


End of Hot Backup(Simple)

Note:

1. Make sure you have appropriate disk space for storing backups. If possible clear the backups which are very old or move it to the Tapes.

2. If the database is very huge, then it is suggested to use RMAN where in we can perfoerm incremental backups.



Coming up.. To take backup using RMAN and create RMAN repository...

Keep checking....

No comments:

Post a Comment