Note: archives are not required to take back up with cold backup.
Taking the backup while the database is up and running is called hot backup.
During hot backup database will be in fuzzy state and still users can perform transactions which makes backup inconsistent.
Whenever we place a tablespace or database in begin backup mode, following happens
The corresponding datafiles header will be freezedi.e CKPT process will not update latest SCN
Body of the datafile is still active i.eDBWRn will write the dirty blocks to datafiles
After end backup, datafile header will be unfreezed and CKPT process will update latest SCN immediately by taking that information from controlfiles.
During hot backup, we will observe much redo generated because oracle will copy entire data block as redo entry into LBC. This is to avoid fractured block.
A block fracture occurs when a block is being read by the backup, and being written to at the same time by DBWR. Because the OS (usually) reads blocks at a different rate than Oracle, your OS copy will pull pieces of an Oracle block at a time. What if the OS copy pulls half a block, and while that is happening, the block is changed by DBWR? When the OS copy pulls the second half of the block it will result in mismatched halves, which Oracle would not know how to reconcile.
This is also why the SCN of the datafile header does not change when a tablespace enters hot backup mode. The current SCNs are recorded in redo, but not in the datafile. This is to ensure that Oracle will always recover over the datafile contents with redo entries. When recovery occurs, the fractured datafile block will be replaced with a complete block from redo, making it whole again.
Note: Database should be in archivelog mode to perform hot backup.
STEPS to take hot backup in 9i
[oracle@server1 ~]$ mkdir /u03/hotbkp
SQL> select name from v$datafile;
SQL> select name from v$controlfile;
SQL> alter tablespace system begin backup;
SQL> !cp /datafiles/prod/system01.dbf /u03/hotbkp
SQL> alter tablespace system end backup;
Repeat above steps for all the tablespaces in the database
SQL> !cp /datafiles/prod/*.ctl /u03/hotbkp
SQL>alter system switch logfile;
SQL> !cp /u03/archives/*.arc /u03/hotbkp/archbkp
Taking archive backup is the important step in hot backup