Different backup scenarios with out RMAN


Cold backups is also called as offline backup
In order to take a cold backup we need to shutdown the database gracefully

Make sure database always runs in the archive mode , if not we cannot perform the recovery . That means oracle applies the archive logs in the same sequence, if any of the archive log is missing oracle will not apply the rest of the archives

whenever we perform the incomplete recovery we are going to open the database within reset logs . That means oracle will generate new incarnation number and create brand new redo logs starting with log sequence number (0,1)(old version) or (1,2) (new version)

Whenever we loose the current online redologs and the current control file the type of recovery we perform is the incomplete recovery


STEPS TO TAKE COLD BACKUP:
==========================
SHUTDOWN THE DATABASE GRACEFULLY
COPY THE CRD FILES TO THE BACKUP DESTINATION AT OS LEVEL

WHAT IS INCARNATION NUMBER:
============================
when ever you are going to create a database oracle assigns one unique incarnation numb er to the database.
> select incarnation#,resetlogs_change#,resetlogs_id,prior_resetlogs_change#,status from v$database_incarnation.


Steps to take the cold backup;
===============================

1.shutdown the database
2.copy the CRD files to backup location
3.startup the database


EG:
====
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     12
Next log sequence to archive   14
Current log sequence           14
SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/system01.dbf
/u01/app/oracle/oradata/orcl/sysaux01.dbf
/u01/app/oracle/oradata/orcl/undotbs01.dbf
/u01/app/oracle/oradata/orcl/users01.dbf
/u01/app/oracle/oradata/orcl/example01.dbf
/u01/app/oracle/product/11.2.0/dbhome_1/dbs/sam.sbf

6 rows selected.

SQL> select member  from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/redo03.log
/u01/app/oracle/oradata/orcl/redo02.log
/u01/app/oracle/oradata/orcl/redo01.log

SQL>  select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/control01.ctl
/u01/app/oracle/flash_recovery_area/orcl/control02.ctl

SQl> shut immediate


Loss of Full database:
=====================
1.shutdown the database using 'shut abort'
2.Restore yesterdays backup;
3.mount the database
4.Recover automatic database using  the backup control file until cancel
5.alter database open resetlogs;


Loss of Non - system datafile:
==============================
1. Alter database datafile <path> offline;
2. Restore the datafile by using cp command from the available backup
3.recover datafile <path> or <datafile number>
4.alter database datafile <path> or <dbfno > online;

Tablespace offline method:
=========================
1.Alter tablespace <name> offline;
2.restore the datafile using the cp command
3.recover tablspace <name>
4.Alter tablespace <name> online;

Loss of System Datafile:
=======================
1.shut abort
2.restore system.dbf from latest backup
3.startup mount
4.Recover database
5.Alter database open

Loss of sysaux.dbf:
==================
1.make the sysaux.dbf offline.
2.restore sysaux.dbf from latest backup
3.recover datafile <path> or <number>
4.Alter database datafile <number> online;


Loss of control file:
====================

1.shut abort
2.restore the control file from the latest cold backup
3.startup mount
4.alter database recover automatic database using backup control file
5.Alter database open

Loss of online redolog files;
============================
1.shut abort
2.restore the datafiles from previous latest backup
3.startup mount
4.recover database until cancel
5.alter database open resetlogs;

Loss of datafile without having backup:
======================================

1.alter database datafile <path> offline
2.alter database create datafile <path>
3.recover datafile <path>


What is HOT Backup:
===============
It is the backup taken while the database is up and running
It is also called as online backup or inconsistent backup
In order to take the backup we need to keep the table-space in begin backup mode
During this phase headers of the data-files wil be freezed and only redo logs will be heavily archived as it contains information of data buffer cache as split blocks and also oracle will not generate or update the SCN


Steps for hot backup:
===============

Note: in this case we are not going to backup the online redo-log files since they were continuously getting modified by the business users

1. keep the table-space in begin backup mode
2. take the backup of all the data-files of that particular table-space which is in begin backup mode
3. end the backup of the table-spaces which is in begin backup
4. repeat step 1 to 3 for the remaining table-spaces
5. Take the backup of the control file at oracle level
6.alter system switch logfile


at  the end of the every hot backup it is mandatory to switch the log-file. this causes a check point and this check point change number will be updates in the control file

Different types of check points

complete ,thread,incremental,table-space,object -level




Comments

Popular posts from this blog

Understanding Terraform

How to make CRS and ASM not to restart after server reboot

How to repair ASM disk header