linux 上oracle安装

Linux上oracle的安装

Linux 版本: Red Hat Enterprise Linux5.0
Oracle 版本: oracle 11g
 
Linux 版本检查 #cat /etc/issue
 
首先检查自己安装的 linux5.0 上是否安装有以下包(参照 oracle11g 文档):
The following packages (or later versions) must be installed:
binutils-2.17.50.0.6-2.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
gcc-4.1.1-52
gcc-c++-4.1.1-52
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
glibc-headers-2.5-12
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
libstdc++-devel-4.1.1-52.e15
make-3.81-1.1
sysstat-7.0.0
 
若是10g则需以下包:
make-3.79.1
gcc-3.2.3-34
glibc-2.3.2-95.20
glibc-devel-2.3.2-95.20
glibc-devel-2.3.2-95.20 (32 bit)
compat-db-4.0.14-5
compat-gcc-7.3-2.96.128
compat-gcc-c++-7.3-2.96.128
compat-libstdc++-7.3-2.96.128
compat-libstdc++-devel-7.3-2.96.128
gnome-libs-1.4.1.2.90-34.1 (32 bit)
openmotif21-2.1.30-8
setarch-1.3-1
libaio-0.3.96-3
libaio-devel-0.3.96-3
怎样检查是否安装呢?如检查 binutils-2.17.50.0.6-2.el5
[root@oracle11gdemo ~]# rpm -qa | grep binutils
binutils-2.17.50.0.6-2.el 5
说明 binutils-2.17.50.0.6-2.el5 已经安装。其它的依次检查。
将没有安装的包(去安装文件的 server 目录下找)上传到 linux 上,然后运行以下命令安装:
# rpm –ivh   *.rpm
 
下面的组和用户必须存在
The oinstall group (the oracle inventory group)
The dba group (the OSDBA group)
The oracle user (the oracle owner)
如果上面的组和用户不存在,用下面的步骤创建它们。
(1) 先查看这些组和用户是否存在 :
#grep oinstall /etc/group
#grep dba /etc/group
(2) 创建安装 oracle 所需的组和用户
#groupadd oinstall
#groupadd dba
 
 
bash: groupadd: command not found 错误解决: groupadd 命令是要用 ROOT 用户来执行的 , 而出错的用户是用 su root 切换到 ROOT 用户下 , 这个命令不会把环境带过去 !!!!, 要用
  su   -   root 命令。
 
(3) 建立一个目录作为 oracle 用户的缺省路径
创建目录: #mkdir –p /user01
建立一个缺省路径为 /user01/oracle 的用户 oracle ,同时 oracle 属于主组 oinstall ,和属于辅助组 dba #useradd –g oinstall –G dba –d /user01/oracle oracle
 
将目录 user01 的属主改为 oracle ,属组改为 oinstall
[root@oracle11gdemo /]# chown -R oracle.oinstall /user01
 
查看 nobody 是否存在: [root@oracle11gdemo user01]# id nobody
 
配置内核参数:
/etc/sysctl.conf 下通过 vi 添加如下参数
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
 
如下这些参数如法炮制
To increase the shell limits:
1. Add the following lines to the /etc/security/limits.conf file:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
2. Add or edit the following line in the /etc/pam.d/login file, if it does not
already exist:
session required pam_limits.so
3. Depending . the oracle user's default shell, make the following changes to the
default shell start-up file:
For the Bourne, Bash, or Korn shell, add the following lines to the
/etc/profile file (or the file . SUSE Linux Enterprise Server systems
/etc/profile.local ):
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
For the C shell ( csh or tcsh ), add the following lines to the
/etc/csh.login file (or the file . SUSE Linux Enterprise Server systems
/etc/csh.login.local ):
if ( $USER == "oracle" ) then
limit maxproc 16384
limit de.ors 65536
endif
 
 
oracle 用户名登录系统,配置 oracle 用户的环境。以 oracle 帐号用安装器来安装 oracle, 但是开始运行安装器之前,还得设定 oracle 用户的环境变量。
[oracle@oracle11gdemo ~]$ vi .bash_profile
vi 打开 .bash_profile, 然后添加一下变量:
ORACLE_BASE=/user01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=Wilson
PATH=$ORACLE_HOME/bin:$PATH
 
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
 
oracle 安装文件解压:
[root@oracle11gdemo user01]# unzip linux_11gR1_database_1013.zip
 
解压后将在当前目录生成一个 database 文件夹,将此文件夹移动的 oracle 用户的缺省路径的上一级路径:
[root@oracle11gdemo user01]# mv database/ /user01
 
将目录 database 的属主改为 oracle ,属组改为 oinstall
[root@oracle11gdemo user01]# chown -R oracle.oinstall database/
 
 
oracle 用户登录图像界面,运行 database 下的 runInstaller:
./runInstaller
注:一定要用 oracle 用户登陆,不能用 root ,否则安装 oracle 时会出现错误:。。。。。 at least 256 color 。。。。。

如果用 root 登陆,要按以下操作:
# xhost +
# su - oracle
$ export DISPLAY= :0
$ ./runInstaller.sh
我建议用 oracle 登陆,简单,直接到 Disk1 目录下安装即可
# ./runInstaller
如果是第一次安装的话,系统会提示用 root 用户运行一个脚本文件,新开一个 console su root 后,按照提示运行即可。
之后的安装过程比较简单,一路 next 即可。
 
至此, oracle11g 安装完毕。下面介绍怎么创建一个数据库实例:
首先配置一个 Listener ,启动 linux 图形界面,打开终端,输入 netca ,然后一路 next
接着就可以配置数据库实例了,在终端中输入 dbca ,然后跳出 dbca 的图形界面,一路设置下去即可。
 
开启监听后才可以用 PLSQL Developer 连接。
开启监听命令: $ lsnrctl start
开启数据库实例命令: SQL> startup
 
错误解决:
1.Can't connect to X11 window server using '127.0.0.1:0.0' as the value of the DISPLAY variable.
解决:
在终端里   以root用户执行   #xhost   +
然后su   -   oracle
执行#export   DISPLAY=:0
运行runinstaller
 
2.若想在本地通过plsql访问服务器的oracle,需先把服务器的防火墙关闭。
解决:
1) 重启后生效
开启: chkconfig iptables
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

在开启了防火墙时,做如下设置,开启相关端口,
修改/etc/sysconfig/iptables 文件,添加以下内容:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值