AIX+HA+双机互备ORACLE

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
"
sleep 5
kill -9 `ps -ef | grep cinms | grep LOCAL=NO |awk '{print $2}'`
su - oracle -c"
export ORACLE_SID=cinms
sqlplus /nolog <<EOF
conn / as sysdba
shutdown immediate
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
3
#smit hacmp
4
5
6
7
选择所有节点
8
9SERVER_IP
9
11
12
13
14:
15
16:
# lspv | grep cinms
hdisk3 00ce9f6ad8f74bf9 cinmsvg active
hdisk4 00ce9f6aff0292c1 cinmsvg active
# lspv | grep yssh
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
Cinms
25
成功后验证
$ export ORACLE_SID=yssh
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Aug 16 01:32:00 2014
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
su - oracle -c"
export ORACLE_SID=yssh
sqlplus /nolog <<EOF
conn / as sysdba
shutdown immediate
exit
EOF
"
exit 0
$ cat listener.ora
LSNRYSSH =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.1.2)(PORT=1521))
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
inet 10.10.10.206 netmask 0xffffff00 broadcast 10.10.10.255
inet 172.16.0.68 netmask 0xffffff00 broadcast 172.16.0.255
inet 172.16.0.206 netmask 0xffffff00 broadcast 172.16.0.255
19
20
21
22
23
24
$ export ORACLE_SID=yssh
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Aug 16 15:28:22 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
inet 192.168.1.206 netmask 0xffffff00 broadcast 192.168.1.255
tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en1: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
Yssh
$ export ORACLE_SID=cinms
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Aug 16 01:27:06 2014
lsnrctl start lsnryssh
"
exit 0
# cat stopyssh
#!/usr/bin/ksh
banner stoptyssh | wall
su - oracle -c"
lsnrctl stop lsnryssh
"
sleep 5
kill -9 `ps -ef | grep yssh | grep LOCAL=NO |awk '{print $2}'`
inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
inet6 ::1%1/0
tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1
2
192.168.1.206 aix206_boot1
10:创建集群CLUSTER
11:添加节点ADD NODE
12:discover抓取节点信息,创建心跳磁盘
--这个如果正确抓取就会有百分比出现
--smit mkvg创建心跳磁盘
13:创建网络TCP/IP,和心跳网络
14:添加网络接口,和心跳接口
####################
这里就可以同步一次验证一下,并且启动HA,使server_ip
(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.1.20)(PORT=1522))
)
SID_LIST_LSNRCINMS =
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=cinms)
(SID_NAME=cinms)
(ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1)
步骤简述
1:安装AIX操作系统
2:安装ORACLE和HA的基础软件
3:升级操作系统
4:安装HA软件
5:打HA补丁
6:重启
7:主机名
8:IP
9:vi /etc/hosts
--所有的NODENAME和HOSTNAME都要用小写
TOP
########################################3
exห้องสมุดไป่ตู้t
EOF
"
exit 0
# cat startyssh
banner startyssh | wall
su - oracle -c "
export ORACLE_SID=yssh
sqlplus /nolog <<EOF
conn / as sysdba
startup
exit
EOF
"
su - oracle -c "
15.创建Resource ,SERVER_IP,APP,SCRIPTS
这时候要验证你的开机和关机启动脚本
16:
创建资源组RG
A.Rg运行在哪些节点上
B.节点优先级顺序
C.Rg启动策略
D.切换策略
E.回切策略
17:修改资源组属性,将资源加入到资源组
18:检查配置是否正确
19:同步到其他节点
20:启动集群服务
hdisk1 00ce9f6ad767447d ysshvg active
17
启动关闭及监听脚本如下,记住更改权限
# cat startcinms
banner startcinms | wall
su - oracle -c "
export ORACLE_SID=cinms
sqlplus /nolog <<EOF
conn / as sysdba
startup
exit
EOF
"
su - oracle -c "
lsnrctl start lsnrcinms
"
exit 0
# cat stopcinms
#!/usr/bin/ksh
banner stoptcinms | wall
su - oracle -c"
lsnrctl stop lsnrcinms
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$ hostname
aix208
26
AIX206数据库启动
$ export ORACLE_SID=yssh
$ sqlplus / as sysdba
10.10.10.206 aix206_boot2
172.16.0.206 aix206
192.168.1.208 aix208_boot1
10.10.10.208 aix208_boot2
172.16.0.208 aix208
172.16.0.68 srvyssh
172.16.0.86 srvcinms
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
21:测试
HA ORACLE
1
# ifconfig -a
en0: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
)
)
2边测试
# /scripts/startcinms成功
# /scripts/stopcinms关闭
# /scripts/startyssh成功
# /scripts/stopyssh
18
# smit mkvg
# importvg -y hbvg hdisk5
synclvodm: No logical volumes in volume group hbvg.
SQL*Plus: Release 11.2.0.1.0 Production on Sat Aug 16 15:39:06 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
yssh
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
hbvg
0516-783 importvg: This imported volume group is concurrent capable.
Therefore, the volume group must be varied on manually.
使用命令验证心跳盘
#/usr/sbin/rsct/bin/dhb_read -p hdisk5–r
)
SID_LIST_LSNRYSSH=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=yssh)
(SID_NAME=yssh)
(ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1)
)
)
LSNRCINMS =
(ADDRESS_LIST=
相关文档
最新文档