RAC環境備份歸檔日誌和RMAN恢復啟動資料庫

it_newbalance發表於2013-02-01

環境linux
Oracle10.2.0.1
歸檔日誌在ASM磁碟組
恢復到原來的RAC節點

根據Oracle的RAC環境的不同,RMAN備份、恢復操作也是不同的。如果RAC環境是建立在CLUSTER檔案系統上的,或者是建立在ASM上的,那麼備份和恢復過程可能會很簡單,基本上和普通的資料庫環境沒有太多的區別。如果RAC環境是建立在裸裝置上的,由於歸檔日誌無法儲存在裸裝置上,那麼歸檔日誌檔案必須放在多個節點的本地硬碟上,這時備份和恢復就變得和普通的資料庫環境有所差異。

這裡先討論一下ASM環境上建立的RAC資料庫的備份。如果將歸檔日誌放在ASM上,那麼兩個節點都是可以備份的,這個時候,備份和普通的單例項資料庫沒有差別。


第一步:背景
SQL> SHOW PARAMETER LOG_ARCHIVE_DEST_1

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1 string LOCATION=+RAC_DISK/demo/arch2
log_archive_dest_10 string
SQL>

SQL> SHOW PARAMETER LOG_ARCHIVE_DEST_1

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest_1 string LOCATION=+RAC_DISK/demo/arch1
log_archive_dest_10 string
SQL>

兩個節點的資料庫查詢得到的都是下面的結果
SQL> select name from v$archived_log;

NAME
--------------------------------------------------------------------------------
/opt/ora10g/arch/2_2_733960822.dbf
/opt/ora10g/arch/1_22_733960822.dbf
/opt/ora10g/arch/1_23_733960822.dbf
/opt/ora10g/arch/1_24_733960822.arc
+RAC_DISK/demo/arch1/1_25_733960822.arc
+RAC_DISK/demo/arch1/2_3_733960822.arc
+RAC_DISK/demo/arch2/2_4_733960822.arc
+RAC_DISK/demo/arch1/1_26_733960822.arc

8 rows selected.

第二步,備份資料庫
[oracle@node2 arch]$ rman target /
connected to target database: RACDB (DBID=731577590)
RMAN> configure channel device type disk format '/opt/ora10g/arch/%U';
RMAN> backup database plus archivelog delete all input;


Starting backup at 09-NOV-10
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=151 instance=RACDB2 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 11/09/2010 22:27:07
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
ORA-19625: error identifying file /opt/ora10g/arch/1_22_733960822.dbf
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

RMAN> exit

我們這個資料庫比較特殊,開始歸檔日誌的時候放的是各伺服器本地,後來又調整到了ASM磁碟組,
由於節點2上無法訪問到節點1上的歸檔,所以出現了上面的錯誤。對於這種情況,可以使用帶CONNECT語句的ALLOCATE來分配CHANNEL:
rman target /
run
{
allocate channel c1 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb1;
allocate channel c2 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb2;
backup database plus archivelog delete all input;
}

再備份就沒有問題了

說明:因為開了兩個channel,所以每個節點的伺服器分別同時備份
在兩個伺服器的/opt/ora10g/arch/目錄下都有備份檔案,而且各不相同
節點1
[oracle@node1 arch]$ ls -ltr
total 406652
-rw-r----- 1 oracle oinstall 61632512 Nov 9 22:38 01lsjrq1_1_1
-rw-r----- 1 oracle oinstall 17735168 Nov 9 22:38 04lsjrr3_1_1
-rw-r----- 1 oracle oinstall 321167360 Nov 9 22:39 05lsjrrj_1_1
-rw-r----- 1 oracle oinstall 15335424 Nov 9 22:39 07lsjrtf_1_1
-rw-r----- 1 oracle oinstall 98304 Nov 9 22:40 08lsjru3_1_1
-rw-r----- 1 oracle oinstall 7168 Nov 9 22:41 09lsjs04_1_1
[oracle@node1 arch]$

節點2
[oracle@node2 arch]$ ls -ltr
total 334480
-rw-r----- 1 oracle oinstall 30736896 Nov 9 22:35 02lsjrl2_1_1
-rw-r----- 1 oracle oinstall 6253056 Nov 9 22:35 03lsjrlt_1_1
-rw-r----- 1 oracle oinstall 305152000 Nov 9 22:37 06lsjrml_1_1
-rw-r----- 1 oracle oinstall 6144 Nov 9 22:37 0alsjrp9_1_1
[oracle@node2 arch]$

注意看上面的結果,在原來歸檔日誌的目錄下,歸檔日誌已經被刪除了

SQL> select name from v$archived_log;

NAME
----------

16 rows selected.

SQL>

因為歸檔日誌已經被歸檔走了,所以看不到name顯示的結果,但是有16個歸檔日誌

下面實驗恢復操作

在恢復之前,需要將資料庫關閉,通過rman啟動例項並準備恢復:

[oracle@node2 arch]$ srvctl stop db -d racdb
[oracle@node2 arch]$

下面準備通過RMAN進行資料庫的恢復。由於RAC的備份是同時備份到兩個節點的本地硬碟上,
因此恢復的時候也應該兩個節點同時進行RESTORE操作。

可以在兩個節點上分別啟動RMAN,將資料庫處於STARTUP MOUNT狀態,然後就可以在任意一個節點上執行RESTORE操作:

先啟動某個節點到mount狀態
sqlplus / as sysdba
startup mount

再在另一個節點進行恢復
[oracle@node2 arch]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Nov 9 23:07:01 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database (not started)

RMAN> startup mount
......
run
{
allocate channel c1 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb1;
allocate channel c2 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb2;
restore database;
}
......
run
{
allocate channel c1 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb1;
allocate channel c2 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb2;
recover database;
}

到此,算是備份恢復的指令碼流程都瀏覽了一遍。

過程如下,沒有問題
[oracle@node2 arch]$ srvctl stop db -d racdb
[oracle@node2 arch]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Nov 9 23:07:01 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database (not started)

RMAN> startup mount

Oracle instance started
database mounted

Total System Global Area 167772160 bytes

Fixed Size 1218316 bytes
Variable Size 113248500 bytes
Database Buffers 50331648 bytes
Redo Buffers 2973696 bytes

RMAN> run
{
allocate channel c1 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb1;
allocate channel c2 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb2;
restore database;
}2> 3> 4> 5> 6>

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=151 instance=RACDB1 devtype=DISK

allocated channel: c2
channel c2: sid=144 instance=RACDB2 devtype=DISK

Starting restore at 09-NOV-10

channel c2: starting datafile backupset restore
channel c2: specifying datafile(s) to restore from backup set
restoring datafile 00002 to +RAC_DISK/racdb/datafile/undotbs1.260.733960879
restoring datafile 00003 to +RAC_DISK/racdb/datafile/sysaux.261.733960895
restoring datafile 00006 to +RAC_DISK/racdb/datafile/test_d.271.734574993
channel c2: reading from backup piece /opt/ora10g/arch/06lsjrml_1_1
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +RAC_DISK/racdb/datafile/system.259.733960845
restoring datafile 00004 to +RAC_DISK/racdb/datafile/undotbs2.263.733960921
restoring datafile 00005 to +RAC_DISK/racdb/datafile/users.264.733960933
channel c1: reading from backup piece /opt/ora10g/arch/05lsjrrj_1_1
channel c1: restored backup piece 1
piece handle=/opt/ora10g/arch/05lsjrrj_1_1 tag=TAG20101109T223604
channel c1: restore complete, elapsed time: 00:01:32
channel c2: restored backup piece 1
piece handle=/opt/ora10g/arch/06lsjrml_1_1 tag=TAG20101109T223604
channel c2: restore complete, elapsed time: 00:01:40
Finished restore at 09-NOV-10
released channel: c1
released channel: c2

RMAN> run
{
allocate channel c1 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb1;
allocate channel c2 device type disk format '/opt/ora10g/arch/%U' connect sys/tagal@racdb2;
recover database;
}2> 3> 4> 5> 6>

allocated channel: c1
channel c1: sid=151 instance=RACDB1 devtype=DISK

allocated channel: c2
channel c2: sid=144 instance=RACDB2 devtype=DISK

Starting recover at 09-NOV-10

starting media recovery
media recovery complete, elapsed time: 00:00:09

Finished recover at 09-NOV-10
released channel: c1
released channel: c2

RMAN>

 

如果是ASM磁碟組管理模式下備份和單節點恢復可參考如下:

SQL> col name format a80
SQL> set linesize 213
SQL> select name from v$archived_log;

NAME
--------------------------------------------------------------------------------
+DATA/rac1db/archivelog/2012_12_24/thread_1_seq_64.297.802891119
+DATA/rac1db/archivelog/2012_12_24/thread_2_seq_1.298.802891163
+DATA/rac1db/archivelog/2012_12_24/thread_2_seq_2.299.802891203
+DATA/rac1db/archivelog/2012_12_24/thread_1_seq_65.300.802891207
+DATA/rac1db/archivelog/2012_12_24/thread_2_seq_3.301.802891209
+DATA/rac1db/archivelog/2012_12_24/thread_2_seq_4.302.802901197
+DATA/rac1db/archivelog/2012_12_24/thread_1_seq_66.303.802901199
+DATA/rac1db/archivelog/2012_12_26/thread_1_seq_67.304.803053197
+DATA/rac1db/archivelog/2012_12_26/thread_1_seq_68.305.803053231
+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_69.306.804591271
+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_5.307.804591299

NAME
--------------------------------------------------------------------------------
+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_6.308.804591305
+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_7.309.804612765
+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_70.310.804612795
+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_71.311.804612797
+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_72.312.804617003
+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_8.313.804617007
+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_9.314.804625095
+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_10.315.804625177
+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_73.316.804625753
+DATA/rac1db/archivelog/2013_02_03/thread_2_seq_11.317.806414025
+DATA/rac1db/archivelog/2013_02_03/thread_1_seq_74.318.806414059

NAME
--------------------------------------------------------------------------------
+DATA/rac1db/archivelog/2013_02_03/thread_1_seq_75.319.806414079
+DATA/rac1db/archivelog/2013_02_03/thread_2_seq_12.320.806414347

24 rows selected.

SQL> exit

備份:

[oracle@rac2 rmanbak]$ rman target / nocatalog

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Feb 3 12:30:58 2013

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

connected to target database: RAC1DB (DBID=1141538281)
using target database control file instead of recovery catalog

RMAN> configure channel device type disk format '/home/oracle/rmanbak/%U';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/home/oracle/rmanbak/%U';
new RMAN configuration parameters are successfully stored

RMAN> backup database plus archivelog delete all input;


Starting backup at 03-FEB-13
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=30 instance=rac1db2 device type=DISK
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=64 RECID=1 STAMP=802891120
input archived log thread=2 sequence=1 RECID=2 STAMP=802891164
input archived log thread=1 sequence=65 RECID=4 STAMP=802891209
input archived log thread=2 sequence=2 RECID=3 STAMP=802891204
input archived log thread=2 sequence=3 RECID=5 STAMP=802891211
input archived log thread=1 sequence=66 RECID=7 STAMP=802901212
input archived log thread=2 sequence=4 RECID=6 STAMP=802901204
input archived log thread=1 sequence=67 RECID=8 STAMP=803053197
input archived log thread=2 sequence=5 RECID=11 STAMP=804591301
input archived log thread=1 sequence=68 RECID=9 STAMP=803053230
input archived log thread=1 sequence=69 RECID=10 STAMP=804591273
input archived log thread=2 sequence=6 RECID=12 STAMP=804591307
input archived log thread=1 sequence=70 RECID=14 STAMP=804612795
input archived log thread=2 sequence=7 RECID=13 STAMP=804612764
input archived log thread=1 sequence=71 RECID=15 STAMP=804612796
input archived log thread=2 sequence=8 RECID=17 STAMP=804617027
input archived log thread=1 sequence=72 RECID=16 STAMP=804617005
input archived log thread=2 sequence=9 RECID=18 STAMP=804625096
input archived log thread=1 sequence=73 RECID=20 STAMP=804625753
input archived log thread=2 sequence=10 RECID=19 STAMP=804625178
input archived log thread=2 sequence=11 RECID=21 STAMP=806414033
input archived log thread=1 sequence=74 RECID=22 STAMP=806414075
input archived log thread=1 sequence=75 RECID=23 STAMP=806414079
input archived log thread=2 sequence=12 RECID=24 STAMP=806414348
input archived log thread=1 sequence=76 RECID=26 STAMP=806416370
input archived log thread=2 sequence=13 RECID=25 STAMP=806416368
channel ORA_DISK_1: starting piece 1 at 03-FEB-13
channel ORA_DISK_1: finished piece 1 at 03-FEB-13
piece handle=/home/oracle/rmanbak/01o11rvt_1_1 tag=TAG20130203T123259 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+DATA/rac1db/archivelog/2012_12_24/thread_1_seq_64.297.802891119 RECID=1 STAMP=802891120
archived log file name=+DATA/rac1db/archivelog/2012_12_24/thread_2_seq_1.298.802891163 RECID=2 STAMP=802891164
archived log file name=+DATA/rac1db/archivelog/2012_12_24/thread_1_seq_65.300.802891207 RECID=4 STAMP=802891209
archived log file name=+DATA/rac1db/archivelog/2012_12_24/thread_2_seq_2.299.802891203 RECID=3 STAMP=802891204
archived log file name=+DATA/rac1db/archivelog/2012_12_24/thread_2_seq_3.301.802891209 RECID=5 STAMP=802891211
archived log file name=+DATA/rac1db/archivelog/2012_12_24/thread_1_seq_66.303.802901199 RECID=7 STAMP=802901212
archived log file name=+DATA/rac1db/archivelog/2012_12_24/thread_2_seq_4.302.802901197 RECID=6 STAMP=802901204
archived log file name=+DATA/rac1db/archivelog/2012_12_26/thread_1_seq_67.304.803053197 RECID=8 STAMP=803053197
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_5.307.804591299 RECID=11 STAMP=804591301
archived log file name=+DATA/rac1db/archivelog/2012_12_26/thread_1_seq_68.305.803053231 RECID=9 STAMP=803053230
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_69.306.804591271 RECID=10 STAMP=804591273
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_6.308.804591305 RECID=12 STAMP=804591307
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_70.310.804612795 RECID=14 STAMP=804612795
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_7.309.804612765 RECID=13 STAMP=804612764
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_71.311.804612797 RECID=15 STAMP=804612796
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_8.313.804617007 RECID=17 STAMP=804617027
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_72.312.804617003 RECID=16 STAMP=804617005
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_9.314.804625095 RECID=18 STAMP=804625096
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_1_seq_73.316.804625753 RECID=20 STAMP=804625753
archived log file name=+DATA/rac1db/archivelog/2013_01_13/thread_2_seq_10.315.804625177 RECID=19 STAMP=804625178
archived log file name=+DATA/rac1db/archivelog/2013_02_03/thread_2_seq_11.317.806414025 RECID=21 STAMP=806414033
archived log file name=+DATA/rac1db/archivelog/2013_02_03/thread_1_seq_74.318.806414059 RECID=22 STAMP=806414075
archived log file name=+DATA/rac1db/archivelog/2013_02_03/thread_1_seq_75.319.806414079 RECID=23 STAMP=806414079
archived log file name=+DATA/rac1db/archivelog/2013_02_03/thread_2_seq_12.320.806414347 RECID=24 STAMP=806414348
archived log file name=+DATA/rac1db/archivelog/2013_02_03/thread_1_seq_76.322.806416369 RECID=26 STAMP=806416370
archived log file name=+DATA/rac1db/archivelog/2013_02_03/thread_2_seq_13.321.806416367 RECID=25 STAMP=806416368
Finished backup at 03-FEB-13

Starting backup at 03-FEB-13
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=00003 name=+DATA/rac1db/datafile/undotbs1.288.802888105
input datafile file number=00001 name=+DATA/rac1db/datafile/system.286.802888061
input datafile file number=00002 name=+DATA/rac1db/datafile/sysaux.287.802888085
input datafile file number=00004 name=+DATA/rac1db/datafile/undotbs2.290.802888125
input datafile file number=00005 name=+DATA/rac1db/datafile/users.291.802888131
channel ORA_DISK_1: starting piece 1 at 03-FEB-13
channel ORA_DISK_1: finished piece 1 at 03-FEB-13
piece handle=/home/oracle/rmanbak/02o11s0t_1_1 tag=TAG20130203T123333 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:55
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 03-FEB-13
channel ORA_DISK_1: finished piece 1 at 03-FEB-13
piece handle=/home/oracle/rmanbak/03o11s6c_1_1 tag=TAG20130203T123333 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
Finished backup at 03-FEB-13

Starting backup at 03-FEB-13
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=2 sequence=14 RECID=27 STAMP=806416605
input archived log thread=1 sequence=77 RECID=28 STAMP=806416606
channel ORA_DISK_1: starting piece 1 at 03-FEB-13
channel ORA_DISK_1: finished piece 1 at 03-FEB-13
piece handle=/home/oracle/rmanbak/04o11s71_1_1 tag=TAG20130203T123649 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=+DATA/rac1db/archivelog/2013_02_03/thread_2_seq_14.321.806416605 RECID=27 STAMP=806416605
archived log file name=+DATA/rac1db/archivelog/2013_02_03/thread_1_seq_77.322.806416607 RECID=28 STAMP=806416606
Finished backup at 03-FEB-13

RMAN> exit

恢復:

[oracle@rac2 rmanbak]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Feb 3 12:46:24 2013

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

connected to target database: RAC1DB (not mounted)

RMAN> startup mount

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area    1033670656 bytes

Fixed Size                     1341056 bytes
Variable Size                658508160 bytes
Database Buffers             369098752 bytes
Redo Buffers                   4722688 bytes

RMAN> restore database;

Starting restore at 03-FEB-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=179 instance=rac1db2 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/rac1db/datafile/system.286.802888061
channel ORA_DISK_1: restoring datafile 00002 to +DATA/rac1db/datafile/sysaux.287.802888085
channel ORA_DISK_1: restoring datafile 00003 to +DATA/rac1db/datafile/undotbs1.288.802888105
channel ORA_DISK_1: restoring datafile 00004 to +DATA/rac1db/datafile/undotbs2.290.802888125
channel ORA_DISK_1: restoring datafile 00005 to +DATA/rac1db/datafile/users.291.802888131
channel ORA_DISK_1: reading from backup piece /home/oracle/rmanbak/02o11s0t_1_1
channel ORA_DISK_1: piece handle=/home/oracle/rmanbak/02o11s0t_1_1 tag=TAG20130203T123333
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:35
Finished restore at 03-FEB-13

RMAN> recover database;

Starting recover at 03-FEB-13
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:06

Finished recover at 03-FEB-13

RMAN>

啟動:

因為是完全恢復,直接open即可


RMAN> alter database open;

database opened


RMAN> exit


Recovery Manager complete.

該節點的資料庫例項已經啟動

[oracle@rac2 ~]$ ps -ef | grep ora
root      3174  3151  0 13:14 ?        00:00:00 hald-addon-storage: polling /dev/hdc
grid      4133     1  0 13:16 ?        00:00:02 /u01/grid/bin/oraagent.bin
root      4209     1  0 13:16 ?        00:00:00 /u01/grid/bin/orarootagent.bin
root      4339  4269  0 13:17 pts/0    00:00:00 su - oracle
oracle    4340  4339  0 13:17 pts/0    00:00:00 -bash
oracle    4718  4340  0 13:20 pts/0    00:00:01 rman target /
grid      4729     1  0 13:20 ?        00:00:00 oracle+ASM2_ocr (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid      4746     1  0 13:20 ?        00:00:00 oracle+ASM2_asmb_+asm2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid      4758     1  0 13:20 ?        00:00:00 oracle+ASM2_o000_+asm2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid      4873     1  0 13:21 ?        00:00:01 /u01/grid/bin/oraagent.bin
root      4877     1  0 13:21 ?        00:00:01 /u01/grid/bin/orarootagent.bin
grid      5039     1  0 13:21 ?        00:00:02 /u01/grid/jdk/jre//bin/java -Doracle.supercluster.cluster.server=eonsd -Djava.net.preferIPv4Stack=true -Djava.util.logging.config.file=/u01/grid/srvm/admin/logging.properties -classpath /u01/grid/jdk/jre//lib/rt.jar:/u01/grid/jlib/srvm.jar:/u01/grid/jlib/srvmhas.jar:/u01/grid/jlib/supercluster.jar:/u01/grid/jlib/supercluster-common.jar:/u01/grid/ons/lib/ons.jar oracle.supercluster.impl.cluster.EONSServerImpl
oracle    5234     1  0 13:23 ?        00:00:00 ora_pmon_rac1db2
oracle    5238     1  0 13:23 ?        00:00:00 ora_vktm_rac1db2
oracle    5244     1  0 13:23 ?        00:00:00 ora_gen0_rac1db2
oracle    5248     1  0 13:23 ?        00:00:00 ora_diag_rac1db2
oracle    5252     1  0 13:23 ?        00:00:00 ora_dbrm_rac1db2
oracle    5256     1  0 13:23 ?        00:00:00 ora_ping_rac1db2
oracle    5261     1  0 13:23 ?        00:00:00 ora_psp0_rac1db2
oracle    5265     1  0 13:23 ?        00:00:00 ora_acms_rac1db2
oracle    5271     1  0 13:23 ?        00:00:00 ora_dia0_rac1db2
oracle    5275     1  0 13:23 ?        00:00:00 ora_lmon_rac1db2
oracle    5279     1  0 13:23 ?        00:00:00 ora_lmd0_rac1db2
oracle    5283     1  0 13:23 ?        00:00:00 ora_lms0_rac1db2
oracle    5289     1  0 13:23 ?        00:00:00 ora_rms0_rac1db2
oracle    5293     1  0 13:23 ?        00:00:00 ora_lmhb_rac1db2
oracle    5297     1  3 13:23 ?        00:00:07 ora_mman_rac1db2
oracle    5301     1  0 13:23 ?        00:00:00 ora_dbw0_rac1db2
oracle    5305     1  0 13:23 ?        00:00:00 ora_lgwr_rac1db2
oracle    5309     1  0 13:23 ?        00:00:00 ora_ckpt_rac1db2
oracle    5313     1  0 13:23 ?        00:00:00 ora_smon_rac1db2
oracle    5317     1  0 13:23 ?        00:00:00 ora_reco_rac1db2
oracle    5321     1  0 13:23 ?        00:00:00 ora_rbal_rac1db2
oracle    5325     1  0 13:23 ?        00:00:00 ora_asmb_rac1db2
oracle    5329     1  0 13:23 ?        00:00:00 ora_mmon_rac1db2
grid      5333     1  0 13:23 ?        00:00:00 oracle+ASM2_asmb_rac1db2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5335     1  0 13:23 ?        00:00:00 ora_mmnl_rac1db2
oracle    5341     1  0 13:23 ?        00:00:00 ora_d000_rac1db2
oracle    5345     1  0 13:23 ?        00:00:00 ora_mark_rac1db2
oracle    5349     1  0 13:23 ?        00:00:00 ora_s000_rac1db2
oracle    5357     1  0 13:23 ?        00:00:00 /u01/grid/bin/oclskd.bin
oracle    5372     1  0 13:23 ?        00:00:01 ora_lck0_rac1db2
oracle    5376     1  0 13:23 ?        00:00:00 ora_rsmn_rac1db2
oracle    5403     1  0 13:23 ?        00:00:00 ora_o000_rac1db2
grid      5409     1  0 13:23 ?        00:00:00 oracle+ASM2_o000_rac1db2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5447  4718  1 13:23 ?        00:00:02 oraclerac1db2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5452  4718  0 13:23 ?        00:00:00 oraclerac1db2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5488     1  0 13:24 ?        00:00:00 ora_o001_rac1db2
grid      5492     1  0 13:24 ?        00:00:00 oracle+ASM2_o001_rac1db2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5506     1  0 13:24 ?        00:00:00 ora_arc0_rac1db2
oracle    5510     1  0 13:24 ?        00:00:00 ora_arc1_rac1db2
oracle    5514     1  0 13:24 ?        00:00:00 ora_arc2_rac1db2
oracle    5518     1  0 13:24 ?        00:00:00 ora_arc3_rac1db2
oracle    5522     1  0 13:25 ?        00:00:00 ora_o002_rac1db2
grid      5526     1  0 13:25 ?        00:00:00 oracle+ASM2_o002_rac1db2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5532     1  0 13:25 ?        00:00:00 ora_gtx0_rac1db2
oracle    5536     1  0 13:25 ?        00:00:00 ora_rcbg_rac1db2
oracle    5543     1  0 13:25 ?        00:00:00 ora_qmnc_rac1db2
oracle    5562     1  0 13:25 ?        00:00:00 ora_q000_rac1db2
oracle    5570     1  0 13:25 ?        00:00:00 ora_q001_rac1db2
oracle    5582     1  0 13:25 ?        00:00:00 ora_cjq0_rac1db2
oracle    5587     1  0 13:25 ?        00:00:00 ora_vkrm_rac1db2
root      5621  4299  0 13:26 pts/1    00:00:00 su - oracle
oracle    5622  5621  0 13:26 pts/1    00:00:00 -bash
oracle    5651  5622  0 13:26 pts/1    00:00:00 ps -ef
oracle    5652  5622  0 13:26 pts/1    00:00:00 grep ora
[oracle@rac2 ~]$

第二種確認方法

SQL> desc gv$instance
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 INST_ID                                            NUMBER
 INSTANCE_NUMBER                                    NUMBER
 INSTANCE_NAME                                      VARCHAR2(16)
 HOST_NAME                                          VARCHAR2(64)
 VERSION                                            VARCHAR2(17)
 STARTUP_TIME                                       DATE
 STATUS                                             VARCHAR2(12)
 PARALLEL                                           VARCHAR2(3)
 THREAD#                                            NUMBER
 ARCHIVER                                           VARCHAR2(7)
 LOG_SWITCH_WAIT                                    VARCHAR2(15)
 LOGINS                                             VARCHAR2(10)
 SHUTDOWN_PENDING                                   VARCHAR2(3)
 DATABASE_STATUS                                    VARCHAR2(17)
 INSTANCE_ROLE                                      VARCHAR2(18)
 ACTIVE_STATE                                       VARCHAR2(9)
 BLOCKED                                            VARCHAR2(3)

SQL> select inst_id,instance_name,status from gv$instance;

   INST_ID INSTANCE_NAME    STATUS
---------- ---------------- ------------
         2 rac1db2          OPEN

SQL>

此時另一個節點的資料庫例項還沒啟動

[oracle@rac1 ~]$ ps -ef | grep ora
root      3190  3167  0 13:15 ?        00:00:00 hald-addon-storage: polling /dev/hdc
grid      4212     1  0 13:17 ?        00:00:01 /u01/grid/bin/oraagent.bin
root      4286     1  0 13:17 ?        00:00:00 /u01/grid/bin/orarootagent.bin
grid      4649     1  0 13:20 ?        00:00:00 oracle+ASM1_asmb_+asm1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid      4689     1  0 13:20 ?        00:00:00 oracle+ASM1_ocr (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
root      4791     1  0 13:20 ?        00:00:02 /u01/grid/bin/orarootagent.bin
grid      4794     1  0 13:20 ?        00:00:01 /u01/grid/bin/oraagent.bin
grid      4983     1  0 13:20 ?        00:00:02 /u01/grid/jdk/jre//bin/java -Doracle.supercluster.cluster.server=eonsd -Djava.net.preferIPv4Stack=true -Djava.util.logging.config.file=/u01/grid/srvm/admin/logging.properties -classpath /u01/grid/jdk/jre//lib/rt.jar:/u01/grid/jlib/srvm.jar:/u01/grid/jlib/srvmhas.jar:/u01/grid/jlib/supercluster.jar:/u01/grid/jlib/supercluster-common.jar:/u01/grid/ons/lib/ons.jar oracle.supercluster.impl.cluster.EONSServerImpl
root      5158  4097  0 13:25 pts/1    00:00:00 su - oracle
oracle    5159  5158  0 13:25 pts/1    00:00:00 -bash
oracle    5200  5159  0 13:26 pts/1    00:00:00 ps -ef
oracle    5201  5159  0 13:26 pts/1    00:00:00 grep ora
[oracle@rac1 ~]$

啟動另一個節點:

[oracle@rac1 ~]$ srvctl start instance -d rac1db -i rac1db1
[oracle@rac1 ~]$

確認:

[oracle@rac1 ~]$ ps -ef | grep ora
root      3190  3167  0 13:15 ?        00:00:00 hald-addon-storage: polling /dev/hdc
grid      4212     1  0 13:17 ?        00:00:03 /u01/grid/bin/oraagent.bin
root      4286     1  0 13:17 ?        00:00:00 /u01/grid/bin/orarootagent.bin
grid      4649     1  0 13:20 ?        00:00:00 oracle+ASM1_asmb_+asm1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid      4689     1  0 13:20 ?        00:00:00 oracle+ASM1_ocr (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
root      4791     1  0 13:20 ?        00:00:06 /u01/grid/bin/orarootagent.bin
grid      4794     1  0 13:20 ?        00:00:03 /u01/grid/bin/oraagent.bin
grid      4983     1  0 13:20 ?        00:00:03 /u01/grid/jdk/jre//bin/java -Doracle.supercluster.cluster.server=eonsd -Djava.net.preferIPv4Stack=true -Djava.util.logging.config.file=/u01/grid/srvm/admin/logging.properties -classpath /u01/grid/jdk/jre//lib/rt.jar:/u01/grid/jlib/srvm.jar:/u01/grid/jlib/srvmhas.jar:/u01/grid/jlib/supercluster.jar:/u01/grid/jlib/supercluster-common.jar:/u01/grid/ons/lib/ons.jar oracle.supercluster.impl.cluster.EONSServerImpl
root      5158  4097  0 13:25 pts/1    00:00:00 su - oracle
oracle    5159  5158  0 13:25 pts/1    00:00:00 -bash
oracle    5404     1  0 13:35 ?        00:00:00 /u01/grid/bin/oraagent.bin
grid      5446     1  0 13:35 ?        00:00:00 oracle+ASM1_o000_+asm1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5517     1  0 13:36 ?        00:00:00 ora_pmon_rac1db1
oracle    5521     1  0 13:36 ?        00:00:00 ora_vktm_rac1db1
oracle    5527     1  0 13:36 ?        00:00:01 ora_gen0_rac1db1
oracle    5531     1  0 13:36 ?        00:00:00 ora_diag_rac1db1
oracle    5535     1  0 13:36 ?        00:00:00 ora_dbrm_rac1db1
oracle    5540     1  0 13:36 ?        00:00:00 ora_ping_rac1db1
oracle    5544     1  0 13:36 ?        00:00:00 ora_psp0_rac1db1
oracle    5549     1  0 13:36 ?        00:00:00 ora_acms_rac1db1
oracle    5553     1  0 13:36 ?        00:00:00 ora_dia0_rac1db1
oracle    5558     1  0 13:36 ?        00:00:00 ora_lmon_rac1db1
oracle    5562     1  0 13:36 ?        00:00:01 ora_lmd0_rac1db1
oracle    5566     1  0 13:36 ?        00:00:00 ora_lms0_rac1db1
oracle    5573     1  0 13:36 ?        00:00:00 ora_rms0_rac1db1
oracle    5577     1  0 13:36 ?        00:00:00 ora_lmhb_rac1db1
oracle    5581     1  2 13:36 ?        00:00:06 ora_mman_rac1db1
oracle    5585     1  0 13:36 ?        00:00:00 ora_dbw0_rac1db1
oracle    5589     1  0 13:36 ?        00:00:00 ora_lgwr_rac1db1
oracle    5593     1  0 13:36 ?        00:00:00 ora_ckpt_rac1db1
oracle    5597     1  0 13:36 ?        00:00:00 ora_smon_rac1db1
oracle    5601     1  0 13:36 ?        00:00:00 ora_reco_rac1db1
oracle    5605     1  0 13:36 ?        00:00:00 ora_rbal_rac1db1
oracle    5609     1  0 13:36 ?        00:00:00 ora_asmb_rac1db1
oracle    5613     1  0 13:36 ?        00:00:00 ora_mmon_rac1db1
grid      5617     1  0 13:36 ?        00:00:00 oracle+ASM1_asmb_rac1db1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5619     1  0 13:36 ?        00:00:00 ora_mmnl_rac1db1
oracle    5625     1  0 13:36 ?        00:00:00 ora_d000_rac1db1
oracle    5629     1  0 13:36 ?        00:00:00 ora_mark_rac1db1
oracle    5633     1  0 13:36 ?        00:00:00 ora_s000_rac1db1
oracle    5639     1  0 13:36 ?        00:00:00 /u01/grid/bin/oclskd.bin
oracle    5663     1  0 13:36 ?        00:00:01 ora_lck0_rac1db1
oracle    5667     1  0 13:36 ?        00:00:00 ora_rsmn_rac1db1
oracle    5680     1  0 13:36 ?        00:00:00 ora_o000_rac1db1
grid      5686     1  0 13:36 ?        00:00:00 oracle+ASM1_o000_rac1db1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5721     1  0 13:36 ?        00:00:00 ora_o001_rac1db1
grid      5726     1  0 13:36 ?        00:00:00 oracle+ASM1_o001_rac1db1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5732     1  0 13:37 ?        00:00:00 ora_arc0_rac1db1
oracle    5741     1  0 13:37 ?        00:00:00 ora_arc1_rac1db1
oracle    5748     1  0 13:37 ?        00:00:00 ora_arc2_rac1db1
oracle    5755     1  0 13:37 ?        00:00:00 ora_arc3_rac1db1
oracle    5831     1  0 13:38 ?        00:00:00 ora_gtx0_rac1db1
oracle    5840     1  0 13:38 ?        00:00:00 ora_rcbg_rac1db1
oracle    5870     1  0 13:38 ?        00:00:00 ora_qmnc_rac1db1
oracle    5887     1  0 13:38 ?        00:00:00 oraclerac1db1 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle    5909     1  0 13:38 ?        00:00:00 ora_q000_rac1db1
oracle    5913     1  0 13:38 ?        00:00:00 ora_q001_rac1db1
oracle    5917     1  0 13:38 ?        00:00:00 ora_pz99_rac1db1
oracle    5943     1  0 13:39 ?        00:00:00 ora_cjq0_rac1db1
oracle    5948     1  0 13:39 ?        00:00:00 ora_vkrm_rac1db1
oracle    5979  5159  0 13:40 pts/1    00:00:00 ps -ef
oracle    5980  5159  0 13:40 pts/1    00:00:00 grep ora
[oracle@rac1 ~]$

程式啟動

或者:
SQL> select inst_id,instance_name,status from gv$instance;

   INST_ID INSTANCE_NAME    STATUS
---------- ---------------- ------------
         2 rac1db2          OPEN
         1 rac1db1          OPEN

SQL>

另一種方法啟動:

資料庫恢復後,關閉資料庫,統一啟動


RMAN> alter database open;

database opened

RMAN> shutdown immediate

database closed
database dismounted
Oracle instance shut down

RMAN> exit

啟動

[oracle@rac1 ~]$ srvctl start database -d rac1db
[oracle@rac1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 3 13:54:12 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> select inst_id,instance_name,status from gv$instance;

   INST_ID INSTANCE_NAME    STATUS
---------- ---------------- ------------
         1 rac1db1          OPEN
         2 rac1db2          OPEN

SQL>

 

 

 

 

 

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

相關文章