ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RAC环境备份归档日志和RMAN恢复启动数据库

RAC环境备份归档日志和RMAN恢复启动数据库

Linux操作系统 作者:chinalong75 时间:2013-11-17 15:15:25 0 删除 编辑

环境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/29327782/viewspace-776780/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-17

  • 博文量
    3
  • 访问量
    11949