一、软件准备
名称 |
版本号 |
软件包 |
OS |
7.6 |
CentOS Linux release 7.6.1810 (Core) |
Oracle Database 19c |
19.3 |
LINUX.X64_193000_db_home.zip |
Oracle Enterprise Cloud Control |
13.3.0.0 |
em13300_linux64.bin em13300_linux64-2.zip em13300_linux64-3.zip em13300_linux64-4.zip em13300_linux64-5.zip em13300_linux64-6.zip |
Database Template |
最新版本18.1,不使用模板建库 |
|
Weblogic Server |
不需要,EMCC中自带该软件 |
|
JDK |
8.0.211(不要用12版本的) |
jdk-8u211-linux-x64.rpm |
下载网址如下:
Oracle Database 19c Software Downloads:
https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
Oracle Enterprise Manager Cloud Control 13c Release 3 Downloads:
https://www.oracle.com/technetwork/oem/enterprise-manager/downloads/index.html
Database Template (with EM 13.3.0.0 repository pre-configured) for Installing Oracle Enterprise Manager Cloud Control 13c Release 3 (13.3.0.0) Downloads:(最高只有18.1)
https://www.oracle.com/technetwork/oem/enterprise-manager/downloads/dbtemplates-5043300.html
Oracle JDK 8u211 Downloads:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
1,修改主机名
[root@localhost ~]# hostnamectl status
Static hostname: localhost.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: 71a9ae0b9a1b47d79f124b53f2427c5b
Boot ID: 31040fec072d4b38aebaf2cd75471d1b
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-957.21.3.el7.x86_64
Architecture: x86-64
[root@localhost ~]# hostnamectl set-hostname gridcontrol
[root@localhost ~]# vi /etc/hosts
10.3.2.206 gridcontrol
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
2,关闭防火墙
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
3,配置yum工具
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
BAK CentOS7-Base-163.repo
[root@localhost yum.repos.d]# cp CentOS7-Base-163.repo CentOS7-Base-163.repo.bak
[root@localhost yum.repos.d]# vi CentOS7-Base-163.repo
--添加如下
[base]
name=CentOS-$releasever - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
[root@gridcontrol yum.repos.d]# yum list |more
--验证yum是否配置生效
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
4,配置VNC远程桌面连接
[root@gridcontrol yum.repos.d]# yum -y install vnc *vnc-server*
……
……
已安装:
tigervnc.x86_64 0:1.8.0-13.el7 tigervnc-server.x86_64 0:1.8.0-13.el7
tigervnc-server-applet.noarch 0:1.8.0-13.el7 tigervnc-server-minimal.x86_64 0:1.8.0-13.el7
tigervnc-server-module.x86_64 0:1.8.0-13.el7
……
完毕!
[root@gridcontrol yum.repos.d]# cd /lib/systemd/system/
[root@gridcontrol system]# ls |grep vncserver
[email protected]
[root@gridcontrol system]# cp vncserver\@.service vncserver\@.1.service
[root@gridcontrol system]# vi vncserver\@.1.service
……
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/home/root/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
……
[root@gridcontrol system]# systemctl daemon-reload
[root@gridcontrol system]# vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n
A view-only password is not used
[root@gridcontrol system]# vncserver :1 --启动vnc
xauth: file /root/.Xauthority does not exist
New 'gridcontrol:1 (root)' desktop is gridcontrol:1
Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/gridcontrol:1.log
[root@gridcontrol system]# vi /root/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/etc/X11/xinit/xinitrc
#vncserver -kill $DISPLAY
[root@gridcontrol system]# vncserver :1
New 'gridcontrol:1 (root)' desktop is gridcontrol:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/gridcontrol:1.log
[root@gridcontrol system]# vncserver -list
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:1 110621
[root@gridcontrol system]# netstat -ntlp |grep 5901
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 110621/Xvnc
tcp6 0 0 :::5901 :::* LISTEN 110621/Xvnc
1,hosts文件编辑
[root@gridcontrol ~]# hostname
gridcontrol
[root@gridcontrol ~]# more /etc/hosts
10.3.2.206 gridcontrol
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
2,vi /etc/sysctl.conf
[root@gridcontrol ~]# vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 6291456
kernel.shmmax = 21474836480
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
[root@gridcontrol ~]# /sbin/sysctl -p
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 6291456
kernel.shmmax = 21474836480
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
3,vi /etc/security/limits.d/oracle-database-preinstall-19c.conf
[root@gridcontrol ~]# vi /etc/security/limits.d/oracle-database-preinstall-19c.conf
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
4,安装必要的yum包
[root@gridcontrol ~]# yum install -y bc binutils compat-libcap1 compat-libstdc++-33 dtrace-utils elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc glibc-devel ksh libaio libaio-devel libdtrace-ctf-devel libXrender libXrender-devel libX11 libXau libXi libXtst libgcc librdmacm-devel libstdc++ libstdc++-devel libxcb make net-tools nfs-utils python python-configshell python-rtslib python-six targetcli smartmontools sysstat unixODBC
5,创建用户
[root@gridcontrol ~]# groupadd -g 54321 oinstall
[root@gridcontrol ~]# groupadd -g 54322 dba
[root@gridcontrol ~]# groupadd -g 54323 oper
[root@gridcontrol ~]# useradd -u 54321 -g oinstall -G dba,oper oracle
[root@gridcontrol ~]# passwd oracle
更改用户 oracle 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
6,/etc/selinux/config
[root@gridcontrol ~]# vi /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=enforcing
SELINUX=permissive
# 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@gridcontrol ~]# setenforce Permissive
7,创建相应的目录
[root@gridcontrol ~]# mkdir -p /u01/app/oracle/product/19.0.0/dbhome_1
[root@gridcontrol ~]# chown -R oracle:oinstall /u01
[root@gridcontrol ~]# chmod -R 775 /u01
8,编辑oracle的profile
[root@gridcontrol ~]# su - oracle
[oracle@gridcontrol ~]$ vi .bash_profile
#oracle setting
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=gridcontrol
export ORACLE_UNQNAME=OMRCDB
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=OMRCDB
export PDB_NAME=OMR
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
[oracle@gridcontrol ~]$ source ~/.bash_profile
9,上传oracle软件
[root@gridcontrol ~]#mkdir /soft
上传软件oracle_193000 LINUX.X64_193000_db_home.zip
[root@gridcontrol ~]# cd /soft
[root@gridcontrol ~]#mkdir oracle_193000
[root@gridcontrol soft]# unzip -d oracle_193000 LINUX.X64_193000_db_home.zip
[root@gridcontrol soft]# chown -R oracle.oinstall /soft
[root@gridcontrol soft]# chmod -R 775 /soft/
10,安装oracle软件
连接VNC工具
[root@gridcontrol ~]# xhost +
access control disabled, clients can connect from any host
[root@gridcontrol ~]# su - oracle
注意:19c的数据库软件位置默认和安装包在同一个目录,并且无法修改。移动安装包,并且重新安装
[oracle@gridcontrol ~]$ mv -f /soft/oracle_193000/* $ORACLE_BASE/product/19.0.0/dbhome_1/
[oracle@gridcontrol ~]$ cd $ORACLE_BASE/product/19.0.0/dbhome_1
[oracle@gridcontrol dbhome_1]$ ./runInstaller
ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
[oracle@gridcontrol dbhome_1]$exit
[root@gridcontrol ~]# xdpyinfo |grep name
name of display: :1
[root@gridcontrol ~]# su - oracle
[oracle@gridcontrol ~]$ export DISPLAY=:1
[oracle@gridcontrol ~]$ cd $ORACLE_BASE/product/19.0.0/dbhome_1
[oracle@gridcontrol dbhome_1]$ ./runInstaller
正在启动oracle数据库安装向导...
图形化安装直接下一步即可,(仅设置软件——单实例数据库安装——企业版——基目录:/u01/app/oracle——操作系统组——输入root口令自行运行脚本——先觉性检查——安装——关闭)
11,配置监听
[oracle@gridcontrol dbhome_1]$netca
Oracle Net Services 配置:
图形化安装直接下一步即可。
1,配置要求
2,DBCA建库
连接VNC工具
[oracle@gridcontrol ~]$ dbca
3,建库后参数修改
SQL> alter system set "_allow_insert_with_update_check"=true scope=both;
System altered.
SQL> alter system set session_cached_cursors =500 scope=spfile;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 9663672480 bytes
Fixed Size 12685472 bytes
Variable Size 1677721600 bytes
Database Buffers 7952400384 bytes
Redo Buffers 20865024 bytes
Database mounted.
Database opened.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 OMR MOUNTED
SQL> alter pluggable database OMR open read write;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 OMR READ WRITE NO
1,安装必要的rpm包
[root@gridcontrol soft]#yum -y install make binutils gcc libaio glibc-common libstdc sysstat glibc glibc-devel.i686 glibc-devel libXtst
2,上传软件
em13300_linux64.bin
em13300_linux64-2.zip
em13300_linux64-3.zip
em13300_linux64-4.zip
em13300_linux64-5.zip
em13300_linux64-6.zip
3,安装EMCC13c
连接VNC工具
[oracle@gridcontrol ~]$ cd /soft
[oracle@gridcontrol soft]$ ./em13300_linux64.bin
0%...........................................................................100%
Launcher log file is /tmp/OraInstall2019-07-05_09-11-30AM/launcher2019-07-05_09-11-30AM.log.
Starting Oracle Universal Installer
Checking if CPU speed is above 300 MHz. Actual 2000.000 MHz Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Checking swap space: must be greater than 512 MB. Actual 22527 MB Passed
Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required)
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2019-07-05_09-11-30AM
====Prereq Config Location main===
/tmp/OraInstall2019-07-05_09-11-30AM/stage/prereq
EMGCInstaller args -scratchPath
EMGCInstaller args /tmp/OraInstall2019-07-05_09-11-30AM
EMGCInstaller args -sourceType
EMGCInstaller args network
EMGCInstaller args -timestamp
EMGCInstaller args 2019-07-05_09-11-30AM
EMGCInstaller args -paramFile
EMGCInstaller args /tmp/sfx_tDXoRt/Disk1/install/linux64/oraparam.ini
EMGCInstaller args -nocleanUpOnExit
DiskLoc inside SourceLoc/soft
EMFileLoc:/tmp/OraInstall2019-07-05_09-11-30AM/oui/em/
ScratchPathValue :/tmp/OraInstall2019-07-05_09-11-30AM
这里的未执行原因是因为EMCC13c配置预检查文件中未设置当前的操作系统版本:
[oracle@gridcontrol prereq]$ cd /tmp/OraInstall2019-07-05_09-11-30AM/stage/prereq
[oracle@gridcontrol prereq]$ ll
total 836
-rw-r-----. 1 oracle oinstall 49925 Jul 5 09:11 agentInstallerPreChecks.jar
-rw-r-----. 1 oracle oinstall 30432 Jul 5 09:11 commonRefhost.xml
-rw-r-----. 1 oracle oinstall 27994 Jul 5 09:11 em_prereqs.xml
-rw-r-----. 1 oracle oinstall 3592 Jul 5 09:11 em_rulemap.xml
-rw-r-----. 1 oracle oinstall 534 Jul 5 09:11 knowledgesrc.xml
-rw-r-----. 1 oracle oinstall 132 Jul 5 09:11 LinuxVendors.xml
-rw-r-----. 1 oracle oinstall 115896 Jul 5 09:11 oms_prereq.jar
-rw-r-----. 1 oracle oinstall 590099 Jul 5 09:11 OraPrereqChecks.jar
-rw-r-----. 1 oracle oinstall 318 Jul 5 09:11 prerequisite.properties
-rw-r-----. 1 oracle oinstall 8739 Jul 5 09:11 rulemap.xml
[oracle@gridcontrol prereq]$ more commonRefhost.xml |grep "VERSION VALUE"
但是通过认证可以看到支持linux7版本的操作系统
只要确保当前的操作系统满足预检查要求,可以忽略安装
[root@gridcontrol soft]# more /proc/sys/net/ipv4/ip_local_port_range
9000 65500
[root@gridcontrol soft]# more /etc/sysctl.conf |grep file-max
fs.file-max = 6815744
[root@gridcontrol soft]# more /etc/security/limits.d/oracle-database-preinstall-19c.conf
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
[oracle@gridcontrol prereq]$ cd /u01/app
[oracle@gridcontrol app]$ ll
total 0
drwxrwxr-x. 9 oracle oinstall 112 Jul 1 14:50 oracle
drwxrwx---. 6 oracle oinstall 64 Jul 5 09:11 oraInventory
--创建中间件的位置
[oracle@gridcontrol app]$ mkdir weblogic
--创建代理基目录
[oracle@gridcontrol app]$ mkdir agent
(这里50%整整耗时快3h,日志一直不会显示,但是可以看到数据库里面有新对象生成)
[root@gridcontrol OraInstall2019-07-05_09-11-30AM]# /u01/app/weblogic/allroot.sh
Starting to execute allroot.sh .........
Starting to execute /u01/app/weblogic/root.sh ......
/etc exist
Creating /etc/oragchomelist file...
/u01/app/weblogic
Finished product-specific root actions.
/etc exist
Finished execution of /u01/app/weblogic/root.sh ......
Starting to execute /u01/app/agent/agent_13.3.0.0.0/root.sh ......
Finished product-specific root actions.
/etc exist
Finished execution of /u01/app/agent/agent_13.3.0.0.0/root.sh ......
(9点11开始安装,下午14点09装完,耗时5h!!!)
4,连接访问EMCC13c
附加添加完数据库目标后的监控页面: