##关闭SELINUX 编辑selinux的配置文件
[root@DB229 ~]#vi /etc/selinux/config
#注释掉下面两行
#SELINUX=enforcing
#SELINUXTYPE=targeted
#增加一行
SELINUX=disabled
[root@DB229 ~]# java -version
java version "1.8.0_181"
# 配置/etc/hosts
[root@DB229 ~]$ cat /etc/hosts
#add
192.168.1.196 DB196 DB196.COM
192.168.1.197 DB197 DB197.COM
192.168.1.229 DB229 DB229.COM
[root@DB229 ~]# cat /etc/hostname
DB229.COM
[root@DB229 ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=DB229
[root@DB229 ~]# groupadd oinstall
[root@DB229 ~]# groupadd dba
[root@DB229 ~]# groupadd oper
[root@DB229 ~]# useradd -g oinstall -G dba,oper oracle
[root@DB229 ~]# echo "mp123mp456" | passwd --stdin oracle #oracle用户的登录密码,后续登录要用,记着。
[root@DB229 ~]# cat /etc/sysconfig/iptables
#add
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
[root@DB196 ~]# service iptables restart
#创建安装目录
[root@DB229 ~]# mkdir -p /u01/app/
[root@DB229 ~]# mkdir -p /u01/tmp/
[root@DB229 ~]# mkdir -p /u01/setup/
[root@DB229 ~]# chown -R oracle:oinstall /u01/app/
[root@DB229 ~]# chown -R oracle:oinstall /u01/tmp/
[root@DB229 ~]# chown -R oracle:oinstall /u01/setup/
[root@DB229 ~]# chmod -R 775 /u01/app/
[root@DB229 ~]# chmod -R 775 /u01/tmp/
[root@DB229 ~]# chmod -R 775 /u01/setup/
[root@DB229 ~]# free -m
total used free shared buffers cached
Mem: 3823 144 3678 0 6 45
[root@DB229 ~]# vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 3145728
oracle hard memlock 3145728
[root@DB229 ~]# vi /etc/pam.d/login,添加:
session required pam_limits.so
修改ulimit:
[root@DB229 ~]# vi /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
[root@DB196 ~]# vim /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 2147483648 # 1610612736 #物理内存一半
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@DB229 ~]# sysctl -p
yum install binutils gcc gcc-c++ compat-libstdc++-33 glibc glibc.i686 glibc-devel ksh libgcc.i686 libstdc++-devel libaio libaio.i686 libaio-devel libaio-devel.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat compat-libcap1 –y
yum-yinstalllibXrender
[root@DB229 ~]# su - oracle
[oracle@DB229 ~]$ vim /home/oracle/.bash_profile
--------------------------------------------------------------------
# User specific environment and startup programs
export DISPLAY=10.0.0.85:0.0
TMP=/u01/tmp
TMPDIR=/u01/tmp
export TMP TMPDIR
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/client_1
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:/sbin:/usr/bin:/usr/sbin
export LANG="en-US.UTF-8"
export NLS_LANG=american_AMERICA.UTF8
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
-------------------------------------------------------------------------
source /home/oracle/.bash_profile
#上傳 linuxx64_12201_client.zip 到 /u01/setup 下
[oracle@DB229 setup]$ unzip linuxx64_12201_client.zip
[oracle@DB229 database]$ ./runInstaller
[oracle@DB229 client_1]$ cd $ORACLE_HOME/network/admin
[oracle@DB229 admin]$ pwd
/u01/app/oracle/product/12.2.0/client_1/network/admin
[oracle@DB229 admin]$ cat tnsnames.ora
PL =
(DESCRIPTION =
(SDU=32767)(SEND_BUF_SIZE=9375000)(RECV_BUF_SIZE=9375000)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DB196)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = MPCDB196_DGMGRL)
)
)
SL =
(DESCRIPTION =
(SDU=32767)(SEND_BUF_SIZE=9375000)(RECV_BUF_SIZE=9375000)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DB197)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = MPCDB197_DGMGRL)
)
)
[oracle@DB229 admin]$ dgmgrl sys/MPCDB@SL
DGMGRL> show configuration;
Configuration - ADGbroker
Protection Mode: MaxAvailability
Members:
MPCDB196 - Primary database
MPCDB197 - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS (status updated 76 seconds ago)
这个是后台启动的方式 :
nohup dgmgrl sys/xxxxxx@SL "start observer file=FSFO.dat">>observer.log 2>&1 &