1、net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576fs.aio-max-nr = 1048576#让内核参数生效sysctl -p5.修改limits.confvi /etc/security/limits.conf#oracle settingsoracle soft nproc 2047 hard 16384nofile 1024655366.改/etc/pam.d/login#添加以下内容:session required /lib64/security/pam_limi
2、ts.so pam_limits.so注意:如果使用的是32位的操作系统,则上面要写成 /lib/security/pam_limits.so7.修改/etc/profilevi /etc/profileif $USER = oracle ; then if $SHELL = /bin/kshulimit -p 16384ulimit -n 65536 elseulimit -u 16384 -n 65536 fifi8.改/etc/csh.loginvi /etc/csh.login#添加以下内容:if ( $USER = ) then limit maxproc 16384 limit d
3、eors 65536endif9.创建oracle用户groupadd oinstallgroupadd dbauseradd -g oinstall -G dba oraclepasswd oracle mkdir -p /data/oraclemkdir -p /data/oraInventorymkdir -p /data/softwarechown -R oracle:oinstall /data/oracleoinstall /data/softwareoinstall /data/oraInventory10.设置用户环境变量#su - oracle$ vi .bash_profi
4、leORACLE_SID=orcl; export ORACLE_SIDORACLE_BASE=/data/oracle; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOMEPATH=$PATH:$ORACLE_HOME/bin:$HOME/bin; export PATH说明:ORACLE_BASE下是admin和productORACLE_HOME下则是ORACLE的命令、连接库、安装助手、listener等等一系列的东东。这只是ORACLE自己的定义习惯。ORACLE_HOM
5、E比ORACLE_BASE目录要更深一些。也就是说:ORACLE_HOME$ORACLE_BASE/product/versionORACLE_BASE是oracle的根目录,ORACLE_HOME是oracle产品的目录。简单说,你如果装了2个版本的oracle,那么ORACLE_BASE可以是一个,但ORACLE_HOME是2个全局数据库名用于区别分布式数据库各个不同机器上的实例。SID用于区别同一台机器上的不同实例,即一个用于外部区分。一个用于内部区分。$source .bash_profile11.安装oracle#可以使用winscp上传oracle安装文件到/data/softwa
6、re目录下,并解压cd /data/softwareunzip linux_11gR2_database_1of2.zipunzip linux_11gR2_database_2of2.zipxhost + (这里使用root用户执行,一定要执行以下2步,如果没有执行,将无法启动图形安装界面)xhost + localhostsu - oralcecd /data/software/database$./runInstaller #(到oracle安装文件所在目录执行该命令)安装过程省略12.开机启动设置#自动启动和关闭数据库实例和监听vi /data/oracle/product/11.2.
7、0/db_1/bin/dbstartORACLE_HOME_LISTNER=$1#修改为:ORACLE_HOME_LISTNER=$ORACLE_HOMEvi /data/oracle/product/11.2.0/db_1/bin/dbshutvi /etc/init.d/oracle#!/bin/sh# chkconfig: 345 61 61# description: Oracle 11g AutoRun Services# /etc/init.d/oracle# Run-level Startup script for the Oracle Instance, Listener, a
8、nd# Web Interfaceexport ORACLE_BASE=/data/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export ORACLE_SID=lukeexport PATH=$PATH:$ORACLE_HOME/binORA_OWNR=# if the executables do not exist - display errorif ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME then echo Oracle startup: cannot
9、start exit 1# depending on parameter - startup, shutdown, restart# of the instance and listener or usage displaycase $1 instart) # Oracle listener and instance startup su $ORA_OWNR -lc $ORACLE_HOME/bin/dbstartOracle Start Succesful!OK. ;stop) # Oracle listener and instance shutdown su $ORA_OWNR -lc
10、$ORACLE_HOME/bin/dbshutOracle Stop Succesful!reload|restart) $0 stop $0 start*) echo $Usage: basename $0 start|stop|reload|reloadesacexit 0chmod 750 /etc/init.d/oraclechkconfig -level 345 oracle onchkconfig -add oracle#启动oracleservice oracle start自动启动和关闭 EMvi /etc/init.d/oraemctl# /etc/init.d/oraemc
11、tlecho -n $Starting Oracle EM DB Console:su -$ORA_OWNR-c $ORACLE_HOME/bin/emctl start dbconsoleOKStopping Oracle EM DB Console:$ORACLE_HOME/bin/emctl stop dbconsoleecho $ $0 start|stopchmod 750 /etc/init.d/oraemctl#启动EMservice oraemctl start问题分析:linux安装oracle时DISPLAY解决方法在Linux上安装Oracle时,经常会报以下错误:无法使
12、用命令 /usr/X11R6/bin/xdpyinfo 自动检查显示器颜色。请检查是否设置了DISPLAY 变量。 可以使用下述命令解决这个问题:1.在root下执行 #xdpyinfo 若不能正常显示继续下面步骤2.进入桌面环境运行终端在root下执行#xhost + localhost3. 切换到Oracle用户:4.在Oracle用户下执行命令:export DISPLAY=:1.0 5.#xhost + 返回信息为:access control disabled,clients can connect from any host 6.在Oracle下执行xdpyinfo命令,如果能正常
13、显示,说明设置成功linux下oracle设置环境变量需要设置ORACLE_HOME和ORACLE_SID两个环境变量,再把ORACLE的bin目录添加到PATH中即可,通常缺省安装的情况下ORACLE_SID=orcl,ORACLE_HOME=/home/oracle/oracle/product/10.这样的形式,操作步骤:1、su oracle并回车切换到oracle用户;2、cd并回车回到oracle用户目录;cd /home/oraclels -a3、vi .bash_profile并回车编辑该文件,按I键进入插入状态,在最后加入以下行:export ORACLE_SID=orcle
14、xport ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1export PATH=$ORACLE_HOME/bin:$PATH输入完毕后按ESC键退出vi编辑状态,输入:wq并回车存盘退出。注销所有oracle用户,再使用oracle登录即可。安装时若遇到如下错误直接忽略Error in invoking target agent nmb nmo nmhs of makefile ins_emagent.mk这个错误。从网上的一些解决方法,我感觉像是ORACLE暂时对RHEL6支持不够造成的。我直接忽略了,点击继续安装在linux下出现c
15、annot restore segment prot after reloc: Permission denied应用程序连接oracle的库时会出现如下错误:XXXXX:: error while loading shared libraries: /usr/local/oracle/product/10.2.0/lib/libnnz10.so: cannot restore segment prot after reloc:或者: /usr/local/oracle/product/10.2.0/lib/libclntsh.so.10.1:等错误。解决办法是用chcon命令把相应文件的属性
16、改一下即可,如:chcon -t texrel_shlib_t /usr/local/oracle/product/10.2.0/lib/libnnz10.so /usr/local/oracle/product/10.2.0/lib/libclntsh.so.10.1上诉文件目录参考时要改成自己的。解决执行Oracle控制脚本时遇到的 “cat: /etc/oratab: 没有那个文件或目录”的问题打开dbshut指令查看,发现了引起错误的语句:# $Header: dbshut.sh.pp 03-apr-2001.13:38:20 jboyce Exp $ dbshut.sh.pp Cop
17、yr (c) 1991 Oracle# usage: dbshut# This script is used to shutdown ORACLE from /etc/rc(.local).# It should ONLY be executed as part of the system boot procedure.#ORATAB=/etc/oratab查看相应的文件# find/etc/oratabfind:没有那个文件或目录这个文件居然不存在,确定是由于该文件的丢失引起的原因。通过如下指令查看该文件是否在系统其它地方# find / -name “oratab”结果居然没找到。估计是当
18、初安装Oracle的遗留问题。解决方案由于该文件已经丢失,所以到另外一台安装了同样版本的Oracle的服务器上查询相应的文件,果然找到了相应的文件,内容如下:# This file is used by ORACLE utilities.It is created by root.sh# and updated by the Database Configuration Assistant when creating# a database.# A colon, , is used as the field terminator.A new line terminates# the entry
19、.Lines beginning with a pound sign, #, are comments.# Entries are of the form:#$ORACLE_SID:$ORACLE_HOME:# The first and second fields are the system identifier and home# directory of the database respectively.The third filed indicates# to the dbstart utility that the database should , Y, or should n
20、ot,# N, be brought up at system boot time.# Multiple entries with the same $ORACLE_SID are not allowed.# *:/opt/ora9/product/9.2:N*:oracle:demo:拷贝完以后一定记得要修改相应的内容。P.S.对于oratab文件的说明:1.只在Linux环境中存在2.设置格式:ORACLE_SIDORACLE_HOMEY|N 示例:3.可以为不同的数据库设置相应的选项4.如果想用$ORACLE_HOME/bin/dbstart脚本来启动数据库,则需要将/etc/orata
21、b文件中相应的数据库的项置为Y,简单的说即dbstart脚本根据oratab文件中的配置决定启动哪几个数据库。5.如果不使用dbstart脚本启动数据库,而是用自己的脚本来启动,那么根本不用关心oratab文件。Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name解决方法: 在启动的时候先设置一下oracle_unqname set oracle_unqname=$ORACLE_SID如果还是失败,在环境变量中添加: vi /.bash_profile
22、在最后添加:exportORACLE_UNQNAME=$ORACLE_SID启动dbconsole emctl start dbconsole如果还出现上述的错误:删除dbconsole重新配置emca -deconfig dbconsole db -repos drop如果删除失败,进入数据库删除dbconsole以前的用户,并且修改DBSNMP密码sqlalter user dbsnmp identified by orcl; 删除早期DBCONSOLE创建的用户:drop role MGMT_USER;drop user MGMT_VIEW cascade;drop user sysman cascade;删除早期DBCONSOLE创建的对象:drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;drop public synonym SETEMVIEWUSERCONTEXT;重新创建DBCONSOLE:(如果是在windows下,要先到注册表删除DBCONSOLE的服务,重启电脑)emca -config dbcontrol db -repos create根据提示,先输入SID,再输入Y继续;输入端口1521,输入SYS密码,输入DBSNMP
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2