这些以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//创建组dba
useradd -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 //固定大小为2M
kernel.shmmax = 2147483648 //一般设置为物理的一半
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max
然后按ESC退出编辑,再按两次大写的Z,或者输入wq就可以保存文件并退出编辑。[root@mc ~]# /sbin/sysctl -p //使修改后的配置文件生效
5、为 oracle 用户设置 Shell 限制
vi /etc/security/limits.conf
在最末尾的地方加上:操作同4
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/profile //此语句是执行指令,不是修改文件
在最末尾的地方加上:操作同4
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
Fi
vi /etc/csh.login
在最末尾的地方加上:
if ( $USER == "oracle" ) then
limit maxproc 16384
limit deors 65536
umask 022
endif
vi /etc/pam.d/login
如果显示结果没有下列语句,则在文件中加入下列行:
session required /lib/security/pam_limits.so
ssion required pam_limits.so
6、选择是开启还是关闭SELINUX的工作模式
vi /etc/selinux/config
设置SELINUX为disabled
SELINUX=disabled
7、修改系统的发行版本(可不操作)
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_BASE
ORACLE_HOME=$ORACLE_BASE/oracle; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=$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-max
2)单击修补再次检查。(弹出提示框)如下图
3)以root身份运行此脚本就可以了
[root@mc ~]# /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh
4)安装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= oracle
ORACLE_HOME= /u01/app/oracle/product/11.1.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 .
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 | stop
em 控制台启动 | 关闭
[oracle@oracle bin]$ emctl start | stop dbconsole
访问 https://localhost:1158/em
iSQL*Plus 启动 | 关闭
[oracle@oracle bin]$ isqlplusctl start | stop 访问 http://localhost:5560/isqlplus