linux平臺 oracle 數據庫 安裝文檔

 Oracle 官方的安裝文檔html

http://download.oracle.com/docs/cd/B28359_01/install.111/b32002/toc.htmnode

 

 

安裝相關包
 1.1 
redhat 4 上安裝10g 須要以下包:linux

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.)
c++

 

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
sql

# 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
shell

# From RedHat AS5 Disk 3
cd /media/cdrom/Server
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4*
cd /
eject
數據庫

 

咱們能夠經過下面這個命令來檢查, 差那個包就安裝哪一個包:bash

rpm -q binutils compat-db control-center gcc gcc-c++ glibc glibc-common \
gnome-libs libstdc++ libstdc++-devel make pdksh sysstat xscreensaver libaio openmotif21
網絡

 

若是少了哪些包,直接在安裝盤裏找一下,安裝上就能夠了。session

 

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-max512 乘以 processes (128process則爲 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將所需啓動的實例修改成
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;

相關文章
相關標籤/搜索