I'm a tree and wating for the spring!

Oracle Database 11g Release 2 (11.2) Installation On RHEL6.3

★作者:桐星豆博客   |  ★类别: 技术文章   |  ★发布时间: 2012-12-20 23:32   |  ★更新时间: 2012-12-28 16:35   |  ★浏览次数:4053   |  ★ 评论(0)

This article describes the installation of Oracle Database 11g Release 2 (11.2) (64-bit) on RHEL6.3 (64-bit).
Unzip the files

#unzip linux.x64_11gR2_database_1of2.zip
#unzip linux.x64_11gR2_database_2of2.zip

You should now have a single directory called "database" containing installation files.
Hosts File
The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address> <fully-qualified-machine-name> <machine-name>

For example. localhost.localdomain localhost ol6-112.localdomain ol6-112

Oracle recommend the following minimum parameter settings.

fs.suid_dumpable = 1
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

The current values can be tested using the following command.

/sbin/sysctl -a | grep <param-name>

Add or amend the following lines in the "/etc/sysctl.conf" file.

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500

Run the following command to change the current kernel parameters.

/sbin/sysctl -p

Add the following lines to the "/etc/security/limits.conf" file.

oracle     soft     nproc     2047
oracle     hard    nproc     16384
oracle     soft     nofile     4096
oracle     hard    nofile     65536
oracle     soft     stack     10240

Install the following packages if they are not already present.

rpm -Uvh binutils-2*x86_64*
rpm -Uvh glibc-2*x86_64* nss-softokn-freebl-3*x86_64*
rpm -Uvh glibc-2*i686* nss-softokn-freebl-3*i686*
rpm -Uvh compat-libstdc++-33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfutils-libelf-0*x86_64*
rpm -Uvh elfutils-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c++-4*x86_64*
rpm -Uvh ksh-*x86_64*
rpm -Uvh libaio-0*x86_64*
rpm -Uvh libaio-devel-0*x86_64*
rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc++-4*x86_64*
rpm -Uvh libstdc++-4*i686*
rpm -Uvh libstdc++-devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc++-33*i686*
rpm -Uvh compat-libcap*

Note. This will install all the necessary 32-bit packages for From onwards many of these are unnecessary, but having them present does not cause a problem.
Create the new groups and users.

groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper
useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
passwd oracle

Note. We are not going to use the "asm" groups, since this installation will not use ASM.

Additional Setup
Disable secure linux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.


Once the change is complete, restart the server.
If you have the Linux firewall enabled, you will need to disable or configure it.
Create the directories in which the Oracle software will be installed.

mkdir -p /home/oracle/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /home/oracle
chmod -R 775 /home/oracle

Login as root and issue the following command.

xhost +

Login as the oracle user and add the following lines at the end of the ".bash_profile" file.

# Oracle Settings
TMP=/tmp; export TMP

ORACLE_HOSTNAME=ol6-112.localdomain; export ORACLE_HOSTNAME
ORACLE_BASE=/home/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME

PATH=/usr/sbin:$PATH; export PATH



Log into the oracle user.Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.


Proceed with the installation of your choice. The prerequisites checks will fail for the following version-dependent reasons:
  1. The installer shows multiple "missing package" failures because it does not recognize several of the newer version packages that were installed. These "missing package" failures can be ignored as the packages are present. The failure for the "pdksh" package can be ignored because we installed the "ksh" package in its place.
  2. The installer should only show a single "missing package" failure for the "pdksh" package. It can be ignored because we  installed the "ksh" package in its place.
  3. The installer shows no failures and continues normally.

You can see the type of installation I performed by clicking on the links below to see screen shots of each stage.

  1. Configure Security Updates
  2. Select Install Option
  3. System Class
  4. Node Selection
  5. Select Install Type
  6. Typical Install Configuration
  7. Create Inventory
  8. Perform Prerequisite Checks
  9. Summary
  10. Install Product
  11. Database Configuration Assistant
  12. Database Configuration Assistant 2
  13. Execute Configuration Scripts
  14. Finish

Post Installation
Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.


Common Errors
  1. "error code 35" : The machine name in the "/etc/hosts" file is not correct. It needs an entry for the loopback adapter (localhost) and the machine name. If you are using DNS for name resolution, you still need the loopback adapter reference in this file.
  2. "error code 37" : The DNS not working properly. You may also get this error is the "/etc/hosts" file is not configured correctly.
  3. "sqlplus: error while loading shared libraries: libclntsh.so.11.1" : The prerequisites have not been met. Work through them again. Specifically, make sure the "gcc" package has been installed.
  4. Listener fails to start - Typically this is due to incorrect name resolution. Make sure the "/etc/hosts" and/or DNS is configured correctly.
  5. Linking errors - Almost always due to missing prerequisites. Review the setup sections.

Hope this helps.



一、Oracle 11g存在一个特性,如果乃用exp/imp来对数据库进行导入导出时,会出现无数据表无法导出的问题,笔者也遇到了此种问题,经研究觉得遇到此情况,最好用expdp/impdp方式进行导出导入,可以回避这种问题。(此命令缺点在于必须在服务器上执行);
  2、设置deferred_segment_creation 参数

show parameter deferred_segment_creation
NAME                                                 TYPE                VALUE
------------------------------------     -----------     ------------------------------
deferred_segment_creation              boolean         TRUE
SQL> alter system set deferred_segment_creation=false;
SQL> show parameter deferred_segment_creation
NAME                                                 TYPE                VALUE
------------------------------------     -----------     ------------------------------
deferred_segment_creation             boolean         FALSE


select table_name from user_tables where NUM_ROWS=0;


select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0;


alter table AQ$_SYS$SERVICE_METRICS_TAB_T allocate extent;
alter table AQ$_SYS$SERVICE_METRICS_TAB_H allocate extent;
alter table AQ$_SYS$SERVICE_METRICS_TAB_G allocate extent;
alter table AQ$_SYS$SERVICE_METRICS_TAB_I allocate extent;

exp 用户名/密码@数据库名 file=/home/oracle/exp.dmp log=/home/oracle/exp_smsrun.log 成功! 

请尊重他人的劳动果实,转载时务必注明出处! 请尊重他人的劳动果实,转载时务必注明出处!
转载请注明:文章转载自:桐星豆博客 [http://blog.txdou.com]
本文标题:Oracle Database 11g Release 2 (11.2) Installation On RHEL6.3
分享到QQ空间 分享到腾讯朋友

  • 注意:“桐星豆博客”只会以“回复”的身份出现,不会以“咨询”的身份出现在留言或评论中,凡是以“咨询”的身份出现的留言或评论均为他人盗用!
  • 本站用以回复网友评论的唯一名称是“桐星豆博客”,除此外均无效,网友不得用此名进行相应文章的评论或回复!
  • 用户言论只代表其个人观点,不代表桐星豆博客的观点或立场!
  • 非诚勿扰,请友好如实的评论,杜绝谩骂、人格攻击等一切伤人言论,请严格遵循中华人民共和国法律法规!
  • 桐星豆博客拥有最终解释权,如有网友违规,本站将有权删除或屏蔽违规评论,情节严重者账户加入黑名单、永久封IP并报司法部门严惩!
  • 您一旦参与评论本站则默认为您已经同意以上条款,否则“非诚勿扰”,谢谢合作!

您的姓名或昵称: 选填
您的E-Mail地址: ☆必填--仅站长可见
您个人网站地址: 选填 ( 如果填写,请务必加上 http:// 或 https:// 等等 )

验证码: 点击重新生成验证码  [ ctrl + enter ]

CopyRight © 2009-2020 by 桐星豆博客 All Rights Reserved.