ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle在HP RX6600小机上实现HA后的测试方法

Oracle在HP RX6600小机上实现HA后的测试方法

原创 Linux操作系统 作者:ljm0211 时间:2012-06-20 14:18:49 0 删除 编辑

使用的命令:
cmviewcl:查看节点状态
cmrunnode:运行节点
cmhaltnode -f:挂起节点
cmrunpkg:运行package
cmruncl -f:运行集群
ps -ef|grep ora_:查看当前Oracle是否运行

步骤:
1、使用cmviewcl查看节点状态和Oracle在哪个节点上运行,下面显示2个节点zjop01和zjop02都为up状态,zjoppkg运行在zjop01节点上,即Oracle运行在zjop01节点上。
zjop01#[/]cmviewcl

CLUSTER        STATUS
cluster_zjop   up

NODE           STATUS       STATE
zjop01         up           running

    PACKAGE        STATUS        STATE         AUTO_RUN     NODE
    zjoppkg        up            running       enabled      zjop01

NODE           STATUS       STATE
zjop02         up           running

2、查看Oracle当前在zjop01节点上是否正常运行,结果显示正常。
zjop01#[/]ps -ef|grep ora_
oracle 21457     1 0 13:55:30 ?         0:00 ora_q001_zjdb
oracle 21455     1 0 13:55:30 ?         0:00 ora_q000_zjdb
oracle 21390     1 0 13:55:14 ?         0:00 ora_dbw0_zjdb
oracle 21384     1 0 13:55:14 ?         0:00 ora_pmon_zjdb
oracle 22991     1 0 14:35:24 ?         0:00 ora_j000_zjdb
    root 23002 14155 0 14:36:20 pts/0     0:00 grep ora_
oracle 21392     1 0 13:55:15 ?         0:00 ora_lgwr_zjdb
oracle 21398     1 0 13:55:15 ?         0:00 ora_reco_zjdb
oracle 21404     1 0 13:55:15 ?         0:00 ora_cjq0_zjdb
oracle 21406     1 0 13:55:15 ?         0:00 ora_mmon_zjdb
oracle 21394     1 0 13:55:15 ?         0:00 ora_ckpt_zjdb
oracle 21386     1 0 13:55:14 ?         0:00 ora_psp0_zjdb
oracle 21408     1 0 13:55:15 ?         0:00 ora_mmnl_zjdb
oracle 21388     1 0 13:55:14 ?         0:01 ora_mman_zjdb
oracle 21414     1 0 13:55:20 ?         0:00 ora_qmnc_zjdb
oracle 21396     1 0 13:55:15 ?         0:00 ora_smon_zjdb

3、使用cmhaltnode命令挂起zjop01节点,红色为一次出错的输出信息,通过shutdown -ry 0重启zjop01,然后cmruncl -f再启动集群的方法解决了问题,出现问题的原因暂时未知。蓝色为运行正常的信息。
zjop01#[/]cmhaltnode -f zjop01
Disabling all packages from starting on nodes to be halted.
Warning: Do not modify or enable packages until the halt operation is completed.
Disabling automatic failover for failover packages to be halted.
Halting package zjoppkg
The package script. for zjoppkg failed with no restart. zjoppkg should not be restarted
Unable to halt package zjoppkg
Check the syslog and pkg log files for more detailed information

zjop01#[/]cmhaltnode -f zjop01
Disabling all packages from starting on nodes to be halted.
Warning: Do not modify or enable packages until the halt operation is completed.
Disabling automatic failover for failover packages to be halted.
Halting package zjoppkg
Successfully halted package zjoppkg
Waiting for nodes to halt ..... done
Successfully halted all nodes specified.
Halt operation complete.

4、使用cmviewcl查看当前节点状态,显示zjop01节点已经挂起,zjoppkg在zjop02上运行起来,即数据库已经在zjop02上运行。
zjop01#[/]cmviewcl

CLUSTER        STATUS
cluster_zjop   up

NODE           STATUS       STATE
zjop01         down         halted
zjop02         up           running

    PACKAGE        STATUS        STATE         AUTO_RUN     NODE
    zjoppkg        up            running       enabled      zjop02

5、rlogin到zjop02,ps -ef|grep ora_查看oracle进程,以下显示Oracle进程正常,到此实现HA切换成功。
zjop02#[/]ps -ef|grep ora_
oracle 25829     1 0 17:03:57 ?         0:00 ora_reco_zjdb
oracle 25815     1 0 17:03:57 ?         0:00 ora_pmon_zjdb
oracle 25835     1 0 17:03:57 ?         0:00 ora_mmnl_zjdb
oracle 25833     1 0 17:03:57 ?         0:00 ora_mmon_zjdb
oracle 25897     1 0 17:04:14 ?         0:00 ora_q001_zjdb
oracle 25819     1 0 17:03:57 ?         0:01 ora_mman_zjdb
    root 26083 26067 1 17:09:38 pts/1     0:00 grep ora_
oracle 25831     1 0 17:03:57 ?         0:00 ora_cjq0_zjdb
oracle 25825     1 0 17:03:57 ?         0:00 ora_ckpt_zjdb
oracle 26023     1 0 17:09:05 ?         0:00 ora_j000_zjdb
oracle 25823     1 0 17:03:57 ?         0:00 ora_lgwr_zjdb
oracle 25817     1 0 17:03:57 ?         0:00 ora_psp0_zjdb
oracle 25827     1 0 17:03:57 ?         0:00 ora_smon_zjdb
oracle 25821     1 0 17:03:57 ?         0:00 ora_dbw0_zjdb
oracle 25895     1 0 17:04:14 ?         0:00 ora_q000_zjdb
oracle 25883     1 0 17:04:04 ?         0:00 ora_qmnc_zjdb

6、使用cmrunnode zjop01,启动节点zjop01,然后使用cmviewcl查看,显示zjop01节点已经运行,zjoppkg运行在zjop02上。
zjop02#[/]cmrunnode zjop01
cmrunnode: Validating network configuration...
cmrunnode: Network validation complete
cmrunnode: Validating cluster lock disk .... Done
Waiting for nodes to join ..... done
Cluster successfully formed.
Check the syslog files on all nodes in the cluster to verify that no warnings occurred during startup.
zjop02#[/]cmviewcl

CLUSTER        STATUS
cluster_zjop   up

NODE           STATUS       STATE
zjop01         up           running
zjop02         up           running

    PACKAGE        STATUS        STATE         AUTO_RUN     NODE
    zjoppkg        up            running       enabled      zjop02

7、使用cmhaltnode -f zjop02挂起zjop02节点,使得zjop01节点接管Oracle进程,然后再cmrunnode zjop02启动zjop02节点,恢复到测试前的状态。
zjop02#[/]cmhaltnode -f zjop02
Disabling all packages from starting on nodes to be halted.
Warning: Do not modify or enable packages until the halt operation is completed.
Disabling automatic failover for failover packages to be halted.
Halting package zjoppkg
Successfully halted package zjoppkg
Waiting for nodes to halt ... done
Successfully halted all nodes specified.
Halt operation complete.
zjop02#[/]cmviewcl

CLUSTER        STATUS
cluster_zjop   up

NODE           STATUS       STATE
zjop01         up           running

    PACKAGE        STATUS        STATE         AUTO_RUN     NODE
    zjoppkg        starting      starting      enabled      zjop01

NODE           STATUS       STATE
zjop02         down         halted
zjop02#[/]cmrunnode zjop02
cmrunnode: Validating network configuration...
cmrunnode: Network validation complete
cmrunnode: Validating cluster lock disk .... Done
Waiting for nodes to join ..... done
Cluster successfully formed.
Check the syslog files on all nodes in the cluster to verify that no warnings occurred during startup.
zjop02#[/]cmviewcl

CLUSTER        STATUS
cluster_zjop   up

NODE           STATUS       STATE
zjop01         up           running

    PACKAGE        STATUS        STATE         AUTO_RUN     NODE
    zjoppkg        up            running       enabled      zjop01

NODE           STATUS       STATE
zjop02         up           running

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11411056/viewspace-733371/,如需转载,请注明出处,否则将追究法律责任。

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

注册时间:2009-05-14

  • 博文量
    272
  • 访问量
    442038