11->centos6 安装oracle

[root@localhost oracle]# groupadd oinstall;
[root@localhost oracle]# groupadd dba;
[root@localhost oracle]# mkdir /u01
[root@localhost oracle]# useradd -g oinstall -G dba -d /u01/oracle oracle

[root@localhost oracle]# passwd oracle

将oracle安装文件拷贝到 u01目录 将u01拥有者 改成oracle用户

[root@localhost oracle]# mv ./database /u01
[root@localhost oracle]# cd /u01
[root@localhost u01]# ls
database  oracle
[root@localhost u01]# chown -R oracle:oinstall /u01
[root@localhost u01]# cd /u01/oracle
[root@localhost u01]# vi .bash_profile


加入
ORACLE_SID=orcl
ORACLE_BASE=/u01
ORACLE_HOME=$ORACLE_BASE/oracle
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH
DISPLAY=192.168.0.88:0.0

export ORACLE_SID ORACLE_BASE ORACLE_HOME LD_LIBRARY_PATH PATH DISPLAY


这里 DISPLAY=192.168.0.88:0.0 表示 dos命令下 打开图形界面在192.168.0.88ip下 在192.168.0.88的window界面安装xmanager 并且打开

xmanage passive 如果执行了 runInstaller 会自动192.168.0.88的系统上 打开图形界面 

依赖包 可以通过oracle官网查看 

http://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm#BHCFACHG

通过命令 rpm -qa | grep gcc 命令查询是否存在 不存在 到操作系统安装包iso的 packages的目录下寻找 

通过明 rpm -ivh aaa.rpm 

由于在64位下 依赖包 亦需要安装 32位和64位同时存在的问题 果断换 centos6 x86版本了 主要是学习方便

centos6依赖包 如下

  • The following or later version of packages for Oracle Linux 6, and Red Hat Enterprise Linux 6 should be installed:

    binutils-2.20.51.0.2-5.11.el6.i686
    compat-libcap1-1.10-1.i686
    compat-libstdc++-33-3.2.3-69.el6.i686
    gcc-4.4.4-13.el6.i686
    gcc-c++-4.4.4-13.el6.i686
    glibc-2.12-1.7.el6.i686
    glibc-devel-2.12-1.7.el6.i686
    ksh
    libgcc-4.4.4-13.el6.i686
    libstdc++-4.4.4-13.el6.i686
    libstdc++-devel-4.4.4-13.el6.i686
    libaio-0.3.107-10.el6.i686
    libaio-devel-0.3.107-10.el6.i686
    make-3.81-19.el6.i686
    sysstat-9.0.4-11.el6.i686

配置内核参数


Parameter Command
semmslsemmnssemopm, and semmni # /sbin/sysctl -a | grep sem

This command displays the value of the semaphore parameters in the order listed.

shmallshmmax, and shmmni # /sbin/sysctl -a | grep shm
file-max # /sbin/sysctl -a | grep file-max
ip_local_port_range # /sbin/sysctl -a | grep ip_local_port_range
rmem_default # /sbin/sysctl -a | grep rmem_default
rmem_max # /sbin/sysctl -a | grep rmem_max
wmem_default # /sbin/sysctl -a | grep wmem_default
wmem_max # /sbin/sysctl -a | grep wmem_max
通过命令 查看 上面这些参数的值 是否是下面的值

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 = 1048576
如果查询的数据比上面的值 列表的数据要大 这无需添加该参数到 /sbin/sysctl.conf文件中

比如我的 比较后往 vi /etc/sysctl.conf 加入

fs.aio-max-nr = 1048576

fs.file-max = 6815744
kernel.shmmax = 536870912
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 = 1048576

执行命令 

/sbin/sysctl -p

如果出现异常

sysctl -P 报错解决办法
问题症状
修改 linux 内核文件 
#vi /etc/sysctl.conf后执行sysctl  -P 报错
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
 
解决方法如下:
modprobe bridge
lsmod|grep bridge


执行/sbin/sysctl -a | grep sem

kernel.sem = 250 32000 100 128 已经修改成功 

配置资源限制

Resource Shell Limit

Resource

Soft Limit

Hard Limit

Open file descriptors

nofile

at least 1024

at least 65536

Number of processes available to a single user

nproc

at least 2047

at least 16384

Size of the stack segment of the process

stack

 

 

同理 我们这里 查看 soft  nofile 和 hard nofile

$ ulimit -Sn
4096
$ ulimit -Hn
65536
查看 soft  nproc 和 hard nproc

$ ulimit -Su
2047
$ ulimit -Hu
16384
查看soft  stack 和 hard stack

$ ulimit -Ss
10240
$ ulimit -Hs
32768

我们直接 修改  vi /etc/security/limits.conf 添加以下内容

*  soft nofile 1024
*  hard nofile 65536  
*  soft nproc 2047
*  hard nproc 16384  
*  soft stack 1024
*  hard stack 32768 

添加 swap

方法:用文件作为Swap分区,操作如下
1.创建要作为swap分区的文件:增加1GB大小的交换分区,则命令写法如下,其中的count等于想要的块的数量(bs*count=文件大小)。
 dd if=/dev/zero of=/root/swapfile bs=1M count=1024

2.格式化为交换分区文件:
mkswap /root/swapfile #建立swap的文件系统

3.启用交换分区文件:
swapon /root/swapfile #启用swap文件

4 使系统开机时自启用,在文件/etc/fstab中添加一行:
/root/swapfile swap swap defaults 0 0


sftp上传 linux_11gR2_database_1of2.zip linux_11gR2_database_2of2.zip到 u01目录下 

unzip解压 

在window端电脑中打开xmanger4  切换到oracle 用户

 su - oracle

cd /u01/databse

./runInstaller

图形界面中其中一项 /oraInventory改成/u01/oraInventory 因为oracle账号只有u01的操作权限

图形界面 会自动检测 缺少哪些 包 如果 centos联网  直接使用 yum install 包名 安装 如果 yum找不到的 可以去 rpmfind.net搜索上传到centos使用或者配置yum最全rpm库 http://pkgs.repoforge.org/ 

rpm命令安装

安装完成后 需要切换到root账号执行 安装界面上要求的两个shell文件 

执行完后  执行dbca创建数据库

图形界面一步步 ok


posted @ 2015-03-18 22:12  饺子吃遍天  阅读(193)  评论(0编辑  收藏  举报