码迷,mamicode.com
首页 > 数据库 > 详细

Oracle11g(RedHat Enterprise Linux6.7)-ASM

时间:2017-10-06 18:38:26      阅读:279      评论:0      收藏:0      [点我收藏+]

标签:bash   instance   alt   pad   运行   crs_stat   selinux   操作   abort   

Oracle11g(RedHat Enterprise Linux6.7)-ASM
基础环境说明:
操作系统:RedHat Enterprise Linux 6.7 x86_64
IP地址: 192.168.56.10
Oracle版本:Oracle11.2.0.4
Oracle安装目录:/u01
Oracle数据目录:asm_disk
Oracle归档目录:/archive
所有的ASMLib安装需要oracleasmlib和oracleasm-support安装包
oracleasm-support包可以从http://public-yum.oracle.com下载,
oracleasm kernel driver已经被集成到Unbreakable Enterprise Kernel for Oracle Linux 6,不需要手工安装。
RedHat 编译版本的oracleasm kernel driver可以从http://public-yum.oracle.com通过yum工具安装
#yum install kmod-oracleasm
RedHat Enterprise Linux 6.7 x86_64环境中需要安装的ASM相关包为:
rpm -ivh kmod-oracleasm-2.0.8-5.el6_7.x86_64.rpm
rpm -ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm
rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
关闭不必要的系统服务
chkconfig cups off
chkconfig sendmail off
chkconfig isdn off
chkconfig smartd off
chkconfig iptables off
reboot
编辑主机HOST配置文件
vi /etc/hosts
192.168.56.10    asm11g
创建共享盘
cd C:\Program Files (x86)\VMware\VMware Workstation
vmware-vdiskmanager.exe -c -s 5000Mb -a lsilogic -t 2 E:\VMware-OS\asm11g\asmdisk\asm_disk01.vmdk
vmware-vdiskmanager.exe -c -s 5000Mb -a lsilogic -t 2 E:\VMware-OS\asm11g\asmdisk\asm_disk02.vmdk
vmware-vdiskmanager.exe -c -s 5000Mb -a lsilogic -t 2 E:\VMware-OS\asm11g\asmdisk\asm_disk03.vmdk
这条语句是为了新建ASM DISKGROUP使用的
vmware-vdiskmanager.exe -c -s 10000Mb -a lsilogic -t 2 E:\VMware-OS\asm11g\asmdisk\asm_disk04.vmdk
编辑vmx文件,识别共享磁盘
下面类容添加到 asm11g中的asm11g.vmx中
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1.sharedBus = "virtual"
scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.filename = "asmdisk\asm_disk01.vmdk"
scsi1:1.deviceType = "plainDisk"
scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.filename = "asmdisk\asm_disk02.vmdk"
scsi1:2.deviceType = "plainDisk"
scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.filename = "asmdisk\asm_disk03.vmdk"
scsi1:3.deviceType = "plainDisk"
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
需要添加内容结束(可选项)
后期追加 asm_data4,查看 asmdisk 和 普通disk 在asm 中的应用【空间不够用时的扩展】
vmware-vdiskmanager.exe -c -s 5000Mb -a lsilogic -t 2 H:/VM_ware/ora_11g/oel6disk/asm_data4.vmdk
scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.filename = "H:/VM_ware/ora_11g/oel6disk/asm_data4.vmdk"
scsi1:4.deviceType = "plainDisk"
用发现asmca 在linux下是只能看到 asmdisk(oracleasm 创建) 或者 rawdisk(udev 配置),是看不到rawpartition(裸区)的
修改 rhel57_11gr2asm 的信息
默认网关必须设置
不然 vipca 报错
vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=dbasm
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29:59:4B:00
ONBOOT=yes
IPADDR=192.168.249.15
NETMASK=255.255.255.0
GATEWAY=192.168.249.1
vi /etc/hosts
192.168.249.15 dbasm
--重启网络服务,使修改生效
service network restart
建立oracle,grid用户
11gr2建议将oracle用户的权限分离,当然不分离也是可以的,不过分离是应该的,
把数据库用户和存储用户区别开,就好比 data tablespace 和index tablespace 一样让人概念清晰,管理方便
估计会在12c中强制分离
创建Oracle及想应的用户组
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
groupadd asmdba
groupadd asmoper
--创建oracle用户及grid用户,这里可以看出grid的权限是比oracle大的
useradd -g oinstall -G asmdba,dba,oper oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,dba,oper grid
passwd oracle
passwd grid
--检查
[root@dbasm ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),504(asmdba)
[root@dbasm ~]# id grid
uid=501(grid) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin),504(asmdba),505(asmoper)
[root@dbasm ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
创建Oracle相关目录
mkdir -p /u01/app/oracle/product/11.2.0/db_1
mkdir -p /u01/app/grid/product/11.2.0/grid_1
mkdir -p /u01/app/gridbase
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/gridbase
chmod -R 775 /u01
--如果有错可以用usermod 命令修改
[root@dbasm ~]# usermod -G osasm,osdba,osoper,dba,oper oracle
--查看oracle,grid 用户是否配置正确
[root@dbasm ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),504(asmdba)
[root@dbasm ~]# id grid
uid=501(grid) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin),504(asmdba),505(asmoper)
配置Oracle基础配置文件
vi /etc/security/limits.conf
#ORACLE SETTING
grid                soft    nproc  2047
grid                hard    nproc  16384
grid                soft    nofile  1024
grid                hard    nofile  65536
oracle              soft    nproc  2047
oracle              hard    nproc  16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
vi /etc/pam.d/login
#ORACLE SETTING
session    required    pam_limits.so
vi /etc/sysctl.conf
#ORACLE SETTING
#kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmni = 4096
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
立即生效
sysctl -p
vi /etc/selinux/config
SELINUX=disabled
--应该是不需要的,单机需要时间同步?在11gr2 中确实是需要这样做的
禁用NTP服务
gird时间同步所需要的设置(需要执行,否则安装grid时间会报错),
Network Time Protocol Setting
/sbin/service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak 或者 rm /etc/ntp.conf
fdisk 处理裸设备,使其变为裸区,切记不要格式化为文件系统
通过如下命令创建分区,
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
/dev/sdb1
/dev/sdb2
/dev/sdc1
/dev/sdc2
/dev/sdd1
/dev/sdd2
其中sdd1,sdd2为扩展vg所用(又要啰嗦的说下安装前的规划是何等重要)
--创建PV
# pvcreate /dev/sdd1
# pvcreate /dev/sdd2
--PV添加到VG
# vgextend VolGroup00 /dev/sdd1
# vgextend VolGroup00 /dev/sdd2
--查看PV
# pvs
# lvdisplay
--扩容LV
# lvextend -L +3000M /dev/VolGroup00/LogVol00
--扩大文件系统
# resize2fs -p /dev/mapper/VolGroup00-LogVol00
--查看扩容是否成功
# df -h
不再配置裸设备,直接使用裸区,以下直接忽略
vi /etc/udev/rules.d/60-raw.rules
ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdc2",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add",KERNEL=="raw[1-4]", OWNER="grid", GROUP="asmadmin", MODE="660"
[root@rac1 ~]# start_udev
[root@rac1 ~]# ls -lrt /dev/raw
在ASMLIB相关软件包已经安装的前提下执行如下命令完成ASM的相关配置
[root@ora11gr2asm 11.2.0]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets (‘[]‘). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
开始创建 asm盘(一定要改参数 asm_diskstring="ORCL:*")
在本次实验中(11.2.0.3)中创建ASM盘遇到N多问题,解决问题的过程,了解到些东西。
在root用户下操作
/etc/init.d/oracleasm createdisk VOL1_SDB1 /dev/sdb1
/etc/init.d/oracleasm createdisk VOL2_SDB2 /dev/sdb2
/etc/init.d/oracleasm createdisk VOL3_SDC1 /dev/sdc1
/etc/init.d/oracleasm createdisk VOL4_SDC2 /dev/sdc2
/etc/init.d/oracleasm createdisk VOL5_SDD1 /dev/sdd1
/etc/init.d/oracleasm createdisk VOL6_SDD2 /dev/sdd2
扫描ASM磁盘
/etc/init.d/oracleasm scandisks
查看ASM磁盘
/etc/init.d/oracleasm listdisks
oracleasm的log:
tail -20 /var/log/oracleasm
oracle 用户的.bash_profile 文件
vi /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=asm11g
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export TEMP=/tmp
export TMPDIR=/tmp
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
        umask 022
fi
grid 用户配置文件 ORACLE_HOSTNAME请自行设置
vi /home/grid/.bash_profile
export ORACLE_BASE=/u01/app/gridbase
export ORACLE_HOME=/u01/app/grid/product/11.2.0/grid_1
export ORACLE_SID=+ASM
export TEMP=/tmp
export TMPDIR=/tmp
PATH=$ORACLE_HOME/bin:$PATH; export PATH
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
        umask 022
fi
安装的整体思路为:ASM软件,配置ASM,数据库软件,配置数据库。
在客户端机器中执行
$export DISPLAY=192.168.1.103:0.0
$xhost +
RedHat Enterprise Linux 6.7 x64环境下安装Oracle 11.2.0.4需要安装的软件包;
1、gcc软件包
rpm -ivh gcc-4.4.7-16.el6.x86_64.rpm cloog-ppl-0.15.7-1.2.el6.x86_64.rpm cpp-4.4.7-16.el6.x86_64.rpm ppl-0.10.2-11.el6.x86_64.rpm mpfr-2.4.1-6.el6.x86_64.rpm
2、compat-libstdc++软件包
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
3、elfutils-libelf-devel软件包
rpm -ivh elfutils-libelf-devel-0.161-3.el6.x86_64.rpm
4、gcc-c++软件包
rpm -ivh gcc-c++-4.4.7-16.el6.x86_64.rpm libstdc++-devel-4.4.7-16.el6.x86_64.rpm
5、libaio-devel 软件包
rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
6、pdksh软件包
rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
grid软件安装
最后运行弹出窗口的脚本
/u01/app/oraInventory/orainstRoot.sh
/u01/app/grid/product/11.2.0/grid_1/root.sh
一下为执行过程orainstRoot.sh
[root@asm11g ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
执行root.sh
[root@asm11g ~]# /u01/app/grid/product/11.2.0/grid_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/grid/product/11.2.0/grid_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
  Copying dbhome to /usr/local/bin ...
  Copying oraenv to /usr/local/bin ...
  Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/grid/product/11.2.0/grid_1/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.
按照上面的提示执行roothas.pl
[root@asm11g ~]#/u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_params
Creating trace directory
/u01/app/grid/product/11.2.0/grid_1/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
Failed to create keys in the OLR, rc = 127, Message:
Failed to create keys in the OLR at /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_lib.pm line 7660.
上面的错误处理步骤如下:
[root@asm11g Packages]# cd /lib64
[root@asm11g lib64]# ls -lrt libcap*
[root@asm11g lib64]# ls -lrt libcap.so.2
[root@asm11g lib64]# ln -s libcap.so.2.16 libcap.so.1
再次执行roothas.pl
[root@asm11g ~]#/u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_params
Improper Oracle Grid Infrastructure configuration found on this host
Deconfigure the existing cluster configuration before starting
to configure a new Grid Infrastructure
run ‘/u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl -deconfig‘
to configure existing failed configuration and then rerun root.sh
重新执行roothas.pl
[root@asm11g ~]#/u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl -deconfig
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_params
Oracle Restart stack is not active on this node
Restart the SIHA stack (use /u01/app/grid/product/11.2.0/grid_1/bin/crsctl start has) and retry
Failed to verify HA resources
执行删除命令
/u01/app/grid/product/11.2.0/grid_1/crs/install/rootcrs.pl -deconfig -force -verbose
再次执行root脚本
[root@asm11g ~]# /u01/app/grid/product/11.2.0/grid_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/grid/product/11.2.0/grid_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/grid/product/11.2.0/grid_1/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.
按照上面的提示执行roothas.pl
[root@asm11g ~]# /u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user ‘grid‘, privgrp ‘oinstall‘..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root‘, privgrp ‘root‘..
Operation successful.
CRS-4664: Node asm11g successfully pinned.
Adding Clusterware entries to upstart
asm11g    2015/10/05 22:54:23    /u01/app/grid/product/11.2.0/grid_1/cdata/asm11g/backup_20151005_225423.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
运行 netca 配置监听(在grid用户下)
运行 asmca (从dbca中分离了出来)
--没有配置linux raw 时看不到任何设备,为什么,重启后可以看到!神器了!
asm实例的用户密码均为oracle
注意 asm_diskstring 赋值为 "ORCL:*"
alter system set asm_diskstring="ORCL:*"
裸区被标记为asmdisk后,系统会优先扫描裸区,这样asmdisk虽然可见,但是不可用,
修改 asm_diskstring="ORCL:*" 那asm就仅能看见 asmdisk
如果配置 asmca 时出错,退出后重新运行 asmca 就可以了!
建议asm disk group 有个远景规划,比如预计100G左右的数据库要按照1000G的数据库去规划
DG_DATA01
最后提示如下时,说明asm实例创建成功
ASM created and started successfully.
Disk Group DG_DATA01 created successfully.
grid 用户下,注意用sysasm登录(11g新加的角色)
[grid@dbasm ~]$ sqlplus /nolog
SQL> conn / as sysasm
Connected.
SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
安装数据库(仅安装数据库软件)
下一步,一直下一步 注意选择 only database software
/u01/app/oracle/product/10.2.0/db_1/root.sh
分别运行后 数据库软件就算安装完毕了
开始创建数据库,运行dbca
[oracle@rac1 database]$ dbca
注意存储时选择ASM,
DG_DATA01
注意选择数据库的编码
再后面是创建数据库了,没什么好说的了
------------
11g grid 下启动asm实例会报 ORA-29701 错误
[grid@dbasm ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on Sun May 12 00:29:57 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service
那是因为css没有起来,可以手动起来,或者稍等一下,因为重启后会随着系统启动,存在延迟
注意用户.bash_profile 的 ORACLE_SID 和dbca 的实例名的大小写
--检查css
crsctl check css
ps -ef|grep cssd
--检查has
crsctl check has
ps -ef|grep d.bin
手动启动css
crsctl start resource ora.cssd
手动启动全部资源
crsctl start resource -all
[grid@dbasm bin]$ ./crs_stat -t -v
Name          Type          R/RA  F/FT  Target    State    Host     
----------------------------------------------------------------------
ora....A_01.dg ora....up.type 0/5    0/    ONLINE    ONLINE    dbasm   
ora....ER.lsnr ora....er.type 0/5    0/    ONLINE    ONLINE    dbasm   
ora.asm        ora.asm.type  0/5    0/    ONLINE    ONLINE    dbasm   
ora.cssd      ora.cssd.type  0/5    0/5    ONLINE    ONLINE    dbasm   
ora.diskmon    ora....on.type 0/10  0/5    OFFLINE  OFFLINE           
ora.evmd      ora.evm.type  0/10  0/5    ONLINE    ONLINE    dbasm   
ora.ons        ora.ons.type  0/3    0/    OFFLINE  OFFLINE
crsctl status resource -t
[grid@dbasm admin]$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME          TARGET  STATE        SERVER                  STATE_DETAILS   
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DG_DATA_01.dg
              ONLINE  ONLINE      dbasm                                     
ora.LISTENER.lsnr
              ONLINE  ONLINE      dbasm                                     
ora.asm
              ONLINE  ONLINE      dbasm                    Started         
ora.ons
              OFFLINE OFFLINE      dbasm                                     
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.bidb.db
      1        ONLINE  ONLINE      dbasm                    Open             
ora.cssd
      1        ONLINE  ONLINE      dbasm                                     
ora.diskmon
      1        OFFLINE OFFLINE                                               
ora.evmd
      1        ONLINE  ONLINE      dbasm 
1)默认情况下HAS(High Availability Service)是自动启动的.通过如下命令可以取消和启用自动启动
    crsctl disable has     
    crsctl enable has   
2)HAS手动启动和停止     
    crsctl start has     
    crsctl stop has   
3)查看HAS的状态     
    crsctl check has   
4)如果想让ora.css和ora.diskmon服务随着HAS的启动而自动启动,
  那么你可以这两个服务的AUTO_START属性     
  crsctl modify resource "ora.cssd" -attr "AUTO_START=1"   
  or     
  crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"
5)如果想取消ora.css和ora.diskmon的Auto start     
  crsctl modify resource "ora.cssd" -attr "AUTO_START=never"
  or
  crsctl modify resource "ora.diskmon" -attr "AUTO_START=never"
但是我发现在RHEL6.3上启动has服务并不能只使用crsctl start has 这个命令来启动,还必须以root用户去执行
/etc/init.d/init.ohasd run 这命令,才能启动has服务,不然crsctl start has 会一直挂着且也不能启动。
查看资源属性
crs_stat -p ora.cssd
AUTO_START=never
crs_stat -p ora.diskmon
AUTO_START=never
----------------------------------------------------------
init.ohasd

Oracle11g(RedHat Enterprise Linux6.7)-ASM

标签:bash   instance   alt   pad   运行   crs_stat   selinux   操作   abort   

原文地址:http://www.cnblogs.com/hanyist/p/7631921.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!