virtualbox+oracle linux 6.3 下安装oracle 11.2.3.0
閑來無事,今天在虛擬機(jī)下安裝了oracle11g的單實(shí)例,特此記錄分享下!
用到的軟件: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。
虛擬機(jī)配置的是:1g內(nèi)存,30g硬盤,一塊網(wǎng)卡(host-only模式)
檢查內(nèi)存情況 # grep MemTotal /proc/meminfo # grep SwapTotal /proc/meminfo一般來說,安裝圖形化界面一直走下去即可。需要注意的是在硬盤分配的時候選擇自定義。我是新建了三個,一個是swap=2g ?一個是boot=1g ?剩下的給到了/根節(jié)點(diǎn)
二、安裝前的配置.
1.設(shè)置本地的虛擬網(wǎng)卡及l(fā)inux下的etho。
一般來講安裝好linux系統(tǒng)之后,在本地的網(wǎng)絡(luò)連接中會出現(xiàn)host-only的網(wǎng)絡(luò) 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進(jìn)行遠(yuǎn)程訪問了。
2.設(shè)置hosts文件。
vi /etc/hosts ?在下面增加一行(ip地址 ? 主機(jī)名.域名)
3.修改內(nèi)核參數(shù)(在root帳號下操作): 這個必須要設(shè)置,不然安裝oracle的時候會報(bào)一些錯誤
編輯內(nèi)核參數(shù)配置文件 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.編輯系統(tǒng)資源限制配置文件 在文件/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
5.編輯文件 vi /etc/pam.d/login,添加如下行
session required /lib/security/pam_limits.so
session required pam_limits.so
注意:
如果操作系統(tǒng)是64位,則應(yīng)使用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登錄時會立即生效,如果當(dāng)前 oracle 用戶已經(jīng)登錄可退出后重新登錄使之生效。
?
7.關(guān)閉防火墻
停止2個防火墻服務(wù)iptables(ipv4)、ip6tables(ipv6)
service iptables stop
service ip6tables stop
查看防火墻服務(wù)狀態(tài)
service iptables status
service ip6tables status
禁止防火墻服務(wù)開機(jī)啟動
chkconfig iptables off
chkconfig ip6tables off
查看防火墻服務(wù)開機(jī)啟動狀態(tài)
chkconfig –list | grep iptables
8.關(guān)閉selinux
獲取selinux狀態(tài)?getenforce
修改selinux配置文件關(guān)閉selinux
vi /etc/selinux/config
SELINUX=disabled --將參數(shù)又enforcing修改為disabled
重啟操作系統(tǒng)
關(guān)閉當(dāng)前已開啟的SELinux使用如下命令 setenforce 0
9.創(chuàng)建或修改安裝數(shù)據(jù)庫的用戶和組
groupadd oinstall
groupadd dba
groupadd oper
useradd -g oinstall -G dba oracle (如果系統(tǒng)中沒用創(chuàng)建oracle用戶執(zhí)行本句及接下來的一條語句)
password oracle
usermod -g oinstall -G dba,oper oracle (如果系統(tǒng)中已經(jīng)存在oracle 用戶)
10.創(chuàng)建oracle安裝目錄與修改安裝權(quán)限
mkdir -p /u01/app/oracle
mkdir /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/
chmod -R 755 /u01/app/*
11.設(shè)置環(huán)境變量?修改vi .bash_profile 在文件中添加以下內(nèi)容: 切換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--執(zhí)行如下命令使以上設(shè)置立即生效
?
12.通過yum的方式安裝缺少的系統(tǒng)包(采用本地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 ---出現(xiàn)這個提示說明掛載成功
(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.解壓兩個壓縮包并進(jìn)行授權(quán)
安裝前用root用戶執(zhí)行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
出現(xiàn)的問題:安裝oracle碰到 上面的錯誤:報(bào) Exception in thread "main" java.lang.NoClassDefFoundError
解決:查找缺少哪些包并進(jìn)行安裝。rpm -q --queryformat %-{name}-%{version}-%{release}-%{arch}"\n" \ compat-libstdc++-33 glibc-kernheaders glibc-headers libaio libgcc glibc-devel xorg-x11-deprecated-libs?
14.運(yùn)行./runInstaller 之后就安裝圖形化界面一步步安裝就行了。前期配置好了,不會出現(xiàn)安裝出錯的問題。圖就偷個懶不截圖了。
?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ------請大家指點(diǎn)不足,互相探討 ? ? ?2016-04-19?
?
轉(zhuǎn)載于:https://www.cnblogs.com/sherq1989/p/5406631.html
總結(jié)
以上是生活随笔為你收集整理的virtualbox+oracle linux 6.3 下安装oracle 11.2.3.0的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Magento事件机制 - Magent
- 下一篇: 使用mysql索引的规则