当前位置:Gxlcms > 数据库问题 > CentOS安装Oracle 12c

CentOS安装Oracle 12c

时间:2021-07-01 10:21:17 帮助过:15人阅读

下载地址:

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

https://www.oracle.com/technetwork/database/enterprise-edition/downloads/oracle12c-linux-12201-3608234.html

整个过程下载可能会比较慢,最好是抓取下载链接,然后使用wget下载,例如

技术图片

[root@terwergreen opt]# wget https://download.oracle.com/otn/linux/oracle12c/122010/linuxx64_12201_database.zip?AuthParam=1552132547_497757efbab4cd9c91b5d9c3fde56635
--2019-03-09 19:55:16--  https://download.oracle.com/otn/linux/oracle12c/122010/linuxx64_12201_database.zip?AuthParam=1552132547_497757efbab4cd9c91b5d9c3fde56635
正在解析主机 download.oracle.com (download.oracle.com)... 104.127.201.249
正在连接 download.oracle.com (download.oracle.com)|104.127.201.249|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:3453696911 (3.2G) [application/zip]
正在保存至: “linuxx64_12201_database.zip?AuthParam=1552132547_497757efbab4cd9c91b5d9c3fde56635”

78% [================================================================================>                       ] 2,711,796,149 10.8MB/s 剩余 71s    

1.root身份安装依赖包:

yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gc

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.修改内核参数vim /etc/sysctl.conf,添加:

fs.aio-max-nr = 1048576  
fs.file-max = 6815744  
kernel.shmall = 2097152  
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

改好后,使之生效
sysctl -p

另外 上面的kernel.shmmax = 1200000000可能会有问题,后面咱们再说。

或者你直接现在就写成4098955264

5.改文件限制: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

注意:修改此文件是即时生效的,但可能要重登录后再看

6.以及vim /etc/pam.d/login,添加:

    session required pam_limits.so

7.修改ulimit:vim /etc/profile,添加:

    if [ $USER = "oracle" ]; then  
    if [ $SHELL = "/bin/ksh" ]; then  
    ulimit -p 16384  
    ulimit -n 65536a  
    else  
    ulimit -u 16384 -n 65536  
    fi  
    fi

8.修改环境变量。vim ~oracle/.bash_profile,添加:

    ORACLE_BASE=/orcl/app/oracle  
    ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1  
    ORACLE_SID=orcl  
    export ORACLE_BASE ORACLE_HOME ORACLE_SID  
    PATH=$ORACLE_HOME/bin:$PATH  
    export PATH  

9.用yum remove *openjdk*把系统自带的openjdk卸载,再安装

sun jdk:rpm -ivh jdk-8u144-linux-x64.rpm

下载地址: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

(openjdk环境安装oracle GUI会报class not found的错)。然后$>java -version检查一下安装是否成功。上述工作完成后,建议重启系统。

CentOS安装Oracle 12c

标签:登录密码   conf   base   kernel   pat   acl   utils   ica   抓取   

人气教程排行