虚拟RHEL5上安装11g RAC-安装配置
虚拟RHEL5上安装11g RAC-安装配置时间:2009-03-13 00:00 来源:IT168 字体:[大 中 小] 本文描述了如何使用VMware ESX Server和NFS作为共享存储 style="COLOR: #000000" href="http://storage.it168.com/" target=_blank>存储在Red Hat Enterprise Linux 5上安装Oracle 11g R1 RAC。
介绍
ESX Server是VMware公司提供的企业级管理程序(hypervisor),它安装在裸机上,比起桌面虚拟工具而言,它的效率高多了,本文使用ESX Server为安装Oracle真正应用集群(RAC)提供基础架构。
本文假设你已经安装了VMware ESX Server和一个VMware基础架构客户端(VMware Infrastructure Client),它们的安装说明请参考:
http://www.oracle-base.com/articles/misc/VMwareESXServer3Installation.php
下载软件
需要的软件:Red Hat Enterprise Linux (RHEL) 5和Oracle 11g Release 1 (11.1) Clusterware and DB software。请去www.redhat.com和www.oracle.com下载。
虚拟机设置
在左边窗格ESX服务器 style="COLOR: #000000" href="http://server.it168.com/" target=_blank>服务器上点击右键,然后选择“新的虚拟机... ”菜单选项。
选择自定义选项,并点击“下一步”按钮。
输入你希望出现在客户端右侧窗格中的虚拟机的名称( RAC1 ),然后点击“下一步”按钮。
选择默认的数据存储,然后点击“下一步”按钮。
选择“ Linux系统”和“红帽企业Linux 5 ”选项,然后点击“下一步”按钮。
为虚拟机选择所需处理器的数量,然后点击“下一步”按钮。
这里证明我们完成安装最低需要1G的内存。输入虚拟机所需的内存数量,然后点击“下一步”按钮。
我们至少需要两个网卡。一个为公网IP和虚拟IP地址,为私有IP地址单独提供一个。选择需要的数量和网卡类型,然后点击“下一步”按钮。
接受默认的存储适配器,点击“下一步”按钮
接受“创建一个新的虚拟磁盘”选项,点击“下一步”按钮。
我们使用的是NFS共享存储ORACLE HOME和数据库文件,因此在每个虚拟机上我们并不需要多少磁盘空间。假设您使用的是1G的内存,您将确定的2G的交换空间,使10G的磁盘空间足够了。如果您使用了更多的内存,您将需要增加相应的磁盘空间。输入适当的磁盘容量,然后点击“下一步”按钮。
本地磁盘不需要共享,所以点击“下一步”按钮,忽略高级选项。
如果你对摘要信息感到满意,请单击“完成”按钮。
现在在左侧窗格中就可以看到虚拟机了。
重复此过程来创建第二个节点(RAC2)。
要启动虚拟机,在工具栏上点击播放按钮。
虚拟机将开始从已安装媒体或网络启动。
请将RHEL 第5版Linux的DVD放到客户端PC的DVD驱动器,在工具栏上点击播放按钮,启动虚拟机,右窗格中显示VMware ESX服务器的客户机启动加载器,然后显示RHEL Linux 5安装屏幕。
下面的安装就和正常的操作系统安装一样了,但至少要有2G SWAP空间,要禁用防火墙和SELinux,并安装下列软件包:
GNOME Desktop Environment
Editors
Graphical Internet
Text-based Internet
Development Libraries
Development Tools
Server Configuration Tools
Administration Tools
Base
System Tools
X Window System
要保持和本文剩余的部分一致,在安装过程中必须象下面这样进行设置:
RAC1:
主机名:rac1.localdomain
eth0的IP地址:10.1.10.201(公共地址)
eth0默认网关:10.1.10.1(公共地址)
eth1的IP地址:10.1.9.201(私有地址)
eth1默认网关:无
RAC2:
主机名:rac2.localdomain
eth0的IP地址:10.1.10.202(公共地址)
eth0默认网关:10.1.10.2(公共地址)
eth1的IP地址:10.1.9.202(私有地址)
eth1默认网关:无
你可以自由更改IP地址,以适应您的网络,但请记住保持这些调整符合文章的其他内容。
一旦基本安装完成后,您必须安装一些额外的软件包,同时登录为根用户。如果您有互联网连接,您可以使用以下命令进行下载和安装。
yum install binutils elfutils-libelf glibc glibc-common libaio \
libgcc libstdc++ make compat-libstdc++-33 elfutils-libelf-devel \
glibc-headers glibc-devel libgomp gcc gcc-c++ libaio-devel \
libstdc++-devel unixODBC unixODBC-devel sysstat
或者从RHEL 5的DVD安装它们。
# From Enterprise Linux 5.2 DVD
cd /media/dvd/Server
rpm -Uvh binutils-2.*
rpm -Uvh elfutils-libelf-0.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh libaio-0.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh make-3.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh elfutils-libelf-devel-*
rpm -Uvh glibc-headers*
rpm -Uvh glibc-devel-2.*
rpm -Uvh libgomp*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh sysstat-7.*
cd /
eject
请记住,安装完客户端操作系统后要安装VMware工具。
Oracle安装先决条件
请作为root用户登录到RAC1虚拟机执行下列步骤。
在/etc/hosts文件必须包含以下信息:
127.0.0.1 localhost.localdomain localhost
# Public
10.1.10.201 rac1.localdomain rac1
10.1.10.202 rac2.localdomain rac2
#Private
10.1.9.201 rac1-priv.localdomain rac1-priv
10.1.9.202 rac2-priv.localdomain rac2-priv
#Virtual
10.1.10.203 rac1-vip.localdomain rac1-vip
10.1.10.204 rac2-vip.localdomain rac2-vip
#NAS
10.1.10.61 nas1.localdomain nas1
将下列语句添加到/etc/sysctl.conf文件:
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=262144
# Additional and amended parameters suggested by Kevin Closson
#net.core.rmem_default = 524288
#net.core.wmem_default = 524288
#net.core.rmem_max = 16777216
#net.core.wmem_max = 16777216
net.ipv4.ipfrag_high_thresh=524288
net.ipv4.ipfrag_low_thresh=393216
net.ipv4.tcp_rmem=4096 524288 16777216
net.ipv4.tcp_wmem=4096 524288 16777216
net.ipv4.tcp_timestamps=0
net.ipv4.tcp_sack=0
net.ipv4.tcp_window_scaling=1
net.core.optmem_max=524287
net.core.netdev_max_backlog=2500
sunrpc.tcp_slot_table_entries=128
sunrpc.udp_slot_table_entries=128
net.ipv4.tcp_mem=16384 16384 16384
运行以下命令以改变当前的内核参数:
/sbin/sysctl –p
将下列语句添加到/etc/security/limits.conf文件:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
请将以下几行添加到/etc/pam.d /login文件,如果它们不存在的话:
session required /lib/security/pam_limits.so
session required pam_limits.so
通过编辑/etc/SELinux/config文件禁用安全 style="COLOR: #000000" href="http://safe.it168.com/" target=_blank>安全Linux,确保了SELinux标志设置如下:
SELINUX=disabled
另外,这一改动可以使用GUI工具(系统?管理?安全级和防火墙)做到 。按一下SELinux标签,点击停用功能。
创建新的组和用户:
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
useradd -u 500 -g oinstall -G dba,oper,asmadmin oracle
passwd oracle
配置群集每个节点上的SSH。在每个节点上以Oracle用户登陆执行下列任务:
su - oracle
mkdir ~/.ssh
chmod 700 ~/.ssh
/usr/bin/ssh-keygen -t rsa # Accept the default settings.
exit
RSA公钥被写入~/.ssh/id_rsa.pub文件,私钥写入~/.ssh/id_rsa文件。
在RAC1节点上以Oracle用户登陆,生成一个authorized_keys文件,然后复制到RAC2上:
su - oracle
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
scp authorized_keys rac2:/home/oracle/.ssh/
exit
接下来,在RAC2上以Oracle用户登陆,执行下面的命令:
su - oracle
cd ~/.ssh
cat id_rsa.pub >> authorized_keys
scp authorized_keys rac1:/home/oracle/.ssh/
exit
现在在两台服务器上的authorized_keys文件都包括了所有节点的公钥。
为了使每个群集成员节点上的SSH用户都对等,在每个节点上执行下面的命令:
su - oracle
ssh rac1 date
ssh rac2 date
ssh rac1.localdomain date
ssh rac2.localdomain date
exec /usr/bin/ssh-agent $SHELL
/usr/bin/ssh-add
现在在这两台服务器之间应该可以不要密码使用SSH和SCP了。
以Oracle用户登陆,然后将下面的语句添加到.bash_profile末尾:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=rac1.localdomain; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1; export ORACLE_HOME
ORACLE_SID=RAC1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
请记住,在第二个节点上为ORACLE_SID和ORACLE_HOSTNAME设置正确的值。
这里安装使用NFS为RAC提供共享存储,修改下面的语句以适应你的NAS或NFS服务器。
如果你使用了第三个Linux服务器提供NFS服务,你应该如下面语句这样创建一些共享目录:
mkdir /shared_config
mkdir /shared_crs
mkdir /shared_home
mkdir /shared_data
将下列语句添加到/etc/exports文件:
/shared_config *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/shared_crs *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/shared_home *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
/shared_data *(rw,sync,no_wdelay,insecure_locks,no_root_squash)
运行以下命令导出NFS共享:
chkconfig nfs on
service nfs restart
如果你使用的是NAS或其他一些支持NFS的存储设备,也请创建4个共享。
在RAC1和RAC2上创建用于安装Oracle软件的目录:
mkdir -p /u01/app/crs/product/11.1.0/crs
mkdir -p /u01/app/oracle/product/11.1.0/db_1
mkdir -p /u01/oradata
mkdir -p /u01/shared_config
chown -R oracle:oinstall /u01/app /u01/app/oracle /u01/oradata /u01/shared_config
chmod -R 775 /u01/app /u01/app/oracle /u01/oradata /u01/shared_config
将下面的语句添加到每个服务器的/etc/fstab文件中,挂载选项是基于Oracle metalink注记:359515.1的建议:
nas1:/shared_config /u01/shared_config nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,noac,vers=3,timeo=600 0 0
nas1:/shared_crs /u01/app/crs/product/11.1.0/crs nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0 0 0
nas1:/shared_home /u01/app/oracle/product/11.1.0/db_1 nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0 0 0
nas1:/shared_data /u01/oradata nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=0,vers=3,timeo=600 0 0
以root用户登陆两台服务器运行下列命令挂载NFS共享:
mount /u01/shared_config
mount /u01/app/crs/product/11.1.0/crs
mount /u01/app/oracle/product/11.1.0/db_1
mount /u01/oradata
建立共享CRS配置和表决磁盘文件:
touch /u01/shared_config/ocr_configuration
touch /u01/shared_config/voting_disk
在每台服务器上以root登陆执行下列命令确保共享目录的权限设置正确:
chown -R oracle:oinstall /u01/shared_config
chown -R oracle:oinstall /u01/app/crs/product/11.1.0/crs
chown -R oracle:oinstall /u01/app/oracle/product/11.1.0/db_1
chown -R oracle:oinstall /u01/oradata
开始安装clusterware之前,先在clusterware根目录使用runcluvfy.sh检查先决条件是否已经满足:
/mountpoint/clusterware/runcluvfy.sh stage -pre crsinst -n rac1,rac2 –verbose
如果你收到任何失败消息,请先纠正后再继续安装。
安装clusterware软件
解压clusterware和数据库软件:
unzip linux_11gR1_clusterware.zip
unzip linux_11gR1_database.zip
以Oracle用户登陆到RAC1,然后执行安装程序:
cd clusterware
./runInstaller
在“欢迎”屏幕,点击“下一步”按钮。
接受默认的inventory目录,点击“下一步”按钮。
输入“/u01/app/crs/product/11.1.0/crs ”的ORACLE HOME,并点击“下一步”按钮。
等待先决条件检查,遇到任何失败都应该纠正并重新测试,确保所有先决条件检查都通过,然后点击“下一步”按钮。
“指定群集配置”屏幕显示只有RAC1节点。点击“添加”按钮继续。
输入RAC2节点的详细资料,并点击“确定”按钮
按“下一步”按钮继续。
在“指定网络接口用法”屏幕定义每个网络接口的用途。选中“eth0”接口,点击“修改”按钮。
设置“eht0”接口类型“public”,并点击“确定”按钮。
保留“eth1”接口为私有,点击“下一步”按钮。
点击“外部冗余”选项,输入“/u01/shared_config/ocr_configuration”作为OCR位置,点击“下一步”按钮。为了有更大的冗余,我们需要确定另一个共享磁盘的备用位置。
点击“外部冗余”选项,输入“/u01/shared_config/voting_disk”的表决磁盘位置,并点击“下一步”按钮,为了有更大的冗余,我们需要确定另一个共享磁盘的替代的位置。
在“摘要”屏幕上,单击“安装”按钮,继续。
等待安装
一旦安装完成,在两个节点上运行下列屏幕显示的orainstRoot.sh root.sh脚本。
执行orainstRoot.sh文件的输出看起来应该像下面这样。
# cd /u01/app/oraInventory
# ./orainstRoot.sh
Changing permissions of /u01/app/oraInventory to 770.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script. is complete
#
执行root.sh的输出将取决于它运行的节点。下列文字是来自RAC1节点的输出。
# cd /u01/app/crs/product/11.1.0/crs
# ./root.sh
WARNING: directory '/u01/app/crs/product/11.1.0' is not owned by root
WARNING: directory '/u01/app/crs/product' is not owned by root
WARNING: directory '/u01/app/crs' is not owned by root
WARNING: directory '/u01/app' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.
Setting the permissions on OCR backup directory
Setting up Network socket directories
Oracle Cluster Registry configuration upgraded successfully
The directory '/u01/app/crs/product/11.1.0' is not owned by root. Changing owner to root
The directory '/u01/app/crs/product' is not owned by root. Changing owner to root
The directory '/u01/app/crs' is not owned by root. Changing owner to root
The directory '/u01/app' is not owned by root. Changing owner to root
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /u01/shared_config/voting_disk
Format of 1 voting devices complete.
Startup will be queued to init within 30 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
Cluster Synchronization Services is active on these nodes.
rac1
Cluster Synchronization Services is inactive on these nodes.
rac2
Local node checking complete. Run root.sh on remaining nodes to start CRS daemons.
#
下面的输出来自RAC2节点。
# /u01/app/crs/product/11.1.0/crs
# ./root.sh
WARNING: directory '/u01/app/crs/product/11.1.0' is not owned by root
WARNING: directory '/u01/app/crs/product' is not owned by root
WARNING: directory '/u01/app/crs' is not owned by root
WARNING: directory '/u01/app' is not owned by root
Checking to see if Oracle CRS stack is already configured
/etc/oracle does not exist. Creating it now.
Setting the permissions on OCR backup directory
Setting up Network socket directories
Oracle Cluster Registry configuration upgraded successfully
The directory '/u01/app/crs/product/11.1.0' is not owned by root. Changing owner to root
The directory '/u01/app/crs/product' is not owned by root. Changing owner to root
The directory '/u01/app/crs' is not owned by root. Changing owner to root
The directory '/u01/app' is not owned by root. Changing owner to root
clscfg: EXISTING configuration version 4 detected.
clscfg: version 4 is 11 Release 1.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
clscfg: Arguments check out successfully.
NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 30 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
Cluster Synchronization Services is active on these nodes.
rac1
rac2
Cluster Synchronization Services is active on all the nodes.
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
Creating VIP application resource on (2) nodes...
Creating GSD application resource on (2) nodes...
Creating ONS application resource on (2) nodes...
Starting VIP application resource on (2) nodes...
Starting GSD application resource on (2) nodes...
Starting ONS application resource on (2) nodes...
Done.
#
在这里您可以看到,有些配置的步骤被省略了,因为他们在第一个节点做,此外,最后一部分脚本以安静模式运行虚拟IP配置助理(VIPCA)。
您现在应该回到RAC1 的“执行配置脚本”屏幕上,并点击“确定”按钮。
等待配置助手完成。
当安装完成后,点击“退出”按钮离开安装程序。
该集群安装现已完成。
安装完成后,在共享的$ ORACLE_HOME 目录下“$ORACLE_HOME/network/admin/listener.ora”文件中将包含下列项目:
# listener.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER_RAC2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.10.202)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
LISTENER_RAC1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.10.201)(PORT = 1521)(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
共享的$ORACLE_HOME/network/admin/tnsnames.ora文件将包含下列内容:
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.WORLD)
)
)
LISTENERS_RAC =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
)
RAC2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.WORLD)
(INSTANCE_NAME = RAC2)
)
)
RAC1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC.WORLD)
(INSTANCE_NAME = RAC1)
)
)
这种配置可直接连接到具体的实例,或使用负载平衡连接到主服务。
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Tue Aug 19 16:54:45 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> CONN sys/password@rac1 AS SYSDBA
Connected.
SQL> SELECT instance_name, host_name FROM v$instance;
INSTANCE_NAME HOST_NAME
---------------- ----------------------------------------------------
RAC1 rac1.lynx.co.uk
SQL> CONN sys/password@rac2 AS SYSDBA
Connected.
SQL> SELECT instance_name, host_name FROM v$instance;
INSTANCE_NAME HOST_NAME
---------------- -----------------------------------------------------
RAC2 rac2.lynx.co.uk
SQL> CONN sys/password@rac AS SYSDBA
Connected.
SQL> SELECT instance_name, host_name FROM v$instance;
INSTANCE_NAME HOST_NAME
---------------- --------------------------------------------
RAC1 rac1.lynx.co.uk
SQL>
检查RAC的状态
有几种方法来检查RAC的现况。srvctl实用程序显示当前的配置和RAC数据库的状态。
$ srvctl config database -d RAC
rac1 RAC1 /u01/app/oracle/product/11.1.0/db_1
rac2 RAC2 /u01/app/oracle/product/11.1.0/db_1
$
$ srvctl status database -d RAC
Instance RAC1 is running on node rac1
Instance RAC2 is running on node rac2
$
在V$ACTIVE_INSTANCES视图也可以显示实例目前的状况。
$ sqlplus / as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Tue Aug 19 16:55:31 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> SELECT * FROM v$active_instances;
INST_NUMBER INST_NAME
----------- ------------------------------------------------------------
1 rac1.lynx.co.uk:RAC1
2 rac2.lynx.co.uk:RAC2
SQL>
最后,GV$视图让您可以显示整个RAC的信息。
SQL> SELECT inst_id, username, sid, serial# FROM gv$session WHERE username IS NOT NULL;
INST_ID USERNAME SID SERIAL#
---------- ------------------------------ ---------- ----------
2 SYS 116 841
2 SYSMAN 118 78
2 SYS 119 1992
2 SYSMAN 121 1
2 SYSMAN 122 29
2 SYS 123 2
2 SYSMAN 124 50
2 DBSNMP 129 1
2 DBSNMP 130 6
2 DBSNMP 134 1
2 SYSMAN 145 53
INST_ID USERNAME SID SERIAL#
---------- ------------------------------ ---------- ----------
2 SYS 170 14
1 SYSMAN 117 144
1 SYSMAN 118 186
1 SYSMAN 119 31
1 SYS 121 3
1 SYSMAN 122 162
1 SYSMAN 123 99
1 DBSNMP 124 3
1 SYS 125 2
1 SYS 126 19
1 SYS 127 291
INST_ID USERNAME SID SERIAL#
---------- ------------------------------ ---------- ----------
1 DBSNMP 131 61
1 SYS 170 17
24 rows selected.
SQL>
如果您已配置了企业管理器,它可以用来查看配置和数据库的现状,使用类似 “https://rac1.localdomain:1158/em”的网址 。
为了改善NFS的性能,oracle公司建议使用随oracle 11g发布的直接NFS客户。直接NFS客户在下列地点寻找NFS信息:
(1)$ORACLE_HOME/dbs/oranfstab
(2)/etc/oranfstab
(3)/etc/mtab
既然在“/etc/fstab”我们已经有了我们的挂载NFS点,因此“/etc/mtab”文件不需要配置任何额外信息。
为了使客户端工作,我们需要切换libodm11.so库到libnfsodm11.so库,如下所示:
srvctl stop database -d RAC
cd $ORACLE_HOME/lib
mv libodm11.so libodm11.so_stub
ln -s libnfsodm11.so libodm11.so
srvctl start database -d RAC
配置完成后,你就可以通过以下视图看到直接NFS客户端:
v$dnfs_servers
v$dnfs_files
v$dnfs_channels
v$dnfs_stats
例如:
SQL> SELECT svrname, dirname FROM v$dnfs_servers;
SVRNAME DIRNAME
------------- -----------------
nas1 /shared_data
SQL>
默认情况下,直接NFS客户端支持直接I/O和异步I/O。
文章转载自网管之家:http://www.bitscn.com/pdb/oracle/200904/160413.html
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9606200/viewspace-745648/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9606200/viewspace-745648/