oracle可以在liux上装_【Oracle】手把手教你做之Linux上安装Oracle11g
手把手教你做之Linux上安裝Oracle11g
這是我第一次安裝時(shí)的過(guò)程,及遇到問(wèn)題的解決辦法,在此記錄,有不妥之處,多多交流。
因?yàn)楦叻€(wěn)定性及高定制低系統(tǒng)消耗等原因,我們希望在Linux上安裝Oracle數(shù)據(jù)庫(kù),本文旨在能讓任何人看完之后都能在linux上安裝Oracle。
安裝前準(zhǔn)備
Oracle下載地址
oracle安裝文件下載
根據(jù)需求下載對(duì)應(yīng)的安裝包版本。X86是32位操作系統(tǒng)用的安裝包,x86-64是64位操作系統(tǒng)用的安裝包。
在系統(tǒng)上檢查軟件依賴的安裝
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel
軟件依賴檢查
提示 is not installed 的用yum安裝
例如:
yum -y install compat-libstdc++-33 yum -y install elfutils-libelf-devel
提示:要提前配置好yum源。
創(chuàng)建oracle用戶
密碼為oracle,密碼輸入兩次。
/usr/sbin/groupadd oinstall /usr/sbin/groupadd dba /usr/sbin/useradd -g oinstall -G dba oracle passwd oracle
系統(tǒng)提示:
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
修改內(nèi)核參數(shù)
vi /etc/sysctl.conf
文本末尾加入以下內(nèi)容:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586
修改內(nèi)核參數(shù)
vi中編輯的方法
按i進(jìn)入輸入模式,esc退出 :wq退出編輯
為使上述配置生效而不重啟系統(tǒng),執(zhí)行如下命令
/sbin/sysctl –p
修改用戶限制
vi /etc/security/limits.conf
文本末尾加入以下內(nèi)容:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
修改用戶驗(yàn)證選項(xiàng)
vi /etc/pam.d/login
文本末尾加入以下內(nèi)容:
session required pam_limits.so
修改用戶配置文件
vi /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
安裝目錄配置
切換到root 用戶,執(zhí)行以下命令。
mkdir -p oraInventory chown -R oracle:oinstall oraInventory chmod -R 775 oraInventory
配置oracle用戶的環(huán)境變量
切換到oracle用戶
然后直接輸入
vi .bash_profile
文本末尾加入以下內(nèi)容:
export ORACLE_BASE=/u01
export ORACLE_HOME=$ORACLE_BASE/oracle
export ORACLE_SID=oracleSid
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
之后執(zhí)行
source .bash_profile
Oracle安裝
先將安裝包利用ftp傳到目錄下,一定要用oracle用戶傳!
然后進(jìn)入目錄解壓文件
unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip
因?yàn)閛racle11g的安裝有圖形界面,而我暫時(shí)沒(méi)法用遠(yuǎn)程命令顯示圖形。
所以在虛擬機(jī)本機(jī)上運(yùn)行如下命令
[oracle@localhost oraclepackage]$ cd database/ [oracle@localhost database]$ ./runInstaller
執(zhí)行開(kāi)始安裝命令
安裝桌面類(lèi)數(shù)據(jù)庫(kù)
忽略檢查的錯(cuò)誤
因?yàn)橹拔覀儥z查了軟件安裝的依賴,這些錯(cuò)誤都是版本的問(wèn)題,不影響安裝,所以我們選擇忽略。
之后的安裝就跟在windows圖形化界面的安裝一樣了。
安裝完成后,系統(tǒng)會(huì)提示你需要用root權(quán)限執(zhí)行2個(gè)shell腳本。按照其提示的路徑,找到其所在的位置, 新開(kāi)啟一個(gè)終端,輸入命令:
[root@localhost oraInventory]# cd /u01/oracle/ [root@localhost oracle]# sh root.sh [root@localhost ~]# cd /oraInventory/ [root@localhost oraInventory]# sh orainstRoot.sh
root用戶執(zhí)行兩個(gè)命令
安裝后的問(wèn)題解決
啟動(dòng)監(jiān)聽(tīng)
[oracle@localhost ~]$ lsnrctl start
連接數(shù)據(jù)庫(kù)
[oracle@localhost ~]$ sqlplus / as sysdba
啟動(dòng)數(shù)據(jù)庫(kù)實(shí)例
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/oracle/dbs/initoracleSid.ora'
提示文件未找到,解決辦法如下,將/u01/admin/orcl/pfile下類(lèi)似于init.ora.的文件復(fù)制到/u01/oracle/dbs路徑下,并重命名為未找到的文件名。
[oracle@localhost ~]$ cd /u01/admin/orcl/pfile [oracle@localhost pfile]$ ls
init.ora.10302016235216
[oracle@localhost pfile]$ cp init.ora.10302016235216 /u01/oracle/dbs [oracle@localhost pfile]$ cd /u01/oracle/dbs [oracle@localhost dbs]$ mv init.ora.10302016235216 initoracleSid.ora SQL> startup
提示存儲(chǔ)不足。
ORA-00845: MEMORY_TARGET not supported on this system
用root用戶編輯/etc/fstab
[root@localhost etc]# vi fstab
在tmpfs 后面加入,size=3G
編輯 fstab文件
修改完成后重啟掛載,遇到在使用的情況,故加上參數(shù)-k,之后重啟掛載。
[root@localhost ~]# umount /dev/shm
umount: /dev/shm: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
[root@localhost ~]# fuser -mvk /dev/shm [root@localhost ~]# umount /dev/shm [root@localhost ~]# mount /dev/shm
關(guān)閉防火墻
sudo service iptables stop
防火墻文件中加入下面一行,然后啟動(dòng)防火墻。
sudo vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT
修改防火墻文件
修改密碼文件
可以在本地用sysdba登陸,但plsql不能訪問(wèn)。
查詢oracle實(shí)例名。
查詢oracle實(shí)例名
select instance_name from v$instance;
將dbs目錄下orapw實(shí)例名的文件修改成對(duì)應(yīng)的。或者使用一下命令重新生成。
orapwd file=orapworacleSid password=123456 entries=10
密碼文件的生成
重啟數(shù)據(jù)庫(kù),plsql就可以訪問(wèn)了。
SQL> shutdown immediate SQL>startup
數(shù)據(jù)庫(kù)重啟
當(dāng)使用如下命令可以查出結(jié)果時(shí),就可以遠(yuǎn)程連接數(shù)據(jù)庫(kù)了。
select * from v$pwfile_users;
至此oracle11g在Linux上的基本安裝就完成了。
總結(jié)
以上是生活随笔為你收集整理的oracle可以在liux上装_【Oracle】手把手教你做之Linux上安装Oracle11g的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: amd一点也不yes_A粉的狂欢,AMD
- 下一篇: 滑动轮播_这样运营轮播图可以增加订单