欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

程序员文章站 2022-06-06 08:00:53
Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)...

首先在oracle官方上下载一个oracle 11g(特别说明一下在安装centos 5.2时尽量是把开发包装全一些,这样您在安装包检测的时候就会少装一些包。还有一点:安装大概需要5g多的空间,空间不够就老是出错。)

1、用unzip解压 oracle 11g文件

unzip linux_x86_11gr1_database.zip

(这个您也可以在windows下面解压,不过您要加载过来,如果你的分区是ntfs,那您就要安装kernel-module-ntfs、fuse、ntfs-3g,当然具体的怎么操作就不必多说了。如果您还是搞不定的话,请给qq:42271520留言。)

2、安装包检测及安装

在终端中执行: rpm -q gcc make binutils setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel unixodbc unixodbc-devel libaio-devel sysstat
显示结果如下:

vel sysstat

gcc-4.1.2-42.el5

make-3.81-3.el5

binutils-2.17.50.0.6-6.el5

setarch-2.0-1.1

package compat-db is not installed

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

package unixodbc-devel is not installed

package libaio-devel is not installed

package sysstat is not installed

分析:

上面package 软件包 is not installed 部分说明此软件包没有安装,您可以再光盘里面找,再用rpm -ivh 安装就行,这些包在centos安装盘中都用;或者直接用yum install 软件包 来安装,具体操作如下:

yum install compat-db

安装成功installed: compat-db.i386 0:4.2.52-5.1 complete!

yum install compat* (这个包比较多,要稍等一会,不急先抽根烟吧。)

安装成功 installed: compat*......... complete!

yum install unixodbc-devel

安装成功 installed: unixodbc-devel.i386 0:2.2.11-7.1 complete!

yum install  libaio-devel

安装成功 installed: libaio-devel.i386 0:0.3.106-3.2 complete!

yum install  sysstat

安装成功 installed: sysstat.i386 0:7.0.2-1.el5 complete!

说明:您可以再执行一次rpm -q 软件包组合 具体如下:

gcc-4.1.2-42.el5

make-3.81-3.el5

binutils-2.17.50.0.6-6.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.2-1.el5

如上所述:还是有4个软件包没有安装,这个不用理会,其实我们刚才安装的compat包已经包含了;可以继续下一步了。

3、系统参数和用户及目录设置
//系统参数设置
vi /etc/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
#chown -r oracle:dba /u01
#chmod -r 755 /u01
//用户环境变量

先切换用户到oracle:
su – oracle

修改.bash_profile文件:
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

4、安装oracle
注销root ;

用oracle帐号进入,进入oracle所在的目录我的是/disk/oracle11g-linux_x86
[oracle@root-bs oracle11g-linux_x86]$  ls
doc install response runinstaller stage welcome.html
执行./runinsaller进行安装:

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

[oracle@root-bs oracle11g-linux_x86]$ ./runinstaller

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)
Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

当进度条走到头时弹出“密码管理窗口”不想更改,点“确定”
Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

//最后再做几下修改就大功告成了:

vi /u01/app/oracle/producte/11.1.0.6/bin/dbshut

把oracle_home_listner=$1改成oracle_home_listner=$oracle_home

vi /u01/app/oracle/producte/11.1.0.6/bin/dbstart

把oracle_home_listner=$1改成oracle_home_listner=$oracle_home

vi /etc/oratab

把sales:/u01/app/oracle/product/11.1.0.6:n 改成ales:/u01/app/oracle/product/11.1.0.6:y

好了,到此oracle 11g安装完成了,安装的是否成功测试一下就知道了(等不急了......)。

5、测试oracle
[oracle@root-bs oracle11g-linux_x86]$ dbstart

processing database instance "sales": logfile /u01/app/oracle/product/11.1.0.6/

startup.log
[oracle@root-bs oracle11g-linux_x86]$ sqlplus /nolog

sql*plus: release 11.1.0.6.0 - production on wed sep 24 13:57:51 2008

copyright (c) 1982, 2007, oracle.  all rights reserved.

sql> conn / as sysdba
connected.
sql> startup

ora-01081: cannot start already-running oracle - shut it down first

此提示说明服务已经运行不必再重新启动了。如果出现如下错误:
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'
说明没有找到oracle实例,请重新创建实例:

[oracle@root-bs oracle11g-linux_x86]$ netca

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)
创建监听:

具体步骤不再多说
[oracle@root-bs oracle11g-linux_x86]$ dbca

创建数据库:

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)
具体步骤不再多说

总述:到此安装步骤已经写晚了,第一次写这么详细的步骤,写的比较匆忙,不足之处请大伙谅解,写这个步骤主要是不想让初学者们不要走这么多的弯路,尽可能的把我所知道的全部贡献给大家,希望能带给大伙一点点的帮助。

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

Oracle 11g for Linux CentOS 5.2 详细安装步骤分享(图解教程)

相关标签: oracle 11g