参考文章
download
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c
版本19.3
centos改标识符
vim /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
chown -R oracle:oinstall /usr/local/oracle/oraclemain
chown -R oracle:oinstall /usr/local/oracle/inventory
chown -R oracle:oinstall /usr/local/oracle/src
[root@localhost oracle]# mkdir inventory
[root@localhost oracle]# mkdir src
[root@localhost oracle]# mkdir oraclemain
[root@localhost oracle]# chown -R oracle:oinstall /usr/local/oracle/oraclemain
[root@localhost oracle]# chown -R oracle:oinstall /usr/local/oracle/inventory
[root@localhost oracle]# chown -R oracle:oinstall /usr/local/oracle/src
[root@localhost oracle]#
[root@localhost oracle]# ll //usr/local/oracle
总用量 2988012
drwxr-xr-x. 2 oracle oinstall 4096 9月 17 00:28 inventory
-rw-r--r--. 1 root root 3059705302 9月 17 00:10 LINUX.X64_193000_db_home (1).zip
drwxr-xr-x. 2 oracle oinstall 4096 9月 17 00:29 oraclemain
drwxr-xr-x. 2 oracle oinstall 4096 9月 17 00:28 src
[root@localhost oracle]#
修改环境变量
export PATH
export ORACLE_BASE=/usr/local/oracle/oraclemain
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LANG=C
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
groupadd oinstall
# 创建dba用户组
groupadd dba
# 创建oper用户组
groupadd oper
# 为dba和oper用户组创建oracle用户
# -g 主用户组
# -G 附加组
useradd -g oinstall -G dba,oper oracle
# 将oracle用户的密码设置为oracle
echo "oracle"|passwd oracle --stdin
用户oracle
密码oracle
mkdir /home/oracle
vim /etc/sysctl.conf
# 添加如下内容
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
# kernel.shmmax 参数设置为物理内存的一半
kernel.shmmax = 1200000000
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 = 1048576
# 因为刚自定义配置了shmmax、shmmni、shmall,所以注释掉原有自带的shmmax、shmall这些属性
sysctl -p
vim /etc/security/limits.conf
# 在文件末尾添加下面四行
# 设置进程数软限制
oracle soft nproc 2047
# 设置进程数硬限制
oracle hard nproc 16384
# 设置文件数软限制
oracle soft nofile 1024
# 设置文件数硬限制
oracle hard nofile 65536
# 进程会话限制可以采用pam_limits认证模块来实现,通过修改登录程序login的PAM设置以启用该认证
vim /etc/pam.d/login # 在文件最后添加下面一行
session required /lib64/security/pam_limits.so
# 一般都是64位系统,64位系统需要设置为/lib64/security/pam_limits.so 否则重启服务器后就会出现命令行无法登录,但是通过桌面方式能登录的情况
session required pam_limits.so
配置hostname
192.168.81.128
vim /etc/hosts
# 添加如下内容
127.0.0.1 localhost
192.168.81.128 mydb
ping -c 3 mydb
vim /etc/sysconfig/network
# 添加如下内容
NETWORKING=yes
HOSTNAME=mydb
# 服务器IP
GATEWAY=192.168.81.128
NTPSERVERARGS=iburst
yum -y groupinstall "X Window System"
#安装VNC+图形、oracle需要的依赖(软件)
yum -y install \
binutils \
compat-libcap1 \
compat-libstdc++-33 \
compat-libstdc++-33*.i686 \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc*.i686 \
glibc \
glibc-devel \
glibc-devel*.i686 \
ksh \
libgcc*.i686 \
libgcc \
libstdc++ \
libstdc++*.i686 \
libstdc++-devel \
libstdc++-devel*.i686 \
libaio \
libaio*.i686 \
libaio-devel \
libaio-devel*.i686 \
make \
sysstat \
unixODBC \
unixODBC*.i686 \
unixODBC-devel \
unixODBC-devel*.i686 \
libXp
rpm -q \
binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
expat \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
pdksh \
sysstat \
unixODBC \
unixODBC-devel | grep "not installed"
由于linux和windows安装太几把麻烦,换docker
docker部署oracle