0、下载oracle 11g的2个安装包,上传到服务器,并解压2个包在一个目录下(我的目录是/upload)
1、安装依赖包,如需离线安装,需部署本地源
yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc- gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh
2、添加oracle用户
groupadd dba
groupadd oinstall
groupadd asmdba
groupadd asmadmin
useradd -g oinstall -G dba,asmdba,asmadmin oracle
3、建立oracle安装目录
mkdir -p /u01
chmod 777 -R /u01
4、编辑环境变量
vi /etc/profile
#----------------------------------------------
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
DISPLAY=192.168.1.159:0.0;export DISPLAY
ORACLE_HOSTNAME=oracle2; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=ORCL; export ORACLE_SID
ORACLE_UNQNAME=ORCL; export ORACLE_UNQNAME
ORACLE_TERM=xterm; export ORACLE_TERM
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
#-----------------------------------------------
5、执行安装
./runInstaller -silent -responseFile /upload/db_install.rsp -ignoreSysPrereqs -ignorePrereq
6、安装提成成功后在root用户下执行以下2句
As a root user, execute the following script(s):
1. /u01/app/oinventory/orainstRoot.sh
2. /u01/app/oracle/product/11.2.0/db_1/root.sh
6、创建数据库
cd /u01/app/oracle/product/1.20/db_1/bin
dbca -silent -cloneTemplate -gdbName orcl -sid orcl -datafileDestination /u01/oradata -responseFile /upload/db_create.rsp
7、启动数据库
拷贝/u01/app/oracle/admin/orcl/pfile/init.ora.8122014171937 改名为initORCL.ora到/u01/app/oracle/product/11.2.0/db_1/dbs
lsnrctl start
sqlplus / as sysdba
SQL>startup
8关闭防火墙
service iptables stop
chkconfig --level 35 iptables off