DM7 使用dminit工具创建数据库

1 功能简介
dminit是DM数据库初始化工具。在安装DM的过程中,用户可以选择是否创建初始数据库。如果当时没有创建,那么在安装完成之后,可以利用创建数据库工具dminit来创建。

系统管理员可以利用dminit工具提供的各种参数,设置数据库存放路径、段页大小、是否对大小写敏感、以及是否使用UNICODE等,创建出满足用户需要的数据库。该工具位于安装目录的/bin目录下。

2 使用dminit
dminit工具需要从命令行启动。找到dminit所在安装目录/bin,输入dminit和参数后回车。参数在下一节详细介绍。
语法如下:
dminit KEYWORD=value { KEYWORD=value }
KEYWORD:dminit参数关键字。多个参数之间排列顺序无影响,参数之间使用空格间隔。value:参数取值。

dminit如果没有带参数,系统会引导用户进行设置。参数、等号和值之间不能有空格,例如PAGE_SIZE=16。HELP参数的后面不用添加“=”号。

例如,初始化一个数据库,放在/home/test/dmdbms目录下,数据页PAGE_SIZE大小为16K。

./dminit PATH=/home/test/dmdbms PAGE_SIZE=16 

如果创建成功,则屏幕显示如下:

initdb V7.1.5.22-Build(2015.11.17-62910trunc)
db version: 0x70009
create dm database success. 2015-12-21 15:46:27

此时在/home/test/dmdbms目录下会出现一个DAMENG文件夹,内容包含初始数据库DAMENG的相关文件和DM数据库启动所必须的配置文件dm.ini。

3 查看dminit参数
dminit使用较为灵活,参数较多。用户可使用“dminit HELP”快速查看各参数。

[dmdba@ora19c bin]$ ./dminit help
initdb V7.1.6.46-Build(2018.02.08-89107)ENT 
db version: 0x7000a
file dm.key not found, use default license!
License will expire on 2020-06-05
Format:  ./dminit         KEYWORD=value

Example: ./dminit         PATH=/public/dmdb/dmData PAGE_SIZE=16

Keyword                     Explanation(default value)
--------------------------------------------------------------------------------
INI_FILE                    dm.ini path
PATH                        database path
CTL_PATH                    control file path
LOG_PATH                    log file path
EXTENT_SIZE                 extent size of data file(16), optional value: 16,32, unit: PAGE
PAGE_SIZE                   page size(8), optional value: 4,8,16,32, unit: K
LOG_SIZE                    log file size(256), unit: M, range: 64M ~ 2G
CASE_SENSITIVE              whether case is sensitive(Y), optional value: Y/N or 1/0
CHARSET/UNICODE_FLAG        CHARSET(0), optional value:0[GB18030],1[UTF-8],2[EUC-KR]
LENGTH_IN_CHAR              whether LENGTH for VARCHAR is in characters(N), optional value: Y/N, 1/0
SYSDBA_PWD                  set SYSDBA password(SYSDBA), password length must between 9 and 48
SYSAUDITOR_PWD              set SYSAUDITOR password(SYSAUDITOR), password length must between 9 and 48
DB_NAME                     database name(DAMENG)
INSTANCE_NAME               instance name(DMSERVER)
PORT_NUM                    listener port(5236)
TIME_ZONE                   set time zone(+08:00)
PAGE_CHECK                  page check mode(0), optional value: 0/1/2
EXTERNAL_CIPHER_NAME        set default encrypt/decrypt algorithm
EXTERNAL_HASH_NAME          set default hash algorithm
EXTERNAL_CRYPTO_NAME        set crypto name to encrypt svr key
RLOG_ENC_FLAG               whether encrypt redo log(N), optional value: Y/N, 1/0
USBKEY_PIN                  set usbkey pin
ENCRYPT_NAME                set algorithm for encrypt the whole database
BLANK_PAD_MODE              set blank padding mode(0), optional value:0/1
SYSTEM_MIRROR_PATH          mirror path of system data file
MAIN_MIRROR_PATH            mirror path of main file
ROLL_MIRROR_PATH            mirror path of roll file
MAL_FLAG                    MAL_INI flag(0) in dm.ini
ARCH_FLAG                   ARCH_INI(0) flag in dm.ini
MPP_FLAG                    MPP_INI(0) flag in dm.ini
CONTROL                     control file path!
AUTO_OVERWRITE              whether overwrite all files with the same name(0) 0: no 1: part 2: all
USE_NEW_HASH                whether use new hash algorithm for string. (default 1)
DCP_MODE                    whether is DM CLUSTER PROXY mode(default 0)
DCP_PORT_NUM                in DCP mode, set dcp_port_num
ELOG_PATH                   set the path of log file recording the contents during initialization
HELP                        print help information

4 dminit初始化数据库
CONTROL参数是dminit工具的高级功能,用于初始化数据库时指定初始化配置文件。初始化配置文件是一个保存了各数据文件路径和大小设置、所有dminit工具的命令行参数设置等信息的文本,名称由用户自己选取,例如:dminit.ini 、abc.txt、dminit.ctl等。

dminit工具使用CONTROL参数,就不能再指定其他参数,CONTROL参数只能单独使用。

DM既支持初始化单机数据库,又支持初始化RAC集群的数据库。操作非常简单,只要在使用dminit工具创建数据库的时候,使用CONTROL参数指定初始化配置文件即可。

例如:初始化配置文件为dminit.ini。

./dminit CONTROL=/home/data/dminit.ini 

初始化配置文件(本章统一命名为dminit.ini)内容如何书写,单机和RAC环境下略有不同,下面分别详细介绍。

4.1 初始化单机数据库
DM支持初始化数据库到一个普通机器上或是一个共享存储上。本节以文件系统为例,初始化单机数据库。涉及路径和文件大小的参数配置。

例如,在文件系统上创建数据库。参数path、main、system、roll、ctl_path、log01、log02都指定了文件系统,单机配置文件(命名dminit.ini)书写如下:

[dmdba@ora19c dm7]$ cat dminit.ini
[jy] --实例名使用control配置文件指定实例不能使用instance_name参数
db_name = jy
path =/dm7/data
main = /dm7/data/jy/main.dbf
main_size = 256
system = /dm7/data/jy//system.dbf
system_size = 256
roll = /dm7/data/jy//roll.dbf
roll_size = 256
ctl_path = /dm7/data/jy/dm.ctl
log_path = /dm7/data/jy/log01.log
log_path = /dm7/data/jy/log02.log
log_size = 128
auto_overwrite = 2

初始化数据库
[dmdba@ora19c bin]$ ./dminit control=/dm7/dminit.ini
initdb V7.1.6.46-Build(2018.02.08-89107)ENT 
db version: 0x7000a
file dm.key not found, use default license!
License will expire on 2020-06-05

 log file path: /dm7/data/jy/log01.log


 log file path: /dm7/data/jy/log02.log

write to dir [/dm7/data/jy].
create dm database success. 2020-05-22 22:36:10


注册数据库服务
[root@ora19c root]# ./dm_service_installer.sh -t dmserver -p jy -i /dm7/data/jy/dm.ini -m open
ln -s '/usr/lib/systemd/system/DmServicejy.service' '/etc/systemd/system/multi-user.target.wants/DmServicejy.service'
Finished to create the service (DmServicejy)
[root@ora19c root]# systemctl start DmServicejy
[root@ora19c root]# ps -ef | grep dmserver
dmdba    31843     1 21 01:29 ?        00:00:05 /dm7/bin/dmserver /dm7/data/jy/dm.ini -noconsole
root     31901  3225  0 01:30 pts/2    00:00:00 grep --color=auto dmserver

连接数据库
[dmdba@ora19c ~]$ disql SYSDBA/SYSDBA@10.13.13.140:5236

Server[10.13.13.140:5236]:mode is normal, state is open
login used time: 10.975(ms)
disql V7.1.6.46-Build(2018.02.08-89107)ENT 
Connected to: DM 7.1.6.46
SQL> select * from v$version;

LINEID     BANNER                                                       
---------- -------------------------------------------------------------
1          DM Database Server x64 V7.1.6.46-Build(2018.02.08-89107)ENT  
2          DB Version: 0x7000a

used time: 3.827(ms). Execute id is 807.

4.2初始化RAC集群的数据库
DM RAC是一个单数据库、多实例的集群系统,数据库部署在共享存储上,供所有节点访问,具有高可用性、高性能、低成本等特性。DM支持在RAC环境下创建数据库。RAC的初始化库配置文件dminit.ini中涉及到的参数,是在单机dminit.ini基础上,增加了RAC节点信息。同时,把单机dminit.ini中node_instance参数去掉,log_size,log_path二个参数下放到每个RAC节点里。

准备dminit.ini 配置文件
在2个节点的/dm/dmdbms/data目录下创建 dminit.ini 配置文件,添加如下内容。 在2个节点都创建。

[dmdba@dmrac1 data]$ vi dminit.ini
db_name = rac
system_path = +DMDATA/data
system = +DMDATA/data/rac/system.dbf
system_size = 128
roll = +DMDATA/data/rac/roll.dbf
roll_size = 128
main = +DMDATA/data/rac/main.dbf
main_size = 128
ctl_path = +DMDATA/data/rac/dm.ctl
ctl_size = 8
log_size = 256
dcr_path = /dev/raw/raw1 #dcr 磁盘路径,目前不支持 asm,只能是裸设备
dcr_seqno = 0
auto_overwrite = 1

[RAC0] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /dm7/data/rac0_config
port_num = 5236
mal_host = 10.10.10.161
mal_port = 9340
log_path = +DMLOG/log/rac0_log01.log
log_path = +DMLOG/log/rac0_log02.log

[RAC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /dm7/data/rac1_config
port_num = 5236
mal_host = 10.10.10.162
mal_port = 9341
log_path = +DMLOG/log/rac1_log01.log
log_path = +DMLOG/log/rac1_log02.log


[dmdba@dmrac2 data]$ vi dminit.ini
db_name = rac
system_path = +DMDATA/data
system = +DMDATA/data/rac/system.dbf
system_size = 128
roll = +DMDATA/data/rac/roll.dbf
roll_size = 128
main = +DMDATA/data/rac/main.dbf
main_size = 128
ctl_path = +DMDATA/data/rac/dm.ctl
ctl_size = 8
log_size = 256
dcr_path = /dev/raw/raw1 #dcr 磁盘路径,目前不支持 asm,只能是裸设备
dcr_seqno = 0
auto_overwrite = 1

[RAC0] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /dm7/data/rac0_config
port_num = 5236
mal_host = 10.10.10.161
mal_port = 9340
log_path = +DMLOG/log/rac0_log01.log
log_path = +DMLOG/log/rac0_log02.log

[RAC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /dm7/data/rac1_config
port_num = 5236
mal_host = 10.10.10.162
mal_port = 9341
log_path = +DMLOG/log/rac1_log01.log
log_path = +DMLOG/log/rac1_log02.log

使用dminit初始化数据库
在任意节点启动 dminit 工具初始化数据库。dminit 执行完成后,会在 config_path 目录(/dm7/data/rac0_config 和/dm7/data/rac1_config)下生成配置文件 dm.ini 和 dmmal.ini。

[dmdba@dmrac1 data]$ dminit control=/dm7/data/dminit.ini
initdb V7.1.6.46-Build(2018.02.08-89107)ENT
db version: 0x7000a
file dm.key not found, use default license!
License will expire on 2020-05-08

 log file path: +DMLOG/log/rac0_log01.log


 log file path: +DMLOG/log/rac0_log02.log


 log file path: +DMLOG/log/rac1_log01.log


 log file path: +DMLOG/log/rac1_log02.log

write to dir [+DMDATA/data/rac].
create dm database success. 2020-04-24 16:39:03

将节点一的配置文件复制到节点二:

[dmdba@dmrac1 data]$ scp -r rac1_config 10.13.13.162:`pwd`
The authenticity of host '10.13.13.162 (10.13.13.162)' can't be established.
RSA key fingerprint is 89:fc:3e:e3:2d:27:94:07:0e:6b:fc:c5:e8:89:44:1f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.13.13.162' (RSA) to the list of known hosts.
dmdba@10.13.13.162's password:
sqllog.ini                                                                                                                                                                                                100%  479     0.5KB/s   00:00
dm.ini                                                                                                                                                                                                    100%   40KB  39.8KB/s   00:00
dmmal.ini                                                                                                                                                                                                 100%  204     0.2KB/s   00:00
[dmdba@dmrac1 data]$

启动数据库服务器
1、在2个节点分别注册DM 数据库服务:
节点一:

[root@dmrac1 init.d]# /dm7/script/root/dm_service_installer.sh -t dmserver -i /dm7/data/rac0_config/dm.ini -d /dm7/data/dmdcr.ini -p rac1
Move the service script file(/dm7/bin/DmServicerac1 to /etc/rc.d/init.d/DmServicerac1)
Finished to create the service (DmServicerac1)

节点二:
[root@dmrac2 ~]# /dm7/script/root/dm_service_installer.sh -t dmserver -i /dm7/data/rac1_config/dm.ini -d /dm7/data/dmdcr.ini -p rac2
Move the service script file(/dm7/bin/DmServicerac2 to /etc/rc.d/init.d/DmServicerac2)
Finished to create the service (DmServicerac2)

2、启动数据库

[root@dmrac1 init.d]# service DmServicerac1 start
Starting DmServicerac1: [ OK ]

[root@dmrac2 ~]# service DmServicerac2 start
Starting DmServicerac2: [ OK ]

手工启动命令如下,手工启动后窗口不能关闭,所以

./dmserver /dm7/data/rac0_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini
./dmserver /dm7/data/rac1_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini

连接数据库验证
1 配置服务名文件

[dmdba@dmrac1 ~]$ vi /etc/dm_svc.conf
TIME_ZONE=(480)
rac=(10.13.13.161:5236,10.13.13.162:5236)
SWITCH_TIME=(10000)
SWITCH_INTERVAL=(10)

TIME_ZONE=(480)
LANGUAGE=(en)

[dmdba@dmrac2 ~]$ vi /etc/dm_svc.conf
TIME_ZONE=(480)
rac=(10.13.13.161:5236,10.13.13.162:5236)
SWITCH_TIME=(10000)
SWITCH_INTERVAL=(10)

TIME_ZONE=(480)
LANGUAGE=(en)

2连接RAC集群

[dmdba@dmrac1 ~]$ disql SYSDBA/SYSDBA@rac

Server[10.13.13.161:5236]:mode is normal, state is open
login used time: 10.365(ms)
disql V7.1.6.46-Build(2018.02.08-89107)ENT
Connected to: DM 7.1.6.46
SQL> select instance_name from v$instance;

LINEID     INSTANCE_NAME
---------- -------------
1          RAC0

used time: 18.248(ms). Execute id is 807.
SQL> select * from v$rac_ep_info;

LINEID     EP_NAME EP_SEQNO    EP_GUID              EP_TIMESTAMP         EP_MODE EP_STATUS
---------- ------- ----------- -------------------- -------------------- ------- ---------
1          RAC0    0           2067076818           2067077298           MASTER  OK
2          RAC1    1           2067098084           2067098537           SLAVE   OK

used time: 2.741(ms). Execute id is 808.

Oracle Linux 7.1 silent install 19C RAC

一·系统环境规则
1.1网络架构

                                    节点1                    节点2
主机名                               19c1                     19c2 
Private IP                          10.10.10.141             10.10.10.142 
Public IP                           10.13.13.141             10.13.13.142
VIP                                 10.13.13.143             10.13.13.144
SCANIP                              10.13.13.145/146/147 
SCAN_NAME                           scan-19c

1.2 存储

共享磁盘         ASM磁盘                ASM磁盘组              大小              冗余
/dev/sdb        /dev/asmdisk1          OCR                   50G               外部
/dev/sdc       /dev/asmdisk2           DATA                  60G               外部

1.3 软件版本

操作系统:Oracle Linux 7.1
集群软件: Oracle Clusterware 19.3.0
数据库软件:Oracle Database Enterprise 19.3.0

二·安装环境准备
2.1修改主机名和IP地址
修改主机名

[root@localhost ~]# hostnamectl set-hostname 19c1
[root@localhost ~]# hostnamectl set-hostname 19c2

2.2修改Private IP地址

[root@19c1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192
HWADDR=00:50:56:A3:10:82
TYPE=Ethernet
BOOTPROTO=none
IPADDR=10.10.10.141
PREFIX=24
GATEWAY=10.10.10.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens192
UUID=7d9faf7c-d74c-41da-b02e-8703dfb8ef20
DEVICE=ens192
ONBOOT=no

[root@19c2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens192
UUID=752d38b2-aa25-4f94-9232-df2edb36ed79
ONBOOT=yes
DEVICE=ens192
IPADDR=10.10.10.142
PREFIX=24
GATEWAY=10.10.10.1
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

2.3 修改Public IP地址

[root@19c1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens160
UUID=073349c5-40bc-4a0d-b1e6-44a935689d41
DEVICE=ens160
ONBOOT=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
IPADDR=10.13.13.141
PREFIX=24
GATEWAY=10.13.13.254

[root@19c2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=ens160
UUID=073349c5-40bc-4a0d-b1e6-44a935689d41
DEVICE=ens160
ONBOOT=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
IPADDR=10.13.13.142
PREFIX=24
GATEWAY=10.13.13.254

2.4 关闭时间同步服务

[root@19c1 ~]# systemctl stop chronyd
[root@19c1 ~]# systemctl disable chronyd
rm '/etc/systemd/system/multi-user.target.wants/chronyd.service'
[root@19c1 ~]# mv /etc/chrony.conf /etc/chrony.conf.bak

[root@19c2 ~]# systemctl stop chronyd
[root@19c2 ~]# systemctl disable chronyd
rm '/etc/systemd/system/multi-user.target.wants/chronyd.service'
[root@19c2 ~]# mv /etc/chrony.conf /etc/chrony.conf.bak

2.5关闭防火墙和SELinux

[root@19c1 ~]# systemctl stop firewalld
[root@19c1 ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@19c1 ~]# setenforce 0
[root@19c1 ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@19c1 ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected. 
# mls - Multi Level Security protection.
SELINUXTYPE=targeted


[root@19c2 ~]# systemctl stop chronyd
[root@19c2 ~]# systemctl disable chronyd
rm '/etc/systemd/system/multi-user.target.wants/chronyd.service'
[root@19c2 ~]# mv /etc/chrony.conf /etc/chrony.conf.bak
[root@19c2 ~]# setenforce 0
[root@19c2 ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@19c2 ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected. 
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

2.6 配置本地YUM

[root@19c1 ~]# ls -lrt /etc/yum.repos.d/
total 4
-rw-r--r--. 1 root root 2323 Feb 16 2015 public-yum-ol7.repo

[root@19c1 ~]# mv /etc/yum.repos.d/public-yum-ol7.repo /etc/yum.repos.d/public-yum-ol7.repo.bak
[root@19c1 ~]# mount /dev/sr0 /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@19c1 ~]# cat >> /etc/yum.repos.d/jy.repo < [base]
> name=jy
> baseurl=file:///mnt
> enabled=1
> gpgcheck=0
> multilib_policy=all
> EOF
[root@19c1 ~]# cat /etc/yum.repos.d/jy.repo
[base]
name=jy
baseurl=file:///mnt
enabled=1
gpgcheck=0
multilib_policy=all
[root@19c1 ~]# yum clean all
Loaded plugins: langpacks
Cleaning repos: base ol7_UEKR3 ol7_latest
Cleaning up everything
[root@19c1 ~]# yum makecache
Loaded plugins: langpacks
base | 3.6 kB 00:00:00 
(1/4): base/group_gz | 134 kB 00:00:00 
(2/4): base/filelists_db | 3.4 MB 00:00:00 
(3/4): base/primary_db | 4.0 MB 00:00:00 
(4/4): base/other_db | 1.3 MB 00:00:00 
Metadata Cache Created

[root@19c2 ~]# ls -lrt /etc/yum.repos.d/
total 4
-rw-r--r--. 1 root root 2323 Feb 16 2015 public-yum-ol7.repo
[root@19c2 ~]# mv /etc/yum.repos.d/public-yum-ol7.repo /etc/yum.repos.d/public-yum-ol7.repo.bak
[root@19c2 ~]# mount /dev/sr0 /mnt/
mount: /dev/sr0 is write-protected, mounting read-only
[root@19c2 ~]# cat >> /etc/yum.repos.d/jy.repo < [base]
> name=jy
> baseurl=file:///mnt
> enabled=1
> gpgcheck=0
> multilib_policy=all
> EOF
[root@19c2 ~]# cat /etc/yum.repos.d/jy.repo
[base]
name=jy
baseurl=file:///mnt
enabled=1
gpgcheck=0
multilib_policy=all
[root@19c2 ~]# yum clean all
Loaded plugins: langpacks
Cleaning repos: base
Cleaning up everything

[root@19c2 ~]# yum makecache
Loaded plugins: langpacks
base | 3.6 kB 00:00:00 
(1/4): base/group_gz | 134 kB 00:00:00 
(2/4): base/filelists_db | 3.4 MB 00:00:00 
(3/4): base/primary_db | 4.0 MB 00:00:00 
(4/4): base/other_db | 1.3 MB 00:00:00 
Metadata Cache Created

2.7 禁用NTP

[root@19c1 ~]# systemctl stop ntpd.service
[root@19c1 ~]# systemctl disable ntpd.service

[root@19c2 ~]# systemctl stop ntpd.service
[root@19c2 ~]# systemctl disable ntpd.service

2.8创建用户和组
创建用户组

[root@19c1 ~]# systemctl stop ntpd.service
[root@19c1 ~]# systemctl disable ntpd.service
[root@19c1 ~]# groupadd -g 54321 oinstall
[root@19c1 ~]# groupadd -g 54322 dba
[root@19c1 ~]# groupadd -g 54323 oper
[root@19c1 ~]# groupadd -g 54324 backupdba
[root@19c1 ~]# groupadd -g 54325 dgdba
[root@19c1 ~]# groupadd -g 54326 kmdba
[root@19c1 ~]# groupadd -g 54327 asmdba
[root@19c1 ~]# groupadd -g 54328 asmoper
[root@19c1 ~]# groupadd -g 54329 asmadmin
[root@19c1 ~]# groupadd -g 54330 racdba

[root@19c1 ~]# grep 543 /etc/group
dba:x:54322:
oper:x:54323:
backupdba:x:54324:
dgdba:x:54325:
kmdba:x:54326:
asmdba:x:54327:
asmoper:x:54328:
asmadmin:x:54329:
racdba:x:54330:
oinstall:x:54321:

[root@19c2 ~]# groupadd -g 54321 oinstall
[root@19c2 ~]# groupadd -g 54322 dba
[root@19c2 ~]# groupadd -g 54323 oper
[root@19c2 ~]# groupadd -g 54324 backupdba
[root@19c2 ~]# groupadd -g 54325 dgdba
[root@19c2 ~]# groupadd -g 54326 kmdba
[root@19c2 ~]# groupadd -g 54327 asmdba
[root@19c2 ~]# groupadd -g 54328 asmoper
[root@19c2 ~]# groupadd -g 54329 asmadmin
[root@19c2 ~]# groupadd -g 54330 racdba

[root@19c2 ~]# grep 543 /etc/group
dba:x:54322:
oper:x:54323:
backupdba:x:54324:
dgdba:x:54325:
kmdba:x:54326:
asmdba:x:54327:
asmoper:x:54328:
asmadmin:x:54329:
racdba:x:54330:
oinstall:x:54321:

创建用户

[root@19c1 ~]# useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,racdba grid
[root@19c1 ~]# useradd -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
[root@19c1 ~]# passwd grid
Changing password for user grid.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@19c1 ~]# passwd oracle
Changing password for user oracle.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

[root@19c2 ~]# useradd -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,racdba grid
[root@19c2 ~]# useradd -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
[root@19c2 ~]# passwd grid
Changing password for user grid.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@19c2 ~]# passwd oracle
Changing password for user oracle.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@19c2 ~]#

2.9创建相关目录

[root@19c1 ~]# mkdir -p /u01/tmp
[root@19c1 ~]# mkdir -p /u01/app/19.3/grid
[root@19c1 ~]# mkdir -p /u01/app/grid
[root@19c1 ~]# mkdir -p /u01/app/oracle/product/19.3/db
[root@19c1 ~]# mkdir -p /u01/app/oraInventory
[root@19c1 ~]# chown -R grid:oinstall /u01
[root@19c1 ~]# chown oracle:oinstall /u01/app/oracle
[root@19c1 ~]# chmod -R 775 /u01/

[root@19c2 ~]# mkdir -p /u01/tmp
[root@19c2 ~]# mkdir -p /u01/app/19.3/grid
[root@19c2 ~]# mkdir -p /u01/app/grid
[root@19c2 ~]# mkdir -p /u01/app/oracle/product/19.3/db
[root@19c2 ~]# mkdir -p /u01/app/oraInventory
[root@19c2 ~]# chown -R grid:oinstall /u01
[root@19c2 ~]# chown oracle:oinstall /u01/app/oracle
[root@19c2 ~]# chmod -R 775 /u01/

2.10 安装软件包

[root@19c1 ~]# yum install -y bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python python-configshell python-rtslib python-six targetcli smartmontools sysstat gcc c-c++ gcc-info gcc-locale gcc48 gcc48-info gcc48-locale gcc48-c++
Loaded plugins: langpacks
Package bc-1.06.95-13.el7.x86_64 already installed and latest version
Package binutils-2.23.52.0.1-30.el7.x86_64 already installed and latest version
Package compat-libcap1-1.10-7.el7.x86_64 already installed and latest version
No package compat-libstdc++ available. --后面要单独安装这个包
Package elfutils-libelf-0.160-1.el7.x86_64 already installed and latest version
Package glibc-2.17-78.0.1.el7.x86_64 already installed and latest version
Package glibc-devel-2.17-78.0.1.el7.x86_64 already installed and latest version
Package libaio-0.3.109-12.el7.x86_64 already installed and latest version
Package libX11-1.6.0-2.1.el7.x86_64 already installed and latest version
Package libXau-1.0.8-2.1.el7.x86_64 already installed and latest version
Package libXi-1.7.2-2.1.el7.x86_64 already installed and latest version
Package libXtst-1.2.2-2.1.el7.x86_64 already installed and latest version
Package libXrender-0.9.8-2.1.el7.x86_64 already installed and latest version
Package libgcc-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-devel-4.8.3-9.el7.x86_64 already installed and latest version
Package libxcb-1.9-5.el7.x86_64 already installed and latest version
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package net-tools-2.0-0.17.20131004git.el7.x86_64 already installed and latest version
Package 1:nfs-utils-1.3.0-0.8.el7.x86_64 already installed and latest version
Package python-2.7.5-16.el7.x86_64 already installed and latest version
Package 1:python-configshell-1.1.fb14-1.el7.noarch already installed and latest version
Package python-rtslib-2.1.fb50-1.el7.noarch already installed and latest version
Package python-six-1.3.0-4.el7.noarch already installed and latest version
Package targetcli-2.1.fb37-3.el7.noarch already installed and latest version
Package 1:smartmontools-6.2-4.el7.x86_64 already installed and latest version
Package sysstat-10.1.5-7.el7.x86_64 already installed and latest version
Package gcc-4.8.3-9.el7.x86_64 already installed and latest version
No package c-c++ available.
No package gcc-info available.
No package gcc-locale available.
No package gcc48 available.
No package gcc48-info available.
No package gcc48-locale available.
No package gcc48-c++ available.
Resolving Dependencies
--> Running transaction check
---> Package elfutils-libelf-devel.x86_64 0:0.160-1.el7 will be installed
---> Package fontconfig-devel.x86_64 0:2.10.95-7.el7 will be installed
--> Processing Dependency: freetype-devel >= 2.1.4 for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(freetype2) for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.10.95-7.el7.x86_64
---> Package ksh.x86_64 0:20120801-22.el7 will be installed
---> Package libXrender-devel.x86_64 0:0.9.8-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(renderproto) >= 0.9 for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xproto) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(x11) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
---> Package libaio-devel.x86_64 0:0.3.109-12.el7 will be installed
--> Running transaction check
---> Package expat-devel.x86_64 0:2.1.0-8.el7 will be installed
---> Package freetype-devel.x86_64 0:2.4.11-9.el7 will be installed
--> Processing Dependency: zlib-devel for package: freetype-devel-2.4.11-9.el7.x86_64
---> Package libX11-devel.x86_64 0:1.6.0-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(xcb) >= 1.1.92 for package: libX11-devel-1.6.0-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.0-2.1.el7.x86_64
---> Package xorg-x11-proto-devel.noarch 0:7.7-8.el7.1 will be installed
--> Running transaction check
---> Package libxcb-devel.x86_64 0:1.9-5.el7 will be installed
--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.9-5.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-13.el7 will be installed
--> Running transaction check
---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================================================
Installing:
elfutils-libelf-devel x86_64 0.160-1.el7 base 34 k
fontconfig-devel x86_64 2.10.95-7.el7 base 127 k
ksh x86_64 20120801-22.el7 base 879 k
libXrender-devel x86_64 0.9.8-2.1.el7 base 16 k
libaio-devel x86_64 0.3.109-12.el7 base 12 k
Installing for dependencies:
expat-devel x86_64 2.1.0-8.el7 base 56 k
freetype-devel x86_64 2.4.11-9.el7 base 354 k
libX11-devel x86_64 1.6.0-2.1.el7 base 978 k
libXau-devel x86_64 1.0.8-2.1.el7 base 14 k
libxcb-devel x86_64 1.9-5.el7 base 1.0 M
xorg-x11-proto-devel noarch 7.7-8.el7.1 base 280 k
zlib-devel x86_64 1.2.7-13.el7 base 49 k

Transaction Summary
============================================================================================================================================================================================================================================
Install 5 Packages (+7 Dependent packages)

Total download size: 3.7 M
Installed size: 12 M
Downloading packages:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 13 MB/s | 3.7 MB 00:00:00 
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : xorg-x11-proto-devel-7.7-8.el7.1.noarch 1/12 
Installing : libXau-devel-1.0.8-2.1.el7.x86_64 2/12 
Installing : libxcb-devel-1.9-5.el7.x86_64 3/12 
Installing : libX11-devel-1.6.0-2.1.el7.x86_64 4/12 
Installing : expat-devel-2.1.0-8.el7.x86_64 5/12 
Installing : zlib-devel-1.2.7-13.el7.x86_64 6/12 
Installing : freetype-devel-2.4.11-9.el7.x86_64 7/12 
Installing : fontconfig-devel-2.10.95-7.el7.x86_64 8/12 
Installing : libXrender-devel-0.9.8-2.1.el7.x86_64 9/12 
Installing : libaio-devel-0.3.109-12.el7.x86_64 10/12 
Installing : elfutils-libelf-devel-0.160-1.el7.x86_64 11/12 
Installing : ksh-20120801-22.el7.x86_64 12/12 
Verifying : ksh-20120801-22.el7.x86_64 1/12 
Verifying : libXrender-devel-0.9.8-2.1.el7.x86_64 2/12 
Verifying : zlib-devel-1.2.7-13.el7.x86_64 3/12 
Verifying : libxcb-devel-1.9-5.el7.x86_64 4/12 
Verifying : libX11-devel-1.6.0-2.1.el7.x86_64 5/12 
Verifying : expat-devel-2.1.0-8.el7.x86_64 6/12 
Verifying : xorg-x11-proto-devel-7.7-8.el7.1.noarch 7/12 
Verifying : elfutils-libelf-devel-0.160-1.el7.x86_64 8/12 
Verifying : libaio-devel-0.3.109-12.el7.x86_64 9/12 
Verifying : fontconfig-devel-2.10.95-7.el7.x86_64 10/12 
Verifying : freetype-devel-2.4.11-9.el7.x86_64 11/12 
Verifying : libXau-devel-1.0.8-2.1.el7.x86_64 12/12

Installed:
elfutils-libelf-devel.x86_64 0:0.160-1.el7 fontconfig-devel.x86_64 0:2.10.95-7.el7 ksh.x86_64 0:20120801-22.el7 libXrender-devel.x86_64 0:0.9.8-2.1.el7 libaio-devel.x86_64 0:0.3.109-12.el7

Dependency Installed:
expat-devel.x86_64 0:2.1.0-8.el7 freetype-devel.x86_64 0:2.4.11-9.el7 libX11-devel.x86_64 0:1.6.0-2.1.el7 libXau-devel.x86_64 0:1.0.8-2.1.el7 libxcb-devel.x86_64 0:1.9-5.el7 xorg-x11-proto-devel.noarch 0:7.7-8.el7.1 
zlib-devel.x86_64 0:1.2.7-13.el7

Complete!

安装compat-libstdc++-33-3.2.3-72.el7.i686.rpm,因为名字带有版本信息

[root@19c1 ~]# yum install compat-libstdc++-33-3.2.3-72.el7.i686
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package compat-libstdc++-33.i686 0:3.2.3-72.el7 will be installed
--> Processing Dependency: libm.so.6 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GLIBC_2.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libc.so.6(GLIBC_2.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Running transaction check
---> Package glibc.i686 0:2.17-78.0.1.el7 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-78.0.1.el7.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.17-78.0.1.el7.i686
---> Package libgcc.i686 0:4.8.3-9.el7 will be installed
--> Running transaction check
---> Package nss-softokn-freebl.i686 0:3.16.2.3-9.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================================================
Installing:
compat-libstdc++-33 i686 3.2.3-72.el7 base 196 k
Installing for dependencies:
glibc i686 2.17-78.0.1.el7 base 4.2 M
libgcc i686 4.8.3-9.el7 base 99 k
nss-softokn-freebl i686 3.16.2.3-9.el7 base 186 k

Transaction Summary
============================================================================================================================================================================================================================================
Install 1 Package (+3 Dependent packages)

Total download size: 4.6 M
Installed size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 26 MB/s | 4.6 MB 00:00:00 
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libgcc-4.8.3-9.el7.i686 1/4 
Installing : nss-softokn-freebl-3.16.2.3-9.el7.i686 2/4 
Installing : glibc-2.17-78.0.1.el7.i686 3/4 
Installing : compat-libstdc++-33-3.2.3-72.el7.i686 4/4 
Verifying : compat-libstdc++-33-3.2.3-72.el7.i686 1/4 
Verifying : glibc-2.17-78.0.1.el7.i686 2/4 
Verifying : libgcc-4.8.3-9.el7.i686 3/4 
Verifying : nss-softokn-freebl-3.16.2.3-9.el7.i686 4/4

Installed:
compat-libstdc++-33.i686 0:3.2.3-72.el7

Dependency Installed:
glibc.i686 0:2.17-78.0.1.el7 libgcc.i686 0:4.8.3-9.el7 nss-softokn-freebl.i686 0:3.16.2.3-9.el7

Complete!


[root@19c2 ~]# yum install -y bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python python-configshell python-rtslib python-six targetcli smartmontools sysstat gcc c-c++ gcc-info gcc-locale gcc48 gcc48-info gcc48-locale gcc48-c++
Loaded plugins: langpacks
Package bc-1.06.95-13.el7.x86_64 already installed and latest version
Package binutils-2.23.52.0.1-30.el7.x86_64 already installed and latest version
Package compat-libcap1-1.10-7.el7.x86_64 already installed and latest version
No package compat-libstdc++ available. --后面要单独安装这个包
Package elfutils-libelf-0.160-1.el7.x86_64 already installed and latest version
Package glibc-2.17-78.0.1.el7.x86_64 already installed and latest version
Package glibc-devel-2.17-78.0.1.el7.x86_64 already installed and latest version
Package libaio-0.3.109-12.el7.x86_64 already installed and latest version
Package libX11-1.6.0-2.1.el7.x86_64 already installed and latest version
Package libXau-1.0.8-2.1.el7.x86_64 already installed and latest version
Package libXi-1.7.2-2.1.el7.x86_64 already installed and latest version
Package libXtst-1.2.2-2.1.el7.x86_64 already installed and latest version
Package libXrender-0.9.8-2.1.el7.x86_64 already installed and latest version
Package libgcc-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-devel-4.8.3-9.el7.x86_64 already installed and latest version
Package libxcb-1.9-5.el7.x86_64 already installed and latest version
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package net-tools-2.0-0.17.20131004git.el7.x86_64 already installed and latest version
Package 1:nfs-utils-1.3.0-0.8.el7.x86_64 already installed and latest version
Package python-2.7.5-16.el7.x86_64 already installed and latest version
Package 1:python-configshell-1.1.fb14-1.el7.noarch already installed and latest version
Package python-rtslib-2.1.fb50-1.el7.noarch already installed and latest version
Package python-six-1.3.0-4.el7.noarch already installed and latest version
Package targetcli-2.1.fb37-3.el7.noarch already installed and latest version
Package 1:smartmontools-6.2-4.el7.x86_64 already installed and latest version
Package sysstat-10.1.5-7.el7.x86_64 already installed and latest version
Package gcc-4.8.3-9.el7.x86_64 already installed and latest version
No package c-c++ available.
No package gcc-info available.
No package gcc-locale available.
No package gcc48 available.
No package gcc48-info available.
No package gcc48-locale available.
No package gcc48-c++ available.
Resolving Dependencies
--> Running transaction check
---> Package elfutils-libelf-devel.x86_64 0:0.160-1.el7 will be installed
---> Package fontconfig-devel.x86_64 0:2.10.95-7.el7 will be installed
--> Processing Dependency: freetype-devel >= 2.1.4 for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(freetype2) for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.10.95-7.el7.x86_64
---> Package ksh.x86_64 0:20120801-22.el7 will be installed
---> Package libXrender-devel.x86_64 0:0.9.8-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(renderproto) >= 0.9 for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xproto) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(x11) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
---> Package libaio-devel.x86_64 0:0.3.109-12.el7 will be installed
--> Running transaction check
---> Package expat-devel.x86_64 0:2.1.0-8.el7 will be installed
---> Package freetype-devel.x86_64 0:2.4.11-9.el7 will be installed
--> Processing Dependency: zlib-devel for package: freetype-devel-2.4.11-9.el7.x86_64
---> Package libX11-devel.x86_64 0:1.6.0-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(xcb) >= 1.1.92 for package: libX11-devel-1.6.0-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.0-2.1.el7.x86_64
---> Package xorg-x11-proto-devel.noarch 0:7.7-8.el7.1 will be installed
--> Running transaction check
---> Package libxcb-devel.x86_64 0:1.9-5.el7 will be installed
--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.9-5.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-13.el7 will be installed
--> Running transaction check
---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================================================
Installing:
elfutils-libelf-devel x86_64 0.160-1.el7 base 34 k
fontconfig-devel x86_64 2.10.95-7.el7 base 127 k
ksh x86_64 20120801-22.el7 base 879 k
libXrender-devel x86_64 0.9.8-2.1.el7 base 16 k
libaio-devel x86_64 0.3.109-12.el7 base 12 k
Installing for dependencies:
expat-devel x86_64 2.1.0-8.el7 base 56 k
freetype-devel x86_64 2.4.11-9.el7 base 354 k
libX11-devel x86_64 1.6.0-2.1.el7 base 978 k
libXau-devel x86_64 1.0.8-2.1.el7 base 14 k
libxcb-devel x86_64 1.9-5.el7 base 1.0 M
xorg-x11-proto-devel noarch 7.7-8.el7.1 base 280 k
zlib-devel x86_64 1.2.7-13.el7 base 49 k

Transaction Summary
============================================================================================================================================================================================================================================
Install 5 Packages (+7 Dependent packages)

Total download size: 3.7 M
Installed size: 12 M
Downloading packages:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 8.1 MB/s | 3.7 MB 00:00:00 
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : xorg-x11-proto-devel-7.7-8.el7.1.noarch 1/12 
Installing : libXau-devel-1.0.8-2.1.el7.x86_64 2/12 
Installing : libxcb-devel-1.9-5.el7.x86_64 3/12 
Installing : libX11-devel-1.6.0-2.1.el7.x86_64 4/12 
Installing : expat-devel-2.1.0-8.el7.x86_64 5/12 
Installing : zlib-devel-1.2.7-13.el7.x86_64 6/12 
Installing : freetype-devel-2.4.11-9.el7.x86_64 7/12 
Installing : fontconfig-devel-2.10.95-7.el7.x86_64 8/12 
Installing : libXrender-devel-0.9.8-2.1.el7.x86_64 9/12 
Installing : libaio-devel-0.3.109-12.el7.x86_64 10/12 
Installing : elfutils-libelf-devel-0.160-1.el7.x86_64 11/12 
Installing : ksh-20120801-22.el7.x86_64 12/12 
Verifying : ksh-20120801-22.el7.x86_64 1/12 
Verifying : libXrender-devel-0.9.8-2.1.el7.x86_64 2/12 
Verifying : zlib-devel-1.2.7-13.el7.x86_64 3/12 
Verifying : libxcb-devel-1.9-5.el7.x86_64 4/12 
Verifying : libX11-devel-1.6.0-2.1.el7.x86_64 5/12 
Verifying : expat-devel-2.1.0-8.el7.x86_64 6/12 
Verifying : xorg-x11-proto-devel-7.7-8.el7.1.noarch 7/12 
Verifying : elfutils-libelf-devel-0.160-1.el7.x86_64 8/12 
Verifying : libaio-devel-0.3.109-12.el7.x86_64 9/12 
Verifying : fontconfig-devel-2.10.95-7.el7.x86_64 10/12 
Verifying : freetype-devel-2.4.11-9.el7.x86_64 11/12 
Verifying : libXau-devel-1.0.8-2.1.el7.x86_64 12/12

Installed:
elfutils-libelf-devel.x86_64 0:0.160-1.el7 fontconfig-devel.x86_64 0:2.10.95-7.el7 ksh.x86_64 0:20120801-22.el7 libXrender-devel.x86_64 0:0.9.8-2.1.el7 libaio-devel.x86_64 0:0.3.109-12.el7

Dependency Installed:
expat-devel.x86_64 0:2.1.0-8.el7 freetype-devel.x86_64 0:2.4.11-9.el7 libX11-devel.x86_64 0:1.6.0-2.1.el7 libXau-devel.x86_64 0:1.0.8-2.1.el7 libxcb-devel.x86_64 0:1.9-5.el7 xorg-x11-proto-devel.noarch 0:7.7-8.el7.1 
zlib-devel.x86_64 0:1.2.7-13.el7

Complete!

安装compat-libstdc++-33-3.2.3-72.el7.i686.rpm,因为名字带有版本信息

[root@19c2 ~]# yum install compat-libstdc++-33-3.2.3-72.el7.i686
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package compat-libstdc++-33.i686 0:3.2.3-72.el7 will be installed
--> Processing Dependency: libm.so.6 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GLIBC_2.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libc.so.6(GLIBC_2.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Running transaction check
---> Package glibc.i686 0:2.17-78.0.1.el7 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-78.0.1.el7.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.17-78.0.1.el7.i686
---> Package libgcc.i686 0:4.8.3-9.el7 will be installed
--> Running transaction check
---> Package nss-softokn-freebl.i686 0:3.16.2.3-9.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
Package Arch Version Repository Size
============================================================================================================================================================================================================================================
Installing:
compat-libstdc++-33 i686 3.2.3-72.el7 base 196 k
Installing for dependencies:
glibc i686 2.17-78.0.1.el7 base 4.2 M
libgcc i686 4.8.3-9.el7 base 99 k
nss-softokn-freebl i686 3.16.2.3-9.el7 base 186 k

Transaction Summary
============================================================================================================================================================================================================================================
Install 1 Package (+3 Dependent packages)

Total download size: 4.6 M
Installed size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 74 MB/s | 4.6 MB 00:00:00 
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libgcc-4.8.3-9.el7.i686 1/4 
Installing : nss-softokn-freebl-3.16.2.3-9.el7.i686 2/4 
Installing : glibc-2.17-78.0.1.el7.i686 3/4 
Installing : compat-libstdc++-33-3.2.3-72.el7.i686 4/4 
Verifying : compat-libstdc++-33-3.2.3-72.el7.i686 1/4 
Verifying : glibc-2.17-78.0.1.el7.i686 2/4 
Verifying : libgcc-4.8.3-9.el7.i686 3/4 
Verifying : nss-softokn-freebl-3.16.2.3-9.el7.i686 4/4

Installed:
compat-libstdc++-33.i686 0:3.2.3-72.el7

Dependency Installed:
glibc.i686 0:2.17-78.0.1.el7 libgcc.i686 0:4.8.3-9.el7 nss-softokn-freebl.i686 0:3.16.2.3-9.el7

Complete!

检查已经安装的软件包

[root@19c1 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python python-configshell python-rtslib python-six targetcli smartmontools sysstat
bc-1.06.95-13.el7 (x86_64)
binutils-2.23.52.0.1-30.el7 (x86_64)
compat-libcap1-1.10-7.el7 (x86_64)
package compat-libstdc++ is not installed
elfutils-libelf-0.160-1.el7 (x86_64)
elfutils-libelf-devel-0.160-1.el7 (x86_64)
fontconfig-devel-2.10.95-7.el7 (x86_64)
glibc-2.17-78.0.1.el7 (x86_64)
glibc-2.17-78.0.1.el7 (i686)
glibc-devel-2.17-78.0.1.el7 (x86_64)
ksh-20120801-22.el7 (x86_64)
libaio-0.3.109-12.el7 (x86_64)
libaio-devel-0.3.109-12.el7 (x86_64)
libX11-1.6.0-2.1.el7 (x86_64)
libXau-1.0.8-2.1.el7 (x86_64)
libXi-1.7.2-2.1.el7 (x86_64)
libXtst-1.2.2-2.1.el7 (x86_64)
libXrender-0.9.8-2.1.el7 (x86_64)
libXrender-devel-0.9.8-2.1.el7 (x86_64)
libgcc-4.8.3-9.el7 (x86_64)
libgcc-4.8.3-9.el7 (i686)
libstdc++-4.8.3-9.el7 (x86_64)
libstdc++-devel-4.8.3-9.el7 (x86_64)
libxcb-1.9-5.el7 (x86_64)
make-3.82-21.el7 (x86_64)
net-tools-2.0-0.17.20131004git.el7 (x86_64)
nfs-utils-1.3.0-0.8.el7 (x86_64)
python-2.7.5-16.el7 (x86_64)
python-configshell-1.1.fb14-1.el7 (noarch)
python-rtslib-2.1.fb50-1.el7 (noarch)
python-six-1.3.0-4.el7 (noarch)
targetcli-2.1.fb37-3.el7 (noarch)
smartmontools-6.2-4.el7 (x86_64)
sysstat-10.1.5-7.el7 (x86_64)

[root@19c2 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python python-configshell python-rtslib python-six targetcli smartmontools sysstat
bc-1.06.95-13.el7 (x86_64)
binutils-2.23.52.0.1-30.el7 (x86_64)
compat-libcap1-1.10-7.el7 (x86_64)
package compat-libstdc++ is not installed
elfutils-libelf-0.160-1.el7 (x86_64)
elfutils-libelf-devel-0.160-1.el7 (x86_64)
fontconfig-devel-2.10.95-7.el7 (x86_64)
glibc-2.17-78.0.1.el7 (x86_64)
glibc-2.17-78.0.1.el7 (i686)
glibc-devel-2.17-78.0.1.el7 (x86_64)
ksh-20120801-22.el7 (x86_64)
libaio-0.3.109-12.el7 (x86_64)
libaio-devel-0.3.109-12.el7 (x86_64)
libX11-1.6.0-2.1.el7 (x86_64)
libXau-1.0.8-2.1.el7 (x86_64)
libXi-1.7.2-2.1.el7 (x86_64)
libXtst-1.2.2-2.1.el7 (x86_64)
libXrender-0.9.8-2.1.el7 (x86_64)
libXrender-devel-0.9.8-2.1.el7 (x86_64)
libgcc-4.8.3-9.el7 (x86_64)
libgcc-4.8.3-9.el7 (i686)
libstdc++-4.8.3-9.el7 (x86_64)
libstdc++-devel-4.8.3-9.el7 (x86_64)
libxcb-1.9-5.el7 (x86_64)
make-3.82-21.el7 (x86_64)
net-tools-2.0-0.17.20131004git.el7 (x86_64)
nfs-utils-1.3.0-0.8.el7 (x86_64)
python-2.7.5-16.el7 (x86_64)
python-configshell-1.1.fb14-1.el7 (noarch)
python-rtslib-2.1.fb50-1.el7 (noarch)
python-six-1.3.0-4.el7 (noarch)
targetcli-2.1.fb37-3.el7 (noarch)
smartmontools-6.2-4.el7 (x86_64)
sysstat-10.1.5-7.el7 (x86_64)

2.11编辑hosts文件

[root@19c1 ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

#public-ip
10.13.13.141 19c1
10.13.13.142 19c2

#public-vip
10.13.13.143 19c1-vip
10.13.13.144 19c2-vip

#prive-ip
10.10.10.141 19c1-priv
10.10.10.142 19c2-priv

#scan-ip
10.13.13.145 scan-19c
10.13.13.146 scan-19c
10.13.13.147 scan-19c


[root@19c2 ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

#public-ip
10.13.13.141 19c1
10.13.13.142 19c2

#public-vip
10.13.13.143 19c1-vip
10.13.13.144 19c2-vip

#prive-ip
10.10.10.141 19c1-priv
10.10.10.142 19c2-priv

#scan-ip
10.13.13.145 scan-19c
10.13.13.146 scan-19c
10.13.13.147 scan-19c

2.12 修改系统内核参数

[root@19c1 ~]# cat /etc/sysconfig/network
# Created by anaconda
[root@19c1 ~]# cat >> /etc/sysctl.conf < kernel.shmall = 4294967296
> kernel.sem = 510 65280 510 128
> kernel.shmmni = 4096
> kernel.shmmax = 429496729500
> net.ipv4.ip_local_port_range = 9000 65500
> net.core.rmem_default = 1048576
> net.core.rmem_max = 4194304
> net.core.wmem_default = 262144
> net.core.wmem_max = 1048576
> fs.file-max = 6815744
> fs.aio-max-nr = 1048576
> vm.swappiness = 0
> vm.dirty_background_ratio = 3
> vm.dirty_ratio = 80
> vm.dirty_expire_centisecs = 500
> vm.dirty_writeback_centisecs = 100
> net.ipv4.tcp_sack = 0
> net.ipv4.tcp_timestamps = 0
> net.ipv4.conf.default.rp_filter = 0
> net.ipv4.tcp_wmem = 262144
> net.ipv4.tcp_rmem = 4194304
> EOF

[root@19c2 ~]# cat /etc/sysconfig/network
# Created by anaconda
[root@19c2 ~]# cat >> /etc/sysctl.conf < kernel.shmall = 4294967296
> kernel.sem = 510 65280 510 128
> kernel.shmmni = 4096
> kernel.shmmax = 429496729500
> net.ipv4.ip_local_port_range = 9000 65500
> net.core.rmem_default = 1048576
> net.core.rmem_max = 4194304
> net.core.wmem_default = 262144
> net.core.wmem_max = 1048576
> fs.file-max = 6815744
> fs.aio-max-nr = 1048576
> vm.swappiness = 0
> vm.dirty_background_ratio = 3
> vm.dirty_ratio = 80
> vm.dirty_expire_centisecs = 500
> vm.dirty_writeback_centisecs = 100
> net.ipv4.tcp_sack = 0
> net.ipv4.tcp_timestamps = 0
> net.ipv4.conf.default.rp_filter = 0
> net.ipv4.tcp_wmem = 262144
> net.ipv4.tcp_rmem = 4194304
> EOF

[root@19c1 ~]# sysctl -p
kernel.shmall = 4294967296
kernel.sem = 510 65280 510 128
kernel.shmmni = 4096
kernel.shmmax = 429496729500
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 1048576
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.tcp_wmem = 262144
net.ipv4.tcp_rmem = 4194304

[root@19c2 ~]# sysctl -p
kernel.shmall = 4294967296
kernel.sem = 510 65280 510 128
kernel.shmmni = 4096
kernel.shmmax = 429496729500
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max = 6815744
fs.aio-max-nr = 1048576
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.tcp_wmem = 262144
net.ipv4.tcp_rmem = 4194304

2.13 配置LIMITS限制参数

[root@19c1 ~]# cat >> /etc/security/limits.conf < oracle soft nproc 2047
> oracle hard nproc 16384
> oracle soft nofile 65536
> oracle hard nofile 65536
> oracle soft memlock 3145728
> oracle hard memlock 3145728
> oracle soft stack 10240
> oracle hard stack 32768
> 
> grid soft nproc 2047
> grid hard nproc 16384
> grid soft nofile 65536
> grid hard nofile 65536
> grid soft memlock 3145728
> grid hard memlock 3145728
> grid soft stack 10240
> grid hard stack 32768
> EOF

[root@19c2 ~]# cat >> /etc/security/limits.conf < oracle soft nproc 2047
> oracle hard nproc 16384
> oracle soft nofile 65536
> oracle hard nofile 65536
> oracle soft memlock 3145728
> oracle hard memlock 3145728
> oracle soft stack 10240
> oracle hard stack 32768
> 
> grid soft nproc 2047
> grid hard nproc 16384
> grid soft nofile 65536
> grid hard nofile 65536
> grid soft memlock 3145728
> grid hard memlock 3145728
> grid soft stack 10240
> grid hard stack 32768
> EOF

2.14配置PAM

[root@19c1 ~]# cat >> /etc/pam.d/login < session required /lib64/security/pam_limits.so 
> EOF

[root@19c2 ~]# cat >> /etc/pam.d/login < session required /lib64/security/pam_limits.so 
> EOF

2.15 配置系统环境变量

[root@19c1 ~]# cat >> /etc/pam.d/login < if [ \$USER = "oracle" ]; then 
> if [ \$SHELL = "/bin/ksh" ]; then
> ulimit -p 16384
> ulimit -n 65536
> else
> ulimit -u 16384 -n 65536
> fi
> fi
> 
> if [ \$USER = "grid" ]; then 
> if [ \$SHELL = "/bin/ksh" ]; then
> ulimit -p 16384
> ulimit -n 65536
> else
> ulimit -u 16384 -n 65536
> fi
> fi
> 
> EOF



[root@19c2 ~]# cat >> /etc/profile < if [ \$USER = "oracle" ]; then 
> if [ \$SHELL = "/bin/ksh" ]; then
> ulimit -p 16384
> ulimit -n 65536
> else
> ulimit -u 16384 -n 65536
> fi
> fi
> 
> if [ \$USER = "grid" ]; then 
> if [ \$SHELL = "/bin/ksh" ]; then
> ulimit -p 16384
> ulimit -n 65536
> else
> ulimit -u 16384 -n 65536
> fi
> fi
> 
> EOF

2.16 配置grid用户环境变量

[grid@19c1 ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.3/grid
export ORACLE_SID=+ASM1
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib

[grid@19c2 ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/19.3/grid
export ORACLE_SID=+ASM2
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib

2.17 配置oracle用户环境变量

[oracle@19c1 ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3/db
export ORACLE_SID=ora19c1
export ORACLE_UNQNAME=ora19c
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib


[oracle@19c2 ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TEMP=/u01/tmp
TMPDIR=/u01/tmp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3/db
export ORACLE_SID=ora19c2
export ORACLE_UNQNAME=ora19c
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib

2.18 配置ASM所需磁盘,编辑/etc/udev/rules.d/99-my-asmdevices.rules配置文件

[root@19c1 ~]# fdisk -l

Disk /dev/sdc: 64.4 GB, 64424509440 bytes, 125829120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0001fbac

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 167649279 83311616 8e Linux LVM

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/ol-root: 76.8 GB, 76843843584 bytes, 150085632 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/ol-swap: 8455 MB, 8455716864 bytes, 16515072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@19c1 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdb
36000c299fe61de641fb3c6a854adf1f7
[root@19c1 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdc
36000c29ad3aa426c31327dac0a2b2a01

[root@19c1 ~]# vi /etc/udev/rules.d/99-my-asmdevices.rules

KERNEL==”sd*[!0-9]”, ENV{DEVTYPE}==”disk”, SUBSYSTEM==”block”, PROGRAM==”/usr/lib/udev/scsi_id -g -u -d $devnode”, RESULT==”36000c299fe61de641fb3c6a854adf1f7″, RUN+=”/bin/sh -c ‘mknod /dev/asmdisk01 b $major $minor; chown grid:asmadmin /dev/asmdisk01; chmod 0660 /dev/asmdisk01′”
KERNEL==”sd*[!0-9]”, ENV{DEVTYPE}==”disk”, SUBSYSTEM==”block”, PROGRAM==”/usr/lib/udev/scsi_id -g -u -d $devnode”, RESULT==”36000c29ad3aa426c31327dac0a2b2a01″, RUN+=”/bin/sh -c ‘mknod /dev/asmdisk02 b $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02′”

[root@19c1 ~]# /sbin/udevadm trigger –type=devices –action=change
[root@19c1 ~]# ls -lrt /dev/asm*
brw-rw—-. 1 grid asmadmin 8, 16 May 18 18:30 /dev/asmdisk01
brw-rw—-. 1 grid asmadmin 8, 32 May 18 18:30 /dev/asmdisk02

[root@19c2 ~]# fdisk -l

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 85.9 GB, 85899345920 bytes, 167772160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0001fbac

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 167649279 83311616 8e Linux LVM

Disk /dev/sdc: 64.4 GB, 64424509440 bytes, 125829120 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/ol-root: 76.8 GB, 76843843584 bytes, 150085632 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/ol-swap: 8455 MB, 8455716864 bytes, 16515072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@19c2 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdb
36000c299fe61de641fb3c6a854adf1f7
[root@19c2 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdc
36000c29ad3aa426c31327dac0a2b2a01

[root@19c2 ~]# vi /etc/udev/rules.d/99-my-asmdevices.rules
KERNEL==”sd*[!0-9]”, ENV{DEVTYPE}==”disk”, SUBSYSTEM==”block”, PROGRAM==”/usr/lib/udev/scsi_id -g -u -d $devnode”, RESULT==”36000c299fe61de641fb3c6a854adf1f7″, RUN+=”/bin/sh -c ‘mknod /dev/asmdisk01 b $major $minor; chown grid:asmadmin /dev/asmdisk01; chmod 0660 /dev/asmdisk01′”
KERNEL==”sd*[!0-9]”, ENV{DEVTYPE}==”disk”, SUBSYSTEM==”block”, PROGRAM==”/usr/lib/udev/scsi_id -g -u -d $devnode”, RESULT==”36000c29ad3aa426c31327dac0a2b2a01″, RUN+=”/bin/sh -c ‘mknod /dev/asmdisk02 b $major $minor; chown grid:asmadmin /dev/asmdisk02; chmod 0660 /dev/asmdisk02′”

[root@19c2 ~]# /sbin/udevadm trigger –type=devices –action=change
[root@19c2 ~]# ls -lrt /dev/asm*
brw-rw—-. 1 grid asmadmin 8, 16 May 18 18:30 /dev/asmdisk01
brw-rw—-. 1 grid asmadmin 8, 32 May 18 18:30 /dev/asmdisk02

2.19 禁用avahi
[root@19c1 /]# systemctl stop avahi-dnsconfd
Failed to issue method call: Unit avahi-dnsconfd.service not loaded.
[root@19c1 /]# systemctl stop avahi-daemon
Warning: Stopping avahi-daemon, but it can still be activated by:
avahi-daemon.socket
[root@19c1 /]# systemctl disable avahi-dnsconfd
[root@19c1 /]# systemctl disable avahi-daemon

[root@19c2 /]# systemctl stop avahi-dnsconfd
Failed to issue method call: Unit avahi-dnsconfd.service not loaded.
[root@19c2 /]# systemctl stop avahi-daemon
Warning: Stopping avahi-daemon, but it can still be activated by:
avahi-daemon.socket
[root@19c2 /]# systemctl disable avahi-dnsconfd
[root@19c2 /]# systemctl disable avahi-daemon

三·安装集群软件
3.1解压grid软件

[root@19c1 /]# su - grid
Last login: Mon May 18 18:15:15 CST 2020 on pts/0
[grid@19c1 ~]$ cd /soft
[grid@19c1 soft]$ ls -lrt
total 5809468
-rw-r--r--. 1 grid oinstall 2889184573 May 16 22:08 LINUX.X64_193000_grid_home.zip
-rwxr-xr-x. 1 oracle oinstall 3059705302 May 18 18:44 LINUX.X64_193000_db_home.zip
[grid@19c1 soft]$ unzip -q LINUX.X64_193000_grid_home.zip -d $ORACLE_HOME

3.2 安装CVU

[root@19c1 /]# export CVUQDISK_GRP=oinstall; 
[root@19c1 /]# rpm -ivh /u01/app/19.3/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm
Preparing... ################################# [100%]
Updating / installing...
1:cvuqdisk-1.0.10-1 ################################# [100%]

把安装包复件到节点2

[root@19c1 /]# scp /u01/app/19.3/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm 19c2:~ 
The authenticity of host '19c2 (10.13.13.142)' can't be established.
ECDSA key fingerprint is 7f:1f:9a:0f:8b:d1:e0:17:32:08:12:73:d8:1d:9c:da.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '19c2,10.13.13.142' (ECDSA) to the list of known hosts.
root@19c2's password: 
cvuqdisk-1.0.10-1.rpm

[root@19c2 ~]# export CVUQDISK_GRP=oinstall;
[root@19c2 ~]# rpm -ivh cvuqdisk-1.0.10-1.rpm 
Preparing... ################################# [100%]
Updating / installing...
1:cvuqdisk-1.0.10-1 ################################# [100%]

3.3 配置SSH信任
给grid用户进行配置

[root@19c1 /]# /u01/app/19.3/grid/oui/prov/resources/scripts/sshUserSetup.sh -user grid -hosts "19c1 19c2" -advanced exverify -confirm

[root@19c1 /]# /u01/app/19.3/grid/oui/prov/resources/scripts/sshUserSetup.sh -user oracle -hosts "19c1 19c2" -advanced exverify -confirm

[root@19c1 /]# su - grid
Last login: Mon May 18 19:03:39 CST 2020 on pts/0
[grid@19c1 ~]$ ssh 19c2 date
Mon May 18 19:07:27 CST 2020
[grid@19c1 ~]$ ssh 19c1 date
Mon May 18 19:07:36 CST 2020
[grid@19c1 ~]$ exit
logout
[root@19c1 /]# su - oracle
Last login: Mon May 18 18:17:25 CST 2020 on pts/0
[oracle@19c1 ~]$ ssh 19c2 date
Mon May 18 19:07:45 CST 2020
[oracle@19c1 ~]$ ssh 19c1 date
Mon May 18 19:07:51 CST 2020

[root@19c2 ~]# su - grid
Last login: Mon May 18 18:16:12 CST 2020 on pts/0
[grid@19c2 ~]$ ssh 19c1 date
Mon May 18 19:04:05 CST 2020
[grid@19c2 ~]$ ssh 19c2 date
Mon May 18 19:08:17 CST 2020
[grid@19c2 ~]$ exit
logout
[root@19c2 ~]# su - oracle
Last login: Mon May 18 18:19:20 CST 2020 on pts/0
[oracle@19c2 ~]$ ssh 19c1 date
Mon May 18 19:08:27 CST 2020
[oracle@19c2 ~]$ ssh 19c2 date
Mon May 18 19:08:31 CST 2020

3.4 安装前环境检查GI

[grid@19c1 ~]$ $ORACLE_HOME/runcluvfy.sh stage -pre crsinst -n "19c1,19c2" -fixup -verbose

根据提示修复检查的问题
[root@19c1 /]# /u01/tmp/CVU_19.0.0.0.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

[root@19c2 /]# /u01/tmp/CVU_19.0.0.0.0_grid/runfixup.sh
All Fix-up operations were completed successfully.

3.5开始安装Grid软件

[grid@19c1 ~]$ vi grid.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v19.0.0
INVENTORY_LOCATION=/u01/app/oraInventory
oracle.install.option=CRS_CONFIG
ORACLE_BASE=/u01/app/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=asmoper
oracle.install.asm.OSASM=asmadmin
oracle.install.crs.config.scanType=LOCAL_SCAN
oracle.install.crs.config.gpnp.scanName=scan-19c
oracle.install.crs.config.gpnp.scanPort=1521
oracle.install.crs.config.ClusterConfiguration=STANDALONE
oracle.install.crs.config.configureAsExtendedCluster=false
oracle.install.crs.config.clusterName=ora19c-cluster
oracle.install.crs.config.gpnp.configureGNS=false
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.crs.config.clusterNodes=19c1:19c1-vip,19c2:19c2-vip
oracle.install.crs.config.networkInterfaceList=ens192:10.10.10.0:5,ens160:10.13.13.0:1
oracle.install.crs.configureGIMR=false
oracle.install.asm.configureGIMRDataDG=false
oracle.install.crs.config.useIPMI=false
oracle.install.asm.storageOption=ASM
oracle.install.asmOnNAS.configureGIMRDataDG=false
oracle.install.asm.SYSASMPassword=xxzx7817600
oracle.install.asm.diskGroup.name=OCR
oracle.install.asm.diskGroup.redundancy=EXTERNAL
oracle.install.asm.diskGroup.AUSize=4
oracle.install.asm.diskGroup.disks=/dev/asmdisk01
oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm*
oracle.install.asm.configureAFD=false
oracle.install.asm.monitorPassword=xxzx7817600
oracle.install.crs.configureRHPS=false
oracle.install.crs.config.ignoreDownNodes=false
oracle.install.config.managementOption=NONE
oracle.install.config.omsPort=0
oracle.install.crs.rootconfig.executeRootScript=false


[grid@19c1 ~]$ $ORACLE_HOME/gridSetup.sh -silent -force -noconfig -waitforcompletion -ignorePrereq -responseFile /home/grid/grid.rsp
Launching Oracle Grid Infrastructure Setup Wizard...

[WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards.
CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.
CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-32047] The location (/u01/app/oraInventory) specified for the central inventory is not empty.
ACTION: It is recommended to provide an empty location for the inventory.
[WARNING] [INS-13013] Target environment does not meet some mandatory requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /u01/tmp/GridSetupActions2020-05-18_09-17-17PM/gridSetupActions2020-05-18_09-17-17PM.log
ACTION: Identify the list of failed prerequisite checks from the log: /u01/tmp/GridSetupActions2020-05-18_09-17-17PM/gridSetupActions2020-05-18_09-17-17PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
/u01/app/19.3/grid/install/response/grid_2020-05-18_09-17-17PM.rsp

You can find the log of this install session at:
/u01/tmp/GridSetupActions2020-05-18_09-17-17PM/gridSetupActions2020-05-18_09-17-17PM.log

As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/19.3/grid/root.sh

Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes: 
[19c1, 19c2]
Execute /u01/app/19.3/grid/root.sh on the following nodes: 
[19c1, 19c2]

Run the script on the local node first. After successful completion, you can start the script in parallel on all other nodes.

Successfully Setup Software with warning(s).
As install user, execute the following command to complete the configuration.
/u01/app/19.3/grid/gridSetup.sh -executeConfigTools -responseFile /home/grid/grid.rsp [-silent]


Moved the install session logs to:
/u01/app/oraInventory/logs/GridSetupActions2020-05-18_09-17-17PM

节点一 执行root脚本

[root@19c1 ~]# /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@19c1 ~]# /u01/app/19.3/grid/root.sh
Check /u01/app/19.3/grid/install/root_19c1_2020-05-18_21-35-58-622023345.log for the output of root script

节点二 执行root脚本

[root@19c2 /]# /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@19c2 /]# /u01/app/19.3/grid/root.sh
Check /u01/app/19.3/grid/install/root_19c2_2020-05-18_21-58-15-384301417.log for the output of root script

[grid@19c1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details 
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.chad
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.net1.network
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.ons
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.19c1.vip
1 ONLINE ONLINE 19c1 STABLE
ora.19c2.vip
1 ONLINE ONLINE 19c2 STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE 19c2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.OCR.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE 19c1 Started,STABLE
2 ONLINE ONLINE 19c2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE 19c1 STABLE
ora.qosmserver
1 ONLINE ONLINE 19c1 STABLE
ora.scan1.vip
1 ONLINE ONLINE 19c2 STABLE
ora.scan2.vip
1 ONLINE ONLINE 19c1 STABLE
ora.scan3.vip
1 ONLINE ONLINE 19c1 STABLE
--------------------------------------------------------------------------------

3.6创建ASM磁盘组

[grid@19c1 ~]$ sqlplus / as sysasm

SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 18 22:10:54 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> create diskgroup DATA external REDUNDANCY disk '/dev/asmdisk02' ATTRIBUTE 'au_size'='4M', 'compatible.rdbms' = '19.0', 'compatible.asm' = '19.0';

Diskgroup created.

节点二执行挂载

[grid@19c2 ~]$ sqlplus / as sysasm

SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 18 22:13:07 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> alter diskgroup data mount;

Diskgroup altered.

[grid@19c1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details 
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.chad
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.net1.network
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.ons
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.19c1.vip
1 ONLINE ONLINE 19c1 STABLE
ora.19c2.vip
1 ONLINE ONLINE 19c2 STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE 19c2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.OCR.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE 19c1 Started,STABLE
2 ONLINE ONLINE 19c2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE 19c1 STABLE
ora.qosmserver
1 ONLINE ONLINE 19c1 STABLE
ora.scan1.vip
1 ONLINE ONLINE 19c2 STABLE
ora.scan2.vip
1 ONLINE ONLINE 19c1 STABLE
ora.scan3.vip
1 ONLINE ONLINE 19c1 STABLE
--------------------------------------------------------------------------------

四·安装数据库软件
4.1 解压安装包

[oracle@19c1 ~]$ cd /soft
[oracle@19c1 soft]$ ls -lrt
total 5809468
-rw-r--r--. 1 grid oinstall 2889184573 May 16 22:08 LINUX.X64_193000_grid_home.zip
-rwxr-xr-x. 1 oracle oinstall 3059705302 May 18 18:44 LINUX.X64_193000_db_home.zip
[oracle@19c1 soft]$ unzip -q LINUX.X64_193000_db_home.zip -d $ORACLE_HOME



4.2安装前检查
[grid@19c1 ~]$ $ORACLE_HOME/runcluvfy.sh stage -pre dbinst -n "19c1,19c2" -fixup -verbose

4.3编写响应文件

[oracle@19c1 ~]$ vi dbinstall.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.3/db
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.CLUSTER_NODES=19c1,19c2
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

4.4执行安装

[oracle@19c1 ~]$ $ORACLE_HOME/runInstaller -silent -force -noconfig -ignorePrereq -responseFile /home/oracle/dbinstall.rsp
Launching Oracle Database Setup Wizard...

[WARNING] [INS-13013] Target environment does not meet some mandatory requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/InstallActions2020-05-18_10-55-24PM/installActions2020-05-18_10-55-24PM.log
ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/InstallActions2020-05-18_10-55-24PM/installActions2020-05-18_10-55-24PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
/u01/app/oracle/product/19.3/db/install/response/db_2020-05-18_10-55-24PM.rsp

You can find the log of this install session at:
/u01/app/oraInventory/logs/InstallActions2020-05-18_10-55-24PM/installActions2020-05-18_10-55-24PM.log

As a root user, execute the following script(s):
1. /u01/app/oracle/product/19.3/db/root.sh

Execute /u01/app/oracle/product/19.3/db/root.sh on the following nodes: 
[19c1, 19c2]


Successfully Setup Software with warning(s).

4.5执行root.sh脚本

[root@19c1 ~]# /u01/app/oracle/product/19.3/db/root.sh
Check /u01/app/oracle/product/19.3/db/install/root_19c1_2020-05-18_23-18-15-064687854.log for the output of root script
[root@19c1 ~]# cat /u01/app/oracle/product/19.3/db/install/root_19c1_2020-05-18_23-18-15-064687854.log
Performing root user operation.

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/19.3/db
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...

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.

[root@19c2 /]# /u01/app/19.3/grid/root.sh
Check /u01/app/19.3/grid/install/root_19c2_2020-05-18_21-58-15-384301417.log for the output of root script
[root@19c2 /]# /u01/app/oracle/product/19.3/db/root.sh
Check /u01/app/oracle/product/19.3/db/install/root_19c2_2020-05-18_23-18-22-213501815.log for the output of root script
[root@19c2 /]# cat /u01/app/oracle/product/19.3/db/install/root_19c2_2020-05-18_23-18-22-213501815.log
Performing root user operation.

The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/19.3/db
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...

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.

五·创建数据库

[oracle@19c1 ~]$ vi dbca.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
templateName=General_Purpose.dbc
gdbName=ora19c
sid=ora19c
databaseConfigType=RAC
responseFile=NO_VALUE
characterSet=ZHS16GBK
nationalCharacterSet=AL16UTF16
sysPassword=xxzx7817600
systemPassword=xxzx7817600
createAsContainerDatabase=true
numberOfPDBs=1
pdbName=ora19cpdb
useLocalUndoForPDBs=TRUE
pdbAdminPassword=xxzx7817600
databaseType=MULTIPURPOSE
automaticMemoryManagement=false
totalMemory=3072
redoLogFileSize=50
emConfiguration=NONE
nodelist=19c1,19c2
storageType=ASM
diskGroupName=+DATA
datafileDestination=+DATA
asmsnmpPassword=xxzx7817600
sampleSchema=TRUE

oracle@19c1 ~]$ dbca -silent -createDatabase -responseFile /home/oracle/dbca.rsp
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[FATAL] [DBT-09101] Target environment does not meet some mandatory requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /u01/app/oracle/cfgtoollogs/dbca/trace.log_2020-05-19_12-01-31AM
ACTION: Find the appropriate configuration from the log file or from the installation guide to meet the prerequisites and fix this manually.

查看错误日志可以看到因为操作系统内核版本过低等原因检查没有通过

INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OS Kernel Version: This is a prerequisite condition to test whether the system kernel version is at least "4.1.12".


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:CRITICAL


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: *********************************************


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Package: kmod-20-21 (x86_64): This is a prerequisite condition to test whether the package "kmod-20-21 (x86_64)" is available on the system.


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:IGNORABLE


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: *********************************************


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Package: kmod-libs-20-21 (x86_64): This is a prerequisite condition to test whether the package "kmod-libs-20-21 (x86_64)" is available on the system.


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:IGNORABLE


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: *********************************************


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Single Client Access Name (SCAN): This test verifies the Single Client Access Name configuration.


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:CRITICAL


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: *********************************************


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: DNS/NIS name service 'scan-19c': This test verifies that the Name Service lookups for the Distributed Name Server (DNS) and the Network Information Service (NIS) match for the SCAN name entries.


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: Severity:CRITICAL


INFO: May 19, 2020 12:09:27 AM oracle.install.commons.base.prereq.PrereqCheckerJob logTaskOverallResult
INFO: OverallStatus:VERIFICATION_FAILED

使用-ignorePreReqs忽略警告和错误再次执行

[oracle@19c1 ~]$ dbca -ignorePreReqs -silent -createDatabase -responseFile /home/oracle/dbca.rsp
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
7% complete
Copying database files
27% complete
Creating and starting Oracle instance
28% complete
31% complete
35% complete
37% complete
40% complete
Creating cluster database views
41% complete
53% complete
Completing Database Creation
57% complete
59% complete
60% complete
Creating Pluggable Databases
64% complete
80% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/ora19c.
Database Information:
Global Database Name:ora19c
System Identifier(SID) Prefix:ora19c
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ora19c/ora19c0.log" for further details.

[grid@19c2 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details 
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.chad
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.net1.network
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
ora.ons
ONLINE ONLINE 19c1 STABLE
ONLINE ONLINE 19c2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.19c1.vip
1 ONLINE ONLINE 19c1 STABLE
ora.19c2.vip
1 ONLINE ONLINE 19c2 STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE 19c2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE 19c1 STABLE
ora.OCR.dg(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE 19c1 Started,STABLE
2 ONLINE ONLINE 19c2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE 19c1 STABLE
2 ONLINE ONLINE 19c2 STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE 19c1 STABLE
ora.ora19c.db
1 ONLINE ONLINE 19c1 Open,HOME=/u01/app/o
racle/product/19.3/d
b,STABLE
2 ONLINE ONLINE 19c2 Open,HOME=/u01/app/o
racle/product/19.3/d
b,STABLE
ora.qosmserver
1 ONLINE ONLINE 19c1 STABLE
ora.scan1.vip
1 ONLINE ONLINE 19c2 STABLE
ora.scan2.vip
1 ONLINE ONLINE 19c1 STABLE
ora.scan3.vip
1 ONLINE ONLINE 19c1 STABLE
--------------------------------------------------------------------------------

测试连接

[oracle@19c2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue May 19 02:12:46 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0


SQL> select * from v$version;

BANNER BANNER_FULL BANNER_LEGACY CON_ID
------------------------------------------------------------ ------------------------------------------------------------ -------------------------------------------------- ----------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Oracle Database 19c Enterprise Edition Release 19. 0
Production Production 0.0.0.0 - Production

SQL> show pdbs;

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORA19CPDB READ WRITE NO

到此安装就完了.

Oracle Linux 7.1 silent install 19c

Oracle Linux 7.1 单机静默安装19C
一·操作环境
操作系统 Oracle Linux 7.1
数据库版本 Oracle Database 19.3
主机名 ora19c
IP:10.10.10.140
安装目录 /u01/app/oracle/product/19.3/db1
数据库名称 cs

二·操作环境准备
2.1 关闭防火墙

[root@ora19c ~]# systemctl stop firewalld
[root@ora19c ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'

2.2禁用NetworkManager服务

[root@ora19c ~]# systemctl stop NetworkManager
[root@ora19c ~]# systemctl disable NetworkManager
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
rm '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'

2.3禁用SELINUX

[root@ora19c ~]# setenforce 0
[root@ora19c ~]# sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@ora19c ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

2.4配置hosts解析

[root@ora19c ~]# echo " 
> 10.138.130.140 ora19c " >> /etc/hosts
[root@ora19c ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
 
10.138.130.140 ora19c 

2.6创建组和用户

[root@ora19c ~]# groupadd -g 54327 asmdba
[root@ora19c ~]# groupadd -g 54328 asmoper
[root@ora19c ~]# groupadd -g 54322 dba
[root@ora19c ~]# groupadd -g 54323 oper
[root@ora19c ~]# groupadd -g 54324 backupdba
[root@ora19c ~]# groupadd -g 54325 dgdba
[root@ora19c ~]# groupadd -g 54326 kmdba
[root@ora19c ~]# groupadd -g 54329 oinstall
[root@ora19c ~]# groupadd -g 54330 racdba

[root@ora19c ~]# useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba oracle
[root@ora19c ~]# passwd oracle
Changing password for user oracle.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.

2.7创建安装目录

[root@ora19c ~]# mkdir -p /u01/app/oraInventory
[root@ora19c ~]# mkdir -p /u01/app/oracle/product/19.3/db1
[root@ora19c ~]# mkdir -p /u01/temp

[root@ora19c ~]# chown -R oracle:oinstall /u01
[root@ora19c ~]# chmod -R 775 /u01

2.8配置用户环境变量

[oracle@ora19c ~]$ 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/.local/bin:$HOME/bin

export PATH

TEMP=/u01/temp
TMPDIR=/u01/temp
export TEMP TMPDIR
export LD_ASSUME_KERNEL=3.8.13
export ORACLE_BASE=/u01/app/oracle
DB_HOME=/u01/app/oracle/product/19.3/db1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=ora19c
export ORACLE_UNQNAME=ora19c
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME/bin
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
umask=022
export PATH=$PATH:$ORACLE_HOME/rdbms/lib 

2.9配置系统环境变量

[root@ora19c ~]# cat >> /etc/profile <  if [ \$USER = "oracle" ]; then  
>     if [ \$SHELL = "/bin/ksh" ]; then
>         ulimit -p 16384
>         ulimit -n 65536
>     else
>         ulimit -u 16384 -n 65536
>     fi
> fi
> EOF

2.10修改系统内核参数

[root@ora19c ~]# cat >> /etc/sysctl.conf <  fs.aio-max-nr = 1048576
> fs.file-max = 6815744
> kernel.shmall = 2097152
> kernel.shmmax = 42949672950
> kernel.shmmni = 4096
> 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 = 1048576
> EOF


[root@ora19c ~]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 42949672950
kernel.shmmni = 4096
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 = 1048576

2.11 配置LIMITS限制

[root@ora19c ~]# cat >> /etc/security/limits.conf <  oracle          soft    nproc           16384
> oracle          hard    nproc           16384
> oracle          soft    nofile          65536
> oracle          hard    nofile          65536
> oracle          soft    memlock         3145728
> oracle          hard    memlock         3145728
> EOF

2.12配置PAM
[root@ora19c ~]# cat >> /etc/pam.d/login < session required /lib64/security/pam_limits.so
> EOF

2.13安装依赖包
配置YUM源

[root@ora19c ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ol-root   72G   11G   61G  16% /
devtmpfs             3.8G     0  3.8G   0% /dev
tmpfs                3.8G   84K  3.8G   1% /dev/shm
tmpfs                3.8G  8.9M  3.8G   1% /run
tmpfs                3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/sda1            497M  152M  346M  31% /boot
/dev/sr0             4.0G  4.0G     0 100% /run/media/root/OL-7.1 Server.x86_64
[root@ora19c ~]# mount /dev/sr0 /mnt/
mount: /dev/sr0 is write-protected, mounting read-only

[root@ora19c ~]# cd /etc/yum.repos.d/
[root@ora19c yum.repos.d]# ls -lrt
total 4
-rw-r--r--. 1 root root 2323 Feb 16  2015 public-yum-ol7.repo

[root@ora19c yum.repos.d]# cat >> /etc/yum.repos.d/local.repo <  [base]
> name=local
> baseurl=file:///mnt 
> gpgcheck=0
> enabled=1
> EOF

[root@ora19c yum.repos.d]# yum clean all
Loaded plugins: langpacks
Cleaning repos: base
Cleaning up everything
[root@ora19c yum.repos.d]# yum makecache
Loaded plugins: langpacks
base                                                                                                                                                                                                                 | 3.6 kB  00:00:00     
(1/4): base/group_gz                                                                                                                                                                                                 | 134 kB  00:00:00     
(2/4): base/filelists_db                                                                                                                                                                                             | 3.4 MB  00:00:00     
(3/4): base/primary_db                                                                                                                                                                                               | 4.0 MB  00:00:00     
(4/4): base/other_db                                                                                                                                                                                                 | 1.3 MB  00:00:00     
Metadata Cache Created

安装依赖包

[root@ora19c yum.repos.d]# yum install -y bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python  python-configshell  python-rtslib python-six targetcli smartmontools sysstat
Loaded plugins: langpacks
Package bc-1.06.95-13.el7.x86_64 already installed and latest version
Package binutils-2.23.52.0.1-30.el7.x86_64 already installed and latest version
Package compat-libcap1-1.10-7.el7.x86_64 already installed and latest version
No package compat-libstdc++ available. --后面要单独安装这个包
Package elfutils-libelf-0.160-1.el7.x86_64 already installed and latest version
Package glibc-2.17-78.0.1.el7.x86_64 already installed and latest version
Package glibc-devel-2.17-78.0.1.el7.x86_64 already installed and latest version
Package libaio-0.3.109-12.el7.x86_64 already installed and latest version
Package libX11-1.6.0-2.1.el7.x86_64 already installed and latest version
Package libXau-1.0.8-2.1.el7.x86_64 already installed and latest version
Package libXi-1.7.2-2.1.el7.x86_64 already installed and latest version
Package libXtst-1.2.2-2.1.el7.x86_64 already installed and latest version
Package libXrender-0.9.8-2.1.el7.x86_64 already installed and latest version
Package libgcc-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-4.8.3-9.el7.x86_64 already installed and latest version
Package libstdc++-devel-4.8.3-9.el7.x86_64 already installed and latest version
Package libxcb-1.9-5.el7.x86_64 already installed and latest version
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package net-tools-2.0-0.17.20131004git.el7.x86_64 already installed and latest version
Package 1:nfs-utils-1.3.0-0.8.el7.x86_64 already installed and latest version
Package python-2.7.5-16.el7.x86_64 already installed and latest version
Package 1:python-configshell-1.1.fb14-1.el7.noarch already installed and latest version
Package python-rtslib-2.1.fb50-1.el7.noarch already installed and latest version
Package python-six-1.3.0-4.el7.noarch already installed and latest version
Package targetcli-2.1.fb37-3.el7.noarch already installed and latest version
Package 1:smartmontools-6.2-4.el7.x86_64 already installed and latest version
Package sysstat-10.1.5-7.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package elfutils-libelf-devel.x86_64 0:0.160-1.el7 will be installed
---> Package fontconfig-devel.x86_64 0:2.10.95-7.el7 will be installed
--> Processing Dependency: freetype-devel >= 2.1.4 for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(freetype2) for package: fontconfig-devel-2.10.95-7.el7.x86_64
--> Processing Dependency: pkgconfig(expat) for package: fontconfig-devel-2.10.95-7.el7.x86_64
---> Package ksh.x86_64 0:20120801-22.el7 will be installed
---> Package libXrender-devel.x86_64 0:0.9.8-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(renderproto) >= 0.9 for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xproto) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(x11) for package: libXrender-devel-0.9.8-2.1.el7.x86_64
---> Package libaio-devel.x86_64 0:0.3.109-12.el7 will be installed
--> Running transaction check
---> Package expat-devel.x86_64 0:2.1.0-8.el7 will be installed
---> Package freetype-devel.x86_64 0:2.4.11-9.el7 will be installed
--> Processing Dependency: zlib-devel for package: freetype-devel-2.4.11-9.el7.x86_64
---> Package libX11-devel.x86_64 0:1.6.0-2.1.el7 will be installed
--> Processing Dependency: pkgconfig(xcb) >= 1.1.92 for package: libX11-devel-1.6.0-2.1.el7.x86_64
--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.0-2.1.el7.x86_64
---> Package xorg-x11-proto-devel.noarch 0:7.7-8.el7.1 will be installed
--> Running transaction check
---> Package libxcb-devel.x86_64 0:1.9-5.el7 will be installed
--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.9-5.el7.x86_64
---> Package zlib-devel.x86_64 0:1.2.7-13.el7 will be installed
--> Running transaction check
---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
 Package                                                           Arch                                               Version                                                        Repository                                        Size
============================================================================================================================================================================================================================================
Installing:
 elfutils-libelf-devel                                             x86_64                                             0.160-1.el7                                                    base                                              34 k
 fontconfig-devel                                                  x86_64                                             2.10.95-7.el7                                                  base                                             127 k
 ksh                                                               x86_64                                             20120801-22.el7                                                base                                             879 k
 libXrender-devel                                                  x86_64                                             0.9.8-2.1.el7                                                  base                                              16 k
 libaio-devel                                                      x86_64                                             0.3.109-12.el7                                                 base                                              12 k
Installing for dependencies:
 expat-devel                                                       x86_64                                             2.1.0-8.el7                                                    base                                              56 k
 freetype-devel                                                    x86_64                                             2.4.11-9.el7                                                   base                                             354 k
 libX11-devel                                                      x86_64                                             1.6.0-2.1.el7                                                  base                                             978 k
 libXau-devel                                                      x86_64                                             1.0.8-2.1.el7                                                  base                                              14 k
 libxcb-devel                                                      x86_64                                             1.9-5.el7                                                      base                                             1.0 M
 xorg-x11-proto-devel                                              noarch                                             7.7-8.el7.1                                                    base                                             280 k
 zlib-devel                                                        x86_64                                             1.2.7-13.el7                                                   base                                              49 k

Transaction Summary
============================================================================================================================================================================================================================================
Install  5 Packages (+7 Dependent packages)

Total download size: 3.7 M
Installed size: 12 M
Downloading packages:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                       9.3 MB/s | 3.7 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : xorg-x11-proto-devel-7.7-8.el7.1.noarch                                                                                                                                                                                 1/12 
  Installing : libXau-devel-1.0.8-2.1.el7.x86_64                                                                                                                                                                                       2/12 
  Installing : libxcb-devel-1.9-5.el7.x86_64                                                                                                                                                                                           3/12 
  Installing : libX11-devel-1.6.0-2.1.el7.x86_64                                                                                                                                                                                       4/12 
  Installing : expat-devel-2.1.0-8.el7.x86_64                                                                                                                                                                                          5/12 
  Installing : zlib-devel-1.2.7-13.el7.x86_64                                                                                                                                                                                          6/12 
  Installing : freetype-devel-2.4.11-9.el7.x86_64                                                                                                                                                                                      7/12 
  Installing : fontconfig-devel-2.10.95-7.el7.x86_64                                                                                                                                                                                   8/12 
  Installing : libXrender-devel-0.9.8-2.1.el7.x86_64                                                                                                                                                                                   9/12 
  Installing : libaio-devel-0.3.109-12.el7.x86_64                                                                                                                                                                                     10/12 
  Installing : elfutils-libelf-devel-0.160-1.el7.x86_64                                                                                                                                                                               11/12 
  Installing : ksh-20120801-22.el7.x86_64                                                                                                                                                                                             12/12 
  Verifying  : ksh-20120801-22.el7.x86_64                                                                                                                                                                                              1/12 
  Verifying  : libXrender-devel-0.9.8-2.1.el7.x86_64                                                                                                                                                                                   2/12 
  Verifying  : zlib-devel-1.2.7-13.el7.x86_64                                                                                                                                                                                          3/12 
  Verifying  : libxcb-devel-1.9-5.el7.x86_64                                                                                                                                                                                           4/12 
  Verifying  : libX11-devel-1.6.0-2.1.el7.x86_64                                                                                                                                                                                       5/12 
  Verifying  : expat-devel-2.1.0-8.el7.x86_64                                                                                                                                                                                          6/12 
  Verifying  : xorg-x11-proto-devel-7.7-8.el7.1.noarch                                                                                                                                                                                 7/12 
  Verifying  : elfutils-libelf-devel-0.160-1.el7.x86_64                                                                                                                                                                                8/12 
  Verifying  : libaio-devel-0.3.109-12.el7.x86_64                                                                                                                                                                                      9/12 
  Verifying  : fontconfig-devel-2.10.95-7.el7.x86_64                                                                                                                                                                                  10/12 
  Verifying  : freetype-devel-2.4.11-9.el7.x86_64                                                                                                                                                                                     11/12 
  Verifying  : libXau-devel-1.0.8-2.1.el7.x86_64                                                                                                                                                                                      12/12 

Installed:
  elfutils-libelf-devel.x86_64 0:0.160-1.el7          fontconfig-devel.x86_64 0:2.10.95-7.el7          ksh.x86_64 0:20120801-22.el7          libXrender-devel.x86_64 0:0.9.8-2.1.el7          libaio-devel.x86_64 0:0.3.109-12.el7         

Dependency Installed:
  expat-devel.x86_64 0:2.1.0-8.el7    freetype-devel.x86_64 0:2.4.11-9.el7    libX11-devel.x86_64 0:1.6.0-2.1.el7    libXau-devel.x86_64 0:1.0.8-2.1.el7    libxcb-devel.x86_64 0:1.9-5.el7    xorg-x11-proto-devel.noarch 0:7.7-8.el7.1   
  zlib-devel.x86_64 0:1.2.7-13.el7   

Complete!

安装compat-libstdc++-33-3.2.3-72.el7.i686.rpm,因为名字带有版本信息

[root@ora19c yum.repos.d]# yum install  compat-libstdc++-33-3.2.3-72.el7.i686
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package compat-libstdc++-33.i686 0:3.2.3-72.el7 will be installed
--> Processing Dependency: libm.so.6 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GLIBC_2.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1(GCC_3.0) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libgcc_s.so.1 for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Processing Dependency: libc.so.6(GLIBC_2.3) for package: compat-libstdc++-33-3.2.3-72.el7.i686
--> Running transaction check
---> Package glibc.i686 0:2.17-78.0.1.el7 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.17-78.0.1.el7.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.17-78.0.1.el7.i686
---> Package libgcc.i686 0:4.8.3-9.el7 will be installed
--> Running transaction check
---> Package nss-softokn-freebl.i686 0:3.16.2.3-9.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================================================
 Package                                                          Arch                                              Version                                                         Repository                                         Size
============================================================================================================================================================================================================================================
Installing:
 compat-libstdc++-33                                              i686                                              3.2.3-72.el7                                                    base                                              196 k
Installing for dependencies:
 glibc                                                            i686                                              2.17-78.0.1.el7                                                 base                                              4.2 M
 libgcc                                                           i686                                              4.8.3-9.el7                                                     base                                               99 k
 nss-softokn-freebl                                               i686                                              3.16.2.3-9.el7                                                  base                                              186 k

Transaction Summary
============================================================================================================================================================================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 4.6 M
Installed size: 16 M
Is this ok [y/d/N]: y
Downloading packages:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                        44 MB/s | 4.6 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libgcc-4.8.3-9.el7.i686                                                                                                                                                                                                  1/4 
  Installing : nss-softokn-freebl-3.16.2.3-9.el7.i686                                                                                                                                                                                   2/4 
  Installing : glibc-2.17-78.0.1.el7.i686                                                                                                                                                                                               3/4 
  Installing : compat-libstdc++-33-3.2.3-72.el7.i686                                                                                                                                                                                    4/4 
  Verifying  : compat-libstdc++-33-3.2.3-72.el7.i686                                                                                                                                                                                    1/4 
  Verifying  : glibc-2.17-78.0.1.el7.i686                                                                                                                                                                                               2/4 
  Verifying  : libgcc-4.8.3-9.el7.i686                                                                                                                                                                                                  3/4 
  Verifying  : nss-softokn-freebl-3.16.2.3-9.el7.i686                                                                                                                                                                                   4/4 

Installed:
  compat-libstdc++-33.i686 0:3.2.3-72.el7                                                                                                                                                                                                   

Dependency Installed:
  glibc.i686 0:2.17-78.0.1.el7                                               libgcc.i686 0:4.8.3-9.el7                                               nss-softokn-freebl.i686 0:3.16.2.3-9.el7                                              

Complete!

检查已安装依赖包

[root@ora19c yum.repos.d]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' bc binutils compat-libcap1 compat-libstdc++ elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python  python-configshell  python-rtslib python-six targetcli smartmontools sysstat
bc-1.06.95-13.el7 (x86_64)
binutils-2.23.52.0.1-30.el7 (x86_64)
compat-libcap1-1.10-7.el7 (x86_64)
package compat-libstdc++ is not installed --只要安装了这个报错没有关系。
elfutils-libelf-0.160-1.el7 (x86_64)
elfutils-libelf-devel-0.160-1.el7 (x86_64)
fontconfig-devel-2.10.95-7.el7 (x86_64)
glibc-2.17-78.0.1.el7 (x86_64)
glibc-2.17-78.0.1.el7 (i686)
glibc-devel-2.17-78.0.1.el7 (x86_64)
ksh-20120801-22.el7 (x86_64)
libaio-0.3.109-12.el7 (x86_64)
libaio-devel-0.3.109-12.el7 (x86_64)
libX11-1.6.0-2.1.el7 (x86_64)
libXau-1.0.8-2.1.el7 (x86_64)
libXi-1.7.2-2.1.el7 (x86_64)
libXtst-1.2.2-2.1.el7 (x86_64)
libXrender-0.9.8-2.1.el7 (x86_64)
libXrender-devel-0.9.8-2.1.el7 (x86_64)
libgcc-4.8.3-9.el7 (x86_64)
libgcc-4.8.3-9.el7 (i686)
libstdc++-4.8.3-9.el7 (x86_64)
libstdc++-devel-4.8.3-9.el7 (x86_64)
libxcb-1.9-5.el7 (x86_64)
make-3.82-21.el7 (x86_64)
net-tools-2.0-0.17.20131004git.el7 (x86_64)
nfs-utils-1.3.0-0.8.el7 (x86_64)
python-2.7.5-16.el7 (x86_64)
python-configshell-1.1.fb14-1.el7 (noarch)
python-rtslib-2.1.fb50-1.el7 (noarch)
python-six-1.3.0-4.el7 (noarch)
targetcli-2.1.fb37-3.el7 (noarch)
smartmontools-6.2-4.el7 (x86_64)
sysstat-10.1.5-7.el7 (x86_64)

三·安装软件
3.1 解压数据库软件

[root@ora19c soft]# chown -R oracle:oinstall /soft
[root@ora19c soft]# chmod -R 775 /soft
[root@ora19c soft]# su - oracle
Last login: Sun May 17 08:09:29 CST 2020 on pts/0

[oracle@ora19c soft]$ unzip -q LINUX.X64_193000_db_home.zip  -d $ORACLE_HOME
replace /u01/app/oracle/product/19.3/db1/.patch_storage/29517242_Apr_17_2019_23_27_10/original_patch/README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
[oracle@ora19c soft]$ du -sh $ORACLE_HOME
6.5G    /u01/app/oracle/product/19.3/db1

3.2安装数据库软件
配置响应文件

[oracle@ora19c ~]$ vi 19c_dbinstall.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.3/db1
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.rootconfig.executeRootScript=true
oracle.install.db.rootconfig.configMethod=ROOT

执行安装

[oracle@ora19c ~]$ $ORACLE_HOME/runInstaller -silent  -force -noconfig  -ignorePrereq  -responseFile /home/oracle/19c_dbinstall.rsp
Launching Oracle Database Setup Wizard...


 Enter password for 'root' user:  --输入root用户密码用于自动执行root.sh脚本
[WARNING] [INS-13013] Target environment does not meet some mandatory requirements.
   CAUSE: Some of the mandatory prerequisites are not met. See logs for details. /u01/temp/InstallActions2020-05-17_09-19-02AM/installActions2020-05-17_09-19-02AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /u01/temp/InstallActions2020-05-17_09-19-02AM/installActions2020-05-17_09-19-02AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u01/app/oracle/product/19.3/db1/install/response/db_2020-05-17_09-19-02AM.rsp

You can find the log of this install session at:
 /u01/temp/InstallActions2020-05-17_09-19-02AM/installActions2020-05-17_09-19-02AM.log
Successfully Setup Software with warning(s).
Moved the install session logs to:
 /u01/app/oraInventory/logs/InstallActions2020-05-17_09-19-02AM

四·配置监听
创建配置监听的响应文件

[oracle@ora19c ~]$ vi 19c_netca.rsp
[GENERAL]
RESPONSEFILE_VERSION="19.3"
CREATE_TYPE="CUSTOM"
[Session]
TOPLEVEL_COMPONENT={"oracle.net.ca","19.3"}
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}

配置监听

[oracle@ora19c ~]$ netca /silent /responsefile /home/oracle/19c_netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /home/oracle/19c_netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Running Listener Control: 
      /u01/app/oracle/product/19.3/db1/bin/lsnrctl start LISTENER
    Listener Control complete.
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

五·创建数据库
创建配置数据库的响应文件

[oracle@ora19c ~]$ vi 19c_dbca.rsp
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
templateName=General_Purpose.dbc
gdbName=ora19c
sid=ora19c
databaseConfigType=SI
createAsContainerDatabase=TRUE
numberOfPDBs=1
pdbName=ora19c1
useLocalUndoForPDBs=TRUE
pdbAdminPassword=xxzx7817600
sysPassword=xxzx7817600
systemPassword=xxzx7817600
datafileDestination='/u01/app/oracle/oradata'
recoveryAreaDestination='/u01/app/oracle/flash_recovery_area'
storageType=FS
characterSet=ZHS16GBK
nationalCharacterSet=AL16UTF16
listeners="LISTENER"
sampleSchema=TRUE
totalMemory 2048
databaseType=MULTIPURPOSE
automaticMemoryManagement=TRUE
totalMemory=4096

创建数据库

[oracle@ora19c ~]$ dbca -silent  -createDatabase -responseFile /home/oracle/19c_dbca.rsp
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ora19c.
Database Information:
Global Database Name:ora19c
System Identifier(SID):ora19c
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ora19c/ora19c.log" for further details.

六·检查监听状态验证数据库是否被自动注册

[oracle@ora19c ORA19C]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 18-MAY-2020 08:21:51

Copyright (c) 1991, 2019, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19c)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                17-MAY-2020 20:21:29
Uptime                    0 days 12 hr. 0 min. 23 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.3/db1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ora19c/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora19c)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "86b637b62fdf7a65e053f706e80a27ca" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
Service "a5d933ae541261b5e0538c828a0a1480" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
Service "ora19c" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
Service "ora19c1" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
Service "ora19cXDB" has 1 instance(s).
  Instance "ora19c", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@ora19c ORA19C]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon May 18 08:22:30 2020
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORA19C1                        READ WRITE NO

到此,19c静默安装已经完成。

DM7使用裸设备搭建DMRAC

一、操作环境
主机 IP地址(对外服务) IP地址(内部通信) 实例名 操作系统

dmrac1	10.18.13.165	         10.10.10.165	        rac0	Redhat 6.7
dmrac2	10.18.13.166	         10.10.10.166	        rac1	Redhat 6.7

共享存储

/dev/sdb1	/dev/raw/raw1	dcr disk	2G
/dev/sdb2	/dev/raw/raw2	voting disk	2G
/dev/sdb3	/dev/raw/raw3	data disk1	2G
/dev/sdb4	/dev/raw/raw4	data disk2	2G
/dev/sdb1	/dev/raw/raw5	data disk3	2G
/dev/sdb2	/dev/raw/raw6	data disk4	2G
/dev/sdb3	/dev/raw/raw7	log disk1	2G
/dev/sdb4	/dev/raw/raw8	log disk2	2G
/dev/sdb1	/dev/raw/raw9	log disk3	2G
/dev/sdb2	/dev/raw/raw10	log disk4	2G
/dev/sdb3	/dev/raw/raw11	log disk5	2G
/dev/sdb4	/dev/raw/raw12	log disk6	2G

二、操作系统配置
1、关闭防火墙和SELINUX

[root@cs ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: nat mangle filter [  OK  ]
iptables: Flushing firewall rules: [  OK  ]
iptables: Unloading modules: [  OK  ]
[root@cs ~]# chkconfig iptables off
[root@cs ~]# setenforce 0
[root@cs ~]# sed -i s:^SELINUX=.*$:SELINUX=disabled:g /etc/selinux/config

[root@cs ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: nat mangle filter [  OK  ]
iptables: Flushing firewall rules: [  OK  ]
iptables: Unloading modules: [  OK  ]
[root@cs ~]# chkconfig iptables off
[root@cs ~]# setenforce 0
[root@cs ~]# sed -i s:^SELINUX=.*$:SELINUX=disabled:g /etc/selinux/config

2、修改主机名

[root@cs ~]# hostname dm1
[root@cs ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dm1:g /etc/sysconfig/network


[root@cs ~]# hostname dm2
[root@cs ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dm2:g /etc/sysconfig/network

3、修改hosts文件
[root@cs ~]# echo "
> 10.18.13.165   dm1
> 10.18.13.166   dm2" >> /etc/hosts
[root@cs ~]#


[root@cs ~]# echo "
> 10.18.13.165   dm1
> 10.18.13.166   dm2" >> /etc/hosts
[root@cs ~]#

三、 安装达梦软件
安装操作详见Oracle Linux 7.1中安装达梦数据库DM7

四、绑定UDEV

[root@dm1 rules.d]# vi 99-dm-devices.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=="sdb3", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdb4", RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdc2", RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", KERNEL=="sdc3", RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", KERNEL=="sdc4", RUN+="/bin/raw /dev/raw/raw8 %N"

ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw9 %N"
ACTION=="add", KERNEL=="sdd2", RUN+="/bin/raw /dev/raw/raw10 %N"
ACTION=="add", KERNEL=="sdd3", RUN+="/bin/raw /dev/raw/raw11 %N"
ACTION=="add", KERNEL=="sdd4", RUN+="/bin/raw /dev/raw/raw12 %N"



ACTION=="add", KERNEL=="raw[1-12]", OWNER="dmdba", GROUP="dinstall", MODE="660"


[root@dm1 rules.d]# start_udev
Starting udev: [  OK  ]
[root@dm1 rules.d]# ls -lrt /dev/raw/
total 0
crw-rw---- 1 root  disk     162,  0 May  7 16:28 rawctl
crw-rw---- 1 dmdba dinstall 162,  9 May  7 16:28 raw9
crw-rw---- 1 dmdba dinstall 162, 12 May  7 16:28 raw12
crw-rw---- 1 dmdba dinstall 162, 11 May  7 16:28 raw11
crw-rw---- 1 dmdba dinstall 162, 10 May  7 16:28 raw10
crw-rw---- 1 dmdba dinstall 162,  6 May  7 16:28 raw6
crw-rw---- 1 dmdba dinstall 162,  1 May  7 16:28 raw1
crw-rw---- 1 dmdba dinstall 162,  7 May  7 16:28 raw7
crw-rw---- 1 dmdba dinstall 162,  8 May  7 16:28 raw8
crw-rw---- 1 dmdba dinstall 162,  5 May  7 16:28 raw5
crw-rw---- 1 dmdba dinstall 162,  2 May  7 16:28 raw2
crw-rw---- 1 dmdba dinstall 162,  3 May  7 16:28 raw3
crw-rw---- 1 dmdba dinstall 162,  4 May  7 16:28 raw4



[root@dm2 /]# cd /etc/udev/rules.d/
[root@dm2 rules.d]# vi 99-dm-devices.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=="sdb3", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdb4", RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add", KERNEL=="sdc1", RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdc2", RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", KERNEL=="sdc3", RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", KERNEL=="sdc4", RUN+="/bin/raw /dev/raw/raw8 %N"

ACTION=="add", KERNEL=="sdd1", RUN+="/bin/raw /dev/raw/raw9 %N"
ACTION=="add", KERNEL=="sdd2", RUN+="/bin/raw /dev/raw/raw10 %N"
ACTION=="add", KERNEL=="sdd3", RUN+="/bin/raw /dev/raw/raw11 %N"
ACTION=="add", KERNEL=="sdd4", RUN+="/bin/raw /dev/raw/raw12 %N"



ACTION=="add", KERNEL=="raw[1-12]", OWNER="dmdba", GROUP="dinstall", MODE="660"

[root@dm2 rules.d]# start_udev
Starting udev: [  OK  ]
[root@dm2 rules.d]# ls -lrt /dev/raw/
total 0
crw-rw---- 1 root  disk     162,  0 May  7 16:28 rawctl
crw-rw---- 1 dmdba dinstall 162,  9 May  7 16:28 raw9
crw-rw---- 1 dmdba dinstall 162, 12 May  7 16:28 raw12
crw-rw---- 1 dmdba dinstall 162, 11 May  7 16:28 raw11
crw-rw---- 1 dmdba dinstall 162, 10 May  7 16:28 raw10
crw-rw---- 1 dmdba dinstall 162,  6 May  7 16:28 raw6
crw-rw---- 1 dmdba dinstall 162,  1 May  7 16:28 raw1
crw-rw---- 1 dmdba dinstall 162,  7 May  7 16:28 raw7
crw-rw---- 1 dmdba dinstall 162,  8 May  7 16:28 raw8
crw-rw---- 1 dmdba dinstall 162,  5 May  7 16:28 raw5
crw-rw---- 1 dmdba dinstall 162,  2 May  7 16:28 raw2
crw-rw---- 1 dmdba dinstall 162,  3 May  7 16:28 raw3
crw-rw---- 1 dmdba dinstall 162,  4 May  7 16:28 raw4

可以通过blockdev –getsize64 /dev/raw/raw1命令查看裸设备大小

[root@dm1 rules.d]# blockdev --getsize64 /dev/raw/raw1
2154991104


[root@dm2 ~]# blockdev --getsize64 /dev/raw/raw1
2154991104

六、配置dmdcr_cfg.ini文件
在2个节点的/dm7/data目录下创建配置文件dmdcr_cfg.ini,仅使用裸设备,不使用ASM文件系统,不需要配置ASM信息,仅配置CSS/DB信息。在文件中添加如下内容:

[dmdba@dm1 dm7]$ mkdir data
[dmdba@dm1 dm7]$ cd data
[dmdba@dm1 data]$ vi dmdcr_cfg.ini
DCR_N_GRP = 2
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 63635

[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = GRP_CSS
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_CSS]
DCR_EP_NAME = CSS0
DCR_EP_HOST = 10.10.10.165
DCR_EP_PORT = 9541
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 10.10.10.166
DCR_EP_PORT = 9542


[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = GRP_RAC
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_RAC]
DCR_EP_NAME = RAC0
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
[GRP_RAC]
DCR_EP_NAME = RAC1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9742

[dmdba@dm2 dm7]$ mkdir data
[dmdba@dm2 dm7]$ cd data
[dmdba@dm2 data]$ vi dmdcr_cfg.ini
DCR_N_GRP = 2
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 63635

[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = GRP_CSS
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_CSS]
DCR_EP_NAME = CSS0
DCR_EP_HOST = 10.10.10.165
DCR_EP_PORT = 9541
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 10.10.10.166
DCR_EP_PORT = 9542


[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = GRP_RAC
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_RAC]
DCR_EP_NAME = RAC0
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
[GRP_RAC]
DCR_EP_NAME = RAC1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9742

七、使用 DMASMCMD 工具初始化(任意一节点执行)

[dmdba@dm1 ~]$ dmasmcmd
DMASMCMD V7.1.6.46-Build(2018.02.08-89107)ENT
ASM>create dcrdisk '/dev/raw/raw1' 'dcr'
the ASM initialize dcrdisk /dev/raw/raw1 to name DMASMdcr
Used time: 1.459(ms).
ASM>create votedisk '/dev/raw/raw2' 'vote'
the ASM initialize votedisk /dev/raw/raw2 to name DMASMvote
Used time: 1.380(ms).
ASM>init dcrdisk '/dev/raw/raw1' from '/dm7/data/dmdcr_cfg.ini'
syntax error
asmcmd parse failed!
ASM>init dcrdisk '/dev/raw/raw1' from '/dm7/data/dmdcr_cfg.ini' identified by 'dameng123'
[Trace]DG 126 allocate 4 extents for file 0xfe000002.
Check dcr disk failed, please check and try again
Used time: 271.543(ms).
ASM>init dcrdisk '/dev/raw/raw1' from '/dm7/data/dmdcr_cfg.ini' identified by 'dameng123'
[Trace]DG 126 allocate 4 extents for file 0xfe000002.
Used time: 68.745(ms).
ASM>init votedisk '/dev/raw/raw2' from '/dm7/data/dmdcr_cfg.ini'
[Trace]DG 125 allocate 4 extents for file 0xfd000002.
Used time: 33.488(ms).

八、操作系统配置准备配置dminit.ini文件,存放在/dm7/data目录中

system_path = /dm7/data
db_name=rac
main = /dev/raw/raw3
main_size = 128
roll = /dev/raw/raw4
roll_size = 128
system = /dev/raw/raw5
system_size = 128
ctl_path = /dev/raw/raw6
ctl_size = 8
dcr_path=/dev/raw/raw1
dcr_seqno=0

[rac0]
config_path=/dm7/data/rac0_config
port_num = 5236
mal_host = 10.10.10.165
mal_port = 9340
log_size = 256
log_path = /dev/raw/raw7
log_path = /dev/raw/raw8
[rac1]
config_path=/dm7/data/rac1_config
port_num = 5236
mal_host = 10.10.10.166
mal_port = 9341
log_size = 256
log_path = /dev/raw/raw9
log_path = /dev/raw/raw10

九、准备dmdcr.ini 配置文件
dmdcr.ini 是 dmcss、dmasmsvr、dmasmtool 工具的输入参数。记录了当前节点序列号以及 DCR 磁盘路径。在2个节点的/dm/dmdbms/data目录下创建dmdcr.ini 配置文件,dmdcr_path 相同,dmasvrmal.ini 文件内容也相同,dmdcr_seqo 分别为 0 和 1。
节点 1:

[dmdba@dmrac1 data]$ vi dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_SEQNO = 0

#ASM
DMDCR_ASM_RESTART_INTERVAL = 0
DMDCR_ASM_STARTUP_CMD = /dm7/bin/dmasmsvr dcr_ini=/dm7/data/dmdcr.ini

#DB
DMDCR_DB_RESTART_INTERVAL = 0
DMDCR_DB_STARTUP_CMD = /dm7/bin/dmserver path=/dm7/data/rac0_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini

节点2:

[dmdba@dmrac2 data]$ vi dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_SEQNO = 1

#ASM
DMDCR_ASM_RESTART_INTERVAL = 0
DMDCR_ASM_STARTUP_CMD = /dm7/bin/dmasmsvr dcr_ini=/dm7/data/dmdcr.ini

#DB
DMDCR_DB_RESTART_INTERVAL = 0
DMDCR_DB_STARTUP_CMD = /dm7/bin/dmserver path=/dm7/data/rac1_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini

十、启动DMCSS 服务程序
1、注册 DMCSS服务
节点一:

[root@dm1 ~]# /dm7/script/root/dm_service_installer.sh -t dmcss -i /dm7/data/dmdcr.ini -p rac1
Move the service script file(/dm7/bin/DmCSSServicerac1 to /etc/rc.d/init.d/DmCSSServicerac1)
Finished to create the service (DmCSSServicerac1)

节点二:

[root@dm2 ~]# /dm7/script/root/dm_service_installer.sh -t dmcss -i /dm7/data/dmdcr.ini -p rac2
Move the service script file(/dm7/bin/DmCSSServicerac2 to /etc/rc.d/init.d/DmCSSServicerac2)
Finished to create the service (DmCSSServicerac2)

2、启动DMCSS 服务
节点一:

[root@dm1 ~]# service DmCSSServicerac1 start
Starting DmCSSServicerac1: [ OK ]

节点二:

[root@dm2 ~]# service DmCSSServicerac2 start
Starting DmCSSServicerac2: [ OK ]

十一、操作系统配置使用dminit初始化DB环境
在任意节点启动 dminit 工具初始化数据库。dminit 执行完成后,会在 config_path 目录(/dm7/data/rac0_config 和/dm7/data/rac1_config)下生成配置文件 dm.ini 和 dmmal.ini。

[dmdba@dm1 data]$ dminit control=/dm7/data/dminit.ini
initdb V7.1.6.46-Build(2018.02.08-89107)ENT
db version: 0x7000a
file dm.key not found, use default license!
License will expire in 14 day(s) on 2020-05-21

 log file path: /dev/raw/raw7


 log file path: /dev/raw/raw8


 log file path: /dev/raw/raw9


 log file path: /dev/raw/raw10

FILE "/dev/raw/raw5" has already existed
FILE "/dev/raw/raw4" has already existed
FILE "/dev/raw/raw3" has already existed
FILE "/dev/raw/raw6" has already existed
FILE "/dev/raw/raw7" has already existed
FILE "/dev/raw/raw8" has already existed
FILE "/dev/raw/raw9" has already existed
FILE "/dev/raw/raw10" has already existed
File "/dev/raw/raw5" has already existed,
whether overwrite(y/n, 1/0): y
File "/dev/raw/raw4" has already existed,
whether overwrite(y/n, 1/0): y
File "/dev/raw/raw3" has already existed,
whether overwrite(y/n, 1/0): y
File "/dev/raw/raw6" has already existed,
whether overwrite(y/n, 1/0): y
File "/dev/raw/raw7" has already existed,
whether overwrite(y/n, 1/0): y
File "/dev/raw/raw8" has already existed,
whether overwrite(y/n, 1/0): y
File "/dev/raw/raw9" has already existed,
whether overwrite(y/n, 1/0): y
File "/dev/raw/raw10" has already existed,
whether overwrite(y/n, 1/0): y
write to dir [/dm7/data/rac].
create dm database success. 2020-05-07 16:41:52

将节点一的配置文件复制到节点二:

[dmdba@dm1 data]$ scp -r rac1_config 10.18.13.166:`pwd`
The authenticity of host '10.18.13.166 (10.18.13.166)' can't be established.
RSA key fingerprint is 89:fc:3e:e3:2d:27:94:07:0e:6b:fc:c5:e8:89:44:1f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.18.13.166' (RSA) to the list of known hosts.
dmdba@10.18.13.166's password:
sqllog.ini                                                                                                                                                                                                100%  479     0.5KB/s   00:00
dm.ini                                                                                                                                                                                                    100%   40KB  39.8KB/s   00:00
dmmal.ini                                                                                                                                                                                                 100%  204     0.2KB/s   00:00
[dmdba@dm1 data]$

一定要将节点一/dm7/data/目录中生成的rac目录复制到节点二的/dm7/data目录中,否则在节点二中启动数据库时会出现以下错误,原因就是因为使用裸设备时生成的rac目录及其文件不是存储在共享存储中可以让集群节点都能访问。

Starting DmServicerac2: [ FAILED ]
file dm.key not found, use default license!
Read ini warning, default dm.ctl backup path [/dm7/data/rac/ctl_bak] does not exist.
Read ini error, name:SYSTEM_PATH, value:/dm7/data/rac
dmserver startup failed, code = -803 [Invalid ini config value]

将节点一/dm7/data/目录中生成的rac目录复制到节点二的/dm7/data目录

[dmdba@dm1 data]$ scp -r rac 10.18.13.166:`pwd`
dmdba@10.18.13.166's password:
dm_20200507164149_942994.ctl                                                                                                                                                                              100% 6144     6.0KB/s   00:00
TEMP0.DBF                                                                                                                                                                                                 100%   10MB  10.0MB/s   00:00
dm_service.prikey                                                                                                                                                                                         100%  633     0.6KB/s   00:00

十二、启动数据库服务器
1、在2个节点分别注册DM 数据库服务:
节点一:

[root@dm1 ~]# /dm7/script/root/dm_service_installer.sh -t dmserver -i /dm7/data/rac0_config/dm.ini -d /dm7/data/dmdcr.ini -p rac1
Move the service script file(/dm7/bin/DmServicerac1 to /etc/rc.d/init.d/DmServicerac1)
Finished to create the service (DmServicerac1)

节点二:

[root@dm2 ~]# /dm7/script/root/dm_service_installer.sh -t dmserver -i /dm7/data/rac1_config/dm.ini -d /dm7/data/dmdcr.ini -p rac2
Move the service script file(/dm7/bin/DmServicerac2 to /etc/rc.d/init.d/DmServicerac2)
Finished to create the service (DmServicerac2)

2、启动数据库

[root@dm1 ~]# service DmServicerac1 start
Starting DmServicerac1: [ OK ]

[root@dm2 ~]# service DmServicerac2 start
Starting DmServicerac2: [ OK ]

手工启动命令如下,手工启动后窗口不能关闭,所以

./dmserver /dm7/data/rac0_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini
./dmserver /dm7/data/rac1_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini

十三、操作系统配置连接数据库验证
13.1配置服务名文件

[dmdba@dm1 data]$ vi /etc/dm_svc.conf
rac=(10.18.13.165:5236,10.18.13.166:5236)
SWITCH_TIME=(10000)
SWITCH_INTERVAL=(10)

TIME_ZONE=(480)
LANGUAGE=(en)

[dmdba@dm2 rac]$ vi /etc/dm_svc.conf
TIME_ZONE=(480)
rac=(10.18.13.165:5236,10.18.13.166:5236)
SWITCH_TIME=(10000)
SWITCH_INTERVAL=(10)

TIME_ZONE=(480)
LANGUAGE=(en)

13.2 连接RAC集群
节点一:

[dmdba@dm1 data]$ disql SYSDBA/SYSDBA@rac

Server[10.18.13.166:5236]:mode is normal, state is open
login used time: 9.596(ms)
disql V7.1.6.46-Build(2018.02.08-89107)ENT
Connected to: DM 7.1.6.46
SQL> select instance_name from v$instance;

LINEID     INSTANCE_NAME
---------- -------------
1          RAC1

used time: 5.020(ms). Execute id is 2.
SQL> select * from v$rac_ep_info;

LINEID     EP_NAME EP_SEQNO    EP_GUID              EP_TIMESTAMP         EP_MODE EP_STATUS
---------- ------- ----------- -------------------- -------------------- ------- ---------
1          RAC0    0           2982624975           2982625916           MASTER  OK
2          RAC1    1           2983098335           2983098713           SLAVE   OK

used time: 7.731(ms). Execute id is 3.

节点二:

SQL> select instance_name from v$instance;

LINEID     INSTANCE_NAME
---------- -------------
1          RAC1

used time: 117.515(ms). Execute id is 1.
SQL> select * from v$rac_ep_info;

LINEID     EP_NAME EP_SEQNO    EP_GUID              EP_TIMESTAMP         EP_MODE EP_STATUS
---------- ------- ----------- -------------------- -------------------- ------- ---------
1          RAC0    0           2982624975           2982632228           MASTER  OK
2          RAC1    1           2983098335           2983105025           SLAVE   OK

used time: 4.439(ms). Execute id is 4.

13.3测试故障重连

[dmdba@dm2 rac]$ disql SYSDBA/SYSDBA@rac

Server[10.18.13.166:5236]:mode is normal, state is open
login used time: 6.728(ms)
disql V7.1.6.46-Build(2018.02.08-89107)ENT
Connected to: DM 7.1.6.46
SQL> select instance_name from v$instance;

LINEID     INSTANCE_NAME
---------- -------------
1          RAC1

used time: 117.515(ms). Execute id is 1.
SQL> select * from v$rac_ep_info;

LINEID     EP_NAME EP_SEQNO    EP_GUID              EP_TIMESTAMP         EP_MODE EP_STATUS
---------- ------- ----------- -------------------- -------------------- ------- ---------
1          RAC0    0           2982624975           2982632228           MASTER  OK
2          RAC1    1           2983098335           2983105025           SLAVE   OK

used time: 4.439(ms). Execute id is 4.

#此时连接的rac1,我们kill 进程:

[root@dm2 ~]# ps -ef | grep dm.ini
dmdba     6231     1  0 17:25 pts/2    00:00:44 /dm7/bin/dmserver /dm7/data/rac1_config/dm.ini DCR_INI=/dm7/data/dmdcr.ini -noconsole
root     10844  5237  0 19:20 pts/2    00:00:00 grep dm.ini
[root@dm2 ~]# kill -9 6231

#在查询,故障重连成功:

SQL> select instance_name from v$instance;
[-70065]:Connection exception, switch the current connection sucessful.
[-70065]:Connection exception, switch the current connection sucessful.

Server[10.18.13.165:5236]:mode is normal, state is open
SQL> select instance_name from v$instance;

LINEID     INSTANCE_NAME
---------- -------------
1          RAC0

used time: 9.443(ms). Execute id is 807.

SQL> select * from v$rac_ep_info;

LINEID     EP_NAME EP_SEQNO    EP_GUID              EP_TIMESTAMP         EP_MODE EP_STATUS
---------- ------- ----------- -------------------- -------------------- ------- ---------
1          RAC0    0           2982624975           2982632568           MASTER  OK
2          RAC1    1           2983098335           2983105240           SLAVE   ERROR

used time: 3.184(ms). Execute id is 808.

可以看到连接的实例从rac1变为了rac0

DM7使用DMASM安装DMRAC

一.环境准备
主机 IP地址(对外服务) IP地址(内部通信) 实例名 操作系统
dmrac1 10.18.13.161 10.10.10.161 rac0 Redhat 6.7
dmrac2 10.18.13.162 10.10.10.162 rac1 Redhat 6.7

共享存储
/dev/sdb /dev/raw/raw1 dcr disk 2G
/dev/sdc /dev/raw/raw2 voting disk 2G
/dev/sdd /dev/raw/raw3 log disk 10G
/dev/sde /dev/raw/raw4 data disk1 10G
/dev/sdf /dev/raw/raw5 data disk2 10G

二、操作系统配置

1、关闭防火墙和SELINUX

[root@cs ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: nat mangle filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@cs ~]# chkconfig iptables off
[root@cs ~]# setenforce 0
[root@cs ~]# sed -i s:^SELINUX=.*$:SELINUX=disabled:g /etc/selinux/config

[root@cs ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: nat mangle filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@cs ~]# chkconfig iptables off
[root@cs ~]# setenforce 0
[root@cs ~]# sed -i s:^SELINUX=.*$:SELINUX=disabled:g /etc/selinux/config

2、修改主机名

[root@cs ~]# hostname dmrac1
[root@cs ~]# hostname dmrac2
[root@cs ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dmrac1:g /etc/sysconfig/network
[root@cs ~]# sed -i s:^HOSTNAME=.*$:HOSTNAME=dmrac2:g /etc/sysconfig/network

3、修改hosts文件

[root@cs ~]# echo "
> 10.18.13.161 dmrac1
> 10.18.13.162 dmrac2" >> /etc/hosts

[root@cs ~]# echo "
> 10.18.13.161 dmrac1
> 10.18.13.162 dmrac2" >> /etc/hosts

三、 安装达梦软件
为了减少对操作系统的影响,用户不应该以root系统用户来安装和运行DM。用户可以在安装之前为DM创建一个专用的系统用户。具体操作详见Oracle Linux 7.1中安装达梦数据库DM7

四、绑定UDEV

[root@dmrac1 rules.d]# vi 99-dm-devices.rules
ACTION=="add", KERNEL=="sdb", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdf", RUN+="/bin/raw /dev/raw/raw5 %N"


ACTION=="add", KERNEL=="raw[1-5]", OWNER="dmdba", GROUP="dinstall", MODE="660"
~
[root@dmrac1 rules.d]# start_udev
Starting udev: [ OK ]
[root@dmrac1 rules.d]# ls -lrt /dev/raw/
total 0
crw-rw----. 1 root disk 162, 0 Apr 24 14:08 rawctl
crw-rw----. 1 dmdba dinstall 162, 2 Apr 24 14:08 raw2
crw-rw----. 1 dmdba dinstall 162, 1 Apr 24 14:08 raw1
crw-rw----. 1 dmdba dinstall 162, 4 Apr 24 14:08 raw4
crw-rw----. 1 dmdba dinstall 162, 3 Apr 24 14:08 raw3
crw-rw----. 1 dmdba dinstall 162, 5 Apr 24 14:08 raw5


[root@dmrac2 rules.d]# vi 99-dm-devices.rules
ACTION=="add", KERNEL=="sdb", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdc", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdd", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sde", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdf", RUN+="/bin/raw /dev/raw/raw5 %N"


ACTION=="add", KERNEL=="raw[1-5]", OWNER="dmdba", GROUP="dinstall", MODE="660"
~
[root@dmrac2 rules.d]# start_udev
Starting udev: [ OK ]
[root@dmrac2 rules.d]# ls -lrt /dev/raw/
total 0
crw-rw----. 1 root disk 162, 0 Apr 24 14:08 rawctl
crw-rw----. 1 dmdba dinstall 162, 2 Apr 24 14:08 raw2
crw-rw----. 1 dmdba dinstall 162, 1 Apr 24 14:08 raw1
crw-rw----. 1 dmdba dinstall 162, 4 Apr 24 14:08 raw4
crw-rw----. 1 dmdba dinstall 162, 3 Apr 24 14:08 raw3
crw-rw----. 1 dmdba dinstall 162, 5 Apr 24 14:08 raw5

可以通过blockdev –getsize64 /dev/raw/raw1命令查看裸设备大小

[root@dmrac1 rules.d]# blockdev --getsize64 /dev/raw/raw1
2147483648
[root@dmrac1 rules.d]# blockdev --getsize64 /dev/raw/raw2
2147483648
[root@dmrac1 rules.d]# blockdev --getsize64 /dev/raw/raw3
10737418240
[root@dmrac1 rules.d]# blockdev --getsize64 /dev/raw/raw4
10737418240
[root@dmrac1 rules.d]# blockdev --getsize64 /dev/raw/raw5
10737418240

[root@dmrac2 rules.d]# blockdev --getsize64 /dev/raw/raw1
2147483648
[root@dmrac2 rules.d]# blockdev --getsize64 /dev/raw/raw2
2147483648
[root@dmrac2 rules.d]# blockdev --getsize64 /dev/raw/raw3
10737418240
[root@dmrac2 rules.d]# blockdev --getsize64 /dev/raw/raw4
10737418240
[root@dmrac2 rules.d]# blockdev --getsize64 /dev/raw/raw5
10737418240

六、配置dmdcr_cfg.ini文件
在2个节点的/dm7/data目录下创建配置文件dmdcr_cfg.ini,在文件中添加如下内容:

[root@dmrac1 /]# su - dmdba
[dmdba@dmrac1 ~]$ mkdir /dm7/data
[dmdba@dmrac1 ~]$cd /dm7/data
[dmdba@dmrac1 data]$ cat dmdcr_cfg.ini
DCR_N_GRP = 3
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 63635

[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = GRP_CSS
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_CSS]
DCR_EP_NAME = CSS0
DCR_EP_HOST = 10.10.10.161
DCR_EP_PORT = 9541
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 10.10.10.162
DCR_EP_PORT = 9542

[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = GRP_ASM
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_ASM]
DCR_EP_NAME = ASM0
DCR_EP_SHM_KEY = 93360
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.18.13.161
DCR_EP_PORT = 9641
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP_ASM]
DCR_EP_NAME = ASM1
DCR_EP_SHM_KEY = 93361
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.18.13.162
DCR_EP_PORT = 9642
DCR_EP_ASM_LOAD_PATH = /dev/raw

[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = GRP_RAC
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_RAC]
DCR_EP_NAME = RAC0
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
[GRP_RAC]
DCR_EP_NAME = RAC1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9742


[root@dmrac2 /]# su - dmdba
[dmdba@dmrac2 ~]$ mkdir /dm7/data
[dmdba@dmrac2 ~]$cd /dm7/data
[dmdba@dmrac2 data]$ cat dmdcr_cfg.ini
DCR_N_GRP = 3
DCR_VTD_PATH = /dev/raw/raw2
DCR_OGUID = 63635

[GRP]
DCR_GRP_TYPE = CSS
DCR_GRP_NAME = GRP_CSS
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_CSS]
DCR_EP_NAME = CSS0
DCR_EP_HOST = 10.10.10.161
DCR_EP_PORT = 9541
[GRP_CSS]
DCR_EP_NAME = CSS1
DCR_EP_HOST = 10.10.10.162
DCR_EP_PORT = 9542

[GRP]
DCR_GRP_TYPE = ASM
DCR_GRP_NAME = GRP_ASM
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_ASM]
DCR_EP_NAME = ASM0
DCR_EP_SHM_KEY = 93360
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.18.13.161
DCR_EP_PORT = 9641
DCR_EP_ASM_LOAD_PATH = /dev/raw
[GRP_ASM]
DCR_EP_NAME = ASM1
DCR_EP_SHM_KEY = 93361
DCR_EP_SHM_SIZE = 10
DCR_EP_HOST = 10.18.13.162
DCR_EP_PORT = 9642
DCR_EP_ASM_LOAD_PATH = /dev/raw

[GRP]
DCR_GRP_TYPE = DB
DCR_GRP_NAME = GRP_RAC
DCR_GRP_N_EP = 2
DCR_GRP_DSKCHK_CNT = 60
[GRP_RAC]
DCR_EP_NAME = RAC0
DCR_EP_SEQNO = 0
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9741
[GRP_RAC]
DCR_EP_NAME = RAC1
DCR_EP_SEQNO = 1
DCR_EP_PORT = 5236
DCR_CHECK_PORT = 9742

七、使用 DMASMCMD 工具初始化(任意一节点执行)

[dmdba@dmrac1 data]$ dmasmcmd
DMASMCMD V7.1.6.46-Build(2018.02.08-89107)ENT
ASM>create dcrdisk '/dev/raw/raw1' 'dcr'
the ASM initialize dcrdisk /dev/raw/raw1 to name DMASMdcr
Used time: 9.322(ms).
ASM>create votedisk '/dev/raw/raw2' 'vote'
the ASM initialize votedisk /dev/raw/raw2 to name DMASMvote
Used time: 6.251(ms).
ASM>create asmdisk '/dev/raw/raw3' 'LOG0'
the ASM initialize asmdisk /dev/raw/raw3 to name DMASMLOG0
Used time: 8.825(ms).
ASM>create asmdisk '/dev/raw/raw4' 'DATA0'
the ASM initialize asmdisk /dev/raw/raw4 to name DMASMDATA0
Used time: 6.145(ms).
ASM>init dcrdisk '/dev/raw/raw1' from '/dm7/data/dmdcr_cfg.ini' identified by 'dameng123'
[Trace]DG 126 allocate 4 extents for file 0xfe000002.
Check dcr disk failed, please check and try again
Used time: 84.489(ms).提示检查dcr磁盘失败请再次执行
ASM>init dcrdisk '/dev/raw/raw1' from '/dm7/data/dmdcr_cfg.ini' identified by 'dameng123'
[Trace]DG 126 allocate 4 extents for file 0xfe000002.
Used time: 00:00:06.078.
ASM>init votedisk '/dev/raw/raw2' from '/dm7/data/dmdcr_cfg.ini'
[Trace]DG 125 allocate 4 extents for file 0xfd000002.
Used time: 36.305(ms).

八、准备DMASM 的 MAL 配置文件
在2个节点的/dm7/data目录下创建 DMASM 的 MAL 配置文件(命名为 dmasvrmal.ini),使用 DMASM 的所有节点都要配置,内容完全一样。

[dmdba@dmrac1 data]$ vi dmasvrmal.ini
[MAL_INST1]
MAL_INST_NAME = ASM0
MAL_HOST = 10.10.10.161
MAL_PORT = 7236

[MAL_INST2]
MAL_INST_NAME = ASM1
MAL_HOST = 10.10.10.162
MAL_PORT = 7237
[dmdba@dmrac2 data]$ vi dmasvrmal.ini
[MAL_INST1]
MAL_INST_NAME = ASM0
MAL_HOST = 10.10.10.161
MAL_PORT = 7236

[MAL_INST2]
MAL_INST_NAME = ASM1
MAL_HOST = 10.10.10.162
MAL_PORT = 7237
~

九、准备dmdcr.ini 配置文件
dmdcr.ini 是 dmcss、dmasmsvr、dmasmtool 工具的输入参数。记录了当前节点序列号以及 DCR 磁盘路径。
在2个节点的/dm/dmdbms/data目录下创建dmdcr.ini 配置文件,dmdcr_path 相同,dmasvrmal.ini 文件内容也相同,dmdcr_seqo 分别为 0 和 1。
节点 1:

[dmdba@dmrac1 data]$ vi dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH =/dm7/data/dmasvrmal.ini
DMDCR_SEQNO = 0

#ASM
DMDCR_ASM_RESTART_INTERVAL = 0
DMDCR_ASM_STARTUP_CMD = /dm7/bin/dmasmsvr dcr_ini=/dm7/data/dmdcr.ini

#DB
DMDCR_DB_RESTART_INTERVAL = 0
DMDCR_DB_STARTUP_CMD = /dm7/bin/dmserver path=/dm7/data/rac0_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini

节点2:

[dmdba@dmrac2 data]$ vi dmdcr.ini
DMDCR_PATH = /dev/raw/raw1
DMDCR_MAL_PATH =/dm7/data/dmasvrmal.ini
DMDCR_SEQNO = 1

#ASM
DMDCR_ASM_RESTART_INTERVAL = 0
DMDCR_ASM_STARTUP_CMD = /dm7/bin/dmasmsvr dcr_ini=/dm7/data/dmdcr.ini

#DB
DMDCR_DB_RESTART_INTERVAL = 0
DMDCR_DB_STARTUP_CMD = /dm7/bin/dmserver path=/dm7/data/rac1_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini

十、启动DMCSS、DMASM 服务程序
1、注册 DMCSS和DMASM服务
节点一:

[root@dmrac1 ~]# /dm7/script/root/dm_service_installer.sh -t dmcss -i /dm7/data/dmdcr.ini -p rac1
Move the service script file(/dm7/bin/DmCSSServicerac1 to /etc/rc.d/init.d/DmCSSServicerac1)
Finished to create the service (DmCSSServicerac1)
[root@dmrac1 ~]# /dm7/script/root/dm_service_installer.sh -t dmasmsvr -i /dm7/data/dmdcr.ini -p rac1
Move the service script file(/dm7/bin/DmASMSvrServicerac1 to /etc/rc.d/init.d/DmASMSvrServicerac1)
Finished to create the service (DmASMSvrServicerac1)
[root@dmrac1 ~]#

节点二:

[root@dmrac2 ~]# /dm7/script/root/dm_service_installer.sh -t dmcss -i /dm7/data/dmdcr.ini -p rac2
Move the service script file(/dm7/bin/DmCSSServicerac2 to /etc/rc.d/init.d/DmCSSServicerac2)
Finished to create the service (DmCSSServicerac2)
[root@dmrac2 ~]# /dm7/script/root/dm_service_installer.sh -t dmasmsvr -i /dm7/data/dmdcr.ini -p rac2
Move the service script file(/dm7/bin/DmASMSvrServicerac2 to /etc/rc.d/init.d/DmASMSvrServicerac2)
Finished to create the service (DmASMSvrServicerac2)

2、启动DMCSS和DMASM服务
节点一:

[root@dmrac1 init.d]# service DmCSSServicerac1 start
Starting DmCSSServicerac1: [ OK ]
[root@dmrac1 init.d]# service DmASMSvrServicerac1 start
Starting DmASMSvrServicerac1: [ OK ]

节点二:

[root@dmrac2 init.d]# service DmCSSServicerac2 start
Starting DmCSSServicerac2: [ OK ]
[root@dmrac2 init.d]# service DmASMSvrServicerac2 start
Starting DmASMSvrServicerac2: [ OK ]

十一、创建DMASM磁盘组
在任意节点使用 dmasmtool 工具创建 DMASM 磁盘组。

[dmdba@dmrac1 ~]$ dmasmtool DCR_INI=/dm7/data/dmdcr.ini
DMASMTOOL V7.1.6.46-Build(2018.02.08-89107)ENT
ASM>create diskgroup 'DMLOG' asmdisk '/dev/raw/raw3'
Used time: 00:00:06.363.
ASM>create diskgroup 'DMDATA' asmdisk '/dev/raw/raw4'
Used time: 00:00:06.504.

十二、准备dminit.ini 配置文件
在2个节点的/dm/dmdbms/data目录下创建 dminit.ini 配置文件,添加如下内容。 在2个节点都创建。

[dmdba@dmrac1 data]$ vi dminit.ini
db_name = rac
system_path = +DMDATA/data
system = +DMDATA/data/rac/system.dbf
system_size = 128
roll = +DMDATA/data/rac/roll.dbf
roll_size = 128
main = +DMDATA/data/rac/main.dbf
main_size = 128
ctl_path = +DMDATA/data/rac/dm.ctl
ctl_size = 8
log_size = 256
dcr_path = /dev/raw/raw1 #dcr 磁盘路径,目前不支持 asm,只能是裸设备
dcr_seqno = 0
auto_overwrite = 1

[RAC0] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /dm7/data/rac0_config
port_num = 5236
mal_host = 10.10.10.161
mal_port = 9340
log_path = +DMLOG/log/rac0_log01.log
log_path = +DMLOG/log/rac0_log02.log

[RAC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /dm7/data/rac1_config
port_num = 5236
mal_host = 10.10.10.162
mal_port = 9341
log_path = +DMLOG/log/rac1_log01.log
log_path = +DMLOG/log/rac1_log02.log


[dmdba@dmrac2 data]$ vi dminit.ini
db_name = rac
system_path = +DMDATA/data
system = +DMDATA/data/rac/system.dbf
system_size = 128
roll = +DMDATA/data/rac/roll.dbf
roll_size = 128
main = +DMDATA/data/rac/main.dbf
main_size = 128
ctl_path = +DMDATA/data/rac/dm.ctl
ctl_size = 8
log_size = 256
dcr_path = /dev/raw/raw1 #dcr 磁盘路径,目前不支持 asm,只能是裸设备
dcr_seqno = 0
auto_overwrite = 1

[RAC0] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /dm7/data/rac0_config
port_num = 5236
mal_host = 10.10.10.161
mal_port = 9340
log_path = +DMLOG/log/rac0_log01.log
log_path = +DMLOG/log/rac0_log02.log

[RAC1] #inst_name 跟 dmdcr_cfg.ini 中 DB 类型 group 中 DCR_EP_NAME 对应
config_path = /dm7/data/rac1_config
port_num = 5236
mal_host = 10.10.10.162
mal_port = 9341
log_path = +DMLOG/log/rac1_log01.log
log_path = +DMLOG/log/rac1_log02.log

十三、使用dminit初始化数据库
在任意节点启动 dminit 工具初始化数据库。dminit 执行完成后,会在 config_path 目录(/dm7/data/rac0_config 和/dm7/data/rac1_config)下生成配置文件 dm.ini 和 dmmal.ini。

[dmdba@dmrac1 data]$ dminit control=/dm7/data/dminit.ini
initdb V7.1.6.46-Build(2018.02.08-89107)ENT
db version: 0x7000a
file dm.key not found, use default license!
License will expire on 2020-05-08

log file path: +DMLOG/log/rac0_log01.log


log file path: +DMLOG/log/rac0_log02.log


log file path: +DMLOG/log/rac1_log01.log


log file path: +DMLOG/log/rac1_log02.log

write to dir [+DMDATA/data/rac].
create dm database success. 2020-04-24 16:39:03

将节点一的配置文件复制到节点二:

[dmdba@dmrac1 data]$ scp -r rac1_config 10.18.13.162:`pwd`
The authenticity of host '10.18.13.162 (10.18.13.162)' can't be established.
RSA key fingerprint is 89:fc:3e:e3:2d:27:94:07:0e:6b:fc:c5:e8:89:44:1f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.18.13.162' (RSA) to the list of known hosts.
dmdba@10.18.13.162's password:
sqllog.ini 100% 479 0.5KB/s 00:00
dm.ini 100% 40KB 39.8KB/s 00:00
dmmal.ini 100% 204 0.2KB/s 00:00
[dmdba@dmrac1 data]$

十四、启动数据库服务器
1、在2个节点分别注册DM 数据库服务:
节点一:

[root@dmrac1 init.d]# /dm7/script/root/dm_service_installer.sh -t dmserver -i /dm7/data/rac0_config/dm.ini -d /dm7/data/dmdcr.ini -p rac1
Move the service script file(/dm7/bin/DmServicerac1 to /etc/rc.d/init.d/DmServicerac1)
Finished to create the service (DmServicerac1)

节点二:

[root@dmrac2 ~]# /dm7/script/root/dm_service_installer.sh -t dmserver -i /dm7/data/rac1_config/dm.ini -d /dm7/data/dmdcr.ini -p rac2
Move the service script file(/dm7/bin/DmServicerac2 to /etc/rc.d/init.d/DmServicerac2)
Finished to create the service (DmServicerac2)

2、启动数据库

[root@dmrac1 init.d]# service DmServicerac1 start
Starting DmServicerac1: [ OK ]

[root@dmrac2 ~]# service DmServicerac2 start
Starting DmServicerac2: [ OK ]

手工启动命令如下,手工启动后窗口不能关闭,所以

./dmserver /dm7/data/rac0_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini
./dmserver /dm7/data/rac1_config/dm.ini dcr_ini=/dm7/data/dmdcr.ini

15 连接数据库验证
15.1 配置服务名文件

[dmdba@dmrac1 ~]$ vi /etc/dm_svc.conf
TIME_ZONE=(480)
rac=(10.18.13.161:5236,10.18.13.162:5236)
SWITCH_TIME=(10000)
SWITCH_INTERVAL=(10)

TIME_ZONE=(480)
LANGUAGE=(en)

[dmdba@dmrac2 ~]$ vi /etc/dm_svc.conf
TIME_ZONE=(480)
rac=(10.18.13.161:5236,10.18.13.162:5236)
SWITCH_TIME=(10000)
SWITCH_INTERVAL=(10)

TIME_ZONE=(480)
LANGUAGE=(en)

15.2 连接RAC集群
节点一:

[dmdba@dmrac1 ~]$ disql SYSDBA/SYSDBA@rac

Server[10.18.13.161:5236]:mode is normal, state is open
login used time: 10.365(ms)
disql V7.1.6.46-Build(2018.02.08-89107)ENT
Connected to: DM 7.1.6.46
SQL> select instance_name from v$instance;

LINEID INSTANCE_NAME
———- ————-
1 RAC0

used time: 18.248(ms). Execute id is 807.
SQL> select * from v$rac_ep_info;

LINEID EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS
———- ——- ———– ——————– ——————– ——- ———
1 RAC0 0 2067076818 2067077298 MASTER OK
2 RAC1 1 2067098084 2067098537 SLAVE OK

used time: 2.741(ms). Execute id is 808.

节点二:

[dmdba@dmrac2 ~]$ disql SYSDBA/SYSDBA@rac

Server[10.18.13.162:5236]:mode is normal, state is open
login used time: 16.835(ms)
disql V7.1.6.46-Build(2018.02.08-89107)ENT
Connected to: DM 7.1.6.46
SQL> select instance_name from v$instance;

LINEID INSTANCE_NAME
---------- -------------
1 RAC1

used time: 106.703(ms). Execute id is 1.
SQL> select * from v$rac_ep_info;

LINEID EP_NAME EP_SEQNO EP_GUID EP_TIMESTAMP EP_MODE EP_STATUS
---------- ------- ----------- -------------------- -------------------- ------- ---------
1 RAC0 0 2067076818 2067077305 MASTER OK
2 RAC1 1 2067098084 2067098544 SLAVE OK

used time: 7.358(ms). Execute id is 2.

Proudly powered by WordPress | Indrajeet by Sus Hill.