Oracle 官方的安裝文檔
http://download.oracle.com/docs/cd/B28359_01/install.111/b32002/toc.htm
一. 安裝相關包
1.1 在redhat 4 上安裝10g 需要如下包:
Required package versions (or later):
binutils-2.15.92.0.2-10.EL4
compat-db-4.1.25-9
control-center-2.8.0-12
gcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
glibc-2.3.4-2
glibc-common-2.3.4-2
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-9.EL4
libstdc++-devel-3.4.3-9.EL4
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
libaio-0.3.96
openmotif21-2.1.30-11.RHEL4.2 (Required only to install Oracle demos. Installation of Oracle demos is not covered by this guide.)
1.2 redhat 5上安裝orace 10g 需要
# From RedHat AS5 Disk 1
cd /media/cdrom/Server
rpm -Uvh setarch-2*
rpm -Uvh make-3*
rpm -Uvh glibc-2*
rpm -Uvh libaio-0*
cd /
eject
# From RedHat AS5 Disk 2
cd /media/cdrom/Server
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh gcc-4*
rpm -Uvh libXp-1*
cd /
eject
# From RedHat AS5 Disk 3
cd /media/cdrom/Server
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4*
cd /
eject
我們可以通過下面這個指令來檢查, 差那個包就安裝哪個包:
rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common /
gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
如果少了哪些包,直接在安裝盤裡找一下,安裝上就可以了。
rpm 包安裝:
rpm -Uvh *.rpm --force --nodeps
二 下載下傳軟體
10G和11G的官網下載下傳位址:
http://www.oracle.com/technology/software/products/database/index.html
三: 設定核心參數(在/etc/sysctl.conf檔案中加入下列行)
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
net.ipv4.ip_local_port_range = 1024 65000
for 11gR2
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
注意: 如果已經存在的值大于這個值,就不要修改!
--然後運作下面指令,使上面的設定生效
#/sbin/sysctl -p
參數說明:
kernel.shmall為實體記憶體除以pagesize;
kernel.shmmax為實體記憶體的一半;
fs.file-max為512 乘以 processes (如128個process則為 65536);
net.ipv4.ip_local_port_range/net.core.rmem_default/net.core.rmem_max三個參數設定和官方文檔不一樣, 這是根據metalink 343431.1 最新要求更改的;
net.ipv4.tcp_rmem/net.ipv4.tcp_wmem兩個參數一般情況下無需設定, 除非是在Dataguard/Streams等需很多網絡傳輸情況下;
其它參數根據官方文檔要求設定即可.
具體内容參考我的blog:
Linux 核心參數及Oracle相關參數調整
http://blog.csdn.net/tianlesoftware/archive/2009/10/15/4668741.aspx
四: 其他資源設定
4.1 修改/etc/security/limits.conf 檔案
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
for Oracle 11gR2:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
4.2 修改/etc/profile
/etc/profile: 此檔案為系統的每個使用者設定環境資訊,當使用者第一次登入時,該檔案被執行.并從/etc/profile.d目錄的配置檔案中搜集shell的設定.
For the Bourne, Bash, or Korn shell, add the following lines to the /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
五: 将下面一行添加到/etc/pam.d/login檔案中:
session required pam_limits.so
六: 禁用SELINUX
編輯/etc/selinux/config,将SELINUX設定為SELINUX=disabled
七: 添加使用者組和使用者,并為oracle使用者設定密碼
Creating the Oracle Inventory Group
# /usr/sbin/groupadd oinstall
Creating the Oracle OSDBA Group
# /usr/sbin/groupadd dba
Creating the Oracle OSASM Group
# /usr/sbin/groupadd asmadmin
Creating the Oracle OSOPER Group
# /usr/sbin/groupadd oper
Creating the Oracle Database Software Owner
#/usr/sbin/useradd -g oinstall -G dba,oper,asmadmin oracle
Creating the Oracle ASM Software Owner
#/usr/sbin/useradd -g oinstall -G dba,oper,asmadmin osasm
若存在oracle 使用者,則用以下語句來修改使用者組:
###change user group attribute
usermod -g oinstall -G dba oracle
#passwd oracle
#groupadd oinstall
#groupadd dba
#groupadd oper
#useradd -g oinstall -G dba oracle
-g後面隻有一個參數,也就是指定使用者屬于該組
-G後面有好幾個參數,也就是指定使用者屬于後面的多個組,定義值為使用者的起始群組。
八: 建立Oracle安裝檔案夾
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 777 /u01
九: 修改作業系統版本資訊
編輯/etc/redhat-release檔案并将(Fedora Core release 6 (Zod))用下面内容替換:
redhat-4
或者在安裝時加參數
./runInstaller -IgnoreSysPreReqs
十: 設定oracle使用者的環境變量
#vi /home/oracle/.bash_profile
--将如下代碼添加到.bash_profile檔案中:
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
TNS_ADMIN=$ORACLE_HOME/network/admin;export TNS_ADMIN
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
十一:用Xmanager 軟體連接配接linux系統
如果不用Xmanager ,直接在linux 系統裡裝,那麼需要設定幾個參數
root 使用者下: export DISPLAY=IP:0.0
xhost +
傳回資訊為: access control disabled,clients can connect from any host
然後切換到Oracle 使用者: su - oracle
export DISPLAY=IP:0.0
之後就運作程式就可以打開界面了。 不過還是用xmanager 軟體友善。
十二: 在Xmanager中安裝資料庫 (切換到剛才解壓的目錄下,運作:)
export DISPLAY=IP:0.0
$./runInstaller
--在安裝oracle資料庫過程中,要以root身份執行兩個腳本檔案:
十三:設定執行個體自啟動
修改/etc/oratab将所需啟動的執行個體修改為Y
TSH1:/u01/app/oracle/product/10.2.0/db_1:Y
十四: 驗證
$sqlplus /nolog
conn sys/oracle as sysdba
startup
conn scott/tiger
select * from v$version;
本文來自CSDN部落格,轉載請标明出處:http://blog.csdn.net/tianlesoftware/archive/2009/10/24/4718218.aspx