ITPub博客

首页 > 数据库 > Oracle > rac oracle10 asm+raw for centos5.6 on vm server

rac oracle10 asm+raw for centos5.6 on vm server

原创 Oracle 作者:lovehewenyu 时间:2012-05-28 17:45:48 0 删除 编辑

RAC实验报告(vm server asm+raw+oracle10g

首先感谢:以下笔者,没有你们就没有我这个实验的结果。

http://blog.csdn.net/tianlesoftware/article/details/5872593tianlesofeware

http://hi.baidu.com/woshi110/blog/category/vmware%2Blinux%2Boracle10g%20rac%C8%AB%B9%FD%B3%CC (我是110)

 

服务器主机名

rac1-21

rac2-22

 

Public(eth0)

192.168.0.21

192.168.0.22

 

Vip  (eth0)

192.168.0.23

192.168.0.24

 

Priv  (eth1)

192.168.1.25

192.168.1.26

 

Oracle_sid

Rac1-21

Rac-22

 

集群

racdb

 

OCR

/dev/raw/raw1

200M

 

/dev/raw/raw2

200M

 

Voting disk

/dev/raw/raw3

200M

 

/dev/raw/raw4

200M

 

/dev/raw/raw5

200M

 

RAC_DISK

/dev/raw/raw6

4G

 

/dev/raw/raw7

4G

 

BACKUP_DISK

/dev/raw/raw8

2G

 

/dev/raw/raw9

2G

 

 

 

 

 

 

 

一、IP地址规划及/etc/hosts 配置

 

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1      rac1-21         localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

192.168.0.21    rac1-21

192.168.0.22    rac2-22

192.168.0.23    rac1-vip

192.168.0.24    rac2-vip

192.168.1.25    rac1-priv

192.168.1.26    rac2-priv

 

l  关于IP地址一些问题

http://space.itpub.net/?uid-26442936-action-viewspace-itemid-730968

 

二、建立用户,组,用户变量,目录

1、用户,组,修改密码

[root@rac1-21 ~]groupadd -g  1000 oinstall

[root@rac1-21 ~]groupadd -g 1001 dba

[root@rac1-21 ~]useradd -u 1000 ora -g oinstall -G dba

[root@rac1-21 ~]# passwd ora

Changing password for user ora.

New UNIX password:

BAD PASSWORD: it is based on a dictionary word

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

 

2、用户变量

[root@rac1-21 ~]vi .bash_profile

export TMP=/tmp

export TMPDIR=$TMP

export ORACLE_BASE=/u01/oracle

export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORACLE_CRS_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORACLE_SID=racdb1

export ORACLE_TERM=xterm

export PATH=/usr/sbin:$PATH

#export PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_CRS_HOME/bin

export PATH=.:${PATH}:$HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin/

export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

umask 022

 

3、目录,权限

[root@rac1-21 ~]# mkdir -p /u01/oracle

[root@rac1-21 ~]# chown ora:oinstall /u01/oracle

[root@rac1-21 /]# ls –l

drwxr-xr-x   5 ora  oinstall  4096 05-17 16:19 u01

 

 

三、设置限制参数,计时器

1、配置内核参数

[root@rac1-21 /]# vi  /etc/sysctl.conf  在文件底部添加下面参数

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 1048576

net.core.rmem_max = 1048576

net.core.wmem_default = 262144

net.core.wmem_max = 262144

让设置生效

[root@rac1-21 /]# sysctl –p

 

2、提高Oracle用户的shell限制

设置oracle 使用的文件数权限

[root@rac1-21 /]# vi  /etc/security/limits.conf  文件底部添加下面参数

ora soft nproc 2047

ora hard nproc 16384

ora soft nofile 1024

ora hard nofile 65536

 

3、配置Hangcheck 计时器

[root@rac1-21 /]# vi /etc/rc.local

增加:

modprobe hangcheck-timer hangcheck-tick=30 hangcheck_margin=180

这个增加后,记住一定要重新或者执行生效啊!

 

要立即加载模块,执行

[root@rac1-21 ~]# modprobe -v hangcheck-timer

查看是否执行成功,下面为成功

[root@rac1-21 ~]# lsmod | grep hangcheck_timer

hangcheck_timer         8153  0

 

四、准备补丁和ASM

系统包下载地址:

http://oss.oracle.com/projects/compat-oracle/files/Enterprise_Linux/

ASM包下载地址:

[root@rac1-21 u01]# uname -a

Linux rac1-21 2.6.18-238.el5 #1 SMP Thu Jan 13 16:24:47 EST 2011 i686 i686 i386 GNU/Linux

http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html

(这里有不同的类型CPU,找到对应你自己系统的 1,CPU  2,是内核版本)

oracleasm-2.6.18-238.el5-2.0.5-1.el5.i686.rpm       

oracleasm-2.6.18-238.el5PAE-2.0.5-1.el5.i686.rpm

oracleasm-2.6.18-238.el5debug-2.0.5-1.el5.i686.rpm  

oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.i686.rpm

oracleasm-support-2.1.7-1.el5.i386.rpm

compat-binutils215-2.15.92.0.2-24.i386.rpm         

compat-libcwait-2.1-1.i386.rpm

compat-libstdc++-egcs-1.1.2-1.i386.rpm

openmotif21-debuginfo-2.1.30-11.EL5.i386.rpm

xorg-x11-libs-compat-6.8.2-1.EL.33.0.1.i386.rpm

所有节点都应该安装所需的包,我们是整体复制,所有一个节点安装好,复制到另一个节点就OK 了。

 

安装步骤下面:

http://space.itpub.net/?uid-26442936-action-viewspace-itemid-730970

 

 

五、VM server 划分共享磁盘。

具体VM server建立磁盘,分区。

注意磁盘驱动器要选择SCSI,还有建立虚拟机的时候选择I/0 adapter types 选择 LSI Logic

 

下面只是写出了一部分。

[root@rac1-21 u01]# fdisk -l

Disk /dev/hda: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/hda1   *           1          13      104391   83  Linux

/dev/hda2              14         905     7164990   83  Linux

/dev/hda3             906        1287     3068415   82  Linux swap / Solaris

Disk /dev/sdb: 214 MB, 214748160 bytes   磁盘大小200M

64 heads, 32 sectors/track, 204 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdb doesn't contain a valid partition table

 

六、用节点1克隆出节点2

1、  把节点SHUTDOWN,然后建立一个目录。

2、  把节点1目录下的所有文件,复制到另一个目录下。注意共享磁盘文件不用复制。

3、  编辑Red Hat Linux.vmx   这个文件。修改displayName = "rac1-21" displayName = "rac2-22"即可,然后到另一个目录下,双击

 

七、克隆出来2个节点,修改节点2

具体步骤如下。

1、修改 /etc/sysconfig/network   hostname=rac2-22

2、修改IP地址。注意HWaddr 必须一致

3、修改用户变量。ORACLE_SID=racdb2

修改成功后,重启一下系统。这个是必须的。

 

八、用户对等性。

[ora@rac1-21 ~]$ mkdir ~/.ssh

[ora@rac1-21 ~]$ chmod 700 ~/.ssh

[ora@rac1-21 ~]$ ssh-keygen -t rsa

[ora@rac1-21 ~]$ ssh-keygen -t dsa

 

[ora@rac2-22 ~]$ mkdir ~/.ssh

[ora@rac2-22 ~]$ chmod 700 ~/.ssh

[ora@rac2-22 ~]$ ssh-keygen -t rsa

[ora@rac2-22 ~]$ ssh-keygen -t dsa

 

以下节点1运行即可

[ora@rac1-21 ~]$ cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys

[ora@rac1-21 ~]$ cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys

[ora@rac1-21 ~]$ ssh rac2-22 cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys

[ora@rac1-21 ~]$ ssh rac2-22 cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys

[ora@rac1-21 ~]$ ssh rac2-22 cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys

 

检验对等性

[ora@rac1-21 ~]$ ssh rac1-21 date

[ora@rac1-21 ~]$ ssh rac1-priv date

[ora@rac1-21 ~]$ ssh rac2-22 date

[ora@rac1-21 ~]$ ssh rac2-priv date

能看到时间,不用输入密码,这样就可以了。看到时间这里就引出一个问题,时间不同步。

 

九、时间同步

vi /etc/ntp.conf

restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap

server  127.127.1.0 minpoll 4   # local clock

fudge   127.127.1.0 stratum 1

 

cd /etc/ntp

清空ntpservers

vi step-tickers

####添加以下信息

127.127.1.0

 

[root@rac1-21 ntp]# service ntpd restart

关闭 ntpd[失败]

ntpd: 同步时间服务器:[失败]

启动 ntpd[确定]

[root@rac1-21 ntp]# chkconfig ntpd on

[root@rac1-21 ntp]# chkconfig ntpd --list

ntpd            0:关闭  1:关闭  2:启用  3:启用  4:启用  5:启用  6:关闭

 

节点2操作

[root@rac2-22 ~]# /usr/sbin/ntpdate rac1-priv

15 Feb 00:01:06 ntpdate[29130]: no server suitable for synchronization found

刚同步 ,会报这样的错误。这需要有足够的时间来同步,我们也可以手动调节时间

[root@rac2-22 ~]# ntpdate  rac1-priv

21 May 14:14:48 ntpdate[29263]: adjust time server 192.168.1.25 offset -0.055266 sec

同步成功了

[ora@rac2-22 ~]$ ssh rac1-21 date

2012 05 21 星期一 14:17:22 CST

[ora@rac2-22 ~]$ ssh rac2-22 date

2012 05 21 星期一 14:17:27 CST

 

 

十、配置裸设备

vi  /etc/udev/rules.d/60-raw.rules

 

ACTION=="add", KERNEL=="/dev/sda1", RUN+="/bin/raw /dev/raw/raw1 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="17", RUN+="/bin/raw /dev/raw/raw1 %M %m"

ACTION=="add", KERNEL=="/dev/sdb1", RUN+="/bin/raw /dev/raw/raw2 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="33", RUN+="/bin/raw /dev/raw/raw2 %M %m"

ACTION=="add", KERNEL=="/dev/sdc1", RUN+="/bin/raw /dev/raw/raw3 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="49", RUN+="/bin/raw /dev/raw/raw3 %M %m"

ACTION=="add", KERNEL=="/dev/sdd1", RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="65", RUN+="/bin/raw /dev/raw/raw4 %M %m"

ACTION=="add", KERNEL=="/dev/sde1", RUN+="/bin/raw /dev/raw/raw5 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="81", RUN+="/bin/raw /dev/raw/raw5 %M %m"

ACTION=="add", KERNEL=="/dev/sdf1", RUN+="/bin/raw /dev/raw/raw6 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="97", RUN+="/bin/raw /dev/raw/raw6 %M %m"

ACTION=="add", KERNEL=="/dev/sdg1", RUN+="/bin/raw /dev/raw/raw7 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="113", RUN+="/bin/raw /dev/raw/raw7 %M %m"

ACTION=="add", KERNEL=="/dev/sdh1", RUN+="/bin/raw /dev/raw/raw8 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="129", RUN+="/bin/raw /dev/raw/raw8 %M %m"

ACTION=="add", KERNEL=="/dev/sdi1", RUN+="/bin/raw /dev/raw/raw9 %N"

ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="145", RUN+="/bin/raw /dev/raw/raw9 %M %m"

KERNEL=="raw[1-9]",OWNER=="ora",GROUP="oinstall",MODE="1440"

[root@rac1-21 etc]# start_udev

启动 udev[确定]

[root@rac1-21 dev]# ls -l /dev/raw

总计 0

c-------w- 1 ora oinstall 162, 1 05-21 14:44 raw1

c-------w- 1 ora oinstall 162, 2 05-21 14:44 raw2

c-------w- 1 ora oinstall 162, 3 05-21 14:44 raw3

c-------w- 1 ora oinstall 162, 4 05-21 14:44 raw4

c-------w- 1 ora oinstall 162, 5 05-21 14:44 raw5

c-------w- 1 ora oinstall 162, 6 05-21 14:44 raw6

c-------w- 1 ora oinstall 162, 7 05-21 14:44 raw7

c-------w- 1 ora oinstall 162, 8 05-21 14:44 raw8

udev只能显示8个裸设备

RAW命令

[root@rac1-21 dev]# raw /dev/raw/raw9 /dev/sdi1

/dev/raw/raw9:  bound to major 8, minor 129

[root@rac1-21 dev]# ls -l /dev/raw

总计 0

c-------w- 1 ora oinstall 162, 1 05-21 14:44 raw1

c-------w- 1 ora oinstall 162, 2 05-21 14:44 raw2

c-------w- 1 ora oinstall 162, 3 05-21 14:44 raw3

c-------w- 1 ora oinstall 162, 4 05-21 14:44 raw4

c-------w- 1 ora oinstall 162, 5 05-21 14:44 raw5

c-------w- 1 ora oinstall 162, 6 05-21 14:44 raw6

c-------w- 1 ora oinstall 162, 7 05-21 14:44 raw7

c-------w- 1 ora oinstall 162, 8 05-21 14:44 raw8

c-------w- 1 ora oinstall 162, 9 05-21 15:11 raw9

 

然后 vi /etc /rc.local

modprobe hangcheck-timer hangcheck-tick=30 hangcheck_margin=180

raw /dev/raw/raw9 /dev/sdi1

#/etc/init.d/oracleasm createdisk VOL1 /dev/sda1

#/etc/init.d/oracleasm createdisk VOL2 /dev/sdb1

#/etc/init.d/oracleasm createdisk VOL3 /dev/sdc1

#/etc/init.d/oracleasm createdisk VOL4 /dev/sdd1

#/etc/init.d/oracleasm createdisk VOL5 /dev/sde1

#/etc/init.d/oracleasm createdisk VOL6 /dev/sdf1

#/etc/init.d/oracleasm createdisk VOL7 /dev/sdg1

#/etc/init.d/oracleasm createdisk VOL8 /dev/sdh1

#/etc/init.d/oracleasm createdisk VOL9 /dev/sdi1

这里不应该createdisk,否则 raw上的东西都没了。本人失败的经验!

chown ora:oinstall /dev/raw/*

chown root:onistall /dev/raw/raw1

chown root:onistall /dev/raw/raw2

chmod 644              /dev/raw/raw3

chmod 644              /dev/raw/raw4

chmod 644              /dev/raw/raw5

这段权限配置也是很重要的,如果权限不对,你重启服务器之后就启动不了CRS


 

[root@rac1-21 /]# /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 without typing an

answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: ora      

Default group to own the driver interface []: dba

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]: y

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver: [  OK  ]

Scanning the system for Oracle ASMLib disks: [  OK  ]

 

节点2

[root@rac2-22 ~]# /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 without typing an

answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: ora  

Default group to own the driver interface []: dba

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]: y

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver: [  OK  ]

Scanning the system for Oracle ASMLib disks: [  OK  ]

 

[root@rac1-21 /]# /etc/init.d/oracleasm createdisk VOL6 /dev/sdf1

Marking disk "VOL6" as an ASM disk: [  OK  ]

[root@rac1-21 /]# /etc/init.d/oracleasm createdisk VOL7 /dev/sdg1

Marking disk "VOL7" as an ASM disk: [  OK  ]

[root@rac1-21 /]# /etc/init.d/oracleasm createdisk VOL8 /dev/sdh1

Marking disk "VOL8" as an ASM disk: [  OK  ]

[root@rac1-21 /]# /etc/init.d/oracleasm createdisk VOL9 /dev/sdi1

Marking disk "VOL9" as an ASM disk: [  OK  ]

[root@rac1-21 /]# /etc/init.d/oracleasm scandisks

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rac1-21 /]# /etc/init.d/oracleasm listdisks

VOL6

VOL7

VOL8

VOL9

 

[root@rac2-22 ~]# /etc/init.d/oracleasm scandisks

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@rac2-22 ~]# /etc/init.d/oracleasm listdisks

VOL6

VOL7

VOL8

VOL9

所有节点都可以看到 VOL 就表示我们的共享磁盘可以了。

 

十一、RAC的准备工作已经做完了。现在可以进入重头戏了。安装CRS

1、解压CRS包,检测

[ora@rac1-21 u01]$ unzip 10201_clusterware_linux32.zip  解压

[root@rac1-21 u01]# chown -R ora.oinstall  clusterware

[root@rac1-21 u01]# chmod -R 777 clusterware

检测

[ora@rac1-21 u01]$ /u01/clusterware/cluvfy/runcluvfy.sh stage -pre crsinst -n rac1-21,rac2-22 -verbose

2、用 Xmanger 安装CRS软件

[ora@rac1-21 u01]$ export DISPLAY=192.168.0.1:0.0

[ora@rac1-21 u01]$ /u01/clusterware/runInstaller –ignoreSysPreReqs

export LANG=C 英文界面(乱码用英文的解决)

具体步骤省略了。说下需要注意的。

    2-1、这里默认是安装DB PATH/u01/oracle/product/10.2.0/db_1:,

修改成CRS也就是:/u01/oracle/product/10.2.0/crs_1

         2-2add a new node to  the existing cluster 需要和你的 /etc/hosts 相对应

         2-3ocr 2raw,voting disk 3raw 当然你也可以 ocr 1个,voting disk 1个。但是oracle 建议正式数据库用 ocr 2raw,voting disk 3raw

         2-4、节点2在执行这个命令前:/u01/oracle/product/10.2.0/crs_1/root.sh 

需要vi /u01/oracle/product/10.2.0/crs_1/bin/vipca

LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
fi

fi 后新添加一行:
unset LD_ASSUME_KERNEL

         vi /u01/oracle/product/10.2.0/crs_1/bin/srvctl

LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
同样在其后新增加一行:

unset LD_ASSUME_KERNEL

 

然后执行

[root@rac2-22 ~]# /u01/oracle/product/10.2.0/crs_1/root.sh

 

还会报错,使用oifcfg命令指定网络接口

[root@rac2-22 bin]# cd /u01/oracle/product/10.2.0/crs_1/bin

[root@rac2-22 bin]# ./oifcfg setif -global eth0/192.168.0.0:public

[root@rac2-22 bin]# ./oifcfg setif -global eth0/192.168.1.0:cluster_interconnect

[root@rac2-22 bin]# ./oifcfg getif

eth0  192.168.0.0  global  public       VIP和管理IP段)

eth0  192.168.1.0  global  cluster_interconnect       (心跳IP段)

这里的eth0 指定的是一个网段。

 

这里不要急于下一步,我们应该先添加VIP   ./vipca

添加完VIP 然后在下一步。

 

VIP添加完成后,去CRS界面点击成功。

到这里我们的CRS 已经安装成功了。

[ora@rac2-22 bin]$ ./crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....-21.gsd application    ONLINE    ONLINE    rac1-21    

ora....-21.ons application    ONLINE    ONLINE    rac1-21    

ora....-21.vip application    ONLINE    ONLINE    rac1-21    

ora....-22.gsd application    ONLINE    ONLINE    rac2-22    

ora....-22.ons application    ONLINE    ONLINE    rac2-22    

ora....-22.vip application    ONLINE    ONLINE    rac2-22

 

十二、安装数据库软件

安装数据库软件。

1、安装软件不创建数据库,安装完软件后。

2、先安装监听! netca,选择所有节点。

3dbca建立数据库,并用ASM挂载裸设备。          (挂载这里如果报一个网络错误,不能挂载你只修改一下/etc/hosts  127.0.0.1 localhost 即可)

随后就是等待他们的安装了。

 [ora@rac1-21 ~]$ crs_stat -t

Name           Type           Target    State     Host       

------------------------------------------------------------

ora....SM1.asm application    ONLINE    ONLINE    rac1-21    

ora....21.lsnr application    ONLINE    ONLINE    rac1-21    

ora....-21.gsd application    ONLINE    ONLINE    rac1-21    

ora....-21.ons application    ONLINE    ONLINE    rac1-21    

ora....-21.vip application    ONLINE    ONLINE    rac1-21    

ora....SM2.asm application    ONLINE    ONLINE    rac2-22    

ora....22.lsnr application    ONLINE    ONLINE    rac2-22    

ora....-22.gsd application    ONLINE    ONLINE    rac2-22    

ora....-22.ons application    ONLINE    ONLINE    rac2-22    

ora....-22.vip application    ONLINE    ONLINE    rac2-22    

ora.racdb.db   application    ONLINE    ONLINE    rac1-21    

ora....b1.inst application    ONLINE    ONLINE    rac1-21    

ora....b2.inst application    ONLINE    ONLINE    rac2-22

到这里我们RAC整体安装完毕了!

 

十三、管理RAC

RAC管理命令srvctl

使用srvctl报错及解决方法

 

1、解决目录问题

 

[ora@rac1-21 bin]$ srvctl

/u01/oracle/product/10.2.0/db_1/jdk/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory

 

[ora@rac1-21 bin]$ which srvctl

/u01/oracle/product/10.2.0/db_1/bin/srvctl

 

[ora@rac1-21 bin]$ echo $PATH

/u01/oracle/product/10.2.0/db_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/ora/bin:/u01/oracle/product/10.2.0/crs_1/bin

 

其实srvctl应该是在/u01/oracle/product/10.2.0/crs_1/bin目录下的。但是因为我们~/.bash_profile  PATH的顺序问题。所以修改了一下

export PATH=.:${PATH}:$HOME/bin:$ORA_CRS_HOME/bin:$ORACLE_HOME/bin

 

这里也提示我们PATH是有顺序更好。

 

2、解决BUG问题

 

接着使用srvctl 还是报错。想想我们vipca前,添加了unset  这里,我们需要编辑srvctl注释

#Remove this workaround when the bug 3937317 is fixed

#LD_ASSUME_KERNEL=2.4.19

#export LD_ASSUME_KERNEL

 

[ora@rac2-22 ~]$ srvctl --help

用法: srvctl []

    命令: enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config

    对象: database|instance|service|nodeapps|asm|listener

有关各个命令和对象的详细帮助, 请使用:

    srvctl -h

 

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

请登录后发表评论 登录
全部评论
10年老鸟,Oracle,Mysql,EMC 存储,NBU备份

注册时间:2012-02-03

  • 博文量
    268
  • 访问量
    1301776