virtualbox+oracle linux 6.3 下安裝oracle 11.2.3.0

來源:互聯網
上載者:User

標籤:

閑來無事,今天在虛擬機器下安裝了oracle11g的單一實例,特此記錄分享下!

用到的軟體:VirtualBox-4.0.8-71778-Win.exe     oracle linux 6.3(V33411-01.iso) oracle11g(p10404530_112030_Linux-x86-64_1of7.zip, p10404530_112030_Linux-x86-64_2of7.zip)

一、安裝linux。

虛擬機器設定的是:1g記憶體,30g硬碟,一塊網卡(host-only模式)

檢查記憶體情況# grep MemTotal /proc/meminfo# grep SwapTotal /proc/meminfo

一般來說,安裝圖形化介面一直走下去即可。需要注意的是在硬碟分配的時候選擇自訂。我是建立了三個,一個是swap=2g  一個是boot=1g  剩下的給到了/根節點

二、安裝前的配置.

1.設定本地的虛擬網卡及linux下的etho。

一般來講安裝好linux系統之後,在本地的網路連接中會出現host-only的網路 ip=192.168.56.1  掩碼=255.255.255.0  其他不填寫。

編輯vi /etc/sysconfig/network-scripts/ifcfg-eth0 


DEVICE=eth0
NM_CONTROLLED=yes
ONBOOT=yes
HWADDR=08:00:27:E6:97:FA
TYPE=Ethernet
BOOTPROTO=none
IPADDR=192.168.56.137
PREFIX=24
GATEWAY=192.168.56.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
UUID="524b1577-d80a-4f9c-ad33-9480ebf5ddde"
USERCTL=no

然後重啟或service network restart使之生效。這樣就可以在本地通過xshell或者crt進行遠端存取了。

2.設定hosts檔案。

vi /etc/hosts  在下面增加一行(ip地址   主機名稱.網域名稱)

3.修改核心參數(在root帳號下操作): 這個必須要設定,不然安裝oracle的時候會報一些錯誤

編輯核心參數設定檔 vi /etc/sysctl.conf,在該檔案下修改或添加如下行:

fs.file-max = 6815744
fs.aio-max-nr=1048576
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; --生效
sysctl -a --查看

 

4.編輯系統資源限制設定檔 在檔案/etc/security/limits.conf中添加如下內容:

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

5.編輯檔案 vi /etc/pam.d/login,添加如下行

session required /lib/security/pam_limits.so
session required pam_limits.so

注意:
如果作業系統是64位,則應使用64位so檔案
Session required /lib64/security/pam_limits.so

6.編輯 vi /etc/profile 檔案,添加如下行(11gR1有要求,R2沒有要求):

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
該配置在使用者oracle登入時會立即生效,如果當前 oracle 使用者已經登入可退出後重新登入使之生效。

 

7.關閉防火牆
停止2個防火牆服務iptables(ipv4)、ip6tables(ipv6)
service iptables stop
service ip6tables stop

查看防火牆服務狀態
service iptables status
service ip6tables status

禁止防火牆服務開機啟動
chkconfig iptables off
chkconfig ip6tables off

查看防火牆服務開機啟動狀態
chkconfig –list | grep iptables

8.關閉selinux
擷取selinux狀態 getenforce
修改selinux設定檔關閉selinux
vi /etc/selinux/config
SELINUX=disabled --將參數又enforcing修改為disabled
重啟作業系統
關閉當前已開啟的SELinux使用如下命令 setenforce 0

9.建立或修改安裝資料庫的使用者和組

groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba oracle (如果系統中沒用建立oracle使用者執行本句及接下來的一條語句)
password oracle
usermod -g oinstall -G dba,oper oracle (如果系統中已經存在oracle 使用者)

10.建立oracle安裝目錄與修改安裝許可權

mkdir -p /u01/app/oracle
mkdir /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/
chmod -R 755 /u01/app/*

11.設定環境變數 修改vi .bash_profile 在檔案中添加以下內容: 切換oracle目錄

export ORACLE_BASE=/u01/app/oracle
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
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

source /home/oracle/.bash_profile--執行如下命令使以上設定立即生效

 

12.通過yum的方式安裝缺少的系統包(採用本地yum)

 

(a).在 virtualBox 中掛上 oracle-linux-6.3.iso 

cd /mnt

mkdir cdrom

mount /dev/cdrom /mnt/cdrom/

mount: block device /dev/cdrom is write-protected, mounting read-only ---出現這個提示說明掛載成功

(b).cd /etc/yum.repos.d

mv public-yum-ol6.repo public-yum-ol6.repo.bak

vi public-yum-ol6-local.repo

增加

[oel6_local]
name = Enterprise Linux 6.3 DVD
baseurl=file:///mnt/cdrom/Server/
gpgcheck=0
enabled=1

yum install oracle-rdbms-server-11gR2-preinstall

 

 

13.解壓兩個壓縮包並進行授權

安裝前用root使用者執行xhost +   使所有使用者都能訪問圖形案頭

 

unzip p10404530_112030_Linux-x86-64_1of7.zip
unzip p10404530_112030_Linux-x86-64_2of7.zip
chmod -R 700 /home/oracle/database
chown -R oracle:oinstall /home/oracle/database
su - oracle
./runInstaller

出現的問題:安裝oracle碰到 上面的錯誤:報 Exception in thread "main" java.lang.NoClassDefFoundError

解決:尋找缺少哪些包並進行安裝。rpm -q --queryformat %-{name}-%{version}-%{release}-%{arch}"\n" \ compat-libstdc++-33 glibc-kernheaders glibc-headers libaio libgcc glibc-devel xorg-x11-deprecated-libs 

14.運行./runInstaller 之後就安裝圖形化介面一步步安裝就行了。前期配置好了,不會出現安裝出錯的問題。圖就偷個懶不了。

 

                                                ------請大家指點不足,互相探討      2016-04-19 

 

virtualbox+oracle linux 6.3 下安裝oracle 11.2.3.0

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.