Chinaunix首页 | 论坛 | 博客
  • 博客访问: 410987
  • 博文数量: 119
  • 博客积分: 1470
  • 博客等级: 上尉
  • 技术积分: 1258
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-24 13:50
文章分类

全部博文(119)

文章存档

2018年(6)

2017年(11)

2016年(4)

2013年(8)

2012年(1)

2011年(2)

2010年(4)

2009年(37)

2008年(16)

2006年(30)

我的朋友

分类: Oracle

2009-08-05 11:45:44

oracle@orac-b:~> sqlplus system/holeinone@rac

SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 12 20:08:00 2009

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select instance_name from gv$instance;

INSTANCE_NAME
----------------
rac1
rac2

SQL> @checkracstat.sql;

INSTANCE_NAME HOST_NAME FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER
------------- --------- ------------- --------------- -----------
rac1          orac-a
                        NONE          NONE            NO

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
oracle@orac-b:~> srvctl status database -d rac
Instance rac1 is running on node orac-a
Instance rac2 is running on node orac-b
oracle@orac-b:~> srvctl stop instance -d rac -i rac1 -o abort
oracle@orac-b:~> srvctl status database -d rac
Instance rac1 is not running on node orac-a
Instance rac2 is running on node orac-b
oracle@orac-b:~> sqlplus system/holeinone@rac

SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 12 20:10:16 2009

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select instance_name from gv$instance;

SQL> @checkracstat.sql;

INSTANCE_NAME HOST_NAME FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER
------------- --------- ------------- --------------- -----------
rac2          orac-b
                        NONE          NONE            NO

SQL>



checkracstat.sql


# more checkracstat.sql
COL instance_name FORMAT a13;
COL host_name FORMAT a9;
COL failover_method FORMAT a15;
COL failed_over FORMAT a11;
SELECT instance_name,host_name,
NULL AS failover_type,NULL AS failover_method,
NULL AS failed_over
FROM v$instance
UNION
SELECT NULL,NULL,failover_type,failover_method,failed_over
FROM v$session
WHERE username = 'SYSTEM';
阅读(1045) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~