安装包
[root@localhost ~]# yum install binutils compat-db control-center gcc* glibc libXp libstdc++ libstdc++-devel make openmotif
[root@localhost ~]# yum -y install control-center*
[root@localhost ~]# yum -y install sysstat
修改Oracle语言字符集
[root@localhost ~]# vi /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
root用户设置核心参数
vi /etc/sysctl.conf
kernel.shmall = 2097152
(共享内存,单位是页面数 x86的32位为4k)
kernel.shmmax = 2147483648 (单个共享内存段的最大尺寸)
kernel.sem = 250 32000 100 128 (信号量)
fs.file-max = 65536 (文件句柄的最大数量)
net.ipv4.ip_local_port_range = 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) (让Oracle认为linux是版本3)
使内核生效
[root@localhost ~]# /sbin/sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 2147483648
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
[root@sq1 ~]# vi /etc/security/limits.conf (文件实际是 Linux PAM,插入式认证模块)
oracle
soft nproc 2047 (oracle对进程最大数目的软限制)
oracle
hard nproc 16384 (oracle对进程最大数目的硬限制)
oracle
soft nofile 1024 (oracle对打开文件的最大数目的软限制)
oracle
hard nofile 65536 (oracle对打开文件的最大数目的硬限制)
[root@sq1 ~]# vi /etc/pam.d/login (limits.conf是pam_limits.so的配置文件)
session
required /lib/security/pam_limits.so (添加模块)
(应用限制PAM在登陆时加载限制模块)
用户环境变量
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ vi .bash_profile
ORACLE_BASE=/oracle/app (Oracle安装目录)
ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1 (Oracle主目录)
ORACLE_SID=TEST (Oracle实例名)
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin (Oracle所存放命令的路径)
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
切换到Oracle用户
把oracle 安装程序 拷贝到linux
用oracle用户 解压缩
[oracle@localhost ~]$ unzip oracle_database_linux32.zip
root用户创建安装目录 并修改/etc/hosts
[root@localhost 10g]# hostname sq1
[root@localhost 10g]# vi /etc/hosts
[root@localhost /]# mkdir -p /oracle/app
[root@localhost /]# chmod -R 777 /oracle
[root@localhost /]# chown -R oracle.oinstall /oracle
安装Oracle 以oracle 用户登陆 进入解压缩目录 ./runInstaller 具体如图1所示
[root@sq1 oracle]# . /oracle/app/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@sq1 oracle]# . /oracle/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /oracle/app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
创建一个库
[oracle@sq1 database]$ dbca
如图2所示
检查是否安装成功
[oracle@sq1 database]$ ps -ef |grep ora_
oracle
22755 1 0 02:41 ? 00:00:00 ora_pmon_TEST
oracle
22757 1 0 02:41 ? 00:00:00 ora_psp0_TEST
oracle
22759 1 0 02:41 ? 00:00:00 ora_mman_TEST
oracle
22761 1 0 02:41 ? 00:00:00 ora_dbw0_TEST
oracle
22763 1 0 02:41 ? 00:00:00 ora_lgwr_TEST
oracle
22765 1 0 02:41 ? 00:00:00 ora_ckpt_TEST
oracle
22767 1 0 02:41 ? 00:00:00 ora_smon_TEST
oracle
22769 1 0 02:41 ? 00:00:00 ora_reco_TEST
oracle
22771 1 0 02:41 ? 00:00:00 ora_cjq0_TEST
oracle
22773 1 0 02:41 ? 00:00:00 ora_mmon_TEST
oracle
22775 1 0 02:41 ? 00:00:00 ora_mmnl_TEST
oracle
22777 1 0 02:41 ? 00:00:00 ora_d000_TEST
oracle
22779 1 0 02:41 ? 00:00:00 ora_s000_TEST
oracle
22784 1 0 02:41 ? 00:00:00 ora_qmnc_TEST
oracle
22794 1 0 02:41 ? 00:00:00 ora_p000_TEST
oracle
22796 1 0 02:41 ? 00:00:00 ora_p001_TEST
oracle
22798 1 0 02:41 ? 00:00:00 ora_p002_TEST
oracle
22800 1 0 02:41 ? 00:00:00 ora_p003_TEST
oracle
22870 1 0 02:41 ? 00:00:00 ora_q002_TEST
oracle
22872 1 0 02:41 ? 00:00:00 ora_q003_TEST
oracle
23729 3016 0 02:45 pts/1 00:00:00 grep ora_