Tuesday, January 23, 2018

Database backup using RMAN in NoArchivelog mode / Cold backup




If a database runs in NOARCHIVELOG mode, then the only valid database backup is a consistent backup. For the backup to be consistent, the database must be mounted after a consistent shutdown. No recovery is required after restoring the backup.


1. Shutdown database
2. Start database in mount state
3. connect using rman 
4. Perform database backup using "backup database" command
5. Open database


SQL> select log_mode from v$database;

LOG_MODE
------------
NOARCHIVELOG

SQL>
SQL>
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost ~]$
[oracle@localhost ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Sun Jan 21 22:43:55 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 1620115456 bytes
Fixed Size                  2253704 bytes
Variable Size             989858936 bytes
Database Buffers          620756992 bytes
Redo Buffers                7245824 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@localhost ~]$


[oracle@localhost ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Jan 21 22:57:56 2018

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DUCAT (DBID=3782973220, not open)

RMAN> 

RMAN> backup database;

Starting backup at 21-JAN-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/ducat/test01.dbf
input datafile file number=00001 name=/u01/app/oracle/oradata/ducat/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/ducat/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ducat/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ducat/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ducat/users01.dbf
channel ORA_DISK_1: starting piece 1 at 21-JAN-18
channel ORA_DISK_1: finished piece 1 at 21-JAN-18
piece handle=/u01/app/oracle/fast_recovery_area/DUCAT/backupset/2018_01_21/o1_mf_nnndf_TAG20180121T230212_f69mnx3g_.bkp tag=TAG20180121T230212 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:16
Finished backup at 21-JAN-18

Starting Control File and SPFILE Autobackup at 21-JAN-18
piece handle=/u01/app/oracle/fast_recovery_area/DUCAT/autobackup/2018_01_21/o1_mf_s_966032932_f69ms6k7_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 21-JAN-18

RMAN>

RMAN>

RMAN> exit


Recovery Manager complete.
[oracle@localhost ~]$
[oracle@localhost ~]$
[oracle@localhost ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Sun Jan 21 23:08:25 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database open;

Database altered.

SQL>
SQL>  select name ,open_mode,log_mode from v$database;

NAME      OPEN_MODE            LOG_MODE
--------- -------------------- ------------
DUCAT     READ WRITE           NOARCHIVELOG

SQL>

x

No comments:

Post a Comment