溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Centos 6.5安裝oracle 11g

發(fā)布時(shí)間:2020-08-11 10:33:15 來(lái)源:網(wǎng)絡(luò) 閱讀:9747 作者:15816815732 欄目:關(guān)系型數(shù)據(jù)庫(kù)

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

http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip?AuthParam=1479527366_c5c6af19e54f7eed218aafe6914b194e  (下載地址)

安裝時(shí)內(nèi)存不要低于2G

1. 使用root用戶登錄操作系統(tǒng)

2. yum 安裝 unzip 軟件,用來(lái)解壓上傳的Oracle安裝文件

[root@CentOS ~]# yum install unzip –y

3. 解壓Oracle 安裝程序

[root@CentOS ~]# cd /tmp

[root@CentOS tmp]# unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip

(這里有倆個(gè)包,1跟2都要下載)

 

4. Yum 安裝vim軟件,用于編輯配置文件(個(gè)人習(xí)慣,不安裝vim,使用vi也可以)。

[root@CentOS tmp]# yum install vim -y

5. /etc/hosts文件中添加主機(jī)名

[root@CentOS tmp]# vim /etc/hosts

添加192.168.206.135 CentOS

 Centos 6.5安裝oracle 11g

6. 關(guān)閉selinux

[root@CentOS tmp]# vim /etc/selinux/config

設(shè)置SELINUX=disabled

 Centos 6.5安裝oracle 11g

[root@CentOS tmp]# setenforce 0

 

7. 關(guān)閉防火墻

[root@CentOS tmp]# service iptables stop


8. 安裝Oracle 11g依賴包

[root@CentOS tmp]# yum install -y binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make numactl sysstat libXp unixODBC unixODBC-devel -y



9. 添加安裝用戶和用戶組

 

[root@CentOS tmp]# groupadd oinstall

[root@CentOS tmp]# groupadd dba

[root@CentOS tmp]# useradd -g oinstall -G dba oracle

[root@CentOS tmp]# passwd oracle

[root@CentOS tmp]# id oracle

uid=1001(oracle) gid=1001(oinstall) =1001(oinstall),1002(dba)

 

10. 修改內(nèi)核參數(shù)配置文件

[root@CentOS ~]# vim /etc/sysctl.conf

 

添加以下內(nèi)容

 

fs.aio-max-nr = 1048576

fs.file-max = 6815744

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

kernel.shmall = 2097152

kernel.shmmax = 1073741824

 

 

[root@CentOS ~]# sysctl -p

 

其中kernel.shmmax = 1073741824本機(jī)物理內(nèi)存2G)的一半,單位為byte。


這里會(huì)有個(gè)錯(cuò)誤:



Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g



11. 修改用戶的限制文件


[root@CentOS ~]# vim /etc/security/limits.conf

 

添加以下內(nèi)容

 

oracle           soft    nproc           2047

oracle           hard    nproc           16384

oracle           soft    nofile          1024

oracle           hard    nofile          65536

oracle           soft    stack           10240

 

修改/etc/pam.d/login文件

[root@CentOS ~]# vim /etc/pam.d/login

 

添加以下內(nèi)容

 

session  required   /lib64/security/pam_limits.so

session        required               pam_limits.so

 

修改/etc/profile文件

[root@CentOS ~]# vim /etc/profile

 

添加以下內(nèi)容

 

if [ $USER = "oracle" ]; then

  if [ $SHELL = "/bin/ksh" ]; then

   ulimit -p 16384

   ulimit -n 65536

  else

   ulimit -u 16384 -n 65536

  fi

fi

 

12. 創(chuàng)建安裝目錄和設(shè)置文件權(quán)限

 

[root@CentOS ~]# mkdir -p /u01/app/oracle/product/11.2.0

[root@CentOS ~]# mkdir /u01/app/oracle/oradata

[root@CentOS ~]# mkdir /u01/app/oracle/inventory

[root@CentOS ~]# mkdir /u01/app/oracle/flash_recovery_area

[root@CentOS ~]# chown -R oracle:oinstall /u01/app/oracle

[root@CentOS ~]# chmod -R 775 /u01/app/oracle

 

 

13. 設(shè)置oracle用戶環(huán)境變量

 

[root@CentOS ~]# su - oracle

[oracle@CentOS ~]$ vim .bash_profile

添加如下內(nèi)容

 

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0

ORACLE_SID=orcl

PATH=$PATH:$ORACLE_HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH



[root@oracle11g ~]# xhost +

access control disabled, clients can connect from any host

[root@oracle11g ~]# su - oracle

[oracle@oracle11g ~]$ unzip linux.x64_11gR2_database_1of2.zip 

[oracle@oracle11g ~]$ unzip linux.x64_11gR2_database_2of2.zip 

[oracle@oracle11g ~]$ cd database/

[oracle@oracle11g database]$ ./runInstaller 

這里要在圖形化界面安裝 下運(yùn)行./runlnstaller,不然會(huì)出錯(cuò),

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

注意,這里./runInstaller會(huì)出現(xiàn)錯(cuò)誤,需要安裝yum groupinstall "KDE Desktop" 然后在圖形界下重啟服務(wù)器,就可以了



Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g


Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

Centos 6.5安裝oracle 11g

[root@oracle11g ~]# sh /u01/oraInventory/orainstRoot.sh 

執(zhí)行/u01/有個(gè)root.sh的腳本


Running Oracle 11g root.sh script...


The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/oracle/product/11.2.0.1/db_1


Enter the full pathname of the local bin directory: [/usr/local/bin]: 

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.

Finished product-specific root actions.


.登陸oracle數(shù)據(jù)庫(kù)


[oracle@oracle11g database]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 12 23:22:35 2016

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from dual;

D

-

X

SQL> select instance_name from v$instance;

INSTANCE_NAME

----------------

orac11g

SQL> 


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI