linux 安装oracle11g 步骤


   在安装oracle database 11g R2 之前需要进行一些配置部分才能安装


(1)

首先,确保系统安装了以下的包:

binutils

 compat-libstdc++-33 

elfutils-libelf

 elfutils-libelf-devel

 glibc glibc-common

 glibc-devel

 gcc

 gcc-c++

 libaio

 libaio-devel

 libgcc 

libstdc++

 libstdc++-devel 

make

 sysstat

 unixODBC

 unixODBC-devel 


如果没有安装,那使用yum -y install <对应的包>   来安装吧



(2)修改系统配置部分

[root@localhost ~]# vi /etc/sysctl.conf 

# make it comment
#net.bridge.bridge-nf-call-ip6tables = 0
#net.bridge.bridge-nf-call-iptables = 0
#net.bridge.bridge-nf-call-arptables = 0
# add at the last line
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576 

[root@localhost ~]# sysctl -p 
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 65536
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
 





(3)为oracle 创建一个用户

[root@localhost ~]# groupadd -g 200 oinstall 
[root@localhost ~]# groupadd -g 201 dba 
[root@localhost ~]# useradd -u 440 -g oinstall -G dba -d /usr/oracle oracle 
[root@localhost ~]# passwd oracle 
Changing password for user oracle.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]# vi /etc/pam.d/login 
# near line 14: add
session   required   pam_selinux.so open
session   required   pam_namespace.so
session   required   pam_limits.so
session   optional   pam_keyinit.so force revoke
session   include   system-auth
-session   optional   pam_ck_connector.so


[root@localhost ~]# vi /etc/security/limits.conf 
# 在最后一行添加以下代码
oracle   soft   nproc   2047
oracle   hard   nproc   16384
oracle   soft   nofile   1024
oracle   hard   nofile   65536


[root@db01 ~]# vi /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



(4)切换到刚刚创建好的oracle用户,进行一些配置

[oracle@localhost ~]$ chmod 755 /usr/oracle 
[oracle@localhost ~]$ mkdir /usr/oracle/app 
[oracle@localhost ~]$ chmod 775 /usr/oracle/app 
[oracle@localhost ~]$ mkdir /usr/oracle/oradata 
[oracle@localhost ~]$ chmod 775 /usr/oracle/oradata 
[oracle@localhost ~]$ vi ~/.bash_profile 
# 在最后一行添加以下代码
umask 022
export ORACLE_BASE=/usr/oracle/app





oracle 配置部分完毕:


到oracle 官网下载oracle ,下载完成后,解压oracle

[oracle@localhost Download]$ unzip linux.x64_11gR2_database_1of2.zip 
[oracle@localhost Download]$ unzip linux.x64_11gR2_database_2of2.zip 
[oracle@localhost Download]$ ./database/runInstaller


然后就按照自己的需要安装了


在下一步的最后一个过程中,会有一个安装包列表如下:



只要确保已经安装了那些包,就可以点击 “ignore all” 忽略所有



安装进行中。。。。。进度条一直在前进~~~~~


在安装快要结束的时候,会弹出以下窗口,这时切换到root用户进行一些更改





[root@localhost ~]#/usr/oracle/oraInventory/orainstRoot.sh 
Changing permissions of /usr/oracle/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.


Changing groupname of /usr/oracle/oraInventory to oinstall.
The execution of the script is complete.


[root@localhost ~]# /usr/oracle/app/product/11.2.0/dbhome_1/root.sh 
Running Oracle 11g root.sh script...


The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /usr/oracle/app/product/11.2.0/dbhome_1


Enter the full pathname of the local bin directory: [/usr/local/bin]:    # Enter
    Copying dbhome to /usr/local/bin ...
    Copying oraenv to /usr/local/bin ...
    Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.



配置完成后就可以点击“finish” 按钮,结束安装。。



在最后阶段,配置一些环境变量。。切换到oracle 用户

[oracle@localhost ~]$ vi ~/.bash_profile 


# add at the last lone
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin


[oracle@localhost ~]$ source ~/.bash_profile 




至此,安装全部完成,但是,重启linux 后,发现需要手动启动linux,即,没有弄脚本让oracle 随开机时启动

在我的前一篇博客里面,有详细的介绍,怎样让oracle 随开机时自启动

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值