Oracle RMAN 在一台新機器上恢複另台機器的全備份____Oracle

來源:互聯網
上載者:User

在一台新機器上恢複另台機器的全備份

1 要記住原機器的各種目錄結構和DBID

2 在新機器上建立對應的目錄結構 注意使用者權限
/u01/oracle/admin/dbname/pfile bdump udump dpdump cdump
/oradata/dbname/rman_backup  flash_recover_sea archivelog

3 把備份組檔案放到新機器原來的備份目錄中


3 Rman 串連到預設處

]$ export ORACLE_SID=surgesms
]$ ./rman target /
connected to target database (not started)

3 startup nomount 啟動預設spfile
RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/oracle/product/10.2.0/dbs/initsurgesms.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area     159383552 bytes

Fixed Size                     1218244 bytes
Variable Size                 58722620 bytes
Database Buffers              92274688 bytes
Redo Buffers                   7168000 bytes

4 還原spfile 檔案和控制檔案
RMAN> set dbid 4223770157;
RMAN>  restore spfile from '/oradata/{DB_NAME}/rman_backup/full.bak';
RMAN>  restore controlfile from '/oradata/{DB_NAME}/rman_backup/full.bak';

5退出RMAN 再重進RMAN
RMAN> shutdown
RMAN> EXIT
bin]$ ./rman target /
RMAN> startup mount

6 察看是否使用了控制檔案
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/oradata/{DB_NAME}/rman_backup/full_%d_%s_%T_%t.bak';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/product/10.2.0/dbs/snapcf_{DB_NAME}.f'; # default


7 還原資料庫
RMAN> restore database;

8 恢複資料庫
RMAN> recover database
9 開啟資料庫
alter database open resetlog 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.