linux下oracle 11g 64位安装

我安装的是linux centos 6.4系统

[color=darkred]一、安装前准备[/color]
ORACLE 11g 下载地址
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
oracle 11g 64位的安装包有两个分别为
linux.x64_11gR2_database_1of2.zip、
linux.x64_11gR2_database_2of2.zip,把后者解压开放入前者对应目录下。

[color=red]1、查看系统版本、内核版本、操作系统位数,
内存及交换分区大小、文件系统空间、主机名、IP地址等。[/color]
# df -hT /tmp # 查看/tmp分区空间,官方要求至少1G
Filesystem Type Size Used Avail Use% Mounted on
/tmp none 16G 5.9G 9.1G 40% /tmp

# hostname #主机名,主机名可通过修改/etc/hosts和/etc/sysconfig/network进行修改
localhost.localdomain

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
#IP地址配置
DEVICE="eth0"
HWADDR="00:0C:29:4D:E6:3D"
ONBOOT="yes"
BOOTPROTO="static"
IPADDR="192.168.163.44"
NETMASK="255.255.255.0"
GATEWAY="192.168.163.1"
DNS1="202.96.134.133"
DNS2="8.8.8.8"

[color=red]2、关闭防火墙、禁用SELinux[/color]
#service iptables stop
#chkconfig iptables off
#vi/etc/selinux/config 将SELINUX=disabled

对于关闭系统防火墙这个操作,我在安装的过程中是没有禁用的,安装完后,
加了iptables端口放行后,重启iptables,就可以正常使用了,
也没有遇到有些帖子中提到的动态端口的问题. 所以这个步骤也可以不做.
当遇到问题时可临时关闭以便排除问题.


[color=red]3、确认以下包全部安装[/color]
# rpm -q gcc make binutils openmotif setarch
compat-db compat-gcc-34 compat-gcc-34-c++ compat-libstdc++-
libXp ksh sysstat libaio glibc elfutils unixODBC

这个步骤,我建议看官方文档,下面我截取的64位linux的依赖的安装包列表
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6 (i686)|
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
unixODBC-2.2.14-11.el6 (x86_64) or later
unixODBC-2.2.14-11.el6.i686 or later
unixODBC-devel-2.2.14-11.el6 (x86_64) or later
unixODBC-devel-2.2.14-11.el6.i686 or later

上面的列表中有些问题还是比较奇怪的,64位系统下安装了一些32位的包,
如果你直接去光盘上找,可能有些是找不到的.
这里提供一个我在安装是用到的一个链接
http://pkgs.org/#centos-6-rhel-6


[color=red]4、创建Oracle用户[/color]
root用户:创建Oracle安装组oinstall,数据库管理员组dba,及oracle用户
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/useradd -g oinstall -G dba oracle(主组oinstall,其它组:dba)
# passwd oracle

[color=red]5、修改内核参数[/color]
root用户:修改 /etc/sysctl.conf 文件,加上如下参数
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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 = 1048586

为使上述配置生效而不重启系统,执行如下命令
# /sbin/sysctl -p

[color=red]6、修改用户限制[/color]
root用户:修改 /etc/security/limits.conf 文件,加上下面的参数
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

[color=red]7、修改用户验证选项[/color]
root用户下:修改/etc/pam.d/login文件加上如下参数
session required pam_limits.so


[color=red]8修改用户配置文件[/color]
root用户下:修改/etc/profile文件加入如下参数:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

[color=red]9、安装目录配置[/color]
root用户:
# mkdir -p /u01/oraInventory
# chown -R oracle:oinstall /u01/
# chmod -R 775 /u01/

[color=red]10、修改用户bash shell[/color]
切换到oracle用户
#su –oracle

$ vi .bash_profile
增加如下内容,主要是修改
export ORACLE_BASE=/u01/product
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=oracleSid
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

#env | grep ORA查看环境变量是否完成

[color=darkred]二、安装软件[/color]

使用oracle用户登录,然后解压缩Oracle安装文件

$ unzip linux.x64_11gR2_database_1of2.zip
然后进入解压后的目录
[oracle@localhost ~]$ cd /u01/database

执行
[oracle@localhost ~]$ ./runInstaller
经过一小段的时间,会出现如下图形对话框,Email地址以及下方的勾均可不设,直接点next,在弹出的提示对话框中点Yes,不设置Email。


[img]http://dl2.iteye.com/upload/attachment/0092/7517/579c17bf-51a8-39a3-b971-132c6f29a554.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7519/d536f652-0f6d-3118-8fb5-5bbb681db835.png[/img]


[img]http://dl2.iteye.com/upload/attachment/0092/7527/7f7004b3-29a8-3d74-a2e7-2cd0f699c62d.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7529/4db6f3b9-55de-3862-a3d3-3f7d342c461b.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7531/8f4d0e97-21a9-3844-91d1-9cd0e7f67055.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7533/abf5c52d-35f9-3265-a13f-cf3ffa47856e.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7535/ef0c1a42-fcf2-374e-b720-f16d20a413cd.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7537/c0e608bb-278d-33f2-924f-366b1965558b.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7541/ae0b8998-d833-3e66-aff3-1b2b6488ccec.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7543/b1175a67-b330-3243-86b3-6ff6c8bb0f3e.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7545/a8dd6312-2042-3f16-bc97-07e0703a8068.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7551/a6cf382c-6395-3e68-bd04-f2f623f85869.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7554/97ad7bcb-4b90-3594-9597-75e6cb56edd6.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7561/50c0f9d6-30cd-36df-aa58-accd6df50350.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7576/05f50184-7656-379d-811a-1aeb4063a167.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7590/b1b1e436-bc74-34c8-9712-a733398cc6df.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7594/ec86b2bd-0994-3b1e-853a-471d439dc686.png[/img]

[img]http://dl2.iteye.com/upload/attachment/0092/7596/64bfa832-f4e3-3b50-ba44-f26087dfc248.png[/img]

[color=darkred]三、启动数据库实例[/color]
分为两步:第一步,启动监听;第二步,启动数据库实例。
1、如何启动数据库实例
1.进入到sqlplus启动实例
[oracle@redhat ~]$ su - oracle --“切换到oracle用户”
Password:
[oracle@redhat ~]$ lsnrctl start --“打开监听”
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-OCT-2009 19:06:40
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /home/oracle/product/10g/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /home/oracle/product/10g/network/admin/listener.ora
Log messages written to /home/oracle/product/10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 14-OCT-2009 19:06:40
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/product/10g/network/admin/listener.ora
Listener Log File /home/oracle/product/10g/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@redhat ~]$ sqlplus /nolog --“进入到sqlplus”
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Oct 14 19:06:45 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba --“连接到sysdba”
Connected to an idle instance.
SQL> startup --“启动数据库实例”
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 88082024 bytes
Database Buffers 188743680 bytes
Redo Buffers 7168000 bytes
Database mounted.
Database opened.
SQL> shutdown immediate --“关闭数据库实例”
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@redhat ~]$ lsnrctl stop --“关闭监听”
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-OCT-2009 19:08:06
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
The command completed successfully

2.用dbstart和dbshut启动和关闭数据库实例

先启动监听 lsnrctl start
启动实例 dbstart

使用dbstart命令启动数据库比较方便,但是在linux上安装好oracle之后,第一次使用dbstart命令可能会报如下错误:

ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /u01/app/oracle/oracle/product/10.2.0/db_1/bin/dbstart ORACLE_HOME
原因:
dbstart和dbshut脚本文件中ORACLE_HOME_LISTNER的设置有问题,分别打开两个文件找到:用vi编辑dbstart,ORACLE_HOME_LISTNER=$1,修改为
ORACLE_HOME_LISTNER=$ORACLE_HOME


然后保存退出,此时再运行dbstart,已经不报错了,但是没有任何反应,ps一下进程,没有oracle的进程,说明oracle实例没有正常启动。

此时的原因是在/etc/oratab的设置问题,我们vi一下,发现
zgz:/home/oracle/product/10g:N
最后设置的是"N"(我的环境中只有一个实例,因此只有一行配置语句),我们需要把“N”修改为“Y”。

以上的工作做好之后,dbstart就可以正常使用了:

[oracle@redhat bin]$ lsnrctl start --“启动监听”
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-OCT-2009 19:44:53
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /home/oracle/product/10g/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /home/oracle/product/10g/network/admin/listener.ora
Log messages written to /home/oracle/product/10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 14-OCT-2009 19:44:53
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/product/10g/network/admin/listener.ora
Listener Log File /home/oracle/product/10g/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat)(PORT=1522)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@redhat bin]$ dbstart --“启动数据库实例”
Processing Database instance "zgz": log file /home/oracle/product/10g/startup.log
[oracle@redhat bin]$ dbshut --“关闭数据库实例”
[oracle@redhat bin]$ lsnrctl stop --“关闭监听”
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 14-OCT-2009 19:45:33
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
The command completed successfully

2、如何使数据库实例和linux系统一起启动
在/etc/rc.d/rc.local中加入如下语句即可实现同系统启动实例:
su - oracle -c "lsnrctl start"
su - oracle -c "dbstart"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值