這篇文章主要講解了“Linux怎么安裝Oracle 11g”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“Linux怎么安裝Oracle 11g”吧!
安裝前環(huán)境準備
安裝所需要的軟件包:
yum install binutils compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc glibc-devel \ ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make \ sysstat unixODBC-devel -yyum install binutils* compat-libcap1* compat-libstdc++* gcc gcc-c++ glibc glibc-devel* ksh libaio* libaio-devel libgcc libstdc++* libstdc++-devel libXi* libXtst make sysstat* unixODBC-devel -y創(chuàng)建用戶組和用戶:
groupadd -g 502 dba groupadd oinstall groupadd -g 504 asmadmin groupadd -g 506 asmdba useradd -u 502 -g oinstall -G dba,asmdba oracle設置用戶密碼:
passwd oracle修改內(nèi)核資源限制,在/etc/security/limits.conf添加如下內(nèi)容:
* soft nofile 4096 * hard nofile 65536 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536在文件/etc/pam.d/login文件中增加一行,配置驗證登錄限制:
session required pam_limits.so修改內(nèi)核參數(shù),在/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 = 1048576 net.ipv4.tcp_wmem = 262144 262144 262144 net.ipv4.tcp_wmem = 4194304 4194304 4194304設置使生效:
sysctl -p創(chuàng)建Oracle base目錄:
mkdir -p /data/app/oracle chown -R oracle:oinstall /data/app/oracle chmod -R 775 /data/app/oracle創(chuàng)建數(shù)據(jù)庫文件目錄和快速恢復區(qū)目錄:
數(shù)據(jù)文件目錄
mkdir /data/app/oracle/oradata chown oracle:oinstall /data/app/oracle/oradata chmod 775 /data/app/oracle/oradata/快速恢復區(qū)文件目錄
mkdir /data/app/oracle/recovery_area chown oracle:oinstall /data/app/oracle/recovery_area/ chmod 775 /data/app/oracle/recovery_area安裝庫軟件
從官網(wǎng)下載Oracle11g,是兩個zip壓縮文件,下載后在同一個目錄中解壓這兩個文件,會生成一個database的目錄。這里使用圖形安裝的方式,需要在本地配置Xserver,Windows客戶端具體配置方式參考此鏈接:http://tryingstuff.blog.51cto.com/4603492/1958772
切換到oracle用戶,添加環(huán)境變量:
export ORACLE_BASE=/data/app/oracle
配置X:
export DISPLAY=192.168.20.171:0.0
xhost +
access control disabled, clients can connect from any host
執(zhí)行如下命令進行安裝:
# cd database/ # ./runInstaller這里可以選擇先安裝應用再創(chuàng)建數(shù)據(jù)庫,也可以一次性創(chuàng)建數(shù)據(jù)庫,這里先進行安裝:
選擇單實例,和企業(yè)版本后,會根據(jù)我們添加的環(huán)境變量,找到對應的安裝目錄:
如果安裝中出現(xiàn)此錯誤,需要修改目錄權(quán)限:
chown -R oracle:oinstall /data/app
修改權(quán)限即可。
如果安裝的軟件包不符合要求會出現(xiàn)如下提示,可以通過下載這些軟件包,強制安裝。
逐以安裝缺失的軟件包,可以在這里下載缺失的軟件包:http://down.51cto.com/data/2339840
如果要解決依賴關(guān)系可以使用如下命令強制安裝:
rpm -ivh --nodeps --force packagename.rpm如果出現(xiàn)此錯誤,可以先忽略:
PRVF-7543 : OS Kernel parameter “semmni” does not have proper value on node “hostname” [Expected = “128” ; Found = “0”]. – Cause: Kernel parameter value does not meet the requirement. – Action: Modify the kernel parameter value to meet the requirement.
一般在Link binaries這一步出現(xiàn)錯誤是,大多數(shù)情況是由于部分系統(tǒng)包沒有安裝成功,需要重新安裝所需的包,可以使用如下腳本檢測軟件包是否裝好:
#!/bin/sh count=0 arr=( binutils-2* compat-libstdc++-33* elfutils-libelf-0.* elfutils-libelf-devel-0.* elfutils-libelf-devel-static-0.* gcc-4.* gcc-c++-4* glibc-2.* glibc-common-2.* glibc-devel-2.* glibc-headers-2* kernel-headers-* ksh-* libaio-0.* libaio-devel-0.* libgcc-4.* libgomp-4.* libstdc++-4.* libstdc++-devel-* make-* numactl-devel-* sysstat-* ) len=${#arr[@]} for((i=0;i<len;i++)); do char=${arr[$i]} rpm -qa | grep "^$char" if [ $? != 0 ] ; then error[$count]=${arr[$i]} count=$(($count+1)) echo "+++++++++++++++the ${arr[$i]}^is not installed++++++++++++++++++" fi done if [ $count -lt "0" ];then echo "You have $count patchs are not installed." echo "the not installed patch is:" len1=${#error[@]} for((ii=0;ii<len1;ii++)); do echo "${error[$ii]}^" done echo -e "Are you sure to install the patch[yes or no]:\c" read select if [ $select == "yes" ]; then for((is=0;is<len1;is++)); do var=${error[$is]} rpm -ivh ./patch/$var.rpm done fi else echo "++++++++++++++++++++++CHECK PASS!+++++++++++++++++++++++++++" fi count=0 rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make pdksh sysstat unixODBC unixODBC-devel | grep "not installed"繼續(xù)點擊下一步,直到安裝完成.
安裝完成后,按照提示使用root 執(zhí)行系統(tǒng)給出的腳本:
添加oracle的環(huán)境變量:
在oracle用戶下修改.bash_profile:
export ORACLE_BASE=/data/app/oracle export ORACLE_HOME=/data/app/oracle/product/11.2.0/dbhome_1 PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin到此為止,Orace 數(shù)據(jù)庫的軟件安裝工作就完成了。
啟動監(jiān)聽
在oracle 用戶下使用netca命令啟動監(jiān)聽配置界面:
[oracle@temp-test ~]$ export DISPLAY=192.168.20.171:0.0 [oracle@temp-test ~]$ xhost + access control disabled, clients can connect from any host [oracle@temp-test ~]$ netca Oracle Net Services Configuration:然后都是用默認配置,監(jiān)聽1521端口。
$ netstat -lntp|grep 1521 tcp6 0 0 :::1521 :::* LISTEN 22939/tnslsnr顯示監(jiān)聽狀態(tài):
[oracle@temp-test ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-NOV-2017 18:27:02 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=temp-test)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 02-NOV-2017 18:20:27 Uptime 0 days 0 hr. 6 min. 38 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /data/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora Listener Log File /data/app/oracle/diag/tnslsnr/temp-test/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=temp-test)(PORT=1521))) The listener supports no services The command completed successfully使用DBCA工具創(chuàng)建數(shù)據(jù)庫
dbca是數(shù)據(jù)庫自帶的數(shù)據(jù)庫配置助手,可以幫助我們方便的創(chuàng)建數(shù)據(jù)庫,刪除數(shù)據(jù)庫,配置數(shù)據(jù)庫。
執(zhí)行dbca命令:
[oracle@temp-test ~]$ dbca選擇創(chuàng)建數(shù)據(jù)庫,選擇數(shù)據(jù)庫類型:
設置數(shù)據(jù)庫的名稱和SID為 “orcl”, 設置所有數(shù)據(jù)庫使用相同的密碼,這里設置的密碼要滿足密碼復雜度的要求:
選擇數(shù)據(jù)存放目錄:
選擇閃回恢復區(qū)目錄:
選擇sample Schemas, 系統(tǒng)會自動配置資源參數(shù),也可以根據(jù)自己的需要動態(tài)調(diào)整,字符集設置為UTF-8:
然后一路默認配置,直到安裝完成:
在最后的安裝完成界面,數(shù)據(jù)庫會顯示詳細的數(shù)據(jù)庫信息:
測試數(shù)據(jù)庫的連接
在配置文件添加環(huán)境變量:
vim ~/.bash_profile export ORACLE_SID=orcl source ~/.bash_profile登錄數(shù)據(jù)庫:
[oracle@temp-test ~]$ sqlplus sys/oracle as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 2 19:40:58 2017 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>查看數(shù)據(jù):
SQL> select name,created,log_mode,open_mode from v$database; NAME CREATED LOG_MODE OPEN_MODE --------- --------- ------------ -------------------- ORCL 02-NOV-17 NOARCHIVELOG READ WRITE感謝各位的閱讀,以上就是“Linux怎么安裝Oracle 11g”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對Linux怎么安裝Oracle 11g這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
文章名稱:Linux怎么安裝Oracle11g-創(chuàng)新互聯(lián)
網(wǎng)站URL:http://chinadenli.net/article40/epdho.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供虛擬主機、網(wǎng)站收錄、移動網(wǎng)站建設、品牌網(wǎng)站設計、搜索引擎優(yōu)化、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容