Oracle 12CR1安装

Oracle 12CR1安装
过程纪要:

1、root身份安装依赖包:
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
2、建立用户和组:
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba,oper oracle
echo "123456" | passwd --stdin oracle #oracle用户的登录密码,后续登录要用,记着。
3、创建安装目录:
mkdir -p /orcl/app/oracle/product/12.1.0/db_1
chown -R oracle:oinstall /orcl/app
chmod -R 775 /orcl/app
4、修改内核及相关参数
4.1修改内核参数vi /etc/sysctl.conf,添加:
cat >> /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 4007152
kernel.shmmax =4098955264
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

注释:使用Ctrl+c或Ctrl+d结束输入
改好后,使之生效
sysctl -p


4.2改文件限制:cat >> /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
* soft nofile 65535
* hard nofile 65535
注意:修改此文件是即时生效的,但可能要重登录后再看

4.3以及cat >>/etc/pam.d/login,
session required pam_limits.so
4.4
vim /etc/security/limits.d/20-nproc.conf
* soft nproc 40960
root soft nproc unlimited


4.5修改登录脚本
修改ulimit:vi /etc/profile,添加:
cat >> /etc/profile
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_LANG
ORACLE_BASE=/orcl/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
ORACLE_SID=orcl
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH
export PATH
4.5 oracle修改登录脚本
cat >> /home/oracle/.bash_profile
LANG=zh_CN.UTF-8
export LANG
umask 022
5、开始安装
以oracle用户登录,开始安装:
su oracle
cd /orcl/app/oracle
unzip linuxx64_12201_database.zip
export LANG="en_US"
cd /orcl/app/oracle/database
./runInstaller
注:下载好的Oracle要放到/orcl/app/oracle目录下,/orcl/app/oracle/下是2个目录:product和database。解压后的安装文件放在database下。然后就会出现安装界面,配置过程从略。需要注意的是字符集要选择unicode。如下

附录
1、安装后 修改oracle 并发连接数
alter system set processes = 5000 scope = spfile;
2、启动和关闭oracle监听lsnrctl start lsnrctl service
lsnrctl stop
3、启动和关闭数据库
sqlplus sys/XXXXX as sysdba
startup

shutdown immediate  shutdown immediate

posted @ 2021-07-26 22:36  乐乐和笑笑  阅读(123)  评论(0编辑  收藏  举报