1.新建oracle用戶
groupadd oracle
useradd -g oracle oracle
.修改操作系統核心參數 在Root用戶下執行以下步驟:
1)修改用戶的SHELL的限制,修改/etc/security/limits.conf文件 輸入命令:vi /etc/security/limits.conf,按i鍵進入編輯模式,將下列內容加入該文件。
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
2)修改/etc/pam.d/login 文件,輸入命令:vi /etc/pam.d/login,按i鍵進入編輯模式,將下列內容加入該文件。
session required /lib/security/pam_limits.so session
required pam_limits.so
3)修改linux內核,修改/etc/sysctl.conf文件,輸入命令: vi /etc/sysctl.conf ,按i鍵進入編輯模式,將下列內容加入該文件
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
退出:sysctl -p
4)編輯 /etc/profile ,輸入命令:vi /etc/profile,按i鍵進入編輯模式,將下列內容加入該文件。
if [ $USER = "oracle" ];then
if [ $SHELL = "/bin/ksh" ];then
ulimit -p 16384 ulimit -n 65536 else
ulimit -u 16384 -n 65536
fi
fi
6)創建數據庫軟件目錄和數據文件存放目錄,目錄的位置,根據自己的情況來定,注意磁盤空間即可,這里我把其放到oracle用戶下,例如: 輸入命令
mkdir /home/oracle/app
mkdir /home/oracle/app/oracle
mkdir /home/oracle/app/oradata
mkdir /home/oracle/app/oracle/product
7)更改目錄屬主為Oracle用戶所有,輸入命令:
chown -R oracle:oracle /home/oracle/app
8)配置oracle用戶的環境變量,首先,切換到新創建的oracle用戶下, 輸入:su – oracle ,然后直接在輸入 : vi .bash_profile 按i編輯 .bash_profile,進入編輯模式,增加以下內容:
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
2 .使用ls命令可以查看解壓后database所包含的文件,如下圖:
1)執行安裝,輸入命令:./runInstaller ./runInstaller -jreLoc /etc/alternatives/jre_1.8.0
-static
-lnnz11
vim /home/oracle/app/oracle/product/11.2.0/dbhome_1/sqlplus/admin/glogin.sql
define _editor=vim
set linesize 160
set pagesize 100
set sqlprompt ' _user@ _connect_identifier>'
~