oracle,安装
- 格式:doc
- 大小:187.00 KB
- 文档页数:8
基本都是用Oracle身份执行命令(command)1. 验证 Oracle 所需要系统依赖程序包是否完整rpm -qa binutils compat-db control-center gcc gcc-c++ glibc glibc-common libstdc++libstdc++-devel make libaio libXp2. 验证系统要求Oracle 所需最小 RAM 为 512MB 而所需最小交换空间为 1GB 对于 RAM 小于或等于2GB 系统交换空间应为 RAM 数量两倍;对于 RAM 大于 2GB 系统交换空间应为 RAM 数量一到两倍 Oracle 10g 软件还需要 2.5GB 可用磁盘空间而数据(data)库则另需 1.2GB 可用磁盘空间 /tmp 目录至少需要 400MB 可用空间3. 创建 Oracle 用户(user)组和用户(user)创建用户(user)组 oinstall 和 dba创建用户(user) oracle 同属于 oinstall 和 dba 用户(user)组并且建立了 oracle home 目录修改 oracle 用户(user)登录密码(code)$su - root#groupadd dba // 数据(data)库系统管理理组#groupadd oinstall //Oracle 文件所有者组#useradd -g oinstall -G dba -m -s /bin/bash oracle#passwd oracle#chown -R oracle.oinstall /home/oracle4. 配置(configure)内核参数#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. 解压缩安装(install)文件unzip 10201_database_linux32.zip6. 修改 gennttab解压缩 filegroup6.jarcd database/stage/Components/work.rsf/10.2.0.1.0/1/DataFiles/unzip filegroup6.jar bin/gennttab修改解压出来 gennttab 文件vi bin/gennttab改为:即把 `s/ /` 中后面改为 n 同时要注意把 n 后空格删除否则在安装(install)监听器时会报错将 gennttab 添加到 filegroup6.jar 中zip -vu filegroup6.jar bin/gennttab7. Oracle 建议对每个 Linux 帐户可以使用进程数和打开文件数设置限制要进行这些更改以 root 用户(user)身份执行下列命令(command):vi /etc/security/limits.conf添加如下内容:oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 655368. 设置环境变量以 oracle 用户(user)登录vi ~/.bash_profile添加如下内容:export TMP=/tmpexport TMPDIR=/tmpexport ORACLE_BASE=/home/oracleexport ORACLE_SID=ora10gexport ORACLE_HOME=$ORACLE_BASE/product/10.2.0.1/db_1export PATH=$PATH:$ORACLE_HOME/bin9. 修改 enterprise.rsp 文件在 oracle 安装(install)目录下可以找到/database/response/enterprise.rspORACLE_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 用户(user)组名该组用户(user)拥有管理 Oracle 服务器权限(Authorization)s_nameForOPERGrp 用于 Oracle 数据(data)库常规操作 linux 用户(user)组名该组用户(user)拥有常规操作 Oracle 数据(data)库权限(Authorization)n_configurationOption 安装(install)类型 1 为在安装(install)后创建数据(data)库 2 为安装(install)后创建一个自动存储管理实例 3 为只安装(install)服务器软件10. 修改操作系统发行版本由于 oracle 还没有推出支持 CentOS 安装(install)包所以需要修改发行版本以便通过 oracle安装(install)检查发行版本文件位置为 /etc/RedHat-release将 CentOS release 5 (Final)修改成Red Hat Enterprise Linux AS release 3 (Taroon)安装(install)完成后再改回来11. 关闭 SELINUX 工作模式SELINUX 属性配置(configure)文件位置为 /etc/selinux/config# 设置 SELINUX 为 disabledSELINUX=disabled12. 开始安装(install)./runInstaller -ignoreSysPrereqs -silent -responseFile/home/oracle/database/response/enterprise.rsp说明 :ignoreSysPrereqs 让 Oracle 忽略系统检查因为 Oracle 官方声明只支持 Linux 服务器产品所以要在非服务器产品 Linux 上安装(install)就必须指定此参数silent 让安装(install)程序以静默模式运行responseFile 指定一个应答文件注意 : 如果 ORACLE_HOME 和 ORACLE_BASE 目录设在相同位置 , 或者 ORACLE_HOME 所在目录不为空话 , 会有如下错误(error) :SEVERE:OUI-10029:You have 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.如果仍然要以当前配置(configure)安装(install)话 , 请在安装(install)时添加 -force 参数进行强制安装(install)13.oracle 系统初始化以 root 管理员运行 $ORACLE_HOME/root.sh 进行 Oracle 系统初始化工作通常一路按回车用默认值即可14. 安装(install)网络监听器编辑 oracle 安装(install)目录下 netca.rsp 应答文件地址为: /database/response/netca.rsp 主要查看以下参数配置(configure):INSTALL_TYPE=""custom"" 安装(install)类型LISTENER_NUMBER=1 监听器数量LISTENER_NAMES={"LISTENER"} 监听器名称列表LISTENER_PROTOCOLS={"TCP;1521"} 监听器使用通讯协议列表LISTENER_START=""LISTENER"" 监听器启动名称运行安装(install)命令(command):$ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/database/response/netca.rsp注意:在此处可能会有错误(error) oracle 需要软件包不全请根据 1 中列出软件包确保所有软件包都已经正确安装(install) 2 6 中对 gennttab 文件修改不正确本人就是没有去掉 n 后空格导致了该错误(error)15. 修改 dbstartvi $ORACLE_HOME/bin/dbstartORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle改为:ORACLE_HOME_LISTNER=$ORACLE_HOME确保数据(data)库启动时网络监听器同时启动16. 安装(install)数据(data)库实例编辑 Oracle 安装(install)源文件夹 response 目录下 dbca.rsp 应答文件:vi /home/oracle/database/response/dbca.rsp根据自己需要修改下列参数:GDBNAME = orcl10g # 数据(data)库全局名称SID = ora # 数据(data)库 SIDSYSPASSWORD = sys # SYS 用户(user)初始密码(code)SYSTEMPASSWORD = sys #SYSTEM 用户(user)初始密码(code)CHARACTERSET = ZHS16GBK # 数据(data)库字符集中文为 ZHS16GBK NATIONALCHARACTERSET = ZHS16GBK # 数据(data)库国家字符集运行安装(install)命令(command):$ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/database/response/dbca.rsp-cloneTemplate数据(data)库创建成功后需要修改一些信息:vi /etc/oratabora10g:/opt/oracle/product/10.2.0.1/db_1:N改为:ora10g:/opt/oracle/product/10.2.0.1/db_1:Y保证数据(data)库实例能自动启动17. 启动数据(data)库实例$ORACLE_HOME/bin/dbstart18. 测试sqlplus "/as sysdba"19. 配置(configure) EM 资料库数据(data)库和监听都必须已经启动并正常工作配置(configure) dbcontrol[oracle@oracle10 ~]$ emca -config dbcontrol dbSTARTED EMCA at Oct 27, 2007 9:33:48 AMEM Configuration Assistant, Version 10.2.0.1.0 ProductionCopyright (c) 2003, 2005, Oracle. All rights reserved.Enter the following information:Database SID: orclDatabase Control is already configured for the database orclYou have chosen to configure Database Control for managing the database orclThis will remove the existing configuration and the default settings and perform a fresh configurationDo you wish to continue? [yes(Y)/no(N)]: YListener port number: 1521Password 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 settingsDatabase ORACLE_HOME ................ /opt/oracle/product/10.2.0/DatabaseDatabase hostname ................ oracle10Listener port number (1521)Database SID ................ orclEmail address for notifications ...............Outgoing Mail (SMTP) server for notifications ...............-----------------------------------------------------------------Do you wish to continue? [yes(Y)/no(N)]: YOct 27, 2007 9:35:12 AM oracle.sysman.emcp.EMConfig performINFO: 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 stopOMSINFO: Stopping Database Control (this may take a while) ...Oct 27, 2007 9:36:39 AM oracle.sysman.emcp.ParamsManager getLocalListenerWARNING: Error retrieving listener for oracle10Oct 27, 2007 9:36:54 AM oracle.sysman.emcp.util.DBControlUtil startOMSINFO: Starting Database Control (this may take a while) ...Oct 27, 2007 9:39:51 AM oracle.sysman.emcp.EMDBPostConfig performConfigurationINFO: Database Control started successfullyOct 27, 2007 9:39:53 AM oracle.sysman.emcp.EMDBPostConfig performConfigurationINFO: >>>>>>>>>>> The Database Control URL is http://oracle10:5500/em <<<<<<<<<<< Enterprise Manager configuration completed successfullyFINISHED EMCA at Oct 27, 2007 9:39:53 AM[oracle@oracle10 ~]$删除数据(data)库 Database Control 配置(configure)[oracle@oracle10 ~]$ emca -deconfig dbcontrol dbSTARTED EMCA at Oct 27, 2007 10:44:24 AMEM Configuration Assistant, Version 10.2.0.1.0 ProductionCopyright (c) 2003, 2005, Oracle. All rights reserved.Enter the following information:Database SID: orclDo you wish to continue? [yes(Y)/no(N)]: YOct 27, 2007 10:44:47 AM oracle.sysman.emcp.EMConfig performINFO: 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 stopOMSINFO: Stopping Database Control (this may take a while) ...Oct 27, 2007 10:48:13 AM oracle.sysman.emcp.EMReposConfig stopDBMSJobsWARNING: Error initializing SQL connection. SQL operations cannot be performedOct 27, 2007 10:48:13 AM oracle.sysman.emcp.EMReposConfig invokeWARNING: Unable to remove DBMS jobs.Enterprise Manager configuration completed successfullyFINISHED 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.rspGlibc-32bit-8.1.9。