1.安裝前準備
binutils-2.17.50.0.6-5.el5
compat-db-4.2.52-5.1
control-center-2.16.0-14.el5
gcc-4.1.2-14.el5
gcc-c++-4.1.2-14.el5
glibc-2.5-18
libXp-1.0.0-8.1.el5
libstdc++-4.1.2-14.el5
libstdc++-devel-4.1.2-14.el5
make-3.81-1.1
openmotif-2.3.1-2.el5.i386.rpm
2.安裝依賴包
yum -y install control-center
yum -y install sysstat
修改語言
[root@sq1 ~]# vi /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
查看系統空間
df -h
3.root用戶設置核心參數
vi /etc/sysctl.conf
kernel.shmall = 2097152 (共享內存,單位是頁面數 x86的32位爲4k,oracle中是8K)
kernel.shmmax = 2147483648 (單個共享內存段的最大尺寸)
kernel.sem = 250 32000 100 128 (信號量)
fs.file-max = 65536 (文件句柄的最大數量)
net.ipv4.ip_local_port_range = 1024 65000(提供的服務端口號 1024 到 65000之間)
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
vi /etc/redhat-release
Red Hat Enterprise Linux Server release 3 (Tikanga)
使內核生效
[root@sq1 ~]# /sbin/sysctl -p
4.
[root@sq1 ~]# vi /etc/security/limits.conf (文件實際是 Linux PAM,插入式認證模塊)
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
( core - 限制內核文件的大小
date - 最大數據大小
fsize - 最大文件大小
memlock - 最大鎖定內存地址空間
nofile - 打開文件的最大數目
rss - 最大持久設置大小
stack - 最大棧大小
cpu - 以分鐘爲單位的最多 CPU 時間
noproc - 進程的最大數目
as - 地址空間限制
maxlogins - 此用戶允許登錄的最大數目)
5.
[root@sq1 ~]# vi /etc/pam.d/login (limits.conf是pam_limits.so的配置文件)
session required /lib/security/pam_limits.so
6.用戶環境變量
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ vi .bash_profile
ORACLE_BASE=/oracle/app
ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
ORACLE_SID=TEST
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
LANG=en_US.UTF-8
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH LANG
讓環境變量生效
[oracle@localhost ~]$ source .bash_profile
7.把oracle 安裝程序 拷貝到linux
用oracle用戶 解壓縮
[root@localhost ~]# chmod 777 /home/oracle/oracle_database_linux32.zip
[root@localhost ~]# su - oracle
8.root用戶創建安裝目錄 並修改/etc/hosts
[root@localhost 10g]# hostname sq1
[root@localhost 10g]# vi /etc/hosts
192.168.8.12 sq1
[root@localhost /]# mkdir -p /oracle/app
[root@localhost /]# chmod 777 /oracle
[root@localhost ~]# chmod 777 /oracle/app/
[root@localhost /]# chown -R oracle.oinstall /oracle
9.開始安裝oracle(如果是su 切換的用戶會報錯Can't connect to x11 window server using 解決方式:以root用戶執行:xhost +IP(本機ip)然後以oracle用戶執行export DISPLAY=IP:0.0)
以oracle 用戶登陸 進入解壓縮目錄 ./runInstaller
選擇高級安裝(advanced installation)
注意此處爲oinstall組點擊下一步
此處選擇企業版下一步
選擇安裝目錄 下一步
/oracle/app/oracle/product/10.2.0/db_1
(注意安裝目錄要跟bash_profile中 ORACLE_HOME目錄一樣)
檢測是否缺乏軟件包(警告爲正常)下一步
只安裝數據庫軟件(install database software only)下一步
選擇安裝
安裝最後提示需要root身份 執行兩個腳本
執行後退出即可
--------------------------
dbca 創建數據庫
數據庫SID 參照 用戶環境變量中的設置(TEST)
[oracle@localhost ~]$ unzip oracle_database_linux32.zip
[oracle@oracle2 ~]$ ls
database Desktop oracle_database_linux32.zip
[oracle@oracle2 ~]$ cd database/
[oracle@oracle2 database]$ ls
doc install response runInstaller stage welcome.html
[oracle@oracle2 database]$
[oracle@oracle2 database]$ ./runInstaller
[root@localhost ~]# cd /oracle/app/oraInventory/
[root@localhost oraInventory]# ls
Contents logs orainstRoot.sh
ContentsXML oraInstaller.properties oui
install.platform oraInst.loc sessionContext.ser
[root@localhost oraInventory]# ./orainstRoot.sh
Changing permissions of /oracle/app/oraInventory to 770.
Changing groupname of /oracle/app/oraInventory to oinstall.
The execution of the script is complete
[root@localhost ~]# cd /oracle/app/oracle/product/10.2.0/db_1/
[root@localhost db_1]# ls
assistants demo jlib odbc plsql srvm
bin diagnostics jre olap precomp sysman
cdata has ldap OPatch racg uix
cfgtoollogs hs lib opmn rdbms wwg
clone install md oracore relnotes xdk
config install.platform mesg oraInst.loc root.sh
crs inventory mgw ord root.sh.old
css javavm network oui slax
ctx jdbc nls owm sqlj
dbs jdk oc4j perl sqlplus
[root@localhost db_1]# ./root.sh
[root@localhost db_1]# cd /
[root@localhost ~]# su – oracle
[root@localhost ~]# su - oracle
[oracle@oracle2 ~]$ cd $ORACLE_HOME
[oracle@oracle2 db_1]$ pwd
/oracle/app/oracle/product/10.2.0/db_1
[oracle@oracle2 db_1]$
[oracle@oracle2 db_1]$ cd /oracle/app/
[oracle@oracle2 app]$ ls
oracle oraInventory
[oracle@oracle2 database]$ dbca
[oracle@oracle2 ~]$ cd /oracle/app/
[oracle@oracle2 app]$ ls
admin flash_recovery_area oracle oradata oraInventory
[oracle@oracle2 app]$ cd oradata/
[oracle@oracle2 oradata]$ ls
TEST
[oracle@oracle2 TEST]$ sqlplus sys/a123456 as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Sep 20 18:05:21 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>select *from scott.emp;
[oracle@oracle2 TEST]$ sqlplus / as sysdba
安裝最後提示需要root身份 執行兩個腳本
su -
cd /oracle/app/oraInventory/
./orainstRoot.sh
cd /oracle/app/oracle/product/10.2.0/db_1/
./root.sh
執行後退出即可