Let us we discuss about how to take a backup using uman?  

what is uman backup?

-Uman backup  is traditional backup  method we just  copied the files from current location into another location.

-Uman backup has two types

* Hot Backup/Online Backup/Inconsistent Backup

* Cold Backup/Offline Backup/Consistent Backup  

What is Inconsistent Backup?

-Inconsistent  backup  is taken when the database is running  online and up this  is also called as 'Hot Backup'.

-While doing hot backup  the data file have old and new transactions  in database.

-Which means the backup datafile  contain data taken from different points in time.

-Oracle recovery makes inconsistent backups consistent by reading all archived and online redo logs, starting with the earliest SCN in any of the datafile headers, and applying the changes from the logs back into the datafiles.

-For example the database is must be  running on 24  hours a day,seven days  a week  then we have a no choice to  take inconsistent backup of whole database,so we just take backup of  archive logs which  needs our database in archive log mode -A backup of online datafiles is called "Online backup"

-An inconsistent backup is a backup of one or more database files that you make while the database is open or after the database has shut down abnormally.

Steps for hot backup

S-1: check  your database whether  the archive log is enabled  or not

select log_mode from V$database;

(Note : if your database in noarchive mode see this link to enable archive mode http://ampersandacademy.com/tutorials/enable-disable-archive-log-mode-oracle-11g  )

S-2: Once we enabled archive log mode check our  path location and mode

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/product/11.2.0.3/oradata/orcl/arch
Oldest online log sequence     5
Current log sequence           7

S-3: To view the datafiles available in our database

SQL>select  name  from V$datafile;

S-4: To view the control file location in database

SQL>select  name from V$controlfile;

S-5: to view logfiles available on database

SQL>select  member  from V$logfile;

S-6: check  the current sequence number of our database

SQL> select group#, sequence#, status from v$log;
 GROUP# SEQUENCE# STATUS
 ---------- ---------- ----------------
 1 5 INACTIVE
 2 6 INACTIVE
 3 7 CURRENT

S-7: To view backup status of our database

SQL> select * from V$backup;

Here shows not active because we are not started to take backup

S-8: Now we started backup begin

SQL>Alter database begin backup;

S-9: Cross check our backup

SQL> select * from V$backup;

Here now it's showing  active so the backup is initiated now go to  location

[oracle@oracle11g~]cd $ORACLE_BASE/oradata/orcl

S-10: to view listed of files in location

[oracle@oracle11g orcl]ls -lrt

S-11: To create folder for  backup location

[oracle@oracle11g orcl]mkdir -p /u02/backup/

S-12: copy all files into  our backup folder

[oracle@oracle11g orcl]cp * /u02/backup/

S-13: now go to  sql location  and end the backup

[oracle@oracle11g orcl]sqlplus '/as sysdba'

SQL> alter database end backup;

now the entire database has been backup through  hot backup

S-14: To verify  our backup whether  we  took all archived backup or not

SQL> select group#, sequence#, status from v$log;
 GROUP# SEQUENCE# STATUS
 ---------- ---------- ----------------
 1 5 INACTIVE
 2 6 INACTIVE
 3 7 CURRENT

forcefully we need to switch the logfile in order to archive current log sequence number. i.e 7

SQL>Alter system switch logfile;
 System altered.

to view the current sequence number

SQL> select group#, sequence#, status from v$log;
 GROUP# SEQUENCE# STATUS
 ---------- ---------- ----------------
 1 8 CURRENT
 2 6 INACTIVE
 3 7 ACTIVE

We can perform hot backup at tablespace level and control file level To Tablespace Level To start  db backup

SQL>Alter  tablespace users begin backup;

End backup command

SQL>Alter  tablespace users end backup;

 Take control file backup in text format

SQL>alter  database backup controlfile to trace as '/u01/backup.cont.txt';

.ctl format

Alter  database backup controlfile to '/u01/backup/control02.ctl';

  What is consistent Backup?

-Consistent backup is one where the database has been shut down,This is also called a 'Cold backup'

-Shut the database and taking the backup -Cold Backup is the backup contain all the data taken from a same point in time

-The only way to make a consistent whole database backup is to shut down the database with the Normal,Immediate, or Transactional options and make the backup while the database is closed. If a database is not shut down cleanly

Steps for Cold Backup

S-1: shut db

SQL>shut immediate;

S-2: go to db location

[oracle@oracle11g~]cd $ORACLE_BASE/oradata/orcl

S-3: copy the file and paste it on another place

{oracle@oracle11g orcl]$cp * /u02/app/backup/data/

S-4: start the database

SQL> startup