Oracle19c静默安装

Oracle19c静默安装

𝓓𝓸𝓷 Lv6

静默安装Oracle19c数据库

一、关闭防火墙
1
2
3
4
5
6
7
8
9
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service

或者单独开启端口:
firewall-cmd --zone=public --add-port=15021/tcp --permanent
firewall-cmd --reload
firewall-cmd --query-port=15021/tcp
firewall-cmd --list-port
二、关闭selinx
1
2
3
4
5
6
7
8
9
10
临时关闭:
setenforce 0

永久关闭(需要重启机器):
vi /etc/selinux/config

SELINUX=disabled

查看:
getenforce
三、配置YUM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[root@server1 ~]# mkdir /opt/yum
[root@server1 ~]# cp -r /run/media/admin/CentOS\ 7\ x86_64/* /opt/yum
[root@server1 ~]# vi /etc/yum.repos.d/CentOS-Base.repo

[base]
name=CentOS-$releasever - Base
baseurl=file:///opt/yum
gpgcheck=0
enabled=1

[root@server1 ~]# yum list


或者挂载iso文件:
[root@server1 ~]# mkdir /opt/yum
[root@server1 ~]# mount -o loop Oracle_Linux7.6_V980739-01.iso /mnt
[root@server1 ~]# cp -r /mnt/* /opt/yum
四、磁盘空间检查
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
df -h /tmp
free
uname -m
df -h /dev/shm #检查共享内存




If the /tmp directory has less than 1 GB of free space, then identify a file system
with at least 1 GB of free space and set the TMP and TMPDIR environment variables
to specify a temporary directory on this file system:

note:You cannot use a shared file system as the location of the temporary file
directory (typically /tmp) for Oracle RAC installations. If you place /tmp
on a shared file system, then the installation fails.


如果临时空间不足,可以使用以下方法处理:
If necessary, enter commands similar to the following to create a temporary
directory on the file system that you identified, and set the appropriate
permissions on the directory:
$ sudo - s
# mkdir /mount_point/tmp
# chmod 775 /mount_point/tmp
# exit

Enter commands similar to the following to set the TMP and TMPDIR
environment variables:

$ TMP=/mount_point/tmp
$ TMPDIR=/mount_point/tmp
$ export TMP TMPDIR
五、安装preinstall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
wget https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

yum install -y oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm


[root@server ~]# yum install -y oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
Last metadata expiration check: 0:16:29 ago on Tue 17 Mar 2020 10:33:59 PM EDT.
Error:
Problem: conflicting requests
- nothing provides compat-libcap1 needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
- nothing provides compat-libstdc++-33 needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

解决办法:
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libcap1-1.10-7.el7.x86_64.rpm
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

yum install compat-libcap1-1.10-7.el7.x86_64.rpm
yum install compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
yum install oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

[root@server ~]# id oracle
uid=65535(oracle) gid=65535(oinstall) groups=65535(oinstall),65541(racdba),65536(dba),65537(oper),65538(backupdba),65539(dgdba),65540(kmdba)

[root@server ~]# more /etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf
六、安装操作系统依赖包
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
gcc-c++
net-tools (for Oracle RAC and Oracle Clusterware)
nfs-utils (for Oracle ACFS)
python (for Oracle ACFS Remote)
python-configshell (for Oracle ACFS Remote)
python-rtslib (for Oracle ACFS Remote)
python-six (for Oracle ACFS Remote)
targetcli (for Oracle ACFS Remote)
smartmontools
sysstat



安装依赖包:
yum install 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 gcc-c++ smartmontools sysstat


查询依赖包:
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
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 \
gcc-c++ \
smartmontools \
sysstat |grep 'not installed'

解决compat-libstdc++没有安装的问题:
package compat-libstdc++ is not installed

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' compat-libstdc++-33

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

yum install compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
七、禁用透明页
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
To check if Transparent HugePages is enabled, run one of the following commands as
the root user:
方法一:
Red Hat Enterprise Linux kernels:
# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
Other kernels:
# cat /sys/kernel/mm/transparent_hugepage/enabled
The following is a sample output that shows Transparent HugePages are being used
as the [always] flag is enabled.
[always] never

方法二:
[root@server1 ~]# grep AnonHugePages /proc/meminfo
AnonHugePages: 14336 kB

如果 AnonHugePages > 0 同样表示启用了透明大页

note:If Transparent HugePages is removed from the kernel, then neither /sys/
kernel/mm/transparent_hugepage nor /sys/kernel/mm/
redhat_transparent_hugepage files exist.

To disable Transparent HugePages:
1. For Oracle Linux 7 and Red Hat Enterprise Linux 7, add or modify the
transparent_hugepage=never parameter in the /etc/default/grub file:
transparent_hugepage=never
For example:
vi /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet numa=off transparent_hugepage=never"
GRUB_DISABLE_RECOVERY="true"


2. Run the grub2–mkconfig command to regenerate the grub.cfg file.
# grub2-mkconfig -o /boot/grub2/grub.cfg
3. Restart the system to make the changes permanent

4.Verify
[root@server1 ~]# more /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
[root@server1 ~]# grep AnonHugePages /proc/meminfo
AnonHugePages: 0 kB





如果报以下错误,可能是/boot空间不足:
root@localhost GPU]# init 3

Broadcast message from systemd-journald@localhost.localdomain (Wed 2017-09-20 11:26:40 CST):

dracut[11820]: dracut: creation of /boot/initramfs-3.10.0-693.2.2.el7.x86_64kdump.img failed

Message from syslogd@localhost at Sep 20 11:26:40 ...
dracut:dracut: creation of /boot/initramfs-3.10.0-693.2.2.el7.x86_64kdump.img failed


[root@localhost boot]# df /boot

[root@localhost boot]# rpm -qa|grep kernel

卸载老版本内核:
[root@localhost boot]# rpm -e kernel-3.10.0-514.el7.x86_64 kernel-3.10.0-514.26.2.el7.x86_64

[root@localhost boot]# yum remove kernel-3.10.0-957.el7.x86_64
八、验证磁盘调度
1
如果使用ASM共享存储,则需要使用deadline调度
九、创建用户和组
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
如果没有使用到ASM,则不需要创建asmdba,asmoper
/usr/sbin/groupadd -g 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper

创建组:
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 dgdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/groupadd -g 54330 racdba

创建用户:
# /usr/sbin/useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba oracle

修改用户属主:
# /usr/sbin/usermod -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba[,oper] oracle
十、创建目录
1
2
3
4
mkdir -p /opt/oracle19c/product/19.3.0/db_1
mkdir -p /opt/oracle19c/oraInventory
chown -R oracle.oinstall /opt/oracle19c
chmod -R 755 /opt/oracle19c
十一、配置用户环境变量
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
[oracle@server1 ~]$ vi .bash_profile 

export TEMP=/tmp
export TMPDIR=/tmp

export ORACLE_BASE=/opt/oracle19c
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/db_1
export ORACLE_SID=orcl
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH


umask 022




如果不是全新安装,则需要unset环境变量:
unset ORACLE_BASE
unset ORACLE_HOME
unset ORACLE_SID
unset ORA_CRS_HOME
unset ORA_NLS10
unset TNS_ADMIN
移除环境变量PATH中$ORACLE_HOME/bin
十二、配置用户资源限制
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
[root@server2 ~]#  vi /etc/security/limits.conf

注意: centos7.6添加路径为/etc/security/limits.d/,级别优先etc/security/

[root@server2 ~]# vi /etc/security/limits.d/20-nproc.conf

oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728

oracle soft memlock (使用HugePage:90%Mem,单位KB.不使用HuagePages:3145728 (3G),maximum of 128GB on x86_64 or 3GB on x86 OR 90 % of RAM)
oracle hard memlock (使用HugePage:90%Mem,单位KB.不使用HuagePages:3145728 (3G),maximum of 128GB on x86_64 or 3GB on x86 OR 90 % of RAM)



要使 limits.conf 文件配置生效,必须要确保 pam_limits.so 文件被加入到启动文件中(Oracle19c没有要求):

[root@server1 ~]# locate pam_limits.so
/usr/lib64/security/pam_limits.so

[root@server1 ~]# vi /etc/pam.d/login
session required pam_limits.so


1. Log in as an installation owner.
2. Check the soft and hard limits for the file descriptor setting. Ensure that the result
is in the recommended range. For example:
$ ulimit -Sn
1024
$ ulimit -Hn
65536
3. Check the soft and hard limits for the number of processes available to a user.
Ensure that the result is in the recommended range. For example:
$ ulimit -Su
2047
$ ulimit -Hu
16384
4. Check the soft limit for the stack setting. Ensure that the result is in the
recommended range. For example:
$ ulimit -Ss
10240
$ ulimit -Hs
32768






提高用户shell限制(不做此步):

/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

十三、配置内核参数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
vi /etc/sysctl.d/97-oracle-database-sysctl.conf

net.ipv4.neigh.default.base_reachable_time_ms = 600000
net.ipv4.neigh.default.mcast_solicit = 20
net.ipv4.neigh.default.retrans_time_ms = 250
net.ipv4.conf.eth0.rp_filter=0
net.ipv4.conf.eth1.rp_filter=0
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_fastopen=3
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr




fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500




执行以下命令使用内核生效:

/sbin/sysctl --system
/sbin/sysctl -a


net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304


十四、针对隐藏文件配置错误输出
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
如果安装RAC或Grid需要配置:
During an Oracle Grid Infrastructure installation, OUI uses SSH to run commands and
copy files to the other nodes. During the installation, hidden files on the system (for
example, .bashrc or .cshrc) can cause makefile and other installation errors if they
contain terminal output commands.
To avoid this problem, you must modify hidden files in each Oracle installation owner
user home directory to suppress all output on STDOUT or STDERR (for example, stty,
xtitle, and other such commands) as in the following examples:

Bourne, Bash, or Korn shell:

if [ -t 0 ]; then
stty intr ^C
fi

C shell:

test -t 0
if ($status == 0) then
stty intr ^C
endif


note:If the remote shell can load hidden files that contain stty commands, then
OUI indicates an error and stops the installation.




[oracle@server1 ~]$ vi .bash_profile

if [ -t 0 ]; then
stty intr ^C
fi

[oracle@server1 ~]$ source .bash_profile

十五、静默安装Oracle19c
1.静默参数介绍
oracle.install.option=INSTALL_DB_SWONLY 指定安装选项: INSTALL_DB_SWONLY: 仅安装数据库 INSTALL_DB_AND_CONFIG: 安装并配置数据库 UPGRADE_DB: 更新数据库
ORACLE_HOSTNAME=imzcy 指定Oracle主机名
UNIX_GROUP_NAME=oinstall 指定安装Oracle的组名称
INVENTORY_LOCATION=/db/app/oracle/inventory 指定INVENTORY目录位置(存储每个产品所安装的组件及补丁程序信息)
SELECTED_LANGUAGES=en,zh_CN 指定查询语言
ORACLE_HOME=/db/app/oracle/product/11.2.0 指定oracle家目录位置
ORACLE_BASE=/db/app/oracle 指定oracle基本目录
oracle.install.db.InstallEdition=EE 指定oracle安装类型: EE: .企业版(Enterprise Edition) SE: .标准版(Standard Edition) SEONE: 标准版第二版(Standard Edition One) PE: .个人版(Personal Edition)仅windows系统有
oracle.install.db.DBA_GROUP=dba 定义DBA组
oracle.install.db.OPER_GROUP=dba 定义OPER组
DECLINE_SECURITY_UPDATES=true 禁用安全更新
2.静默安装数据库软件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/opt/oracle19c/product/19.3.0/db_1/install/response/db_install.rsp

[root@server1 soft]# unzip LINUX.X64_193000_db_home.zip -d /opt/oracle19c/product/19.3.0/db_1/
[root@server1 ~]# chown -R oracle.oinstall /opt/oracle19c/
[root@server1 ~]# chmod -R 755 /opt/oracle19c/


[oracle@centos ~]$ cd $ORACLE_HOME/install/response
[oracle@centos response]$ ll
total 20
-rwxr-xr-x 1 oracle oinstall 19932 Feb 6 2019 db_install.rsp

[oracle@centos response]$ cp db_install.rsp /home/oracle/db.rsp

[oracle@centos response]$ chmod 600 /home/oracle/db.rsp

[oracle@centos response]$ grep -v '#' /home/oracle/db.rsp|tr -s '\n'

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=
UNIX_GROUP_NAME=
INVENTORY_LOCATION=
ORACLE_HOME=
ORACLE_BASE=
oracle.install.db.InstallEdition=
oracle.install.db.OSDBA_GROUP=
oracle.install.db.OSOPER_GROUP=
oracle.install.db.OSBACKUPDBA_GROUP=
oracle.install.db.OSDGDBA_GROUP=
oracle.install.db.OSKMDBA_GROUP=
oracle.install.db.OSRACDBA_GROUP=
oracle.install.db.rootconfig.executeRootScript=
oracle.install.db.rootconfig.configMethod=
oracle.install.db.rootconfig.sudoPath=
oracle.install.db.rootconfig.sudoUserName=
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.ConfigureAsContainerDB=
oracle.install.db.config.PDBName=
oracle.install.db.config.starterdb.characterSet=
oracle.install.db.config.starterdb.memoryOption=
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.password.PDBADMIN=
oracle.install.db.config.starterdb.managementOption=
oracle.install.db.config.starterdb.omsHost=
oracle.install.db.config.starterdb.omsPort=
oracle.install.db.config.starterdb.emAdminUser=
oracle.install.db.config.starterdb.emAdminPassword=
oracle.install.db.config.starterdb.enableRecovery=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=



[oracle@centos response]$ vi /home/oracle/db.rsp

[oracle@centos response]$ grep -v '#' /home/oracle/db.rsp|tr -s '\n'

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_HOME=/opt/oracle19c/product/19.3.0/db_1
ORACLE_BASE=/opt/oracle19c
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=
oracle.install.db.rootconfig.configMethod=
oracle.install.db.rootconfig.sudoPath=
oracle.install.db.rootconfig.sudoUserName=
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=
oracle.install.db.config.starterdb.SID=
oracle.install.db.ConfigureAsContainerDB=
oracle.install.db.config.PDBName=
oracle.install.db.config.starterdb.characterSet=
oracle.install.db.config.starterdb.memoryOption=
oracle.install.db.config.starterdb.memoryLimit=
oracle.install.db.config.starterdb.installExampleSchemas=
oracle.install.db.config.starterdb.password.ALL=
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.password.PDBADMIN=
oracle.install.db.config.starterdb.managementOption=
oracle.install.db.config.starterdb.omsHost=
oracle.install.db.config.starterdb.omsPort=
oracle.install.db.config.starterdb.emAdminUser=
oracle.install.db.config.starterdb.emAdminPassword=
oracle.install.db.config.starterdb.enableRecovery=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=



[oracle@server1 ~]$ cd /opt/oracle19c/product/19.3.0/db_1/

[oracle@centos db_1]$ ./runInstaller -silent -responseFile /home/oracle/db.rsp
Launching Oracle Database Setup Wizard...

The response file for this session can be found at:
/opt/oracle19c/product/19.3.0/db_1/install/response/db_2020-04-14_11-24-39AM.rsp

You can find the log of this install session at:
/opt/oracle12c/oraInventory/logs/InstallActions2020-04-14_11-24-39AM/installActions2020-04-14_11-24-39AM.log

As a root user, execute the following script(s):
1. /opt/oracle19c/product/19.3.0/db_1/root.sh

Execute /opt/oracle19c/product/19.3.0/db_1/root.sh on the following nodes:
[centos]


Successfully Setup Software.


[root@centos soft]# /opt/oracle19c/product/19.3.0/db_1/root.sh
十六、静默创建数据库
1.静默参数介绍
-silent 以静默方式运行Oracle Universal Installer
-createDatabase 创建数据库
-templateName General_Purpose.dbc 使用模板文件General_Purpose.dbc来创建数据库(模板文件存放在此目录下: $ORACLE_HOME/assistants/dbca/templates/)
-gdbname ZCYDB 指定全局数据库名称
-sid ZCY 指定数据库SID
-sysPassword Abc1230 指定sys用户的密码
-systemPassword Abc1230 指定system用户的密码
-datafileDestination /db/app/oracle/oradata/ 指定数据文件位置
-redoLogFileSize 50 每个日志文件的大小(MB)
-recoveryAreaDestination /db/app/oracle/flash_recovery_area 指定恢复区位置
-storageType FS 指定存储类型,有效值:FS、ASM,默认值FS
-characterSet ZHS16GBK 指定数据库的字符集
-nationalCharacterSet AL16UTF16 指定数据库的国家字符集
-sampleSchema true 指定是否安装示例数据(SCOTT)
-memoryPercentage 40 用于Oracle的物理内存百分比
-totalMemory 1024 为Oracle分配的内存(MB)
-databaseType OLTP 数据库类型,OLTP(多用途数据仓库)
2.静默创建数据库
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/opt/oracle19c/product/19.3.0/db_1/assistants/dbca/dbca.rsp

[oracle@centos ~]$ grep -v '#' /opt/oracle19c/product/19.3.0/db_1/assistants/dbca/dbca.rsp|tr -s '\n'
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
gdbName=
sid=
databaseConfigType=
RACOneNodeServiceName=
policyManaged=
createServerPool=
serverPoolName=
cardinality=
force=
pqPoolName=
pqCardinality=
createAsContainerDatabase=
numberOfPDBs=
pdbName=
useLocalUndoForPDBs=
pdbAdminPassword=
nodelist=
templateName=
sysPassword=
systemPassword=
oracleHomeUserPassword=
emConfiguration=
emExpressPort=5500
runCVUChecks=
dbsnmpPassword=
omsHost=
omsPort=
emUser=
emPassword=
dvConfiguration=
dvUserName=
dvUserPassword=
dvAccountManagerName=
dvAccountManagerPassword=
olsConfiguration=
datafileJarLocation=
datafileDestination=
recoveryAreaDestination=
storageType=
diskGroupName=
asmsnmpPassword=
recoveryGroupName=
characterSet=
nationalCharacterSet=
registerWithDirService=
dirServiceUserName=
dirServicePassword=
walletPassword=
listeners=
variablesFile=
variables=
initParams=
sampleSchema=
memoryPercentage=
databaseType=
automaticMemoryManagement=
totalMemory=



[oracle@centos ~]$ cp /opt/oracle19c/product/19.3.0/db_1/assistants/dbca/dbca.rsp /home/oracle/dbca.rsp
[oracle@centos ~]$ chmod 600 /home/oracle/dbca.rsp

[oracle@centos ~]$ grep -v '#' /home/oracle/dbca.rsp |tr -s '\n'
responseFileVersion=/oracle/assistants/rspfmt_dbca_response_schema_v19.0.0
gdbName=orcl
sid=orcl
databaseConfigType=
RACOneNodeServiceName=
policyManaged=
createServerPool=
serverPoolName=
cardinality=
force=
pqPoolName=
pqCardinality=
createAsContainerDatabase=true
numberOfPDBs=1
pdbName=xprod
useLocalUndoForPDBs=
pdbAdminPassword=oracle
nodelist=
templateName=General_Purpose.dbc
sysPassword=oracle
systemPassword=oracle
oracleHomeUserPassword=
emConfiguration=
emExpressPort=5500
runCVUChecks=
dbsnmpPassword=
omsHost=
omsPort=
emUser=
emPassword=
dvConfiguration=
dvUserName=
dvUserPassword=
dvAccountManagerName=
dvAccountManagerPassword=
olsConfiguration=
datafileJarLocation=
datafileDestination=/opt/oracle19c/Ora19cData
recoveryAreaDestination=
storageType=
diskGroupName=
asmsnmpPassword=
recoveryGroupName=
characterSet=Al32utf8
nationalCharacterSet=AL16UTF16
registerWithDirService=
dirServiceUserName=
dirServicePassword=
walletPassword=
listeners=
variablesFile=
variables=
initParams=
sampleSchema=
memoryPercentage=
databaseType=
automaticMemoryManagement=true
totalMemory=



[oracle@centos ~]$ dbca -silent -createDatabase -responseFile /home/oracle/dbca.rsp


[oracle@dbmon ~]$ dbca -silent -createDatabase -responseFile /home/oracle/dbca.rsp
[FATAL] [DBT-10503] 未指定模板文件。

[oracle@dbmon ~]$ ll /u01/app/oracle/product/19.3.0/db_1/assistants/dbca/templates/
总用量 370964
-rw-r----- 1 oracle oinstall 4888 4月 17 2019 Data_Warehouse.dbc
-rw-r----- 1 oracle oinstall 4768 4月 17 2019 General_Purpose.dbc
-rw-r----- 1 oracle oinstall 10772 4月 6 2019 New_Database.dbt
-rw-r----- 1 oracle oinstall 86548480 4月 17 2019 pdbseed.dfb
-rw-r----- 1 oracle oinstall 6611 4月 17 2019 pdbseed.xml
-rw-r----- 1 oracle oinstall 18726912 4月 17 2019 Seed_Database.ctl
-rw-r----- 1 oracle oinstall 274554880 4月 17 2019 Seed_Database.dfb

如果提示未指定模板文件,则参数里填写模板名称:
templateName=General_Purpose.dbc


[oracle@dbmon ~]$ dbca -silent -createDatabase -responseFile /home/oracle/dbca.rsp
[FATAL] [DBT-11211] 当物理内存总量大于 4GB 时, 不允许使用自动内存管理选项。
原因: 当前的物理内存总量为 15GB。
automaticMemoryManagement=FALSE


[oracle@dbmon ~]$ dbca -silent -createDatabase -responseFile /home/oracle/dbca.rsp
[WARNING] [DBT-00108] 传递给命令行参数的值不正确。
原因: 遇到异常错误: cvc-datatype-valid.1.2.1: '8G' 不是 'integer' 的有效值。
cvc-type.3.1.3: 元素 'totalMemory' 的值 '8G' 无效

totalMemory=8000
后面不需要带单位,默认是MB
十七、静默卸载数据库
1
[oracle@dbmon ~]$ dbca -silent -deleteDatabase -sourceDB oracle -sysDBAUserName sys -sysDBAPassword oracle
  • Title: Oracle19c静默安装
  • Author: 𝓓𝓸𝓷
  • Created at : 2024-06-10 16:30:47
  • Updated at : 2024-07-20 05:15:41
  • Link: https://www.zhangdong.me/oracle19c-silent-installation.html
  • License: This work is licensed under CC BY-NC-SA 4.0.
评论