设为首页 收藏本站
查看: 568|回复: 0

[经验分享] [转载] CentOS 5.5命令行安装Oracle 10g

[复制链接]

尚未签到

发表于 2016-5-12 09:17:17 | 显示全部楼层 |阅读模式
1.验证Oracle所需要的系统依赖程序包是否完整。
rpm -qa binutils compat-db control-center gcc gcc-c++ glibc glibc-common libstdc++ libstdc++-devel make libaio libXp
2.验证系统要求
Oracle所需最小 RAM 512MB,而所需最小交换空间为 1GB。对于 RAM 小于或等于 2GB 的系统,交换空间应为 RAM 数量的两倍;对于 RAM 大于 2GB 的系统,交换空间应为 RAM 数量的一到两倍。Oracle 10g 软件还需要 2.5GB 的可用磁盘空间,而数据库则另需 1.2GB 的可用磁盘空间。/tmp 目录至少需要 400MB 的可用空间。
3.创建Oracle用户组和用户
 创建用户组oinstalldba
创建用户oracle,同属于oinstalldba用户组,并且建立了oraclehome目录。
修改oracle用户的登录密码。
$su - root
#groupadd dba //数据库系统管理理组
#groupadd oinstall //Oracle文件所有者的组
#useradd -g oinstall -G dba -m -s /bin/bash oracle
#passwd oracle
#chown -R oracle.oinstall /home/oracle
4.配置内核参数
#vi /etc/sysctl.conf
编辑文件/etc/sysctl.conf,修改以下项目,如果没有可以自己添加。
kernel.shmall = 2097152#可以使用的共享内存的总量。
kernel.shmmax = 2147483648#最大共享内存段大小。
kernel.shmmni = 4096#整个系统共享内存段的最大数目。
kernel.sem  =  250 32000 100 128 # 每个信号对象集的最大信号对象数;系统范围内最大信号对象数;每个信号对象支持的最大操作数;系统范围内最大信号对象集数。
fs.file-max = 65536#系统中所允许的文件句柄最大数目。
net.ipv4.ip_local_port_range = 1024 65000#应用程序可使用的IPv4端口范围。
net.core.rmem_default = 1048576 # 套接字接收缓冲区大小的缺省值
net.core.rmem_max = 1048576 # 套接字接收缓冲区大小的最大值
net.core.wmem_default = 262144 # 套接字发送缓冲区大小的缺省值
net.core.wmem_max = 262144 # 套接字发送缓冲区大小的最大值
5.解压缩安装文件
unzip 10201_database_linux32.zip
6.修改gennttab
解压缩filegroup6.jar
cd database/stage/Components/oracle.network.rsf/10.2.0.1.0/1/DataFiles/
unzip filegroup6.jar bin/gennttab
修改解压出来的gennttab文件。
vi bin/gennttab
  DSC0000.gif
 改为:
DSC0001.gif
即把`s/ ///`中的后面的”/”改为”n”,同时要注意把n后的空格删除,否则在安装监听器时会报错。
gennttab添加到filegroup6.jar中。
zip -vu filegroup6.jar bin/gennttab
7. Oracle 建议对每个 Linux 帐户可以使用的进程数和打开的文件数设置限制。
要进行这些更改,以 root 用户的身份执行下列命令:
vi /etc/security/limits.conf
添加如下内容:
   oracle soft nproc 2047
   oracle hard nproc 16384
   oracle soft nofile 1024
   oracle hard nofile 65536
8.设置环境变量
oracle用户登录。
vi  ~/.bash_profile
添加如下内容:
    export TMP=/tmp
    export TMPDIR=/tmp
    export ORACLE_BASE=/home/oracle
    export ORACLE_SID=ora10g
    export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1/db_1
    export PATH=$PATH:$ORACLE_HOME/bin
9.修改enterprise.rsp文件,在oracle安装目录下可以找到/database/response/enterprise.rsp
ORACLE_HOME="/home/oracle/product/10.2.0.1/db_1"
ORACLE_HOME_NAME="Oracle10g"
s_nameForDBAGrp="dba"
s_nameForOPERGrp="dba"
n_configurationOption=3
说明:
ORACLE_HOME Oracle服务器的主目录位置,必须是绝对路径。
ORACLE_HOME_NAME Oracle服务器的名称,必须以字母开头。
s_nameForDBAGrp 用于Oracle系统管理的linux用户组名,该组的用户拥有管理Oracle服务器的权限。
s_nameForOPERGrp 用于Oracle数据库常规操作的linux用户组名,该组的用户拥有常规操作Oracle数据库的权限。
n_configurationOption 安装类型(1为在安装后创建数据库,2为安装后创建一个自动存储管理实例,3为只安装服务器软件)。
10.修改操作系统发行版本
由于oracle还没有推出支持CentOS的安装包,所以需要修改发行版本,以便通过oracle的安装检查,发行版本文件的位置为/etc/redhat-release
CentOS release 5 (Final)
修改成
Red Hat Enterprise Linux AS release 3 (Taroon)
安装完成后再改回来。
11.关闭SELINUX工作模式
SELINUX属性配置文件位置为/etc/selinux/config
# 设置SELINUXdisabled
   SELINUX=disabled
12.开始安装
./runInstaller -ignoreSysPrereqs -silent -responseFile /home/oracle/database/response/enterprise.rsp
说明:
ignoreSysPrereqs Oracle忽略系统检查,因为Oracle官方声明只支持Linux服务器产品,所以要在非服务器产品的Linux上安装就必须指定此参数。
silent 让安装程序以静默模式运行。
responseFile 指定一个应答文件。
注意:如果ORACLE_HOMEORACLE_BASE目录设在相同的位置,或者ORACLE_HOME所在目录不为空的话,会有如下错误:
SEVERE:OUI-10029:Youhave specified a non-empty directory to install this product. It is recommended to specify either an empty or a non-existent directory. You may, however, choose to ignore this message if the directory contains Operating System generated files or subdirectories like lost+found.
如果仍然要以当前配置安装的话,请在安装时添加-force参数进行强制安装。
13.oracle系统初始化
root管理员运行$ORACLE_HOME/root.sh进行Oracle的系统初始化工作,通常一路按回车用默认值即可。
14.安装网络监听器
编辑oracle安装目录下的netca.rsp应答文件,地址为:/database/response/netca.rsp,主要查看以下参数配置:
INSTALL_TYPE=""custom"" 安装的类型
LISTENER_NUMBER=1 监听器数量
LISTENER_NAMES={"LISTENER"} 监听器的名称列表
LISTENER_PROTOCOLS={"TCP;1521"} 监听器使用的通讯协议列表
LISTENER_START=""LISTENER"" 监听器启动的名称
运行安装命令:
$ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/database/response/netca.rsp
注意:在此处可能会有错误oracle需要的软件包不全。请根据1中列出的软件包,确保所有的软件包都已经正确安装(26中对gennttab文件的修改不正确,本人就是没有去掉n后的空格导致了该错误。
15.修改dbstart
vi $ORACLE_HOME/bin/dbstart
    ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
改为:
    ORACLE_HOME_LISTNER=$ORACLE_HOME
确保数据库启动时,网络监听器同时启动。
16.安装数据库实例
编辑Oracle安装源文件夹response目录下的dbca.rsp应答文件:
vi /home/oracle/database/response/dbca.rsp
根据自己的需要修改下列参数:
GDBNAME  = orcl10g  #数据库全局名称
SID = ora  #数据库的SID
SYSPASSWORD = sys  # SYS用户的初始密码
SYSTEMPASSWORD = sys #SYSTEM用户的初始密码
CHARACTERSET = ZHS16GBK #数据库字符集(中文为 ZHS16GBK
NATIONALCHARACTERSET = ZHS16GBK # 数据库国家字符集
运行安装命令:
$ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/database/response/dbca.rsp -cloneTemplate
数据库创建成功后需要修改一些信息:
vi /etc/oratab
ora10g:/opt/oracle/product/10.2.0.1/db_1:N
改为:
ora10g:/opt/oracle/product/10.2.0.1/db_1:Y
保证数据库实例能自动启动。
17.启动数据库实例
$ORACLE_HOME/bin/dbstart
18.测试
sqlplus "/as sysdba"
19. 配置EM资料库,数据库和监听都必须已经启动并正常工作
配置dbcontrol
[oracle@oracle10 ~]$ emca -config dbcontrol db
STARTED EMCA at Oct 27, 2007 9:33:48 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: orcl
Database Control is already configured for the database orcl
You have chosen to configure Database Control for managing the database orcl
This will remove the existing configuration and the default settings and perform a fresh configuration
Do you wish to continue? [yes(Y)/no(N)]: Y
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /opt/oracle/product/10.2.0/Database
Database hostname ................ oracle10
Listener port number ................ 1521
Database SID ................ orcl
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 27, 2007 9:35:12 AM oracle.sysman.emcp.EMConfig perform
INFO:This operation is being logged at /opt/oracle/product/10.2.0/Database/cfgtoollogs/emca/orcl/emca_2007-10-27_09-33-46-AM.log.
Oct 27, 2007 9:35:33 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Oct 27, 2007 9:36:39 AM oracle.sysman.emcp.ParamsManager getLocalListener
WARNING: Error retrieving listener for oracle10
Oct 27, 2007 9:36:54 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Oct 27, 2007 9:39:51 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Oct 27, 2007 9:39:53 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO:>>>>>>>>>>> The Database Control URL is http://oracle10:5500/em <<<<<<<<<<<
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 27, 2007 9:39:53 AM
[oracle@oracle10 ~]$
删除数据库的 Database Control配置
[oracle@oracle10 ~]$ emca -deconfig dbcontrol db
STARTED EMCA at Oct 27, 2007 10:44:24 AM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: orcl
Do you wish to continue? [yes(Y)/no(N)]: Y
Oct 27, 2007 10:44:47 AM oracle.sysman.emcp.EMConfig perform
INFO:This operation is being logged at /opt/oracle/product/10.2.0/Database/cfgtoollogs/emca/orcl/emca_2007-10-27_10-44-22-AM.log.
Oct 27, 2007 10:44:52 AM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Oct 27, 2007 10:48:13 AM oracle.sysman.emcp.EMReposConfig stopDBMSJobs
WARNING: Error initializing SQL connection. SQL operations cannot be performed
Oct 27, 2007 10:48:13 AM oracle.sysman.emcp.EMReposConfig invoke
WARNING: Unable to remove DBMS jobs.
Enterprise Manager configuration completed successfully
FINISHED EMCA at Oct 27, 2007 10:51:01 AM
[oracle@oracle10 ~]$
20.uninstall oracle if you want:
   ./runInstaller-silent -deinstall -removeallfiles -removeAllPatches "REMOVE_HOMES={$ORACLE_HOME}" -responseFile ~oracle/database/response/enterprise.rsp

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-215863-1-1.html 上篇帖子: CentOS 5 安装和配置无线网卡指南 下篇帖子: Centos下,安装python2.7.9
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表