一,基本环境配置
01,hosts
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.240 SHLPDBWX01
192.168.0.241 SHLPDBWX02
172.168.0.240 SHLPDBWX01-priv
172.168.0.241 SHLPDBWX02-priv
192.168.0.243 SHLPDBWX01-vip
192.168.0.244 SHLPDBWX02-vip
192.168.0.242 dgwxpdb dgwxpdb.localdomain
02,用户环境配置
groupadd –g 501 oinstall
useradd oracle –u 500 –g oinstall
echo 123456|passwd --stdin oracle
03,配置目录
cat .bash_profile
PATH=$PATH:$HOME/bin
ORACLE_BASE=/u01/app/oracle
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=WXPDB01
export PATH=$PATH:$ORA_CRS_HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:.
alias sqlplus='rlwrap sqlplus' # oracle sqlpls
alias rman='rlwrap rman' # oracle rman
alias ggsci='rlwrap ggsci' # oracle goldengate
stty erase ^h
export PATH
创建目录授予权限
mkdir /u01/app/oracle/product/10.2.0/db_1 -p
chown -R oracle.oinstall /u01/
chmod -R 755 /u01/
04,磁盘配置
05,配置参数
vi /etc/sysctl.conf
kernel.core_uses_pid = 1
fs.file-max = 65536
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
kernel.shmmni = 4096
kernel.sem = 500 64000 100 128
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
06,安装包检测
检测
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
compat-libstdc++ \
elfutils-libelf-devel \
elfutils-libelf-devel-static \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
kernel-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libgomp \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel \
libXp
缺少的对应安装 10C的包可能有的需要i686
通过RPm包安装
07,配置互信
[oracle@SHLPDBWX01 ~]$ mkdir ~/.ssh
mkdir: cannot create directory `/home/oracle/.ssh': File exists
[oracle@SHLPDBWX01 ~]$ chmod 700 ~/.ssh
[oracle@SHLPDBWX01 ~]$ cd .ssh/
下面这命令双截点操作(就下面一条)
[oracle@SHLPDBWX01 .ssh]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_rsa.
Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.
The key fingerprint is:
b1:17:b3:dd:7b:43:8b:8b:7c:06:22:58:c0:29:aa:0a oracle@SHLPDBWX01
The key's randomart image is:
+--[ RSA 2048]----+
| . . |
| . + |
| . . . . o |
| . . o = . |
|. o S o . .. |
|E . . o . o..|
|o . . ...o.|
|. . .o...|
| oo. |
+-----------------+
[oracle@SHLPDBWX01 .ssh]$ ssh SHLPDBWX01 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
The authenticity of host 'shlpdbwx01 (192.168.0.240)' can't be established.
RSA key fingerprint is 11:46:62:ee:23:09:da:62:5f:ae:92:ee:19:6e:0c:4a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'shlpdbwx01,192.168.0.240' (RSA) to the list of known hosts.
oracle@shlpdbwx01's password:
[oracle@SHLPDBWX01 .ssh]$ ssh SHLPDBWX02 cat /home/oracle/.ssh/id_rsa.pub >> authorized_keys
The authenticity of host 'shlpdbwx02 (192.168.0.241)' can't be established.
RSA key fingerprint is 11:46:62:ee:23:09:da:62:5f:ae:92:ee:19:6e:0c:4a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'shlpdbwx02,192.168.0.241' (RSA) to the list of known hosts.
oracle@shlpdbwx02's password:
[oracle@SHLPDBWX01 .ssh]$ chmod 600 ~/.ssh/authorized_keys
[oracle@SHLPDBWX01 .ssh]$ scp authorized_key SHLPDBWX02:/home/oracle/.ssh/
oracle@shlpdbwx02's password:
authorized_key: No such file or directory
[oracle@SHLPDBWX01 .ssh]$ scp authorized_keys SHLPDBWX02:/home/oracle/.ssh/
oracle@shlpdbwx02's password:
authorized_keys 100% 798 0.8KB/s 00:00
[oracle@SHLPDBWX01 .ssh]$ ssh SHLPDBWX01 date
Wed Jun 5 16:36:06 CST 2019
[oracle@SHLPDBWX01 .ssh]$ ssh SHLPDBWX02 date
Wed Jun 5 16:36:09 CST 2019