@clisdodo
2019-11-17T22:51:41.000000Z
字数 8172
阅读 3335
OEL7.7
EMCC13
Oracle19c
AskScuti :搭建类 2级-EM EMCC 13.3 在 OEL 7.7 上的安装
环境 | 服务端 | 客户端 |
---|---|---|
主机名 | emcc | askscuti |
IP | 192.168.1.113 | 192.168.1.10 |
OS | OEL 7.7 | CentOS 8 |
数据库 | 19.3.0.0.0 | 19.3.0.0.0 |
Container | Non-CDB | CDB |
PDB_NAME | / | ORDERS |
ORACLE_SID | emcc13 | CDB19c |
磁盘分区 | 大小 | 挂载目录 | 作用 |
---|---|---|---|
/dev/sdb1 | 50G | /u01 | 安装文档资料数据库 |
/dev/sdc1 | 100G | /cloud | 安装EMCC |
/dev/sdd1 | 50G | /soft | 单独存放软件 |
/dev/sde1 | 20G | /tmp | At least 12289 MB of free space |
编辑 /etc/hosts
文件,添加 IP 及对应主机名
echo "192.168.1.113 emcc" >> /etc/hosts
/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 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper
/usr/sbin/groupadd -g 54329 asmadmin
/usr/sbin/useradd -u 54330 -g oinstall -G dba,oper,backupdba,dgdba,asmadmin oracle
# passwd oracle
mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01
chmod -R 775 /u01
mkdir -p /cloud/app/oracle/product/13c/db
mkdir -p /cloud/app/oracle/middleware
mkdir -p /cloud/app/oracle/agent
chown -R oracle:oinstall /cloud/app
chmod -R 755 /cloud/app
# 本地 YUM 源配置
mount /dev/cdrom /mnt
mv /etc/yum.repos.d/* /tmp
echo "[local_yum]" >> /etc/yum.repos.d/scuti.repo
echo "name = scuti" >> /etc/yum.repos.d/scuti.repo
echo "baseurl = file:///mnt/" >> /etc/yum.repos.d/scuti.repo
echo "enabled = 1" >> /etc/yum.repos.d/scuti.repo
echo "gpgcheck = 0" >> /etc/yum.repos.d/scuti.repo
yum repolist all
# 相关包
yum -y install autoconf
yum -y install automake
yum -y install binutils
yum -y install binutils-devel
yum -y install bison
yum -y install cpp
yum -y install dos2unix
yum -y install ftp
yum -y install gcc
yum -y install gcc-c++
yum -y install lrzsz
yum -y install python-devel
yum -y install compat-libcap1
yum -y install compat-libstdc++-33
yum -y install compat-libstdc++-33.i686
yum -y install glibc-*
yum -y install glibc-*.i686
yum -y install libXpm-*.i686
yum -y install libXext
yum -y install libXext.i686
yum -y install libXtst
yum -y install libXtst.i686
yum -y install libX11
yum -y install libX11.i686
yum -y install libXau
yum -y install libXau.i686
yum -y install libxcb
yum -y install libxcb.i686
yum -y install libXi
yum -y install libXi.i686
yum -y install libstdc++.i686
yum -y install libstdc++-devel
yum -y install libstdc++-devel.i686
yum -y install libaio
yum -y install libaio.i686
yum -y install libaio-devel
yum -y install libaio-devel.i686
yum -y install ksh
yum -y install libXp
yum -y install libaio-devel
yum -y install numactl
yum -y install numactl-devel
yum -y install make -y
yum -y install sysstat -y
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install elfutils-libelf-devel
yum -y install redhat-lsb-core
yum -y install unzip
yum install -y libXrender
yum install -y libXrender-devel
yum install -y nfs-utils
yum install -y smartmontools
编辑 /etc/security/limits.conf
文件,添加以下内容,内存大于8G需配置大内存页,当前内存环境大小 16G
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 16384
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 8192000
oracle soft memlock 8192000
echo "session required pam_limits.so" >> /etc/pam.d/login
编辑 /etc/sysctl.conf
文件,注意 shmmax
和 shmall
参数,修改建议请参考阿里云12cR2内核参数章节。
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmax = 15461882265
kernel.shmall = 3774873
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 = 1048586
kernel.panic_on_oops = 1
使之生效
sysctl -p
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
编辑 /etc/selinux/config
文件
SELINUX=disabled
# 切换 oracle 用户
# 编辑 .bash_profile 添加以下行
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_UNQNAME=emcc13
ORACLE_SID=emcc13; export ORACLE_SID
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
umask=022
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
注意:从 oracle 18c 开始,必须把压缩文件解压到 $ORACLE_HOME 里面,点我查看官方文档
su - root
chown -R oracle:oinstall /soft
chmod -R 775 /soft
su - oracle
cd $ORACLE_HOME
unzip -q /soft/19c-V982063-01.zip
./runInstaller -ignorePrereq -waitforcompletion -silent \
-responseFile /u01/app/oracle/product/19.3.0/dbhome_1/install/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/u01/app/oraInventory \
SELECTED_LANGUAGES=en,en_GB \
ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1 \
ORACLE_BASE=/u01/app/oracle \
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=dba \
oracle.install.db.OSRACDBA_GROUP=dba \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true
# 切换 root 用户执行脚本
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
netca -silent -responseFile /u01/app/oracle/product/19.3.0/dbhome_1/assistants/netca/netca.rsp
执行命令 netca
dbca -silent -createDatabase -templateName General_Purpose.dbc \
-gdbname emcc13 \
-sid emcc13 \
-databaseConfigType SI \
-sysPassword oracle \
-systemPassword oracle \
-characterSet AL32UTF8 \
-memoryPercentage 30
执行命令 dbca
# 文档资料数据库参数设置
alter user dbsnmp identified by oracle account unlock;
alter system set shared_pool_size=800m;
alter system set "_allow_insert_with_update_check"=true;
alter system set session_cached_cursors=300 scope=spfile;
alter system set open_cursors=350 scope=spfile;
alter system set job_queue_processes=22 scope=spfile;
# 更改日志组大小:添加 4/5/6
select a.group#,a.status,b.member from v$log a,v$logfile b where a.group#=b.group#;
alter database add logfile group 4('/u01/app/oracle/oradata/EMCC13/redo04a.log','/u01/app/oracle/oradata/EMCC13/redo04b.log') size 500M;
alter database add logfile group 5('/u01/app/oracle/oradata/EMCC13/redo05a.log','/u01/app/oracle/oradata/EMCC13/redo05b.log') size 500M;
alter database add logfile group 6('/u01/app/oracle/oradata/EMCC13/redo06a.log','/u01/app/oracle/oradata/EMCC13/redo06b.log') size 500M;
# 将 CURRENT 切换至新日志组
alter system switch logfile;
# 执行完全检查点,刷缓存数据变更日志组状态为 INACTIVE
alter system checkpoint;
# 删除 1/2/3 日志组
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
!rm -rf /u01/app/oracle/oradata/EMCC13/redo01.log
!rm -rf /u01/app/oracle/oradata/EMCC13/redo02.log
!rm -rf /u01/app/oracle/oradata/EMCC13/redo03.log
su - root
chown -R oracle:oinstall /soft
chmod -R 775 /soft
su - oracle
cd /soft
./em13300_linux64.bin
服务端编辑 /etc/hosts
添加客户端主机名及IP
[root@emcc ~]# echo "192.168.1.10 askscuti" >> /etc/hosts
客户端(代理)编辑 /etc/hosts
添加服务端主机名及IP
[root@askscuti ~]# echo "192.168.1.113 emcc" >> /etc/hosts
客户端(代理)创建 Agent 目录
[root@askscuti ~]# mkdir -p /opt/oracle/emccagent
[root@askscuti ~]# chown -R oracle:oinstall /opt/oracle/emccagent
[root@askscuti ~]# chmod -R 755 /opt/oracle/emccagent
客户端(代理)编辑 /etc/sudoers
添加权限
[root@askscuti ~]# cp /etc/sudoers /etc/sudoers.bak
[root@askscuti ~]# vim /etc/sudoers
修改原
# Refuse to run if unable to disable echo on the tty.
Defaults !visiblepw
为
Defaults visiblepw
修改原
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
为
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
oracle ALL=(ALL) ALL
登录 EMCC : sysman/xxxxxx
Targets - Hosts
进行查看主机状态修改受控数据库用户 DBSNMP
SQL> alter user dbsnmp identified by oracle account unlock;
User altered.
Targets - Databases
查看数据库状态查看官方文档,去探索 EMCC 的强大之处 [End]