Linux Suse installs Oracle 11g

来源:互联网 发布:linux如何安装ftp服务 编辑:程序博客网 时间:2024/04/29 08:18

1. unzip - o  /*.zip /tempinstallfile

2. 创建oracle用户,以及管理组
以root用户登录linux,执行以下命令
#/usr/sbin/groupadd dba
#/usr/sbin/groupadd oper
#/usr/sbin/groupadd oinstall

创建用户oracle并设置管理组
#useradd oracle
#/usr/sbin/usermod -g oinstall -G dba oracle         (dba为管理组)
 

OR
#/usr/sbin/useradd -g oinstall -G dba oracle

设置密码

#passwd oracle

查看用户

#id oracle

uid=1001(oracle) gid=1002(oinstall) groups=1000(dba),1002(oinstall)

3.OS 参数设置

a设置核心参数

在/etc/sysctl.conf文件中加入下列行:

# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048686

/sbin/chkconfig boot.sysctl on

 echo 1002 > /proc/sys/vm/hugetlb_shm_group

add vm.hugetlb_shm_group=1002 into /etc/sysctl.conf


b设置Shell Limits(系统资源限制),提高软件的运行效率

a.在/etc/security/limits.conf文件中加入下列红色行:

 oracle soft nofile 65536

oracle hard nofile 65536

oracle soft nproc 16384

oracle hard nproc 16384

oracle soft stack 10240



4. -创建相关安装目录,假设安装到/ext1

mkdir -p /ext1/opt/oracle/product

mkdir -p /ext1/opt/oracle/product/OraHome

mkdir -p /ext1/opt/oraInventory                        #(the default inventory folder)

mkdir -p /ext1/opt/oracle/oradata                      #(change the right file owner)

mkdir -p /ext1/var/opt/oracle

设置目录的所有者所属组和权限
#chown -R oracle.oinstall /ext1/opt/oracle
#chown -R oracle.oinstall /ext1/opt/oracle/oradata
#chown -R oracle.oinstall /ext1/opt/oracle/product/OraHome
#chown -R oracle.dba /ext1/opt/oraInventory
#chown oracle.dba /ext1/var/opt/oracle
#chmod -R 775 /ext1/opt/oracle

#chmod -R 755 /ext1/var/opt/oracle


4.设置安装环境变量

# su - oracle   --su到oracle用户下,

更改用户的一些配置

$vi .bash_profile

添加以下参数,主要是配置oracle软件运环境参数

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi

 

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=$ORACLE_BASE/product/OraHome

export ORACLE_SID=orcl

export ORACLE_OWNER=oracle

export ORACLE_TERM=vt100

export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib

export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib

export CLASSPATH

 

注:

11g:ORA_NLS33=$ORACLE_HOME/nls/admin/data

10g:ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

9i:ORA_NLS33=/oracle/app/ora92/ocommon/nls/admin/data

保存退出

--执行以下命令让配置马上生效或以oracle用户登录使设置生效

$ source $HOME/.bash_profile


Install

1、解压命令:unzip 10201_database.zip

2、解压后产生一个包含安装文件的目录database

注:,最好在根上建立一个文件夹,这个文件夹专门用来存放ORACLE的安装文件。但是需要注意的是,在安装ORACLE前,需要把这个文件夹的所有者修改成用户oracle,文件夹权限最好是修改成777,以免在安装过程中出现问题。

3、定制Oracle安装文件及权限(可选)

chmod 777 /oracle

chown -R oracle.oinstall /oracle

注意解压好的目录用户oracle必须具有读写和执行的权限,可以将目录的用户和组改为oracle:
#chown -R oracle database
#chgrp -R oinstall database
四.安装oracle
reboot并以oracle登录,进入图形界面
#cd database
#./runInstaller

 



安装完毕, 提示执行 2个脚本:
以root用户登录,和上面一样,进入所提示目录,并执行这2个脚本。
(安装目录)/orainstRoot.sh
(安装目录)/root.sh


# su – oracle


$ sqlplus "/as sysdba"

SQL> startup  or  shutdown

lsnrctl status/start/stop 启动listener

emctl start dbconsole 启动 http://localhost.localdomain:1158/em