




已阅读5页,还剩15页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
SUSE Linux Enterprise 11SP1静默安装Oracle 11gR2说明文档1 准备oracle安装文件Oracle11gR2包含两个文件linux_11gR2_database_1of2.zip和linux_11gR2_database_2of2.zip,下载地址分别是:/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zip下载完成后将这两个文件通过SSH上传到/usr/local/oracle中。解压安装文件到当前目录rootlocalhost root#cd /usr/local/oraclerootlocalhost oracle#unzip linux_11gR2_database_1of2.ziprootlocalhost oracle#unzip linux_11gR2_database_2of2.zip执行以上命令后,将会在/usr/local/oracle/下面产生名为database的目录,这就是oracle安装程序的目录。2 准备oracle的安装目标目录rootlocalhost oracle#mkdir p /opt/oracle安装目标目录是用户想将oracle安装到哪个位置的目录,本次我们将oracle安装到/opt/oracle目录中,以下为目录创建命令。3 创建oracle相关用户和用户组oracle不能在root帐户下进行安装,所以需要为oracle的安装专门创建一个用户,同时需要创建dba和oinstall的用户组。rootlocalhost oracle#groupadd dbarootlocalhost oracle#groupadd oinstall以下命令将创建dba和oinstall用户组:以下命令将创建oracle用户,并设置密码rootlocalhost oracle#useradd -g oinstall -G dba oraclerootlocalhost oracle#passwd oracleChanging password for user oracle.New UNIX password: 在此键入密码BAD PASSWORD: it is based on a dictionary wordRetype new UNIX password: 在此再次键入密码passwd: all authentication tokens updated successfully.创建oracle用户home目录rootlocalhost oracle# md /home/oraclerootlocalhost oracle# chown -R oracle:oinstall /home/oracle以下命令将oracle安装目录(/opt/oracle)赋予oracle用户oinstall用户组rootlocalhost oracle#chown R oracle:oinstall /opt/oracle4 检查安装ORACLE依赖的RPM软件包oracle的安装所依赖的软件包,有一部分linux是没有安装的。这需要将这些尚未安装的软件包先安装后才能正常安装oracle。这些未安装的软件包在linux安装光盘上可以取到,我们直接在linux的光盘上对这些软件包进行安装(也可将所需的软件包直接复制到linux本地磁盘中),首先我们需要挂载linux光盘,使用以下命令:rootlocalhost oracle#mkdir /mnt/cdromrootlocalhost oracle#mount /dev/cdrom /mnt/cdrom安装所缺少的软件包,此处只安装本linux系统所缺少的软件包。如oracle安装过程中,对软件包进行检查时,发现仍有所需软件包未安装时,可根据显示未安装软件包的名字,再次对所缺少的软件包进行安装。以下为安装命令:rootlocalhost oracle#rpm -ivh linux-kernel-headers-2.6.32-1.4.13.noarch.rpmrootlocalhost oracle#rpm -ivh glibc-devel-2.11.1-0.17.4.i586.rpmrootlocalhost oracle#rpm -ivh gcc43-4.3.4_20091019-0.7.35.i586.rpmrootlocalhost oracle#rpm -ivh gcc-4.3-62.198.i586.rpmrootlocalhost oracle#rpm -ivh libstdc+43-devel-4.3.4_20091019-0.7.35.i586.rpmrootlocalhost oracle#rpm -ivh gcc43-c+-4.3.4_20091019-0.7.35.i586.rpmrootlocalhost oracle#rpm -ivh gcc-c+-4.3-62.198.i586.rpmrootlocalhost oracle#rpm -ivh sysstat-8.1.5-7.9.56.i586.rpmrootlocalhost oracle#rpm -ivh libaio-devel-0.3.109-0.1.46.i586.rpmrootlocalhost oracle#rpm -ivh libstdc+-devel-4.3-62.198.i586.rpmrootlocalhost oracle#rpm -ivh unixODBC-2.2.12-198.17.i586.rpmrootlocalhost oracle#rpm -ivh unixODBC-devel-2.2.12-198.17.i586.rpm5 设置linux内核参数打开修改/etc/sysctl.conf,在最后加入以下内容kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144fs.file-max = 6815744net.ipv4.ip_local_port_range = 9000 65500net.core.wmem_max = 1048576fs.aio-max-nr = 1048576有的时候我们需要调整oracle数据库的最大链接数,而这个链接数的调整是在oacle下的dbs目录下init.ora文件中调整的。ORACLE的连接数(sessions)与其参数文件中的进程数(process)有关,它们的关系如下:sessions=(1.1*process+5)但是我们增加process数时,往往数据库不能启动了。这因为我们还漏调了一个unix系统参数:它是核心参数中的semmns,这是unix系统的信号量参数。每个process会占用一个信号量。semmns调整后,需要重新启动unix操作系统,参数才能生效。不过它的大小会受制于硬件的内存或 ORACLE SGA。范围可从2002000不等。但是,Processes的修改不仅应该调整init.ora文件中的参数,而且应该调整OS的内核参数,象 AIX,HPUX,Solaris,SCO,UNIXWare都是这样,OS的调整是需要重新启动的,而且这个参数的设置不能简单按照多少个终端要连到这个服务器上而定,最关键是考虑会有多少同时连上的session(在使用一些共享连接的中间件时,一般就不需要太大),当然还要考虑一些Oracle的后台进程,还有一些系统维护工作需要多一些连接等。我的atmp大前置机器上对oracle调整的时候,其使用的是unixware操作系统,在做链接数调整的时候,要先对核心参数进行调整。核心主要相关的参数的调整如下:SHMMAX 1000000000SHMMIN 1SHMMNI 200SHMSEG 15SEMMNI 1000SEMMSL 300SEMMNS 230SEMOPM 20其中semmni,semmns,semmsl要加大,至少要比processes大18 ; SEMMNI(10,10000;150):指定在核心中信号识别的数量。这是可以在任意给定时间被激活的唯一信号设置数量。缺省值是150。最大值由系统自动调整产生。SEMMSL(25,300;150):指定每个信号识别中信号量的最大值。缺省值是25。SEMMNS 除最大db外的所有db 的PROCESSES之和+2*最大db的PROCESSES+10*实例数。如3个实例进程数分别为100、100、200,则=(100+100)+2*200+10*3=630SEMOPM(10,20;10):指定在每个系统调用semop中能够被执行的信号操作量的最大值。缺省值是10。SHMMAX(131072,1073741824;524288):指定了共享内存部分大小的最大值。等于0.5物理内存字节数SHMMNI(10,1000;100):指定了系统范围内共享内存标识的最大值。SHMSEG(6,15;6):指定了与每个进程相关连的共享内存块(或标识)的数量。缺省值是6。与每个进程相关连的共享内存块的最大值与进程拥有的未使用空间有关。因此,尽管一个进程拥有少于SHMSEG数值的共享内存块,它也有可能因为其有限的空间而不能与其它进程相联系。init.ora中调整为:processes = 50 # SMALL#processes = 100 # MEDIUM#processes = 200 # LARGE输入以下命令,使配置生效rootlocalhost oracle#sysctl -p6 修改 /etc/security/limits.conf修改 /etc/security/limits.conf,加入内容oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 655367 修改系统环境变量/etc/profile修改环境变量/etc/profile,加入以下内容if $USER = oracle ; thenif $SHELL = /bin/ksh ; thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi8 修改hosts文件lihaolong: # vi /etc/hosts增加一行 lihaolong9 增加/dev/shmMEMORY_MAX_TARGET 的设置不能超过 /dev/shm 的大小编辑fstab,添加一行:vi /etc/fstabtmpfs /dev/shm tmpfs defaults,size=1024m 0 0重新挂载来修改其大小mount -o remount /dev/shm10 修改suse版本lihaolong:/home/database # vi /etc/SuSE-releaseSUSE Linux Enterprise Server 11 (i586)VERSION = 9(等号后面要有个空格)PATCHLEVEL = 111 开始安装过程应答文件:注:安装oracle的目录,至少具备4G的空闲空间rootlocalhost oracle # su oracleoraclelocalhost oracle #cd /usr/local/oracle/database运行安装命令oraclelocalhost database # ./runInstaller -silent -responseFile /home/database/response/db_install.rsp以下为ORACLE安装程序输出的结果Starting Oracle Universal Installer.Checking Temp space: must be greater than 80 MB. Actual 10176 MB PassedChecking swap space: must be greater than 150 MB. Actual 2047 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2011-05-31_09-41-19AM. Please wait .oraclelihaolong:/home/database WARNING INS-32018 The selected Oracle home is outside of Oracle base. CAUSE: The Oracle home selected was outside of Oracle base. ACTION: Oracle recommends installing Oracle software within the Oracle base directory. Adjust the Oracle home or Oracle base accordingly.WARNING INS-13014 Target environment do not meet some optional requirements. CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2011-05-31_09-41-19AM/installActions2011-05-31_09-41-19AM.log ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2011-05-31_09-41-19AM/installActions2011-05-31_09-41-19AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.WARNING INS-32018 The selected Oracle home is outside of Oracle base. CAUSE: The Oracle home selected was outside of Oracle base. ACTION: Oracle recommends installing Oracle software within the Oracle base directory. Adjust the Oracle home or Oracle base accordingly.WARNING INS-13014 Target environment do not meet some optional requirements. CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2011-05-31_09-41-19AM/installActions2011-05-31_09-41-19AM.log ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2011-05-31_09-41-19AM/installActions2011-05-31_09-41-19AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.You can find the log of this install session at: /opt/oracle/oraInventory/logs/installActions2011-05-31_09-41-19AM.log日志文件位置可通过执行以下命令,查看安装进度oraclelocalhost database #tail -f /opt/oracle/oraInventory/logs/installActions2011-05-31_09-41-19AM.logoracle软件安装成功后,切换到root用户,执行以下2个脚本:/opt/oracle/oraInventory/orainstRoot.sh/opt/oracle/product/11.2.0/db_1/root.sh12 安装监听器应答文件:lihaolong:/opt/oracle/product/11.2.0/db_1/bin # ./netca /silent /responseFile /home/database/response/netca.rspParsing command line arguments: Parameter silent = true Parameter responsefile = /home/database/response/netca.rspDone parsing command line arguments.Oracle Net Services Configuration:Configuring Listener:LISTENERListener configuration complete.Oracle Net Listener Startup: Running Listener Control: /opt/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER Listener Control complete. Listener started successfully.Profile configuration complete.Oracle Net Services configuration successful. The exit code is 0在安装完成后,需要将oracle目录的文件夹权限修改为755, 这样其他有ORACLE环境的用户可以连接数据库。 2012020113 创建数据库应答文件:lihaolong:/opt/oracle/product/11.2.0/db_1/bin # ./dbca -silent -responseFile /home/database/response/dbca.rsp Copying database files1% complete2% complete3% complete4% complete37% completeCreating and starting Oracle instance38% complete40% complete41% complete46% complete51% complete56% complete57% complete58% complete61% complete62% completeCompleting Database Creation66% complete70% complete73% complete74% complete85% complete86% complete87% complete88% complete99% complete100% completeLook at the log file /opt/oracle/cfgtoollogs/dbca/orcl/orcl.log for further details.14 设置ORACLE环境变量切换至root用户修改全局环境变量配置文件profile。使用以下命令rootlocalhost oracle#vi /etc/profile往配置文件中加入以下内容export ORACLE_BASE=/opt/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export ORACLE_SID=orclexport PATH=$PATH:$ORACLE_HOME/bin使环境变量配置生效(分别在root、oracle用户下执行)rootlocalhost oracle# source /etc/profile15 启动ORACLE完成以上操作时,建议重新启动一次,避免某些设置未生效。重启后使用oracle用户登录,打开终端,键入以下命令运行sqlplusoraclelihaolong:/opt/oracle/admin/orcl/pfile sqlplus /nologSQL*Plus: Release .0 Production on Tue May 31 11:04:50 2011Copyright (c) 1982, 2009, Oracle. All rights reserved.SQL conn /as sysdbaConnected to an idle instance.SQL startupORACLE instance started.Total System Global Area 414298112 bytesFixed Size 1336904 bytesVariable Size 255855032 bytesDatabase Buffers 150994944 bytesRedo Buffers 6111232 bytesDatabase mounted.Database opened.SQL恭喜,你的ORACLE数据库已经启动成功!现在可以休息一下了。全部完成后,再把suse的版本号改回去16 异常解决16.1 ORA-01102这个错误主要是lk文件造成的,该文件位于ORALCE_HOME下的dbs目录下,这个lk的主要作用是说明DATABASE MOUNT上了,不用在MOUNT了.DATABASE UNMOUNT 后会删除掉,如果DATABASE确实没有MOUNT,这个文件在你也MOUNT上,只有手工删除,所以一定要小心.具体解决ORA-01102问题的步骤:oraclelihaolong:/opt/oracle/product/11.2.0/db_1/dbs ls -ltotal 36-rw-rw- 1 oracle oinstall 1544 May 31 10:37 hc_DBUA0.dat-rw-rw- 1 oracle oinstall 1544 May 31 11:05 hc_ORCL.dat-rw-rw- 1 oracle oinstall 1544 May 31 10:42 hc_orcl.dat-rw-r-r- 1 oracle oinstall 2851 May 15 2009 initORCL.ora-rw-r- 1 oracle oinstall 24 May 31 10:40 lkORCL-rw-r- 1 oracle oinstall 1536 May 31 10:41 orapworcldrwx- 2 oracle oinstall 4096 May 31 10:36 peshm_DBUA0_0drwx- 2 oracle oinstall 4096 May 31 10:37 peshm_orcl_0-rw-r- 1 oracle oinstall 2560 May 31 11:02 spfileorcl.oraoraclelihaolong:/opt/oracle/product/11.2.0/db_1/dbs fuser -u lkORCL/opt/oracle/product/11.2.0/db_1/dbs/lkORCL: 14588(oracle) 14594(oracle) 14598(oracle) 14600(oracle) 14604(oracle) 14606(oracle) 14608(oracle) 14610(oracle) 14612(oracle) 14614(oracle) 14616(oracle) 14618(oracle) 14664(oracle) 14683(oracle) 14685(oracle) 14687(oracle) 14759(oracle) 15300(oracle)该文件没释放,用fuser命令kill掉:oraclelihaolong:/opt/oracle/product/11.2.0/db_1/dbs fuser -k lkORCL/opt/oracle/product/11.2.0/db_1/dbs/lkORCL: 14588 14594 14598 14600 14604 14606 14608 14610 14612 14614 14616 14618 14664 14683 14685 14687 14759 15300oraclelihaolong:/opt/oracle/product/11.2.0/db_1/dbs fuser -u lkORCLSQL startup pfile=/opt/oracle/admin/orcl/pfile/init.ora.4312011104150ORACLE instance started.Total System Global Area 414298112 bytesFixed Size 1336904 bytesVariable Size 255855032 bytesDatabase Buffers 150994944 bytesRedo Buffers 6111232 bytesDatabase mounted.Database opened.SQL17 附件:Db_install.rsp范例# Copyright(c) Oracle Corporation 1998,2008. All rights reserved.# # Specify values for the variables listed below to customize # your installation. # # Each variable is associated with a comment. The comment # can help to populate the variables with the appropriate # values. # # IMPORTANT NOTE: This file contains plain text passwords and # should be secured to have read permission only by oracle user # or db administrator who owns this installation. # #-# Do not change the following system generated value. #-oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0#-# Specify the installation option.# It can be one of the following:# 1. INSTALL_DB_SWONLY# 2. INSTALL_DB_AND_CONFIG# 3. UPGRADE_DB#-oracle.install.option=INSTALL_DB_AND_CONFIG#-# Specify the hostname of the system as set during the install. It can be used# to force the installation to use an alternative hostname rather than using the# first hostname found on the system. (e.g., for systems with multiple hostnames # and network interfaces)#-ORACLE_HOSTNAME=smdw#-# Specify the Unix group to be set for the inventory directory. #-UNIX_GROUP_NAME=oinstall#-# Specify the location which holds the inventory files.#-INVENTORY_LOCATION=/opt/oracle/inventory#-# Specify the languages in which the components will be installed. # en : English ja : Japanese # fr : French ko : Korean # ar : Arabic es : Latin American Spanish # bn : Bengali lv : Latvian # pt_BR: Brazilian Portuguese lt : Lithuanian # bg : Bulgarian ms : Malay # fr_CA: Canadian French es_MX: Mexican Spanish # ca : Catalan no : Norwegian # hr : Croatian pl : Polish # cs : Czech pt : Portuguese # da : Danish ro : Romanian # nl : Dutch ru : Russian # ar_EG: Egyptian zh_CN: Simplified Chinese # en_GB: English (Great Britain) sk : Slovak # et : Estonian sl : Slovenian # fi : Finnish es_ES: Spanish # de : German sv : Swedish # el : Greek th : Thai # iw : Hebrew zh_TW: Traditional Chinese # hu : Hungarian tr : Turkish # is : Icelandic uk : Ukrainian # in : Indonesian vi : Vietnamese # it : Italian # Example : SELECTED_LANGUAGES=en,fr,ja#-SELECTED_LANGUAGES=en#-# Specify the complete path of the Oracle Home.#-ORACLE_HOME=/opt/oracle/product/11.2.0#-# Specify the complete path of the Oracle Base. #-ORACLE_BASE=/opt/oracle#-# Specify the installation edition of the component. # # The value should contain only one of these choices. # EE : Enterprise E
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年度电视剧导演聘用合同书(古装战争)
- 2025年度个人出租车承包运营管理及车辆更新合同
- 2025年吉林工业职业技术学院单招职业适应性测试题库及答案1套
- 健康管理融资居间合同
- 2025年度教育培训借款居间服务合同协议书
- 2025年度农村别墅装修与设施配套合同
- 2025年度房屋租赁权转让及租赁保证金合同协议书
- 历史建筑保护扶梯改造合同
- 2025年度协议离婚孩子抚养权及父母子女法律咨询服务合同
- 2025年度员工股份激励与股权激励评估协议
- 2024年广东普通专升本《公共英语》完整版真题
- 全飞秒激光近视手术
- 中国民族音乐的宫庭音乐
- 单原子催化剂的合成与应用
- 电网调度运行人员考试:电网调度调控考试试题及答案(最新版)
- 成都市深基坑管理规定课件
- 建立高效的员工沟通与反馈机制
- 促进学习的课堂评价:做得对
- 《语用学之指示语》课件
- 《对折剪纸》课件
- 《魔方知识普及》课件
评论
0/150
提交评论