linux下安裝oracle

來源:互聯網
上載者:User

標籤:注意   port   chown   核心   x86   cap   disable   tor   passwd   

一》1.關閉防火牆,禁用selinux

vi /etc/selinux/config  修改SELINUX=disabled,然後重啟,如果不想重啟使用命令setenforce 0

2.安裝依賴包

# rpm -ivh libstdc++-devel-4.4.7-4.el6.x86_64.rpm 

# rpm -ivh gcc-c++-4.4.7-4.el6.x86_64.rpm 

# rpm -ivh compat-libcap1-1.10-1.x86_64.rpm 
# rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm 

# rpm -ivh ksh-20100621-12.el6.x86_64.rpm 
# rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm

# rpm -ivh oracleasm-support-2.1.5-1.el6.x86_64.rpm

可以使用

yum install -y compat-libstdc* 
yum install -y elfutils-libelf*
yum install -y gcc*
yum install -y glibc*
yum install -y ksh*
yum install -y libaio*
yum install -y libgcc*
yum install -y libstdc*
yum install -y make*
yum install -y sysstat*

3.建立Oracle使用者與組

(1) 建立群組dba 

# groupadd dba 
(2) 新增使用者oracle並將其加入dba群組 

# useradd -m -G dba oracle (4) 測試oracle帳號是否建立完成 # id oracle 
(5) 建立oracle的新密碼 # passwd oracle 
oracle

4.將oracle使用者加入到sudo群組中

vi /etc/sudoers

找到 
root        ALL=(ALL)        ALL  這行,並且在底下再加入 
oracle        ALL=(ALL)        ALL 
輸入wq!(由於這是一份唯讀文檔所以需要再加上!)並且按下Enter

5、配置系統核心參數

# vi /etc/sysctl.conf 
修改和添加以下內容:

fs.aio-max-nr =1048576
fs.file-max =6815744
kernel.shmmni = 4096

kernel.sem=5010 641280 5010 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=1048586
vm.hugetlb_shm_group=501

編輯完之後,儲存,然後執行: # sysctl –p

6.編輯

/etc/security/limits.conf

添加以下四行 
oracle  soft        nproc   2047 

oracle  hard        nproc   16384 

oracle  soft        nofile  1024 

oracle  hard        nofile  65536

7、編輯/etc/pam.d/login

# vi /etc/pam.d/login

添加以下兩行

session required /lib64/security/pam_limits.so 

session required pam_limits.so

8、修改/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
9.建立Oracle安裝資料夾以及資料存放檔案夾

#mkdir /opt/oracle 

#mkdir /opt/oracle/112

#mkdir /opt/oraInventory 

#chown -R oracle:dba /opt/oracle 

#chown -R oracle:dba /opt/oraInventory 

#chown -R oracle:dba /opt

10.配置Linux主機

 檢查/etc/hosts檔案中是否有localhost的記錄(指向127.0.0.1即可),若沒有的話,在後面配置Oracle監聽的時候會出現一些問題,導致無法啟動監聽,在此手工添加此記錄即可。  增加以下配置IP地址 加主機名稱 映射
192.168.1.101   CentOS-Oracle

11.配置oracle使用者環境變數

#su oracle

$ cd /home/oracle

$ vi .bash_profile

修改並加入以下內容 
ORACLE_BASE=/opt/oracle                    #上面建立的Oracle安裝資料夾

ORACLE_HOME=$ORACLE_BASE/112 

ORACLE_SID=orcl 
LD_LIBRARY_PATH=$ORACLE_HOME/lib 

PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin 
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH  
#PATH=$PATH:$HOME/bin 

#export PATH 
儲存後使用如下命令,使設定生效: $ source /home/oracle/.bash_profile

12.安裝Oracle,並進行相關設定

準備執行資料庫安裝,如果你的作業系統是中文環境,安裝時會出現中文亂碼,請使用以下指令 $ export LANG=en_US.UTF-8

二》安裝vnc

1.開啟終端使用yum命令安裝vnc sever

yum install tigervnc-server -y

2.將vncserver設定為隨系統啟動。
命令:chkconfig vncserver on

chkconfig vncserver --level 5 on

3.修改vncserver的設定檔。
命令:vim /etc/sysconfig/vncservers

在後面添加VNCSERVERS="1:root"
VNCSERVERARGS

4.設定vncserver的密碼(vnc用戶端登陸使用)。
注意設定密碼前請先su到你要設定的使用者。這示範中用的是root使用者。
命令:vncpasswd

5.重啟vncserver服務。
命令:service vncserver restart

安裝oracle必須用oracle使用者登入然後開啟vnc 才可以遠程到oracle使用者介面安裝oracle

三》

安裝linux案頭服務

1.首先查看系統的運行層級以及是否安裝了案頭環境

  1、使用命令 runlevel 查看當前的運行層級 ,

  2、使用命令 yum grouplist | more  查看是否安裝了案頭環境的組件

2.yum groupinstall -y   "Desktop"   "Desktop Platform"   "Desktop Platform Development"  "Fonts"  "General Purpose Desktop"  "Graphical Administration Tools"  "Graphics Creation Tools"  "Input Methods"  "X Window System"  "Chinese Support [zh]" "Internet Browser" 安裝介面版

3.安裝好了案頭環境的軟體,然後再修改一下系統的啟動層級 為 5

  編輯/etc/inittab檔案,修改啟層級為5,如,然後重新啟動就可以進入案頭環境了。因為我這是遠程環境的,只是運用了命令列,可以使用VNC進行案頭環境的遠程

linux下安裝oracle

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.