操作系统及Oracle版本
linux版本:SUSE Linux Enterprise Server 11 (x86_64)
Oracle 版本:Release 11.2.0.3.0
1、检查依赖包是否安装成功 。如果没有安装成功,请安装完。
rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel
2、创建安装目录及数据库用户
groupadd dba groupadd oinstall useradd -g oinstall -G dba -m oracle mkdir -pv /u01/oracle/oradata mkdir -pv /u01/oracle/oraInventory mkdir -pv /u01/oracle/oracle/product/11.2.0/dbhome_1 chown -R oracle:oinstall /u01/oracle
3、修改内核参数,
在文件末尾添加如下内容(其中shmmax 参数可能需要根据服务器的配置调整,后面预检查的时候,如果不通过,需要根据提示的值配置 。 ):
vi /etc/sysctl.conf fs.file-max = 6815744 fs.aio-max-nr = 1048576 kernel.shmall = 4194304 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576
要使 /etc/sysctl.conf 更改立即生效,执行命令sysctl -p
4、修改用户限制
1)修改用户的shell设置, vi /etc/security/limits.conf ,在文件最后添加以下四行; oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 保存退出; 2)修改/etc/pam.d/login 文件 vi /etc/pam.d/login ,在文件最后添加以下两行; session required /lib/security/pam_limits.so session required pam_limits.so 保存退出;
5、oracle环境变量的设置(需根据实际情况修改,特别是SID)
[email protected]:~> vi .bashrc export ORACLE_BASE=/u01/oracle export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=csdb export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
6、检查oracle是否满足安装条件 。
./runInstaller -silent -executePrereqs
然后再看日志是否有报错 。
7、修改响应文件,安装数据库软件
需要修改db_install.rsp , 具体见附件,附件的文件可以直接使用,只需修改主机名,oracle安装目录即可。
如:
ORACLE_HOSTNAME=CSDB #主机名
ORACLE_HOME=
ORACLE_BASE
安装数据库软件 。
[email protected]:~/ora11gR2_x64/database> ./runInstaller -silent -responseFile /home/oracle/etc/new/db_install.rsp
8、安装库 ,修改字符集和实例跟密码即可 。
dbca -silent -createDatabase -characterset AL32UTF8 -templateName $ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc -gdbName csdb -sid csdb -sysPassword huawei123 -systemPassword huawei123
9、注册实例、验证是否安装成功 。
[email protected]:~> sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Thu Apr 20 11:21:23 2017 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> alter system register 2 ; System altered. SQL> / / System altered.
然后,查看监听 :
[email protected]:~> lsnrctl status LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 20-APR-2017 11:22:14 Copyright (c) 1991, 2011, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production Start Date 20-APR-2017 10:31:20 Uptime 0 days 0 hr. 50 min. 54 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Log File /u01/oracle/diag/tnslsnr/CSDB02/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))) Services Summary... Service "csdb" has 1 instance(s). Instance "csdb", status READY, has 1 handler(s) for this service... Service "csdbXDB" has 1 instance(s). Instance "csdb", status READY, has 1 handler(s) for this service... The command completed successfully [email protected]:~>