centos5.1安装oracle 11G
最近要用到oracle,所以就直接装一下oracle 11g了,在oracle官方上下载一个oracle
用unzip解压,
unzip linux_x86_11gR1_database.zip
1、安装包检测及安装
[root@localhost CentOS]# rpm -q gcc make binutils setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel unixODBC unixODBC-devel libaio-devel sysstat
gcc-4.1.2-14.el5
make-3.81-1.1
binutils-2.17.50.0.6-5.el5
setarch-2.0-1.1
compat-db-4.2.52-5.1
package compat-gcc is not installed
package compat-gcc-c++ is not installed
package compat-libstdc++ is not installed
package compat-libstdc++-devel is not installed
unixODBC-2.2.11-7.1
unixODBC-devel-2.2.11-7.1
libaio-devel-0.3.106-3.2
sysstat-7.0.0-3.el5
再用rpm -ivh 安装就行,这些包在centos安装盘中都用!
2、系统参数设置及用户目录设置
//查看内存及swap
# grep MemTotal /proc/meminfo
MemTotal:512236 kB
# grep SwapTotal /proc/meminfo
SwapTotal:1574360 kB
sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Controls the maximum size of a message, in bytes
#kernel.msgmnb = 65536
# Controls the default maxmimum size of a mesage queue
#kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
#kernel.shmmax = 4294967295
# Controls the maximum number of shared memory segments, in pages
#kernel.shmall = 268435456
#Below for oracle11g
kernel.core_uses_pid = 1
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.sem = 250 32000 100 128
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
//添加用户组及用户
#groupadd dba
#groupadd oinstall
#useradd oracle -g oinstall -G dba
#passwd oracle
//新建目录权限
#mkdir -p /u01/app/oracle
#chown -R oracle:dba /u01/app/oracle
#chmod -R 755 /u01/app/oracle
#mkdir -p /u01/app/oracle/product/11.1.0.6
#chown -R oracle:dba /u01/app/oracle/product/11.1.0.6
#chmod -R 755 /u01/app/oracle/product/11.1.0.6
#mkdir -p /u01/app/oralnventory
#chown -R oracle:dba /u01/app/oralnventory
#chmod -R 755 /u01/app/oralnventory
//用户环境变量
su - oracle
vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:HOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0.6
export ORACLE_SID=sales
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:ORACLE_HOME/lib
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORA_NLS10=$ORACLE_HOME/nls/data
unset USERNAME
umask 022
3、安装oracle
退出root,用oracle帐号进入,进入/oracle/databese
[root@localhost database]# pwd
/oracle/database
[root@localhost database]# ls
doc install response runInstaller stage welcome.html
[root@localhost database]#
执行./runInsaller进行安装,
4、测试oracle
[oracle@localhost bin]$ dbstart
[oracle@localhost bin]$ sqlplus /nolog
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Apr 16 15:34:08 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.1.0.6/dbs/initsales.ora'
SQL>
出错,,郁闷呀,
找了N久也没找到,,后来我们公司的DBA说没有ORALCE实例,没办法,只有把装好的重新安装了。。
LINUX就是一点好,可以删除就行,
选到实例,,重新安装,
后来就没问题了,不过要做启动脚本的话,还要修改一下dbshut和dbstart里面的一行
ORACLE_HOME_LISTNER=$1改成ORACLE_HOME_LISTNER=$ORACLE_HOME
再修改一下/etc/oratab文件,
sales:/u01/app/oracle/product/11.1.0.6:N
修改成sales:/u01/app/oracle/product/11.1.0.6:Y
到些,安装就完成了,,,来,,测试一下
[oracle@localhost bin]$ dbstart
Processing Database instance "sales": log file /u01/app/oracle/product/11.1.0.6/startup.log
[oracle@localhost ~]$ ps -ef |grep ora
root 2147 2124 0 17:26 ? 00:00:00 hald-addon-storage: polling /dev/hdc
root 2415 2381 0 17:29 pts/1 00:00:00 su - oracle
oracle 2416 2415 0 17:29 pts/1 00:00:00 -bash
oracle 2753 2416 0 17:32 pts/1 00:00:00 -bash
oracle 2757 1 0 17:32 ? 00:00:00 /u01/app/oracle/product/11.1.0.6/bin/tnslsnr LISTENER -inherit
oracle 2806 2753 0 17:32 pts/1 00:00:00 -bash
oracle 2855 2806 0 17:32 pts/1 00:00:00 sqlplus
oracle 2860 1 0 17:32 ? 00:00:00 ora_pmon_sales
oracle 2862 1 0 17:32 ? 00:00:00 ora_vktm_sales
oracle 2866 1 0 17:32 ? 00:00:00 ora_diag_sales
oracle 2868 1 0 17:32 ? 00:00:00 ora_dbrm_sales
oracle 2870 1 0 17:32 ? 00:00:00 ora_psp0_sales
oracle 2874 1 0 17:32 ? 00:00:00 ora_dia0_sales
oracle 2876 1 0 17:32 ? 00:00:00 ora_mman_sales
oracle 2878 1 3 17:32 ? 00:00:01 ora_dbw0_sales
oracle 2880 1 1 17:32 ? 00:00:00 ora_lgwr_sales
oracle 2882 1 0 17:32 ? 00:00:00 ora_ckpt_sales
oracle 2884 1 0 17:32 ? 00:00:00 ora_smon_sales
oracle 2886 1 0 17:32 ? 00:00:00 ora_reco_sales
oracle 2888 1 7 17:32 ? 00:00:03 ora_mmon_sales
oracle 2890 1 0 17:32 ? 00:00:00 ora_mmnl_sales
oracle 2892 1 0 17:32 ? 00:00:00 ora_d000_sales
oracle 2894 1 0 17:32 ? 00:00:00 ora_s000_sales
oracle 2901 2855 26 17:33 ? 00:00:09 oraclesales (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 2903 1 22 17:33 ? 00:00:06 ora_p000_sales
oracle 2905 1 1 17:33 ? 00:00:00 ora_fbda_sales
oracle 2907 1 0 17:33 ? 00:00:00 ora_smco_sales
oracle 2909 1 0 17:33 ? 00:00:00 ora_w000_sales
oracle 2911 1 0 17:33 ? 00:00:00 ora_qmnc_sales
root 2940 2912 0 17:33 pts/2 00:00:00 su - oracle
oracle 2941 2940 1 17:33 pts/2 00:00:00 -bash
oracle 2971 1 1 17:33 ? 00:00:00 ora_q000_sales
oracle 2973 1 1 17:33 ? 00:00:00 ora_q001_sales
oracle 2979 1 24 17:33 ? 00:00:02 ora_m002_sales
oracle 2986 2941 0 17:33 pts/2 00:00:00 ps -ef
oracle 2987 2941 0 17:33 pts/2 00:00:00 grep ora
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Apr 16 17:33:57 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
完成!
阅读(1855) | 评论(1) | 转发(0) |