Saturday, August 29, 2020

Hot and Cold Backup in Oracle

 Hot and Cold Backup in Oracle


Introduction


In Oracle basically we use either offline or Online backups, Offline backup is called as COLD backup and online backup is called HOT backup


Backups are two types---> Physical ------>Files(Control file,Data Files,Redolog files)

                                     |---->Logical--------->Data


These Data/Files need to protect from any disaster for that we need to manage backups


Physical Backup: physical backups will have interms of Files using Hot and Cold backup we can take backups


Cold Backup:


Cold backup is a physical backup in which all the files of a  database are copied without any change means it avoids the risk of copying data and hence the image copy is 

can be easily moved to another system having the same operating system,it is the safest way of take back up of All data in the database that is controlfile(.ctl files),Datafiles(.dbf files)

and Redolog files(.logfiles) Cold back are not recommended to take backup for larger databases it will take more time and space consumption client will not accept down time


Process


While taking cold backup 


Shutdown the instances


Complete full consistent backup


Traditional backup


Steps


1. Shutdown instances


2.Copy the Physical files using unix cp command


Note: /orabackup/prod/cold


$ mkdir -p /orabackup/prod/cold


shutdown immediate


Taking db files backup


$ cp /oradata/prod/*.dbf         /orabackup/prod/cold


or


$ cp /oradata/prod


$cp * /orabackup/prod/cold



Taking Control files backup


$ cp /oradata/prod/*.ctl        /orabackup/prod/cold


or


$ cp /oradata/prod


$cp * /orabackup/prod/cold


Taking redolog files backup


$ cp /oradata/prod/*.log        /orabackup/prod/cold


or


$ cp /oradata/prod


$cp * /orabackup/prod/cold



Hot Backup


Hot backup is also physcial backup including the risk of copying data because during the hot backup the database is totally open and available for users that is online.when a full backup of database is required for the hotbackup

 database must be running in the ARCHIVELOG mode, 


Is a inconsistent backup


is incomplete backup


is  a traditional backup


while hot backup ,database must be up and running also database be in archivelog mode,while in hot backup mode ,The database must be freezed can read but cannot write into datafiles so the changes are written into archivelog files tills ends,once the backup ended ,the changes are recovered into datafiles from archivelog


Process


1.archivelog mode


2.begin backup mode


3.copy the files


4.end backup


1. SQL> archive log list


2. SQL> select files #,status from v$backup;


3. SQL> alter database begin backup;


4. $ cp /oradata/prod/*.dbf   /orabackup/prod/hot


5.SQL> alter database end backup


6 . SQL> alter database  backup controlfile to '/orabackup/prod/hot/control01.bkp' ;



Note : Info on hot and cold backup it may be differ in your environment like production,testing,development and directory structures and naming conventions


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME OR SUBSCRIBE ME 


ITIL Process

ITIL Process Introduction In this Blog i am going to explain  ITIL Process, ITIL stands for Information Technology Infrastructure Library ...