当前位置:文档之家› CentOS下oracle11g_2图解安装过程

CentOS下oracle11g_2图解安装过程

这些以rpm为扩展名的文件存在于CentOS-5.6-i386-bin-DVD.iso下的CentOS文件中1|、检查rpm包是否安装完毕:rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat vixie-cron unixODBC unixODBC-devel glibc-headers下图是运行rpm指令的结果上图红色代表改包未安装。

安装方法(1)可以使用yum install 包名来安装,(2)也可以从CentOS-5.6-i386-bin-DVD.iso下的CentOS文件中找到相应的未安装的rpm文件,并把这些文件复制粘贴到CentOS系统中,如下图然后在这个文件夹中打开终端,就不需要跳转目录了如下图使用下图指令安装rpm包。

rpm –ivh compat-libstdc++-33-3.2.3-61.i386.rpm安装完软件包再检查一次。

接下来是第二步。

2、创建oracle所需要的用户名(oracle)和组名(oinstall、dba),并设置相应的权限:groupadd oinstall//创建组oinstall。

groupadd dba//创建组dbauseradd -g oinstall -G dba -d /home/oracle oracle //添加用户、并添加到组成员passwd oracle chunzhilianxue//这里的命令为设置oracle的密码,输入二次进行确认我的密码是chunzhilianxue。

如果设置密码成功的话会出现下图所示3、创建oracle数据库安装的文件目录及路径,并设置文件权限:[root@mc ~]# mkdir -p /home/oracle //设置Oracle的安装目录[root@mc ~]# chown -R oracle:oinstall /home/oracle //设置安装目录所属的用户和组[root@mc ~]# chmod -R 775 /home/oracle //设置文件权限4、接下来修改系统配置[root@mc ~]# vi /etc/sysctl.conf执行此命令之后,是对配置文件进行修改,再把下面的语句复制粘贴进去,操作如下kernel.shmall = 2097152 //固定大小为2Mkernel.shmmax = 2147483648 //一般设置为物理的一半kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max然后按ESC退出编辑,再按两次大写的Z,或者输入wq就可以保存文件并退出编辑。

[root@mc ~]# /sbin/sysctl -p //使修改后的配置文件生效5、为 oracle 用户设置 Shell 限制vi /etc/security/limits.conf在最末尾的地方加上:操作同4oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536vi /etc/profile //此语句是执行指令,不是修改文件在最末尾的地方加上:操作同4if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fiFivi /etc/csh.login在最末尾的地方加上:if ( $USER == "oracle" ) thenlimit maxproc 16384limit deors 65536umask 022endifvi /etc/pam.d/login如果显示结果没有下列语句,则在文件中加入下列行:session required /lib/security/pam_limits.sossion required pam_limits.so6、选择是开启还是关闭SELINUX的工作模式vi /etc/selinux/config设置SELINUX为disabledSELINUX=disabled7、修改系统的发行版本(可不操作)vi /etc/redhat-release将CentOS release 5.6 (Final) 修改成Red Hat Enterprise Linux AS release 5 (Taroon)(因为oracle公司没推出CentOS版本的oracle)8、下面就在终端用新建的 oracle 用户登录进行操作:[root@mc ~]# su – oracle修改 .bash_profile 此文件即为 oracle 用户的环境变量,以下是完整配置 vi .bash_profile操作如下图然后进入修改文件界面,在文件中添加下列语句ORACLE_BASE=/home; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/oracle; export ORACLE_HOMEORACLE_SID=orcl; export ORACLE_SIDPATH=$ORACLE_HOME/bin:$PATH; export PATH保存并退出编辑source .bash_profile //用此命令载入刚配置好的环境变量文件exit //退回到root用户xhost + //确保X窗口的正常显示su - oracle //再次以oracle用户登录cd /home/database //转到database目录下,我的database目录是此处[root@mc database]# $ ./runInstaller-ignoreSysPrereqs //运行runInstall命令开始安装oracle进入到启动检测界面安装的过程会遇到下图的问题,只要根据提示修复就OK了。

1)单击操作系统内核参数:file-max2)单击修补再次检查。

(弹出提示框)如下图3)以root身份运行此脚本就可以了[root@mc ~]# /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh4)安装pdksh-5.2.14包。

yum install pdksh-5.2.14。

数据库安装完毕之后,需要手动执行一条脚本命令:[root@mc ]# /home/oraInventory/orainstRoot.sh更改权限/home/oraInventory 到 770.更改组名/home/oraInventory 到 oinstall.脚本的执行已完成[root@mc oracle]# /home/oracle/app/oracle/product/11.1.0/db_1/root.sh Running Oracle 11g root.sh ...The following environment variables are set as:ORACLE_OWNER= oracleORACLE_HOME= /u01/app/oracle/product/11.1.0/db_1Enter 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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root.sh .Now product-specific root actions will be performed.Finished product-specific root actions.安装完成后设置"/etc/oratab"[[root@mc oracle]# vi /etc/oratab#修改为ORCL:/home/oracle/app/oracle/product/11.1.0/db_1:Y按照提示,一步一步安装,整个过程就非常简单。

安装完以后,重启则oracle服务默认是没有被启动的,则需要手工进行启动。

需要以oracle用户身份登录,登录之后主要服务的启动方式为数据库服务启动 | 关闭[oracle@oracle bin]$ dbstart | dbshut监听器启动 | 关闭。

[oracle@oracle bin]$ lsnrctl start | stopem 控制台启动 | 关闭[oracle@oracle bin]$ emctl start | stop dbconsole访问 https://localhost:1158/emiSQL*Plus 启动 | 关闭[oracle@oracle bin]$ isqlplusctl start | stop 访问 http://localhost:5560/isqlplus。

相关主题