11GR2_for_linux6.4_64实施文档
=====1、系统和软件版本
系统:redhat6.4或其它
数据库版本:11.2.0.3.0或其它
===== 2、配置图形环境
下载安装xmanager
用xshell以root用户登陆linux系统
运行xhost +
输出到自己电脑客户端的IP及端口
export DISPLAY=192.168.x.xxx:0.0
===== 3:检查硬件需求
以root用户登录
3.1内存要求:
3.1.1检查物理内存:最少2G,建议8G或更多
grep MemTotal /proc/meminfo
3.1.2检查交换空间:
内存<16G时
swap=memory
内存>16G时
swap=16G
#grep SwapTotal /proc/meminfo
3.1.3检查共享内存
df –h /dev/shm
由于11g默认开启了AMM自动内存管理,所以共享内存必须=》MEMORY_TARGET和MEMORY_MAX_TARGET
linux系统共享内存=内存的一半
建议修改为内存*80%或相等
3.2系统架构
检查系统架构是否能够运行软件版本
uname -m
3.3磁盘空间要求
3.3.1 /tmp目录最少1G
查/tmp目录:
df –k /tmp
如果tmp空间不足,可以在oracle用户环境变量里设置TMP and TMPDIR environment variables来指定一个空间足够的tmp目录,或者增加磁盘空间
3.3.2检查磁盘空闲空间:
df -h
===== 4:检查软件需求
4.1操作系统需求
The following or later versions of the operating system are required for Oracle
Database 11g Release 2 (11.2):
See Also: "Configuring the oracle User’s Environment" for more
information about setting TMP and TMPDIR
Installation Type Requirement for Software Files (GB)
Enterprise Edition 4.35
Standard Edition 4.22
Installation Type Requirement for Data Files (GB)
Enterprise Edition 1.7
Standard Edition 1.5
Note: Oracle Universal Installer performs checks on the system to
verify that it meets the listed requirements. To ensure that these checks
pass, verify the requirements before you start Oracle Universal
Installer.
7
■ Asianux Server 3 SP2
■ Oracle Linux 4 Update 7
■ Oracle Linux 5 Update 2
■ Oracle Linux 5 Update 5 (with the Oracle Unbreakable Enterprise Kernel for
Linux)
■ Red Hat Enterprise Linux 4 Update 7
■ Red Hat Enterprise Linux 5 Update 2
■ Red Hat Enterprise Linux 5 Update 5 (with the Oracle Unbreakable Enterprise
Kernel for Linux)
■ SUSE Linux Enterprise Server 10 SP2
■ SUSE Linux Enterprise Server 11
cat /proc/version
4.2系统内核需求
uname -r
The following are the kernel requirements for Oracle Database 11g Release 2 (11.2):
■ On Oracle Linux 4 and Red Hat Enterprise Linux 4
2.6.9 or later
Note: For Asianux Server, Oracle Linux, and Red Hat Enterprise
Linux, system requirements are identical by kernel version.
Specifically:
■ Oracle Linux 4 and Red Hat Enterprise Linux 4 requirements are
the same.
■ Asianux Server 3, Oracle Linux 5, and Red Hat Enterprise Linux 5
requirements are the same.
■ Oracle Unbreakable Enterprise Kernel for Linux 5 Update 5
(2.6.32) and above, available for x86-64 systems, contains several
additional features and performance enhancements not available
either with Oracle Linux or with other supported Linux
distributions. This kernel can be installed on either Oracle Linux
or Red Hat Enterprise Linux distributions. Before installing the
Oracle Unbreakable Enterprise Kernel, you must have Oracle
Linux 5 Update 5 or Red Hat Enterprise Linux 5 Update 5
installed on an x86-64 server.
Note: Only the distributions and versions listed in the earlier list are
supported. Do not install the software on other versions of Linux.
8
■ On Oracle Linux 5 Update 2
2.6.18 or later (compatible with Red Hat Enterprise kernel)
■ On Oracle Linux 5 Update 5 with the Unbreakable Enterprise Kernel for Linux
2.6.32-100.0.19 or later
See Also: "About Oracle Unbreakable Enterprise Kernel for Linux" section in
Oracle Database Installation Guide for Linux
■ On Red Hat Enterprise Linux 5 Update 5 with the Unbreakable Enterprise Kernel
for Linux
2.6.32 or later
See Also: "About Oracle Unbreakable Enterprise Kernel for Linux" section in
Oracle Database Installation Guide for Linux
■ On Asianux Server 3, Oracle Linux 5 Update 2, and Red Hat Enterprise Linux 5
Update 2
2.6.18 or later
■ On SUSE Linux Enterprise Server 10
2.6.16.21 or later
■ On SUSE Linux Enterprise Server 11
2.6.27.19 or later
4.3包需求
不一样的数据库版本对应的系统需要安装的包也不一样
查看系统版本号:
lsb_release –a
挂载系统iso镜像以便安装缺少的包
1、首先切换到你的iso文件所在路径,比如,数据在~/Downloads/ 下:
cd ~/Downloads
2、确保要挂载的路径存在:
ls /mnt
如果没有就 sudo mkdir /mnt
3、挂载用好参数:
sudo mount -o loop -t iso9660 simulia-abaqus-dvd1.iso /mnt
如果挂载后看不到具体的文件, 可能是 -t 指明的iso格式错了,是是udf的,或者用 file命令察看
file simulia-abaqus-dvd1.iso
sudo mount -o loop -t udf simulia-abaqus-dvd1.iso /mnt #如果是udf的光盘映像
卸载镜像时报device is busy解决方法
fuser -k /mnt/usbdisk
这里的话,一般情况下系统管理员会全部安装软件包,如果没有安装,在安装oracle软件时,会check缺少的安装包,到时安装即可
The following or later version of packages for Oracle Linux 4 and Red Hat Enterprise Linux 4 must be installed:
binutils-2.15.92.0.2
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.97
elfutils-libelf-devel-0.97
expat-1.95.7
gcc-3.4.6
gcc-c++-3.4.6
glibc-2.3.4-2.41
glibc-2.3.4-2.41 (32 bit)
glibc-common-2.3.4
glibc-devel-2.3.4
glibc-headers-2.3.4
libaio-0.3.105
libaio-0.3.105 (32 bit)
libaio-devel-0.3.105
libaio-devel-0.3.105 (32 bit)
libgcc-3.4.6
libgcc-3.4.6 (32-bit)
Note:
■ Oracle recommends that you install your Linux operating system
with the default software packages (RPMs), unless you
specifically intend to perform a minimal installation, and follow
the directions for performing such an installation to ensure that
you have all required packages for Oracle software.
■ Oracle recommends that you do not customize RPMs during a
default operating system installation. A default installation
includes most required packages, and helps you to limit manual
checks of package dependencies.
■ If you did not perform a default Linux installation, you intend to
use LDAP, and you want to use the scripts odisrvreg, oidca, or
schemasync, then install the Korn shell RPM for your Linux
distribution.
■ You must install the packages (or later versions) listed in the
following table. Also, ensure that the list of RPMs and all the
prerequisites for these RPMs are installed.
■ If you are using Oracle Unbreakable Enterprise Kernel, then all
required kernel packages are installed as part of the Oracle
Unbreakable Enterprise Kernel installation.
IMPORTANT: Starting with Oracle Database 11g Release 2 (11.2.0.2),
all the 32-bit packages, except for gcc-32bit-4.3, listed in the
following table are no longer required for installing a database on
Linux x86-64. Only the 64-bit packages are required.
However, for any Oracle Database 11g release before 11.2.0.2, both the
32-bit and 64-bit packages listed in the following table are required.
10
libstdc++-3.4.6
libstdc++-3.4.6 (32 bit)
libstdc++-devel 3.4.6
make-3.80
numactl-0.6.4.x86_64
pdksh-5.2.14
sysstat-5.0.5
■ The following or later version of packages for Asianux 3, Oracle Linux 5, and Red Hat Enterprise Linux 5 must be installed:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
sysstat-7.0.2
■ The following or later version of packages for SUSE Linux Enterprise Server 10 must be installed:
binutils-2.16.91.0.5
compat-libstdc++-5.0.7
gcc-4.1.0
gcc-c++-4.1.2
glibc-2.4-31.63
glibc-devel-2.4-31.63
glibc-devel-32bit-2.4-31.63
ksh-93r-12.9
libaio-0.3.104
libaio-32bit-0.3.104
libaio-devel-0.3.104
libaio-devel-32bit-0.3.104
libelf-0.8.5
libgcc-4.1.2
libstdc++-4.1.2
libstdc++-devel-4.1.2
make-3.80
numactl-0.9.6.x86_64
sysstat-8.0.4
11
■ The following or later version of packages for SUSE Linux Enterprise Server 11 must be installed:
binutils-2.19
gcc-4.3
gcc-32bit-4.3
gcc-c++-4.3
glibc-2.9
glibc-32bit-2.9
glibc-devel-2.9
glibc-devel-32bit-2.9
ksh-93t
libaio-0.3.104
libaio-32bit-0.3.104
libaio-devel-0.3.104
libaio-devel-32bit-0.3.104
libstdc++33-3.3.3
libstdc++33-32bit-3.3.3
libstdc++43-4.3.3_20081022
libstdc++43-32bit-4.3.3_20081022
libstdc++43-devel-4.3.3_20081022
libstdc++43-devel-32bit-4.3.3_20081022
libgcc43-4.3.3_20081022
libstdc++-devel-4.3
make-3.81
sysstat-8.1.5
如果软件已经安装,系统会给出版本:
例如binutils-2.17.50.0.6-9.e15
如果软件没有安装,系统会提示:
binutils is not installed
安装该软件的方法
#yum search binutils
查找到binutils.i386
#yum install binutils.i386
#rpm -ivh binutils.i386
rmp -ivh xorg-x11-apps-7.7-6.el7.x86_64.rpm
12C Packages for Red Hat Enterprise Linux 6
yum install -y binutils-2.20.51.0.2-5.36.el6 (x86_64)
yum install -y compat-libcap1-1.10-1 (x86_64)
yum install -y compat-libstdc++-33-3.2.3-69.el6 (x86_64)
yum install -y compat-libstdc++-33-3.2.3-69.el6 (i686)
yum install -y e2fsprogs-1.41.12-14.el6 (x86_64)
yum install -y e2fsprogs-libs-1.41.12-14.el6 (x86_64)
yum install -y glibc-2.12-1.107.el6 (i686)
yum install -y glibc-2.12-1.107.el6 (x86_64)
yum install -y glibc-devel-2.12-1.107.el6 (i686)
yum install -y glibc-devel-2.12-1.107.el6 (x86_64)
yum install -y ksh
yum install -y libaio-0.3.107-10.el6 (x86_64)
yum install -y libaio-0.3.107-10.el6 (i686)
yum install -y libaio-devel-0.3.107-10.el6 (x86_64)
yum install -y libaio-devel-0.3.107-10.el6 (i686)
yum install -y libX11-1.5.0-4.el6 (i686)
yum install -y libX11-1.5.0-4.el6 (x86_64)
yum install -y libXau-1.0.6-4.el6 (i686)
yum install -y libXau-1.0.6-4.el6 (x86_64)
yum install -y libXi-1.6.1-3.el6 (i686)
yum install -y libXi-1.6.1-3.el6 (x86_64)
yum install -y libXtst-1.2.1-2.el6 (i686)
yum install -y libXtst-1.2.1-2.el6 (x86_64)
yum install -y libgcc-4.4.7-3.el6 (i686)
yum install -y libgcc-4.4.7-3.el6 (x86_64)
yum install -y libstdc++-4.4.7-3.el6 (i686)
yum install -y libstdc++-4.4.7-3.el6 (x86_64)
yum install -y libstdc++-devel-4.4.7-3.el6 (i686)
yum install -y libstdc++-devel-4.4.7-3.el6 (x86_64)
yum install -y libxcb-1.8.1-1.el6 (i686)
yum install -y libxcb-1.8.1-1.el6 (x86_64)
yum install -y make-3.81-20.el6 (x86_64)
net-tools-1.60-110.el6_2 (x86_64) (for Oracle RAC and Oracle
Clusterware)
nfs-utils-1.2.3-36.el6 (x86_64) (for Oracle ACFS)
smartmontools-5.43-1.el6 (x86_64)
sysstat-9.0.4-20.el6 (x86_64)
=========linux配置yum,用yum安装会解决依赖包的问题
1.将光盘中的Cluster, ClusterStorage, Server, VT,这几个文件COPY到本地目录中,比如我的为/yum/目录,
cp -R ./Cluster /yum
cp -R ./ClusterStorage /yum
cp -R ./Server /yum
cp -R ./VT /yum
2.编辑vi /etc/yum.repos.d/rhel-debuginfo.repo文件,如我的配置文件为
[Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/Cluster/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releasea
[VT]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/VT
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-releasea
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
开始安装
5、创建用户和相关组
5.1创建oinstall,dba组
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/groupadd oper
5.2创建oracle用户
redhat
useradd -d /home/oracle -g oinstall -G dba oracle
SUSE
useradd -g oinstall -G dba,oper -d /home/oracle -s /bin/bash oracle
cd /home
mkdir oracle
chown -R oracle:oinstall oracle
passwd oracle
修改oracle用户密码
passwd oracle
6、配置内核参数
6.1配置内核参数
执行# vi /etc/sysctl.conf 按i进入编辑模式,将下列内容加入该文件
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 536870912
kernel.shmmax = 21474836480
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
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
编辑完成之后按ESC,:wq存盘退出, 重新加载并验证参数是否正确,运行下面命令:
sysctl -p
查看修改的内核参数:
sysctl -a | grep …
6.2检查会话资源限制
设置Shell
执行# vi /etc/security/limits.conf调用现在:
oracle soft nproc 2074
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
编辑完成之后按ESC,:wq存盘退出
限制说明:
7、创建需要的目录
7.1创建oracle家目录
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/
chmod -R 775 /u01/app/
7.2创建oracle软件目录
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01/app
chmod -R 775 /u01/app
执行#vi /etc/pam.d/login 将下列内容加入该文件
session required /lib/security/pam_limits.so
session required pam_limits.so
编辑完成之后按ESC,:wq存盘退出
7.3 创建oracle压缩包目录
cd /u01
mkdir sw
chown -R oracle:oinstall sw
8、配置oracle用户环境
切换到oracle用户
#su – oracle
$vi .bash_profile 编辑.bash_profile文件,增加下列内容
umask 022
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
export PS1=`hostname`:'$PWD'"$"
编辑完成之后按ESC,:wq存盘退出
验证方式:source .bash_profile
9:安装软件:最好是重新登录到Oracle用户下
./runInstall
安装过程比较简单,点下一步即可,但是有几点需要注意
建议先只安装数据库软件,后面再dbca装数据库
第一步:将邮箱对应选项取消(默认选择),提示警告后选择yes
第二步:选择第三个选项即跳过软件更新
第三步:选择第二个选项即只安装软件
第四步:选择安装单机数据库
第五步:语言选择English
第六步:选择企业版
第七步:后面选项默认下一步即可
10:创建Oracle数据库(用oracle身份登录)
dbca
第一步:默认选择创建数据库
第二步:默认选择创建事务处理数据库
第三步:输入数据库名称,单机数据库,保证数据库名称和sid一致
第四步:选择第二个选项,为所有数据库默认用户输入统一的密码
第五步:选择数据文件所在目录
第六步:取消闪回功能,后期手工开启归档
第七步:默认下一步
第八步:内存占用大小可以选择占用60%,后期可以手工增加
进程数选择,默认150太少,建议至少1000
字符集选择,一般选择中文字符集即第三个选项里找到ZHS16GBK-GBK 16-bit Simplified Chinese
第九步:下一步默认进行安装
11:创建监听:(用oracle身份登入)
默认是有监听可以用的,但是建议自己创建一个
启动和停止监听服务
$ lsnrctl start 启动服务
$ lsnrctl stop 停止监听服务
$ lsnrctl status 查看当前监听状态
=====对数据库数据文件进行扩容
alter database datafile '+DATA/aams/datafile/system.260.839517123' resize 20G;
alter database datafile '+DATA/aams/datafile/sysaux.261.839517125' resize 20G;
alter database datafile '+DATA/aams/datafile/undotbs1.262.839517129' resize 20G;
alter database tempfile '+DATA/aams/tempfile/temp.263.839517129' resize 20G;
=====对redo日志进行扩容优化
select group#,thread#,bytes/1024/1024 "MB",members,status from v$log;
select member from v$logfile;
alter database add logfile thread 1 group 4('/u01/app/oracle/ogg2/redo04.log') size 200M;
alter database add logfile thread 1 group 5('/u01/app/oracle/ogg2/redo05.log') size 200M;
alter database add logfile thread 2 group 6('/u01/app/oracle/ogg2/redo06.log') size 200M;
alter database add logfile thread 2 group 7('/u01/app/oracle/ogg2/redo06.log') size 200M;
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;
alter database drop logfile group 4;