oracle 11g for Linux(Red Hat 4.8.5-11) 部署手记

查看系统版本信息

[root@db_slave ~]# uname -a
Linux db_slave 3.10.0-514.6.1.el7.x86_64 #1 SMP Wed Jan 18 13:06:36 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@db_slave ~]# lsb_release -a
bash: lsb_release: command not found...
[root@db_slave ~]# cat /etc/issue
\S
Kernel \r on an \m
[root@db_slave ~]# cat /proc/version
Linux version 3.10.0-514.6.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Jan 18 13:06:36 UTC 2017

[root@db_slave home]# cd /home
[root@db_slave home]# mkdir oracle11g
[root@db_slave home]# cd oracle11g/

上传文件

安装前检查

###检查swap空间,内存  
$ grep MemTotal /proc/meminfo(256M就可以安装,但建议512M以上)
$ cat /proc/swaps  (建议400M以上)
###检查/tmp空间
# df     /tmp (要求400M以上)

##检查开发包是否安装完全
#rpm -q make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel

package openmotif is not installed
package setarch is not installed
package compat-db is not installed
package compat-gcc is not installed
package compat-gcc-c++ is not installed
package compat-libstdc++ is not installed
package compat-libstdc++-devel is not installed

yum install openmotif
yum install compat-db 
yum install compat-gcc 
yum install compat-gcc-c++
yum install compat-libstdc++



另外需要安装的包有:
libXp-1.0.0-8.1.el5.【对应平台】.rpm 
libXp-devel-1.0.0-8.1.el5.【对应平台】.rpm 
openmotif-devel-2.3.0-0.3.el5.【对应平台】.rpm
openmotif-2.3.0-0.3.el5.【对应平台】.rpm

创建Oracle用户

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
-- 123456

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
修改用户限制
root用户:修改 /etc/security/limits.conf 文件,加上下面的参数
oracle           soft    nproc   2047
oracle           hard    nproc   16384
oracle           soft    nofile  1024
oracle           hard    nofile  65536
修改用户验证选项
root用户下:修改/etc/pam.d/login文件加上如下参数
session    required     pam_limits.so
修改用户配置文件
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
安装目录配置
root用户:
# mkdir -p /u01/oraInventory
# chown -R oracle:oinstall /u01/
# chmod -R 775 /u01/
修改用户bash shell
$ vi .bash_profile
增加如下内容,主要是修改
export ORACLE_BASE=/u01 
export ORACLE_HOME=$ORACLE_BASE/oracle
export ORACLE_SID=oracleSid 
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
完成后执行:
#su - oracle
#env | grep ORA查看环境变量是否完成

解压安装

安装文件移到/u01/oracle11gInstall
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
su - oracle
cd  /u01/oracle11gInstall/database
./runInstaller

报错汇总

图形化界面安装报错:

export DISPLAY=IP:0.0

检查时报缺包预警

核查:rpm -qa | grep libaio
安装过新版本的可以ignore,缺包安装

安装报错:

Error in invoking target 'install' of makefile '/u01/oracle/ctx/lib/ins_ctx.mk'. See '/u01/oraInventory/logs/installActions2017-08-24_05-22-00PM.log' for details.
原因:
Linux没有安装32位的glibc-devel包。于是检查一下是否没有安装32位的glibc-devel包。如下所示,确实只安装了64位的glibc-devel包。
解决:
yum install glibc-devel.i386  --安装报错
指定32位和64位程序一起安装:
# echo 'multilib_policy=all' >> /etc/yum.conf
# yum install glibc
# yum install glibc-devel
清理安装文件夹,重新安装
# rpm --all --query --queryformat "%{NAME}-%{VERSION}-%{RELEASE}-(%{ARCH})\n" | grep glibc
glibc-2.17-157.el7_3.5-(x86_64)
glibc-common-2.17-157.el7_3.5-(x86_64)
glibc-devel-2.17-157.el7_3.5-(x86_64)
glibc-devel-2.17-157.el7_3.5-(i686)
glibc-headers-2.17-157.el7_3.5-(x86_64)
glibc-2.17-157.el7_3.5-(i686)
# 还需要安装 glibc-devel-*.i386.rpm
上传文件,安装
# wget http://vault.centos.org/5.11/updates/i386/RPMS/glibc-devel-2.5-123.el5_11.3.i386.rpm
# rpm -ivh glibc-devel-2.5-123.el5_11.3.i386.rpm
glibc = 2.5-123.el5_11.3 is needed by glibc-devel-2.5-123.el5_11.3.i386
    glibc-headers = 2.5-123.el5_11.3 is needed by glibc-devel-2.5-123.el5_11.3.i386 
# rpm -ivh  glibc-common-2.5-123.i386.rpm glibc-2.5-123.i686.rpm glibc-headers-2.5-123.el5_11.3.i386.rpm glibc-devel-2.5-123.el5_11.3.i386.rpm
###skip it

startup报错

  1. ORA-01078: failure in processing system parameters
    LRM-00109: could not open parameter file ‘/u01/oracle/dbs/initoracleSid.ora’
    解决:
    $ cp /u01/admin/orcl/pfile/init.ora.7242017204421 /u01/oracle/dbs/initoracleSid.ora

  2. ORA-00845: MEMORY_TARGET not supported on this system
    解决: 初始化参数MEMORY_TARGET或MEMORY_MAX_TARGET不能大于共享内存(/dev/shm),为了解决这个问题,可以增大/dev/shm

# mount -t tmpfs shmfs -o size=7g /dev/shm
  1. ORA-01102: cannot mount database in EXCLUSIVE mode
[root@db_slave u01]# tail -200 ./diag/rdbms/orcl/oracleSid/trace/alert_oracleSid.log
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
Thu Aug 24 21:08:34 2017
MMNL started with pid=16, OS id=22107 
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /u01
Thu Aug 24 21:08:34 2017
ALTER DATABASE   MOUNT
sculkget: failed to lock /u01/oracle/dbs/lkORCL exclusive
sculkget: lock held by PID: 11319
###NOTICE: lock held by PID: 11319
ORA-09968: unable to lock file
Linux-x86_64 Error: 11: Resource temporarily unavailable
Additional information: 11319
ORA-1102 signalled during: ALTER DATABASE   MOUNT...
Process m000 died, see its trace file
[root@db_slave u01]# ps -ef|grep 11319
oracle   11319     1  0 20:45 ?        00:00:00 ora_dbw0_orcl
root     22826 22385  0 21:15 pts/5    00:00:00 grep --color=auto 11319
[root@db_slave u01]# ps -ef|grep 11319
oracle   11319     1  0 20:45 ?        00:00:00 ora_dbw0_orcl
root     22874 22385  0 21:16 pts/5    00:00:00 grep --color=auto 11319
[root@db_slave u01]# cd cd $ORACLE_HOME/dbs
-bash: cd: cd: No such file or directory
[root@db_slave u01]# cd /u01/oracle/dbs
[root@db_slave dbs]# ll
total 28
-rw-rw----. 1 oracle oinstall 1544 Aug 24 21:15 hc_oracleSid.dat
-rw-rw----. 1 oracle oinstall 1544 Aug 24 20:45 hc_orcl.dat
-rw-r--r--. 1 oracle oinstall 2851 May 15  2009 init.ora
-rw-r-----. 1 oracle oinstall 1871 Aug 24 20:58 initoracleSid.ora
-rw-r-----. 1 oracle oinstall   24 Aug 24 20:38 lkORCL
-rw-r-----. 1 oracle oinstall 1536 Aug 24 20:46 orapworcl
-rw-r-----. 1 oracle oinstall 2560 Aug 24 20:45 spfileorcl.ora
[root@db_slave dbs]# fuser -u lkORCL
/u01/oracle/dbs/lkORCL: 11299(oracle) 11306(oracle) 11310(oracle) 11313(oracle) 11317(oracle) 11319(oracle) 11321(oracle) 11323(oracle) 11325(oracle) 11327(oracle) 11329(oracle) 11331(oracle) 11425(oracle) 11539(oracle) 11546(oracle) 11548(oracle) 11662(oracle)
[root@db_slave dbs]# fuser -k lkORCL
/u01/oracle/dbs/lkORCL: 11299 11306 11310 11313 11317 11319 11321 11323 11325 11327 11329 11331 11425 11539 11546 11548 11662
[root@db_slave dbs]# fuser -u lkORCL

启动正常 呼呼

后续

–创建用户
create user testUser identified by 123456;
Grant connect,dba to testUser;

你可能感兴趣的:(ORACLE,OS)