2016年4月20日 星期三

BE Linux Oracle DB 異機還原

條件:
Oracle 版本要與原本相同
DB ID 要相同
         # su - oracle
         # export ORACLE_SID=<實例名>
         # sqlplus "/as sysdba"
     


SQL>select dbid from v$database;                      

SID 要相同
DB 及Archive log路徑可以不同,但也要知道在中異機的路徑
異機也要安裝BE Linux agent並且設定好 oracle agent config
存取Linux OS帳戶要用oracle
存取Oracle DB帳戶要用sys
要讓DB 處於nomount模式  方可還原


BE端:
BE 設定中的oracle 項目要加入異機,帳戶選用OS帳戶 (oracle)
還原選 用Control file還原,才會有異機還原選項




可參考
https://www.veritas.com/support/en_US/article.TECH60371

How to perform a redirected restore of an Oracle Server to another Oracle Server using Backup Exec for Windows Servers

For Backup Exec 11d and Backup Exec 12.0 the folder structure for Oracle should be the same on the target server as on the original server. For Backup Exec 12.5  and later this is no longer a requirement. (For details please refer to:  http://www.symantec.com/docs/TECH59307  ).


To recover the complete Oracle Instance or database after it has been lost, deleted, or destroyed, a new or alternate Oracle Server must be used for the recovery per the following:

1. Recreate the Oracle Database using the same name used for the original database
that is no longer available.

2. Locate and rename the pwd<SID>.ora file. Make note of the path to this file for use in Step 3b.

3. Create a new pwd<SID>.ora file.  To create a new pwd<SID>.ora file:
         a. Open a command prompt.
         b. Type the following command:

orapwd file="path from Step 2"\pwd<sid>.ora password=<password>
Example: C:\> orapwd file=c:\oracle\product\10.2.0\db_1\database\pwdORCL1.ora password=NEWpasswordNote: Backup Exec Remote Agent must be installed and configured for Oracle database access (http://www.symantec.com/docs/HOWTO24330)

Continue the disaster recovery:

4. At a command prompt, type the following command: SQLplus / as SYSDBA
5. Type SHUTDOWN IMMEDIATE;
6. Type STARTUP NOMOUNT;   <-------基本上到這步就可以嘗試啟動還原看看了
7. Exit Sqlplus and launch RMAN from the command prompt.
8. Type SET DBID=dbid ID;
Note: This dbid MUST be identical to the dbid from the original Oracle instance. Type EXIT when complete.
9. Move to the Backup Exec Media Server.

10. On the navigation bar, click the arrow next to Restore, then click New Restore Job.
11. On the Properties pane, under Source, click Selections.
12. Select the appropriate Control File to restore.
13. On the Restore job properties pane, under Destination, click Oracle Redirection.
14. Enable the check box for the option, Restore Oracle instance to server. Enter account credentials to access the new or alternate Oracle Server.
If the Oracle datafiles and archive logs are stored on a different location on the target server, enable "Redirect Oracle files to path" option  and specify the valid paths for the datafiles and archive logs. Click Run Now to run the restore job.

Note: The restore job will fail because the recovery portion encounters inconsistent archive logs. This is a normal occurrence during a disaster recovery.


15. Move to the Oracle server and launch SQLplus / as SYSDBA from command prompt.

16. Type alter database open resetlogs;

If an error is encountered while Oracle tries to open the database document the online redo log path and then update the path
using the steps below.

To update the online redo log file path:

a. At the Oracle server, open a command prompt.

b. Type the following command:

SQLPLUS /nolog

c. Type connect<sys/password@SID>;

d. Type the following SQLPlus command:

SQLPLUS ALTER DATABASE RENAME FILE <old path from backup to any redolog file name> to <path to expected restored redolog file name>;

For example:

ALTER DATABASE RENAME FILE 'D:\ORACLE\ORADATA\JACOB\REDO01.LOG' to
'C:\ORACLE\ORADATA\JACOB\REDO01.LOG';

e. In the command prompt, type RMAN, then type the following command at the RMAN prompt:

alter database open resetlogs;

f. Close the command prompt.  The recovery should now be complete.


Terms of use for this information are found in Legal Notices.

沒有留言:

張貼留言