1. 程式人生 > >Oracle11g安裝步驟(CentOS7)

Oracle11g安裝步驟(CentOS7)

sqlplus nproc iba nging rar 服務 ted common unix

技術分享圖片安裝環境:CentOS 7(64位) 、 oracle11G 的壓縮包

第一步:創建相關目錄,並將安裝包放在指定路徑下

[root@localhost data]# pwd
/data
[root@localhost data]# ll
total 0
drwxr-xr-x. 2 root root 6 Sep 27 00:42 oracle //安裝目錄
drwxrwxr-x. 2 root root 6 Sep 27 00:25 oradata //配置文件
drwxrwxr-x. 2 root root 88 Sep 26 23:53 soft //壓縮包目錄

第二步:創建相關用戶組和密碼(密碼提示過於簡單之類的話請不用管它)

[root@localhost soft]# groupadd  oinstall 
[root@localhost soft]# groupadd  dba
[root@localhost soft]# useradd -g oinstall -g dba -m oracle //用戶既屬於oinstall又屬於dba 
[root@localhost soft]# passwd  oracle 
Changing password for user oracle.
New password: 
BAD PASSWORD: The password fails the dictionary check 
- it is too simplistic/systematic Retype new password: passwd: all authentication tokens updated successfully.

第三步:賦值

chmod -R 775 /data/chown -R oracle.oinstall /data/oracle/  
chown -R oracle:oinstall /data/soft/
chown -R oracle:oinstall /data/oradata/ chmod
-R 775 /data/oracle/
[root@localhost soft]# chown -R oracle:oinstall database/ //將解壓後的database目錄也賦給oracle
[root@localhost soft]# ll
total 2295592
drwxr-xr-x. 8 oracle oinstall 128 Aug 20 2009 database
-rwxrwxr-x. 1 oracle oinstall 1239269270 Apr 23 2013 linux.x64_11gR2_database_1of2.zip
-rwxrwxr-x. 1 oracle oinstall 1111416131 Apr 23 2013 linux.x64_11gR2_database_2of2.zip

第四步:修改標識

[root@localhost data]# vi /etc/redhat-release
[root@localhost data]# cat /etc/redhat-release redhat-7

第五步:安裝相關軟件包

yum -y install binutils* compat-libcap1* compat-libstdc++* gcc* gcc-c++* glibc* glibc-devel* ksh* libaio* libaio-devel* libgcc* libstdc++* libstdc++-devel* libXi* libXtst* make* sysstat* elfutils* unixODBC*

第六步:防火墻問題

systemctl status firewalld.service
systemctl disable firewalld.service

第七步:修改selinux

 vi /etc/selinux/config
如下圖所示,將selinux設置為disabled狀態
技術分享圖片


第八步:修改 linux 內核

 vi /etc/sysctl.conf
添加以下內容:
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
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 = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
配置生效:[root@localhost data]# sysctl -p

第九步: 修改用戶的 SHELL 的限制

(1)vi /etc/security/limits.conf
添加以下內容:
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
(2)修改/etc/pam.d/login 文件,vi /etc/pam.d/login
添加:
session required /lib64/security/pam_limits.so
session required pam_limits.so
(3)編輯 /etc/profile ,vi /etc/profile
添加:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

第十步:修改配置文件

[root@localhost data]#  su - oracle 
[oracle@localhost ~]$ export LANG=en_US //把語言環境改為英文
vi /home/oracle/.bash_profile
添加:
export PATH
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin:/usr/bin:/usr/sbin:/usr/lib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
生效:source /home/oracle/.bash_profile

設置主機 hosts 文件,vi /etc/hosts
添加自己主機ip信息,例如:
192.168.113.133 localhost localhost.localdomain localhost4 localhost4.localdomain4

第十一步:

[oracle@localhost database]$ ./runInstaller 

後面圖形化部分由於圖片太大,不一一列舉,多數為next。(可見其他博客說明)

安裝好後輸入dbca,繼續圖形化界面安裝。

第十二步:數據庫的啟動、關閉

---------啟動監聽服務-------------

# su – oracle
$ lsnrctl
LSNRCTL> status
LSNRCTL> start
LSNRCTL> exit

[oracle@redhat64 ~]$ export oracle_sid=orcl //實例名用之前圖形界面設置的

---------啟動------------

[oracle@redhat64 ~]$ sqlplus / as sysdba
SQL> startup

-------關閉--------------

# su – oracle
$ sqlplus / as sysdba
SQL> shutdown immediate

其他博客:https://www.cnblogs.com/muhehe/p/7816808.html

Oracle11g安裝步驟(CentOS7)