完整的全庫備份(供資料庫遷移用)

skyin_1603發表於2016-11-14

這裡的講述一個完整的全庫備份:備份中包括全部資料檔案,控制檔案,引數檔案和歸檔日誌檔案。
這樣就可以使用該備份進行資料庫遷移。

---進入rman:
[oracle@oracle ~]$ rman target / 

Recovery Manager: Release 11.2.0.4.0 - Production on Mon Oct 10 17:49:51 2016

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

connected to target database: ORA11GR2 (DBID=238796283)

---進行全庫備份:

RMAN> backup as backupset full database include current controlfile plus archivelog format '/u01/app/backup/db_%U.rmn' delete all input;

... ...

Starting backup at 10-OCT-16

current log archived

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=51 device type=DISK

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

... ...

Starting backup at 10-OCT-16

using channel ORA_DISK_1

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=/u01/app/oracle/oradata/ORA11GR2/system01.dbf

input datafile file number=00002 name=/u01/app/oracle/oradata/ORA11GR2/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/ORA11GR2/example01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/ORA11GR2/undotbs01.dbf

input datafile file number=00006 name=/u01/app/oracle/oradata/ORA11GR2/ts_ora11gr2_01.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/ORA11GR2/test01.dbf

input datafile file number=00008 name=/u01/app/oracle/oradata/ORA11GR2/MYTEST02.dbf

input datafile file number=00009 name=/u01/app/oracle/oradata/ORA11GR2/ts_audit01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/ORA11GR2/users01.dbf

channel ORA_DISK_1: starting piece 1 at 10-OCT-16

channel ORA_DISK_1: finished piece 1 at 10-OCT-16

piece handle=/u01/app/backup/db_0ari1305_1_1.rmn tag=TAG20161010T150437 comment=NONE

piece handle=/u01/app/backup/db_0bri135o_1_1.rmn tag=TAG20161010T150437 comment=NONE

... ...

Starting backup at 10-OCT-16

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=58 RECID=36 STAMP=924880062

channel ORA_DISK_1: starting piece 1 at 10-OCT-16

channel ORA_DISK_1: finished piece 1 at 10-OCT-16

piece handle=/u01/app/backup/db_0cri135u_1_1.rmn tag=TAG20161010T150742 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

channel ORA_DISK_1: deleting archived log(s)

archived log file name=/u01/app/FRA/ORA11GR2/archivelog/2016_10_10/o1_mf_1_58_czphkxox_.arc RECID=36 STAMP=924880062

Finished backup at 10-OCT-16

 

Starting Control File and SPFILE Autobackup at 10-OCT-16

piece handle=/u01/app/FRA/ORA11GR2/autobackup/2016_10_10/o1_mf_s_924880064_czphl11d_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 10-OCT-16

 

[oracle@oracle backup]$ ll

total 3983252

-rw-r----- 1 oracle oinstall  448043520 Sep 25 21:18 db_01rgnirt_1_1.rmn

-rw-r----- 1 oracle oinstall 1246969856 Sep 25 21:21 db_02rgnitc_1_1.rmn

-rw-r----- 1 oracle oinstall    9797632 Sep 25 21:21 db_03rgnj2j_1_1.rmn

-rw-r----- 1 oracle oinstall      60416 Sep 25 21:21 db_04rgnj2r_1_1.rmn

-rw-r----- 1 oracle oinstall  678985728 Oct 10 14:54 db_07ri12bs_1_1.rmn

-rw-r----- 1 oracle oinstall  396577792 Oct 10 15:04 db_09ri12u9_1_1.rmn

-rw-r----- 1 oracle oinstall 1284276224 Oct 10 15:07 db_0ari1305_1_1.rmn

-rw-r----- 1 oracle oinstall    9797632 Oct 10 15:07 db_0bri135o_1_1.rmn

-rw-r----- 1 oracle oinstall     303616 Oct 10 15:07 db_0cri135u_1_1.rmn

 

 

[oracle@oracle archivelog]$ ll

total 24

drwxr-x--- 2 oracle oinstall 4096 Oct 10 15:04 2016_10_05

drwxr-x--- 2 oracle oinstall 4096 Oct 10 15:04 2016_10_06

drwxr-x--- 2 oracle oinstall 4096 Oct 10 15:04 2016_10_07

drwxr-x--- 2 oracle oinstall 4096 Oct 10 15:04 2016_10_08

drwxr-x--- 2 oracle oinstall 4096 Oct 10 15:04 2016_10_09

drwxr-x--- 2 oracle oinstall 4096 Oct 10 15:07 2016_10_10

[oracle@oracle archivelog]$

 

[oracle@oracle autobackup]$ ll

total 8

drwxr-x--- 2 oracle oinstall 4096 Sep 26 14:03 2016_09_26

drwxr-x--- 2 oracle oinstall 4096 Oct 10 15:07 2016_10_10

[oracle@oracle autobackup]$ 

#全庫備份完成,以上是各備份檔案的資訊。

 

--透過以上的備份集,可以把資料庫遷移到一個空庫裡面,達到了資料庫遷移(資料遷移)的目的。



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

相關文章