Oracle 11g RMAN備份-一致備份

yuntui發表於2016-11-03

--調整為非歸檔模式

sys@TESTDB11>shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

--啟動到mount狀態

sys@TESTDB11>startup mount;

ORACLE instance started.

 

Total System Global Area  855982080 bytes

Fixed Size                  2230792 bytes

Variable Size             641730040 bytes

Database Buffers          209715200 bytes

Redo Buffers                2306048 bytes

Database mounted.

--如果開啟了閃回日誌,則要關閉閃回日誌

sys@TESTDB11>alter database flashback off;

--改變為非歸檔模式

Database altered.

 

sys@TESTDB11>alter database noarchivelog;

 

Database altered.

--開庫

sys@TESTDB11>alter database open;

 

Database altered.

--檢視已經執行於非歸檔模式

sys@TESTDB11>archive log list;

Database log mode              No Archive Mode

Automatic archival             Disabled

Archive destination            /archive2

Oldest online log sequence     22

Current log sequence           24

 

--登入rman後關庫

RMAN> shutdown immediate;

 

using target database control file instead of recovery catalog

database closed

database dismounted

Oracle instance shut down

 

--不能進行備份

RMAN> backup database;

 

Starting backup at 2013-08-14 05:42:26

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 08/14/2013 05:42:26

RMAN-06171: not connected to target database

 

--進入nomount狀態,仍然不能進行備份

RMAN> startup nomount;

 

connected to target database (not started)

Oracle instance started

 

Total System Global Area     855982080 bytes

 

Fixed Size                     2230792 bytes

Variable Size                641730040 bytes

Database Buffers             209715200 bytes

Redo Buffers                   2306048 bytes

 

RMAN> backup database;

 

Starting backup at 2013-08-14 05:43:17

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=18 device type=DISK

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 08/14/2013 05:43:18

ORA-01507: database not mounted

 

--只有在mount狀態下才可進行備份,原因是rman需要控制檔案中的資訊,同時需要向控制檔案中儲存資訊

RMAN> mount database;

 

database mounted

released channel: ORA_DISK_1

 

--進行全庫一致性備份

RMAN> backup database;

 

Starting backup at 2013-08-14 05:48:27

configuration for DISK channel 2 is ignored

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=18 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=00001 name=/oradata/system01.dbf

input datafile file number=00002 name=/oradata/sysaux01.dbf

input datafile file number=00005 name=/oradata/example01.dbf

input datafile file number=00003 name=/oradata/undotbs01.dbf

input datafile file number=00007 name=/oradata/fbtbs01.dbf

input datafile file number=00008 name=/oradata/users02.dbf

input datafile file number=00006 name=/oradata/newts01.dbf

input datafile file number=00004 name=/oradata/users01.dbf

channel ORA_DISK_1: starting piece 1 at 2013-08-14 05:48:28

channel ORA_DISK_1: finished piece 1 at 2013-08-14 05:51:01

piece handle=/pooldisk02/backup03/20oh8i5c_1_1 tag=TAG20130814T054828 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:02:33

Finished backup at 2013-08-14 05:51:01

 

Starting Control File and SPFILE Autobackup at 2013-08-14 05:51:01

piece handle=/u01/app/oracle/fast_recovery_area/TESTDB11/autobackup/2013_08_14/o1_mf_s_823412526_90pr8psq_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 2013-08-14 05:51:04

 

--開啟歸檔模式

sys@TESTDB11>shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

--啟動到mount狀態

sys@TESTDB11>startup mount;

ORACLE instance started.

 

Total System Global Area  855982080 bytes

Fixed Size                  2230792 bytes

Variable Size             641730040 bytes

Database Buffers          209715200 bytes

Redo Buffers                2306048 bytes

Database mounted.

--修改為歸檔模式

sys@TESTDB11>alter database archivelog;

 

Database altered.

--檢視歸檔模式

sys@TESTDB11>archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            /archive2

Oldest online log sequence     22

Next log sequence to archive   24

Current log sequence           24

--開庫

sys@TESTDB11>alter database open;

 

Database altered.

 

--將原來所有備份刪除,包括剛做的一致性備份

RMAN> delete backup;

 

--開歸檔之後要做一個整庫備份(非一致性的)

RMAN> backup database;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30633755/viewspace-2127656/,如需轉載,請註明出處,否則將追究法律責任。

相關文章