Oracle Database 11g Release 2 (11.2) Installation On RHEL6.3
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
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.
127.0.0.1 localhost.localdomain localhost
192.168.0.123 ol6-112.localdomain ol6-112
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
/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
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
/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
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*
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.
SELINUX=disabled
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
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
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=ol6-112.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=ORCL; export ORACLE_UNQNAME
ORACLE_BASE=/home/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=ORCL; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
Log into the oracle user.Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.
./runInstaller
Proceed with the installation of your choice. The prerequisites checks will fail for the following version-dependent reasons:- 11.2.0.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.
- 11.2.0.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.
- 11.2.0.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.
- Configure Security Updates
- Select Install Option
- System Class
- Node Selection
- Select Install Type
- Typical Install Configuration
- Create Inventory
- Perform Prerequisite Checks
- Summary
- Install Product
- Database Configuration Assistant
- Database Configuration Assistant 2
- Execute Configuration Scripts
- Finish
Post Installation
Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.
orcl:/home/oracle/app/oracle/product/11.2.0/db_1:Y
Common Errors- "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.
- "error code 37" : The DNS not working properly. You may also get this error is the "/etc/hosts" file is not configured correctly.
- "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.
- Listener fails to start - Typically this is due to incorrect name resolution. Make sure the "/etc/hosts" and/or DNS is configured correctly.
- Linking errors - Almost always due to missing prerequisites. Review the setup sections.
Hope this helps.
知识扩展:
关于Oracle数据库迁移(跨版本)以及空表不导出
一、Oracle 11g存在一个特性,如果乃用exp/imp来对数据库进行导入导出时,会出现无数据表无法导出的问题,笔者也遇到了此种问题,经研究觉得遇到此情况,最好用expdp/impdp方式进行导出导入,可以回避这种问题。(此命令缺点在于必须在服务器上执行);
二、关于Oracle版本数据版本不同时的移植,通常都会提示错误不兼容(这里所说的移植是指由高到低移植,低版本移植高版本)。笔者提供一种解决方案:用expdp进行导出(必须是10G或以上的版本,不然不支持expdp),在导出命令中补充version参数,值为目标数据库的版本号。
比如说:乃想将数据库由oracle版本11.2.0.1.0移植到10.2.0.1.0,只需要在导出时设置version='10.2.0.1.0'即可,导入时不用设置version参数。关于第一个问题:空数据表不能导出,网上也流传着另外一个解决的方法就是:(这种方法笔者不推荐使用)
11G中有个新特性,当表无数据时,不分配segment,以节省空间
解决方法:
1、insert一行,再rollback就产生segment了。
该方法是在在空表中插入数据,再删除,则产生segment。导出时则可导出空表。
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;
把查询结果导出,执行导出的语句
'ALTERTABLE'||TABLE_NAME||'ALLOCATEEXTENT;'
-----------------------------------------------------------
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 成功!

转载请注明:文章转载自:桐星豆 [https://txdou.com]
本文标题:Oracle Database 11g Release 2 (11.2) Installation On RHEL6.3
本文地址:http://blog.txdou.com/article86


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