茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1671767 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
F09_736.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2017/6/8 14:39:37

RMAN Restore Example

There are many ways to restore a database using an RMAN backup - this example assumes you are performing a Disaster-Recovery restore of all data and recovering the entire database with the same SID and the same disk/tablespace layout.

You will need the following information:

Database SID: ________

Database SYS password: ________

Disk layout and sizes: ________

Database ID (DBID): ________

There are 5 steps to recover the database:

1) Create a new (empty) database instance
2) Mount the instance
3) Restore the datafiles
4) Recover the database
5) Reset the logs

1) Create a new (empty) database instance

Configure the new server with same disk layout as the original database - if necessary use Symbolic Links (or in Windows use disk manager to re-assign drive letters.)

Ensure you have enough disk space for both the backup files plus the restored database files.


Create a new database with the database configuration assistant (DBCA) and set the SYS password and global database_nameto the same as the original database.

If the database to be restored is in archive log mode, set the LOG_ARCHIVE_FORMAT parameter to match the setting in the original database.

The ORAPWD utility can also be used to change the SYS password.

Set the environment variable NLS_LANG for your character set -
NLS_LANG=American_America.WE8ISO8859P1

2)  Mount the empty instance

SQL> Shutdown immediate;
SQL> Startup mount;

or specifying the pfile explicitly:

SQL> CREATE PFILE='C:\oracle\Database\initLive.ora' FROM SPFILE;
SQL> Shutdown immediate;
SQL> Startup mount pfile=C:\oracle\Database\initLive.ora

3) Restore the datafiles


In this case we have copied the RMAN backup files and archive logs to R:\Rman\

Change the dbid to match that of the database being restored

RMAN> SET dbid = 477771234;

RMAN> run {
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT 'R:\Rman\%U';
restore database;
}

At this point the datafiles and tablespaces will be re-created. For a large database it can take a long time to restore each tablespace - for better performance during a restore place the RMAN backup files on a separate disk to the Oracle datafiles to reduce disk contention.

4) Recover the database

SQL> Recover from 'L:\oradata\live' database until cancel using backup controlfile;
SQL> cancel

5) Reset the logs

SQL> alter database open resetlogs;


This will update all current datafiles and online redo logs and all subsequent archived redo logs with a new RESETLOGS SCN and time stamp.

As soon as you have done a resetlogs run a full backup, this is important as should you suffer a second failure you will not be able to perform a second recovery because after resetting the logs the SCN numbers will no longer match any older backup files.

Notes:

The DBID can be retrieved in several places, if the database is running: Select dbid from V$DATABASE;

The RMAN client displays the dbid at startup when connecting to a database:

Copyright (c) 1995, 2003, Oracle. All rights reserved.
connected to target database: RDBMS (DBID= 7776644123)

The default filename format for an RMAN controlfile autobackup is c-IIIIIIIIII-YYYYMMDD-QQ, where: IIIIIIIIII is the DBID.


“This only is denied even to God: the power to undo the past” - Agathon

Related Commands:

BACKUP - Back up database files, archive logs, backups, or copies.
CROSSCHECK - Check whether backup items still exist.
LIST - List backups and copies
RECOVER - Perform media recovery from RMAN backups and copies.
RESTORE - Restore RMAN backups and copies.
REPORT - Report backup status: database, files, backups
RUN - Some RMAN commands are only valid inside a RUN block.

SET - Settings for the current RMAN session.
SHOW - Display the current configuration


原文出處:RMAN Restore example - Oracle - SS64.com
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|