在Linux下安裝Oracle
我的安裝環境:
Redhat Enterprise linux 5.4版本
硬體要求:
內存要求:
Oracle Database官方指定最少512M(後面會警告)建議1GB
磁碟空間要求:
Swap交換分區為1.5GB
/tmp目錄中的磁碟空間為400MB
Oracle軟體需要1.5GB
Database 需要1.5GB
預配置的資料庫需要1.2GB(可選)
快速恢復去需要2.4GB(可選)
操作系統:
具有1GB以上RAM和1.5GB交換空間或者更高配置的計算機上可以實現標準安裝
安裝過程:
1. Login as root
2. Oracle的安裝需要在圖形化界面安裝
3. 打開Xwindows,允許所有主機顯示本主機上的X windows
[root@node1 ~]# xhost ======è oracle模擬遠程用戶在本機安裝,這步必須執行.
access control disabled, clients can connect from any host
4. 檢查系統要求
物理內存最少為1G
[root@node1 ~]# grep MemTotal /proc/meminfo
Swap分區建議為1.5G以上
[root@node1 ~]# grep SwapTotal /proc/meminfo
/tmp分區建議大於400M
[root@node1 ~]# df -lh /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vol0-root
37G 5.7G 29G 17% /
查看cpu是否符合安裝Oracle
Note:
This command displays the processor type. Verify that the processor architecture matches the Oracle software release that you want to install. If you do not see the expected output, then you cannot install the software on this system.
[root@node1 ~]# grep "model name" /proc/cpuinfo
model name : 英特爾(R) Core(TM)2 Duo CPU T6570 @ 2.10GHz
5.檢查所需軟體包是否安裝齊全
我們的內核版本應該為4.0或者更新的,但是不能太新了,否則下面實驗時會報錯,我們可以將自己的內核版本稍為改改(我這裡將5.4給為4.4),騙騙系統,呵呵
[root@node1 ~]# vim /etc/issue
[root@node1 ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 4.4 (Tikanga)
Kernel r on an m
RH033
我們需要確保系統已經安裝過以下軟體包:
Red Hat Enterprise Linux 4.0:
Gmake-3.80-5 gcc-3.4.3-22.1 gcc-ppc32-3.4.3-22.1 gcc-c -3.4.3-22.1 gcc-c -ppc32-3.4.3-22.1 glibc-2.3.4-2.9 glibc-2.3.4-29 (64-Bit) libgcc-3.4.3-9.EL4 libgcc-3.4.3-9.EL4.ppc64.rp libstdc -3.4.3-9.EL4 libstdc -devel-3.4.3-9.EL4 libaio-0.3.103-3 libaio-0.3.103-3 (64-Bit) libaio-devel-0.3.103-3 (64-Bit) compat-libstdc -33-3.2.3-47.3 binutils-2.15.92.0.2-13 我的系統是32位的,這裡我只安裝32位的,大家根據自己系統的情況自己選擇注意:
以上的包都是官方4.0系統安裝Oracle需要安裝的包,我們不能照著他的來,我們需要使用rpm -q package-name 一個一個查看以上的包是否已安裝,呵呵,需要點耐心啊!做學問嘛,就是這樣,同志們別急啊!經我測試,我的系統已經全部安裝,大家,別偷懶啊,一個一個慢慢測試下,不然,後面會有大麻煩找你的!
6.配置 Name Resolution
[root@ song ~]# cat /etc/nsswitch.conf | grep hosts ======輸出如下為正確
#hosts: db files nisplus nis dns
hosts: files dns
[root@ song ~]# domainname =====輸出必須如下,一字不差為正確
(none)
[root@ song ~]#vim /etc/sysconfig/network
[root@ song ~]#vim /etc/hosts
[root@ song ~]# hostname
song.example.com
格式類似即可,但/etc/hosts 中的名字和/etc/sysconfig/network中名字一定要是一樣的
7.創建用戶oracle,附加組dba,oper ,oinstall組
屬主是oracle
# /usr/sbin/useradd -g oinstall -G dba,oper oracle # passwd oracle # /usr/sbin/groupadd dba # /usr/sbin/groupadd oinstall # /usr/sbin/groupadd oper # id oracle uid=505(oracle) gid=505(oracle) groups=505(oracle),509(dba),510(oper)我們可以用一下命令來檢測
8.編輯/etc/sysctl.conf文件,添加編輯如下
kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 1048576 net.core.rmem_max = 1048576 net.core.wmem_default = 262144 net.core.wmem_max = 262144[root@node1 oracle]# sysctl -p
9.設置shell limits for oracle user #vim /etc/security/limits.conf oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 #Vim /etc/pam.d/login 添加 session required /lib/security/pam_limits.so #vim /etc/profile file 添加 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@song ~]# su – oracle
[oracle@song ~]$ vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/u01/app/oracle/product/10.2.0/db_1/bin
ORACLE_BASE=/u01/app/oracle
export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_HOME
echo PATH
10.創建oracle掛載安裝目錄,並修改其許可權: # mkdir -p /u01/app/oracle/oradata # chown -R oracle:oinstall /u01/app/oracle/oradata # chmod -R 775 /u01/app/oracle/oradata 11.下在oracle軟體包,並解壓縮 [root@song oracle]# ls 10201_database_linux32.zip [root@song oracle]# unzip 10201_database_linux32.zip [root@song oracle]# ls 10201_database_linux32.zip database [root@song oracle]# unzip 10201_database_linux32.zip 12.安裝oracle實例 [root@song database]# su - oracle [oracle@song ~]$ ls 10201_database_linux32.zip database [oracle@song ~]$ cd database/ [oracle@song database]$ ls doc install response runInstaller stage welcome.html [oracle@song database]$ ./runInstaller 出現以下圖,我們作如下選擇[root@song db_1]# pwd
/u01/app/oracle/product/10.2.0/db_1
[root@song db_1]# ./root.sh
[root@song db_1]#cd /home/oracle/oralnventory/orainstRoot.sh
[root@song db_1]#./orainstRoot.sh
用以下命令開啟配置資料庫伺服器圖形化界面
[oracle@song ~]$ emctl start
[oracle@song ~]$ dbca
記著如圖的地址,要用
在地址欄中填寫剛才的地址,出現如下畫面
正確的登錄畫面如下及表示創建成功
問題總結
1.在使用emctl 和dbca命令時出現沒有命令:
解決方法:重新檢查環境變數的設置
2.
可能是以下問題:
I. 無LISTERNER
a)[oracle@song ~]$netca =======è創建一個LISTENER
II. JianTingQi未啟動
b) [oracle@song ~]$lsnrctl start
III.. 偵聽器未啟動
c) [oracle@song ~]$emctl start dbconsole
IV.資料庫未打開
d)[oracle@song ~]$sqlsplus / as sysdba
sql>show sya;
sql>alter database mount;
sql>alter database open;
V.主機名解析問題
e) [oracle@song ~]$vim /etc/hosts
開啟 127.0.0.1 localhost 這行
3.
[oracle@song config]$ pwd
/u01/app/oracle/product/10.2.0/db_1/sysman/config
[oracle@song config]$ vim emd.properties =======追加以下內容
agentTZRegion=Asia/Shanghai
其他的問題咱是還沒有遇到,等遇到了再貼出來.
[火星人 ] linux下oracle 10g的安裝已經有515次圍觀