使用DP實現RAC異機恢復
Data Protector軟體(以下簡稱:DP軟體)是以Server ( Cell Manager ) --- Client( Agent ) 方式工作的,Cell Manager一般是指DP軟體的管理端,包含所有的配置資訊和備份資訊(這些資訊都存在DP的內建資料庫IDB中)。
環境:原端和目標端都是HPUX
Clusterware version 11R2
Rdbms version 11R1
滿足的要求:
1.對原端沒有什麼要求。
2.目標端需要安裝好RAC,並安裝好Rdbms軟體。
3.兩端都可以連線同一個DP控制檯。
4.原端使用dp備份完畢。
5.確保目標伺服器和原伺服器的ORACLE_HOME一致(如果不一致可以通過建一個軟連結)。
準備工作
建立一個密碼檔案
該密碼檔案是DP恢復控制檔案時是必需的。因為dp端要通過網路描述符合sys密碼來連線到目標端。
$ id orasrm
uid=1005(orasrm) gid=1010(oinstall)
$ cat .profile
umask 022
export TMP=/tmp
export TMPDIR=/tmp
export GRID_HOME=/pmsdb/11.2.0/grid
export ORACLE_BASE=/pmsdb/oracle
export ORACLE_HOME=$ORACLE_BASE/11.1.0
export PATH=$PATH
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export ORACLE_SID=ZKFP1
export ORACLE_OWNER=orasrm
$ cd $ORACLE_HOME/dbs
$ ll
total 44
-rw-r--r-- 1 orasrm oinstall 8385 Sep 11 1998 init.ora
-rw-r--r-- 1 orasrm oinstall 12920 May 3 2001 initdw.ora
$ orapwd file=orapwZKFP1 password=system entries=5 force=y
在目標機器造一個listener
這裡由於是從dp備份軟體方面將資料恢復到目標機器,所以需要在目標機器上配置好監聽,並提供服務,這樣,dp才可以連線到目標機器。我的目標機器之前一直都是同版本的RAC,也有rdbms軟體,但一直沒有建庫。所以這裡不需要我再按照rdbms,只需要手動配置監聽檔案即可。
需要說明的時,這裡的監聽配置是在oracle使用者下配置的,而非grid使用者。因為此時我們需要的時靜態監聽,因為我們要恢復的是控制檔案,那如果是動態監聽的話,在db沒有mount時dp是不可以連結到目標機器的,所有必須配置靜態監聽才可以。
在oracle使用者下編輯listener.ora和tnsnames.ora:
$ cd $ORACLE_HOME/network/admin
$ ll
total 2
drwxr-xr-x 2 orasrm oinstall 96 Sep 19 2012 samples
-rw-r--r-- 1 orasrm oinstall 187 May 7 2007 shrept.lst
$ cat listener.ora
# listener.ora.i2prddb5 Network Configuration File: /pmsdb/oracle/11.1.0/network/admin/listener.ora.i2prddb5
# Generated by Oracle configuration tools.
SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME=PMSZKFDB)(ORACLE_HOME=/pmsdb/oracle/11.1.0)(SID_NAME=ZKFP1)))
LISTENER_I2PRDDB3 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = I2PRDDB3-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.79.44)(PORT = 1521)(IP = FIRST))
)
)
PMSZKFDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = I2PRDDB3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PMSZKFDB)
)
)
$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /pmsdb/oracle/11.1.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_DB=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=11.12.79.42)(PORT=1521))))
LISTENER_SCAN=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=11.12.79.39)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=11.12.79.40)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=11.12.79.41)(PORT=1521)))
PMSZKFDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.79.44)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PMSZKFDB)
)
)
隨後啟動監聽,啟動時會報錯,說grid下的監聽已經啟動,那使用srvctl stop listener關閉grid下的監聽,然後再啟動oracle使用者下的監聽。
$ lsnrctl start
LSNRCTL for HPUX: Version 11.1.0.6.0 - Production on 24-MAR-2016 11:36:25
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Starting /pmsdb/oracle/11.1.0/bin/tnslsnr: please wait...
TNSLSNR for HPUX: Version 11.1.0.6.0 - Production
System parameter file is /pmsdb/oracle/11.1.0/network/admin/listener.ora
Log messages written to /pmsdb/oracle/diag/tnslsnr/I2PRDDB3/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=I2PRDDB3)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for HPUX: Version 11.1.0.6.0 - Production
Start Date 24-MAR-2016 11:36:25
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /pmsdb/oracle/11.1.0/network/admin/listener.ora
Listener Log File /pmsdb/oracle/diag/tnslsnr/I2PRDDB3/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=I2PRDDB3)(PORT=1521)))
Services Summary...
Service "PMSZKFDB" has 1 instance(s).
Instance "ZKFP1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
$ tnsping pmszkfdb
TNS Ping Utility for HPUX: Version 11.1.0.6.0 - Production on 24-MAR-2016 11:46:15
Copyright (c) 1997, 2007, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 11.12.79.44)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PMSZKFDB)))
OK (0 msec)
$ sqlplus sys/system@pmszkfdb as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Mar 24 10:15:39 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> exit
Disconnected
恢復控制檔案
將控制檔案從磁帶庫恢復到目標伺服器
該步操作在DP介面完成。
首先是要確定需要恢復的控制檔案在哪個session裡。因為備份控歸檔的同時會備份一個控制檔案,所以可以在歸檔的備份裡將控制檔案恢復回來。這裡我們找到了3月10日的備份,將從這裡恢復控制檔案。
登入備份伺服器,執行/opt/omni/bin/xomni
開啟restore選項卡,選擇Oracle Server,在Source選項卡選擇Perform RMAN Repository Restore. 在下方選中CONTROL FILE
FROM DP MANAGED BACKUP
在options裡選擇client,即要恢復的目標機器。如果選錯或者不選問題也不嚴重,因為控制檔案會被DP預設恢復到/var/opt/omni/tmp下,而不會直接覆蓋資料庫的控制檔案。在username和user group中填寫目標機器中的oracle資料庫的使用者名稱和使用者組,這裡是orasrm和oinstall. 此外選擇session ID, 這個可以由上面DP介面獲得。預設是最新的session ID。
上面介面的settings按鈕點開,如下圖所示。這裡填寫創造的密碼檔案裡的密碼和sys,service填寫造出來的listener裡的servicename
在Devices選項卡選擇要使用的磁帶機,也可以不選讓其自己選擇。然後點選restore.
以下就開始恢復了:
需要等待大概幾分鐘的時間,最後會提示回覆成功。
此時在目標機器的/var/opt/omni/tmp下已經有了恢復出來的控制檔案。如下所示:
$ ll /var/opt/omni/tmp
-rw-r----- 1 1000 oinstall 20529152 Mar 10 14:16 ctrl_PMSZKFDB_20910.dbf
將資料庫啟動到nomount狀態
對於spfile,可以從dp恢復,也可以直接用原庫的(如果原庫還可以連線的話)。我這裡就直接將原庫的spfile來過來使用了。
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA_ZKF/pmszkfdb/spfilezkfp.
ora
SQL> create pfile='/home/oraZKF/bak0324.ora' from spfile='+DATA_ZKF/pmszkfdb/spfilezkfp.ora';
File created.
scp bak0324.ora 到目標機器。
$ cat bak0324.ora--將涉及到磁碟組名稱的地方改掉。
*.audit_file_dest='/pmsdb/oracle/admin/PMSZKFDB/adump'
*.audit_trail='db'
*.cluster_database_instances=2
*.cluster_database=true
*.compatible='11.1.0.0.0'
*.control_files='+DATA_SRM/pmszkfdb/controlfile/current.268.760189917'
*.db_block_size=8192
*.db_cache_advice='OFF'
*.db_create_file_dest='+DATA_SRM'
*.db_domain=''
*.db_name='PMSZKFDB'
*.db_recovery_file_dest='+DATA_SRM'
*.db_recovery_file_dest_size=2147483648
*.diagnostic_dest='/pmsdb/oracle'
ZKFP1.instance_number=1
ZKFP2.instance_number=2
*.local_listener='LISTENER_DB'
*.log_archive_dest_1='LOCATION=+DATA_SRM/'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_max_target=20401094656
*.memory_target=20401094656
*.open_cursors=300
*.processes=2500
*.remote_listener='LISTENER_SCAN'
*.remote_login_passwordfile='exclusive'
*.sessions=2755
*.sga_max_size=0
ZKFP2.thread=2
ZKFP1.thread=1
ZKFP1.undo_tablespace='UNDOTBS1'
ZKFP2.undo_tablespace='UNDOTBS2'
兩邊都建立目錄:
$ mkdir -p /pmsdb/oracle/admin/PMSZKFDB/adump
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Mar 23 16:31:32 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL>SQL> create spfile='+DATA_SRM/PMSZKFDB/spfilezkfp.ora' from pfile='/home/orasrm/bak0324.ora';
File created.
編輯本地init引數檔案。內如如下:
$ vi initZKFP1.ora
"initZKFP1.ora" 1 line, 43 characters
SPFILE='+DATA_SRM/PMSZKFDB/spfilezkfp.ora'
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Mar 24 12:06:23 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1.2239E+10 bytes
Fixed Size 2229552 bytes
Variable Size 1666849488 bytes
Database Buffers 1.0565E+10 bytes
Redo Buffers 4362240 bytes
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA_SRM/pmszkfdb/spfilezkfp.
ora
將控制檔案恢復到引數檔案制定的位置
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA_SRM/pmszkfdb/controlfile
/current.268.760189917
$ rman target /
Recovery Manager: Release 11.1.0.6.0 - Production on Thu Mar 24 12:09:30 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: PMSZKFDB (not mounted)
RMAN> restore controlfile from '/var/opt/omni/tmp/ctrl_PMSZKFDB_20910.dbf';
Starting restore at 24-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1832 instance=ZKFP1 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA_SRM/pmszkfdb/controlfile/current.284.907330239
Finished restore at 24-MAR-16
切換到grid使用者下檢視:
$ asmcmd
ASMCMD> pwd
+DATA_SRM/PMSZKFDB/CONTROLFILE
ASMCMD> ls
current.284.907330239
將資料庫啟動到mount狀態
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
恢復資料檔案和歸檔
檢視資料檔案的備份
RMAN> list backup of database completed between "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')" and "to_date('2016-03-16 14:00:00','YYYY-MM-DD HH24:MI:SS')";
RMAN> list backup of database summary completed after "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')";
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
53743 B 0 A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T122358
53744 B 0 A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T122358
53745 B 0 A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T122358
53746 B 0 A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T122358
檢視歸檔的備份
RMAN> list backup of archivelog all completed between "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')" and "to_date('2016-03-16 14:00:00','YYYY-MM-DD HH24:MI:SS')";
RMAN> list backup of archivelog all summary completed after "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')";
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
53731 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53732 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53733 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53734 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53735 B A A SBT_TAPE 01-MAR-16 1 1 NO TAG20160301T080036
53737 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53738 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53739 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53740 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53741 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T114652
53747 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T124644
53748 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T124644
53749 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T124644
53750 B A A SBT_TAPE 04-MAR-16 1 1 NO TAG20160304T124644
53754 B A A SBT_TAPE 10-MAR-16 1 1 NO TAG20160310T141129
53755 B A A SBT_TAPE 10-MAR-16 1 1 NO TAG20160310T141129
53756 B A A SBT_TAPE 10-MAR-16 1 1 NO TAG20160310T141129
53757 B A A SBT_TAPE 10-MAR-16 1 1 NO TAG20160310T141129
可以得出我們之前恢復的控制檔案是3月10號的,是隨歸檔一起備份的控制檔案。而全庫的備份最近的一次是發生在3月4號的。
恢復歸檔檔案
先恢復歸檔檔案還是資料檔案,全屏個人喜好,先恢復哪個都是可以的。
RMAN>run{
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_1' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_2' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_3' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
send device type 'sbt_tape' 'OB2BARHOSTNAME=PMSZKFDB. scan_cluster01.com';
restore archivelog time between "to_date('2016-03-01 00:00:00','YYYY-MM-DD HH24:MI:SS')" and "to_date('2016-03-16 00:00:00','YYYY-MM-DD HH24:MI:SS')";
release channel 'dev_0';
release channel 'dev_1';
release channel 'dev_2';
release channel 'dev_3';
}
ASMCMD> pwd
+DATA_SRM/PMSZKFDB/ARCHIVELOG
ASMCMD> ls -l
Type Redund Striped Time Sys Name
Y 2016_03_24/
ASMCMD> ls 20*
thread_1_seq_18434.334.907340379
thread_1_seq_18435.333.907340379
thread_1_seq_18436.331.907340379
thread_1_seq_18437.329.907340379
thread_1_seq_18438.330.907340379
thread_1_seq_18439.332.907340379
thread_1_seq_18440.354.907340629
thread_1_seq_18441.353.907340629
............................................................
恢復資料檔案
異機恢復,磁碟組不一樣,故而需要使用set newname
在資料庫mount狀態下可以看到有哪些資料檔案,只取file#列。寫set newname命令時可以這樣寫: set newname form datafile file# to ‘+DATA_ZKF’;不需要制定目標檔名即可。
SQL> set pagesize 0
SQL> select 'set newname for datafile '||file#||' to ''+DATA_SRM'';' from v$datafile;
set newname for datafile 1 to '+DATA_SRM';
.................省略.......................................
set newname for datafile 39 to '+DATA_SRM';
24 rows selected.
我的操作如下:
run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_1' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_2' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
allocate channel 'dev_3' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=PMSZKFDB,OB2BARLIST=PMSZKFDB)';
send device type 'sbt_tape' 'OB2BARHOSTNAME=pmszkfdb. scan_cluster01.com ';
set newname for datafile 1 to '+DATA_SRM';
set newname for datafile 2 to '+DATA_SRM';
set newname for datafile 3 to '+DATA_SRM';
set newname for datafile 4 to '+DATA_SRM';
set newname for datafile 5 to '+DATA_SRM';
set newname for datafile 6 to '+DATA_SRM';
set newname for datafile 7 to '+DATA_SRM';
set newname for datafile 8 to '+DATA_SRM';
set newname for datafile 24 to '+DATA_SRM';
set newname for datafile 25 to '+DATA_SRM';
set newname for datafile 26 to '+DATA_SRM';
set newname for datafile 27 to '+DATA_SRM';
set newname for datafile 28 to '+DATA_SRM';
set newname for datafile 29 to '+DATA_SRM';
set newname for datafile 30 to '+DATA_SRM';
set newname for datafile 31 to '+DATA_SRM';
set newname for datafile 32 to '+DATA_SRM';
set newname for datafile 33 to '+DATA_SRM';
set newname for datafile 34 to '+DATA_SRM';
set newname for datafile 35 to '+DATA_SRM';
set newname for datafile 36 to '+DATA_SRM';
set newname for datafile 37 to '+DATA_SRM';
set newname for datafile 38 to '+DATA_SRM';
set newname for datafile 39 to '+DATA_SRM';
restore database from tag 'TAG20160304T122358';
switch datafile all;
release channel 'dev_0';
release channel 'dev_1';
release channel 'dev_2';
release channel 'dev_3';
}
檢視DP,可以看到雖然恢復命令是從rman發起的,但是恢復的任務其實已經交給了DP,下圖是恢復過程中的截圖。
恢復中
恢復完成後的截圖如下:
進行資料庫還原
RMAN> run {
set until time "to_date('2016-03-10 10:00:00','YYYY-MM-DD HH24:MI:SS')";
recover database;
}
開啟資料庫
RMAN> alter database open resetlogs;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 03/24/2016 15:37:29
ORA-19809: limit exceeded for recovery files
ORA-19804: cannot reclaim 630194176 bytes disk space from 2147483648 limit
RMAN> exit
這是由於我沒有改變redo的資訊,資料庫重建redo的時候需要用到flash recovery area. 為了簡單,在這裡直接將flash recovery area放大。
$ sqlplus / as sysdba
SQL> show parameter db_r
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string +DATA_SRM
db_recovery_file_dest_size big integer 2G
db_recycle_cache_size big integer 0
dbwr_io_slaves integer 0
SQL> alter system set db_recovery_file_dest_size=10G;
System altered.
SQL> alter database open resetlogs;
Database altered.
將另一個RAC節點啟動:
配置引數檔案
$ vi initZKFP2.ora
SPFILE='+DATA_SRM/PMSZKFDB/spfilezkfp.ora'
$ export ORACLE_SID=ZKFP2
$ sqlplus / as sysdba
SQL> startup
ORACLE instance started.
Total System Global Area 1.2239E+10 bytes
Fixed Size 2229552 bytes
Variable Size 1666849488 bytes
Database Buffers 1.0565E+10 bytes
Redo Buffers 4362240 bytes
Database mounted.
Database opened.
將db資訊和instance資訊註冊到crs中
由於我的clusterware的版本是11.2,而db的版本是11.1,所以註冊方式可能和都是11.2的rac會不同。
#su – orasrm
$srvctl add database -d PMSZKFDB -o /pmsdb/oracle/11.1.0 -p '+DATA_SRM/pmszkfdb/spfilezkfp.ora' -s 'open' -y AUTOMATIC -r PRIMARY
$srvctl add instance -d PMSZKFDB -i ZKFP1 -n I2PRDDB3
$srvctl add instance -d PMSZKFDB -i ZKFP2 -n I2PRDDB4
修改第一個節點的監聽
在我們用dp恢復控制檔案時,需要在第一個節點配置監聽,所以那時候我將grid下面的監聽關閉,在oracle使用者下手動配置的監聽,現在db恢復完畢後,需要將監聽交給grid來管理,那就需要刪除之前配置的監聽。關閉即可。
I2PRDDB3#[/]su - orasrm
$ lsnrctl stop
I2PRDDB3#[/pmsdb/11.2.0/grid/bin]./srvctl start listener
$ sqlplus sys/system@11.12.79.40:1521/pmszkfdb as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Mar 24 16:38:01 2016
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24500180/viewspace-2071827/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE 11.2.0.4 RAC RMAN異機恢復之ORA-15001Oracle
- RAC恢復到單機
- oracle 異機恢復Oracle
- Networker恢復oracle rac到單機Oracle
- 【12c 庫異機恢復】實驗
- RMAN備份異機恢復
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- RMAN備份恢復典型案例——異機恢復未知DBID
- 異機使用完全備份恢復指定的PDB
- 兩篇oracle異機恢復文章Oracle
- RAC備份恢復之Voting備份與恢復
- rman備份異機恢復(原創)
- rac恢復到單例項單例
- 記錄一次Oracle 11.2.0.4 RAC異地恢復到單例項Oracle單例
- DM7使用DMRMAN執行RAC資料庫恢復資料庫
- 【11g 庫異地恢復】實驗
- DG:11.2.0.4 RAC線上duplicate恢復DG
- 從nub備份恢復(同平臺)恢復RAC至單例項單例
- DM7 RAC資料庫恢復成單機資料庫資料庫
- DG同步異常恢復文件
- SQLServer異常故障恢復(二)SQLServer
- Oracle Database 12c RAC損壞ocr和votedisk恢復實驗OracleDatabase
- 12C grid CDB異機恢復+歸檔(DDL操作)
- RAC安裝目錄許可權快速恢復
- RAC控制檔案恢復(三種不同情況)
- 7.6 實現程式掛起與恢復
- 告警與恢復告警原理及實現
- 【硬碟資料恢復】加電有異響的硬碟資料恢復硬碟資料恢復
- NBU異機恢復ORACLE出現ORA-19507、ORA-27029和ORA-19511錯誤Oracle
- Nvidia的CUDA庫現在恢復使用了
- 7_Oracle truncate異常恢復之plsql修復OracleSQL
- 6_Oracle truncate異常恢復之bbed修復Oracle
- Oracle asm磁碟損壞異常恢復OracleASM
- Redis當機恢復Redis
- 【虛擬機器資料恢復】異常斷電導致虛擬機器無法啟動的資料恢復案例虛擬機資料恢復
- 恢復聊天記錄手機軟體如何使用
- 【資料遷移1】Oracle 10gR2 rman異機恢復實驗(FS->RAW)(1)Oracle 10g
- 【資料遷移1】Oracle 10gR2 rman異機恢復實驗(FS->RAW)(2)Oracle 10g
- 通過rman為客戶實現linux下oracle11.2.0.4到windows下oracle同版本資料庫的異機恢復。LinuxOracleWindows資料庫