在青云上部署oracle rac全过程
1.1 服务器基本信息
节点 | Cpu | 内存 | OS |
db01 | 8cores | 16G | Oracle Linux Server release 6.6 (x86_64) |
db02 | 8cores | 16G | Oracle Linux Server release 6.6 (x86_64) |
[root@db02 software]# cat /etc/issue
Oracle Linux Server release 6.6
Kernel \r on an \m
[root@db02 software]# uname -a
Linux db02 3.8.13-55.1.2.el6uek.x86_64 #2 SMP Thu Dec 18 00:15:51 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
1.2 软件信息
Db11.2.0.4:p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip
grid: p13390677_112040_Linux-x86-64_3of7.zip
安装介质存放在/u01/software中
p13390677_112040_Linux-x86-64_1of7.zip、p13390677_112040_Linux-x86-64_2of7.zip解压生成datebase目录;
p13390677_112040_Linux-x86-64_3of7.zip 解压生成grid目录
1.3 本地盘配置
将500GB的本地盘创建文件系统挂载到/u01目录下面,并修改/etc/fstab,让开机自动挂载/u01文件系统。
[root@db01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 20G 3.0G 16G 16% /
tmpfs 8.0G 132M 7.9G 2% /dev/shm
/dev/vdc1 493G 23G 445G 5% /u01
二 基础配置
基础配置需要在两个节点都要操作的。
2.1 网络配置
节点 | Hostname | Type | IP Address | Interface | Resolved by |
db01 | db01 | Public IP | 192.168.0.2 | eth2 | HOST FILE |
db01-vip | Virtual IP | 192.168.0.102 | HOST FILE | ||
db01-priv | Private IP | 192.168.101.2 | eth0 | HOST FILE | |
db02 | db02 | Public IP | 192.168.0.3 | eth2 | HOST FILE |
db02-vip | Virtual IP | 192.168.0.103 | HOST FILE | ||
db02-priv | Private IP | 192.168.101.3 | eth0 | HOST FILE | |
db-scan | SCAN IP | 192.168.0.100 | HOST FILE |
2.1.1 Host文件
#Public
192.168.0.2 db01
192.168.0.3 db02
#Virtual
192.168.0.102 db01-vip
192.168.0.103 db02-vip
#Private
192.168.101.2 db01-priv
192.168.101.3 db02-priv
#SCAN
192.168.0.100 db-scan
2.1.2 网络配置文件
节点1
[root@db01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=52:54:46:A6:94:40
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.101.2
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth0
UUID=d790a693-882a-4b5e-bc9f-44ac2706c5b7
ONBOOT=yes
[root@db01 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
TYPE=Ethernet
IPADDR=192.168.0.2
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DEFROUTE=yes
NAME=eth2
ONBOOT=yes
HWADDR=52:54:a1:2a:34:3f
[root@db01 ~]#
节点2
[root@db02 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=52:54:72:2C:50:63
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.101.3
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth0
UUID=5c37a16a-e9ac-4cf6-a244-c4d0faa592db
ONBOOT=yes
DEVICE=eth0
[root@db02 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
HWADDR=52:54:b0:c6:97:26
TYPE=Ethernet
IPADDR=192.168.0.3
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DEFROUTE=yes
NAME=eth2
ONBOOT=yes
两个节点都要操作:
关闭networkmanager
[root@i-zq8ytr3k network-scripts]# chkconfig NetworkManager --list
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@i-zq8ytr3k network-scripts]# chkconfig NetworkManager off
[root@i-zq8ytr3k network-scripts]# chkconfig NetworkManager --list
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off
重启网络:
service network restart
关闭防火墙
service iptables stop
chkconfig iptables off
关闭selinux
修改:/etc/selinux/config 内容改为:SELINUX=disabled
setenforce 0
2.2 创建用户
两个节点都要操作:
groupadd -g 500 dba
groupadd -g 501 oinstall
groupadd -g 502 asmadmin
useradd -g oinstall -u 500 oracle
useradd -g oinstall -u 501 grid
usermod -G dba oracle
usermod -G dba grid
usermod -aG asmadmin grid
[root@db02 software]# id oracle
uid=500(oracle) gid=501(oinstall) 组=501(oinstall),500(dba)
[root@db02 software]# id grid
uid=501(grid) gid=501(oinstall) 组=501(oinstall),500(dba),502(asmadmin)
[root@db01 ~]# id oracle
uid=500(oracle) gid=501(oinstall) groups=501(oinstall),500(dba)
[root@db01 ~]# id grid
uid=501(grid) gid=501(oinstall) groups=501(oinstall),500(dba),502(asmadmin)
[root@db01 ~]#
2.2.1 设置profile
后续要将oracle的环境变量ORACLE_SID分别改为oadb1 和oadb2
节点1:
Oracle用户
[oracle@db01 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=db1; 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;
grid用户:
[grid@db01 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid/product/db_1; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
THREADS_FLAG=native; export THREADS_FLAG
PATH=$ORACLE_HOME/bin:$PATH; export PATHTHREADS_FLAG=native; export THREADS_FLAG
PATH=$ORACLE_HOME/bin:$PATH; export PATH
节点2
Oracle用户:
[oracle@db02 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=db2; 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;
Grid用户:
[grid@db02 ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_SID=+ASM2; export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/11.2.0/grid/product/db_1; export ORACLE_HOME
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
THREADS_FLAG=native; export THREADS_FLAG
PATH=$ORACLE_HOME/bin:$PATH; export PATHTHREADS_FLAG=native; export THREADS_FLAG
PATH=$ORACLE_HOME/bin:$PATH; export PATH
2.3 配置路径
两台服务器都要配置:
mkdir -p /u01/app
chown -R root:oinstall /u01/app
mkdir -p /u01/app/11.2.0/
mkdir -p /u01/app/grid/
mkdir -p /u01/app/oracle/
chown -R grid:oinstall /u01/app/11.2.0
chown -R grid:oinstall /u01/app/grid
chown -R oracle:oinstall /u01/app/oracle
2.4 安装rpm包
配置本地镜像
将iso文件挂载
mount -t iso9660 -o loop /u01/software/V52218-01-OEL-6.6.iso /u01/software/mnt
重命名之前的文件
Mv /etc/yum.repos.d/public-yum-ol6.repo /etc/yum.repos.d/public-yum-ol6.repo_bak
[root@db02 ~]# cat /etc/yum.repos.d/public-yum-ol6.repo
[Server]
name=Oracle Linux $releasever Beta - $basearch - Server
baseurl=file:///u01/software/mnt
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
安装rpm
yum install gcc compat-libstdc++-33 elfutils-libelf-devel gcc-c++ libaio-devel libstdc++-devel ksh -y
后续根据实际情况也许需要安装一些新的包,都可以在/u01/software/mnt/Packages中找到
2.5 sysctl.conf文件
修改/etc/sysctl.conf
新加
##add by oracle
kernel.shmmax = 4294967295
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 1100 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
vm.min_free_kbytes= 1048576
fs.aio-max-nr= 1048576
设置生效:
/sbin/sysctl -p
2.6 limit文件
/etc/security/limits.conf 添加:
#add by oracle
oracle hard nofile 65536
oracle soft nofile 4096
oracle hard nproc 16384
oracle soft nproc 2047
grid hard nofile 65536
grid soft nofile 1024
grid hard nproc 16384
grid soft nproc 2047
2.7共享盘安装
在云平台上分配共享存储之后,最好在界面上设置可以访问共享存储的客户端,本次设置的是:iqn.2014-12.com.qingcloud:e594a0ee9b82
和iqn.2014-12.com.qingcloud:5ba958139a1
1 安装工具包
yum install -y iscsi-initiator-utils
2 根据前缀生成客户端id
iscsi-iname -p iqn.2014-12.com.qingcloud
结果:
[root@db02 ~]# iscsi-iname -p iqn.2014-12.com.qingcloud
iqn.2014-12.com.qingcloud:e594a0ee9b82
[root@db01 ~]# iscsi-iname -p iqn.2014-12.com.qingcloud
iqn.2014-12.com.qingcloud:5ba958139a1
3 修改配置文件
/etc/iscsi/initiatorname.iscsi 修改为下面的信息(名称是界面上看到的)
节点1:
[root@db01 ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2014-12.com.qingcloud:5ba958139a1
节点2:
[root@db02 ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2014-12.com.qingcloud:e594a0ee9b82
4 客户端发现(两个服务器都要配置)
[root@db01 iscsi]# iscsiadm -m discovery -t st -p 192.168.0.8
Starting iscsid: [ OK ]
192.168.0.8:3260,1 iqn.2014-12.com.qingcloud.s2:sn.data
[root@i-zq8ytr3k iscsi]# iscsiadm -m node
192.168.0.8:3260,1 iqn.2014-12.com.qingcloud.s2:sn.data
5 注册(两个服务器都要配置)
[root@db01 iscsi]# iscsiadm -m node -T iqn.2014-12.com.qingcloud.s2:sn.data -p 192.168.0.8 --login
Logging in to [iface: default, target: iqn.2014-12.com.qingcloud.s2:sn.data, portal: 192.168.0.8,3260] (multiple)
Login to [iface: default, target: iqn.2014-12.com.qingcloud.s2:sn.data, portal: 192.168.0.8,3260] successful.
6 查看结果
[root@db02 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
sdb 8:16 0 500G 0 disk
sdc 8:32 0 10G 0 disk
sdd 8:48 0 10G 0 disk
vda 251:0 0 20G 0 disk
`-vda1 251:1 0 20G 0 part /
vdb 251:16 0 16G 0 disk [SWAP]
vdc 251:32 0 500G 0 disk
`-vdc1 251:33 0 500G 0 part /u01
[root@db01 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 10G 0 disk
sdb 8:16 0 500G 0 disk
sdc 8:32 0 10G 0 disk
sdd 8:48 0 10G 0 disk
vda 251:0 0 20G 0 disk
`-vda1 251:1 0 20G 0 part /
vdb 251:16 0 16G 0 disk [SWAP]
vdc 251:32 0 500G 0 disk
`-vdc1 251:33 0 500G 0 part /u01
7 配置开启自动启动识别
iscsiadm -m node -T iqn.2014-12.com.qingcloud.s2:sn.data -p 192.168.0.8 --op update -n node.startup -v automatic
8 配置asm能识别的盘
echo "options=--whitelisted --replace-whitespace">/etc/scsi_id.config
rm -f /etc/udev/rules.d/99-oracle-asmdevices.rules
i=1
id=''
for x in a b c d
do
id=`scsi_id --whitelisted --replace-whitespace --device=/dev/sd$x`
echo "KERNEL==\"sd*\", SUBSYSTEM==\"block\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"$id\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"">>/etc/udev/rules.d/99-oracle-asmdevices.rules
let i++
done
/sbin/start_udev
最后文件生成的/etc/udev/rules.d/99-oracle-asmdevices.rules文件是:
[root@db01 ~]# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001405745529a22afc4f8fb1a685e36", NAME="asm-disk1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001405e371bbbb031b4547b5fe217d1", NAME="asm-disk2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36001405ff11eeac99ac40f69e34a3ec5", NAME="asm-disk3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600140517aafddef37c4305a3e6930ee", NAME="asm-disk4", OWNER="grid", GROUP="asmadmin", MODE="0660"
查看生成的设备符号
[root@db01 ~]# ll /dev/asm*
brw-rw---- 1 grid asmadmin 8, 0 Mar 23 19:12 /dev/asm-disk1
brw-rw---- 1 grid asmadmin 8, 16 Mar 23 19:12 /dev/asm-disk2
brw-rw---- 1 grid asmadmin 8, 32 Mar 23 19:12 /dev/asm-disk3
brw-rw---- 1 grid asmadmin 8, 48 Mar 23 19:12 /dev/asm-disk4
[root@db02 ~]# ll /dev/asm*
brw-rw---- 1 grid asmadmin 8, 0 Mar 23 19:12 /dev/asm-disk1
brw-rw---- 1 grid asmadmin 8, 16 Mar 23 19:12 /dev/asm-disk2
brw-rw---- 1 grid asmadmin 8, 32 Mar 23 19:12 /dev/asm-disk3
brw-rw---- 1 grid asmadmin 8, 48 Mar 23 19:12 /dev/asm-disk4
其中asm-disk2 是500GB,用作数据。另外3块10GB的盘用作集群vote disk。
2.8 关闭ntp
Service ntpd stop
Chkconfig ntpd off
2.9 配置操作系统用户互信
修改ssh配置文件:/etc/ssh/ssh_config,注释下面两行
#StrictHostKeyChecking no
#UserKnownHostsFile /dev/null
Oracle 和grid用户都要操作
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
在节点1:
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ ssh db02 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh db02 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ scp ~/.ssh/authorized_keys db02:~/.ssh/authorized_keys
之后分别使用grid、oracle用户在两个节点都运行:
Ssh db01
ssh db02
ssh db01-priv
ssh db02-priv
按照提示输入yes,不输入密码能正常登陆表示正常
三 预检查
节点1,使用grid用户,切换至目录:
/u01/software/u01,运行命令:
./runcluvfy.sh stage -pre crsinst -n db01,db02 -fixup -verbose
结果如下,按照需求再安装rpm,让failed成功:
[grid@db01 grid]$ ./runcluvfy.sh stage -pre crsinst -n db01,db02 -fixup -verbose
四 图形化安装
为避免网络中途掉线,所有图形化均在web控制台上分别使用grid、oracle用户登陆db01进行操作。
4.1 安装grid软件
使用grid用户登陆db01,切换至目录:
/u01/software/grid
执行./runInstaller
选择大小为10G的/dev/asm-disk1, /dev/asm-disk3,/dev/asm-disk4
这里需要点击"change discovery path",设置路径为/dev/asm*
在进行环境检查时,会报错
这个警告在青云平台也有说明:
注解 grid安装环境检查脚本在Oracle Linux 6上面的一个bug导致错误"PRVF-9802"无法解决,具体原因请见Debug Cluvfy error ERROR: PRVF-9802。
勾选忽略这个警告。
弹出脚本分别使用root在两个服务器执行:
/u01/app/oraInventory/orainstRoot.sh
/u01/app/11.2.0/grid/product/db_1/root.sh
第二个脚本执行会比较好时间,大概20分钟。
4.1.1执行脚本
节点1
[root@db01 ~]# /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@db01 ~]# /u01/app/11.2.0/grid/product/db_1/root.sh
[root@db01 ~]# su - grid
[grid@db01 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.CRS.dg ora....up.type ONLINE ONLINE db01
ora....N1.lsnr ora....er.type ONLINE ONLINE db01
ora.asm ora.asm.type ONLINE ONLINE db01
ora.cvu ora.cvu.type ONLINE ONLINE db01
ora....SM1.asm application ONLINE ONLINE db01
ora.db01.gsd application OFFLINE OFFLINE
ora.db01.ons application ONLINE ONLINE db01
ora.db01.vip ora....t1.type ONLINE ONLINE db01
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE db01
ora.oc4j ora.oc4j.type ONLINE ONLINE db01
ora.ons ora.ons.type ONLINE ONLINE db01
ora.scan1.vip ora....ip.type ONLINE ONLINE db01
节点2
[root@db02 ~]# /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@db02 ~]# /u01/app/11.2.0/grid/product/db_1/root.sh
[root@db02 ~]# su - grid
[grid@db02 ~]$ crs_stat -t
4.2 创建asm磁盘组
4.3 安装oracle软件
Oracle用户登陆,切换至目录:
/u01/software/database
运行./runInstaller
Root登陆两台机器分别执行脚本:
[root@db01 ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_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.
Finished product-specific root actions.
五 其他
5.1 start_udev重启自动运行
查看start_udev是否开机自动运行,修改/etc/rc.d/rc.sysinit文件
添加:/sbin/start_udev
5.2 Ocr备份
[root@db01 ~]# /u01/app/11.2.0/grid/product/db_1/bin/ocrconfig -manualbackup
db02 2018/03/23 19:29:16 /u01/app/11.2.0/grid/product/db_1/cdata/db-cluster/backup_20180323_192916.ocr
[root@db02 rc.d]# cp /u01/app/11.2.0/grid/product/db_1/cdata/db-cluster/backup_20180323_192916.ocr /root/orc-bak-20180323.ocr
/root/orc-bak-20180323.ocr 为拷贝生成的文件。
5.3 Asm元数据备份
Grid用户运行asmcmd
ASMCMD> md_backup /home/grid/oradgbackup20180323
Disk group metadata to be backed up: CRS
Disk group metadata to be backed up: DATA
Current alias directory path: db-cluster/OCRFILE
Current alias directory path: db-cluster
Current alias directory path: db-cluster/ASMPARAMETERFILE
Current alias directory path: OADB
Current alias directory path: OADB/ARCHIVELOG/2018_03_23
Current alias directory path: OADB/TEMPFILE
Current alias directory path: OADB/ARCHIVELOG
Current alias directory path: OADB/ONLINELOG
Current alias directory path: OADB/CONTROLFILE
Current alias directory path: OADB/PARAMETERFILE
Current alias directory path: OADB/DATAFILE
六 实例测试
Last login: Fri Mar 23 19:37:05 2018 from 172.18.19.194
[root@db01 ~]# su - oracle
[oracle@db01 ~]$ sqlplus system/Oracle_sys123@192.168.0.100:1521/oadb
SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 23 19:42:53 2018
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> create table test0323 as select * from dual;
Table created.
SQL> select * from test0323 ;
D
-
X
SQL> drop table test0323 ;
Table dropped.
SQL>
可以正常进行创建删除操作。
TNS
oadb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oadb)
)
)
可使用上述TNS配置连接数据库。
备注:
Db01节点数据库的SID为oadb1
Db02节点数据库的SID为oadb2