oracle 11g 的安装环境的配置

http://docs.oracle.com/cd/E11882_01/install.112/e24324/toc.htm


1、检查硬件的要求
 内存要求:
    内存要求:至少1G,但是安装11g必须在2G以上
    建议: 2G的RAM以及以上
查看内存:grep MemTotal /proc/meminfo
swap分配:
大页内存的特征是分配非swap内存,如果你开启的大页内存,那么在计算swap时排除已经分配的大页内存
Table 1-1 Swap Space Required for 64-bit Linux and Linux on System z
Available RAM                   Swap Space Required
Between 2.5 GB and 32 GB     Equal to the size of RAM
More than 32 GB              32 GB of RAM


Table 1-2 Swap Space Required for 32-bit Linux
Available RAM                       Swap Space Required
Between 2.5 GB and 16 GB  Equal to the size of RAM
More than 16 G                              16 GB


The MEMORY_MAX_TARGET and MEMORY_TARGET parameters cannot be used when the LOCK_SGA parameter is enabled, or with HugePages on Linux.
如果sga是自动管理的,那么不能使用lock_sga 或者大页内存管理


如果遇到了 ORA-00845 error, 需要增加 the /dev/shm的大小.
# mount -t tmpfs shmfs -o size=7g /dev/shm
为了开机时自动生效, 在 /etc/fstab 配置文件中添加
shmfs /dev/shm tmpfs size=7g 0


查看swap的大小:
root@dba ~]# grep SwapTotal /proc/meminfo
SwapTotal:     4096564 kB

[root@dba ~]# free
       total       used       free     shared    buffers     cached
Mem:        611428     600872      10556          0     138544     367632
-/+ buffers/cache:      94696     516732
Swap:      4096564          0    4096564


磁盘空间的需求:
/tmp要求:至少1G


软件所需要的磁盘空间:
Installation Type Requirement for Software Files (GB)
Enterprise Edition 4.5
Standard Edition 4.4


硬件所需要的磁盘空间:
Installation Type Requirement for Data Files (GB)
Enterprise Edition 1.7
Standard Edition 1.5


显卡要求:
    The minimum resolution for Oracle Database 11g Release 2 (11.2) is 1024 x 768 or higher


对操作系统的要求:
系统:Red Hat Enterprise Linux 5.5(此处我使用的是linux 5.5)
[root@localhost ~]# cat /proc/version
Linux version 2.6.18-194.el5 (mockbuild@x86-005.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48))


[root@localhost ~]# lsb_release -id
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)


[root@localhost ~]# uname -m
x86_64


If you plan to install on Oracle ASM, then to ensure high availability of OCR or voting disk files on Oracle ASM, you need to have at least 2 GB of for Oracle Clusterware files in three separate failure groups, 
with at least three physical disks. Each disk must have at least 1 GB of capacity to ensure that there is sufficient space to create Oracle Clusterware files.


Ensure you have at least 6.5 GB of space for the Oracle Grid Infrastructure for a Cluster home (Grid home). This includes Oracle Clusterware and Oracle Automatic Storage Management (Oracle ASM) files and log files,
 ACFS log files, and includes the Cluster Health Monitor repository.



2、 安装oracle必须的软件置好yum
vi /etc/yum.repo/r
[rhel-server]
name=server
baseurl=file:///misc/cd/Server
enabled=1
gpgcheck=0


[rhel-cluster]
name=cluster
baseurl=file:///misc/cd/Cluster
enabled=1
gpgcheck=0


[rhel-clusterstor]
name=cluster
baseurl=file:///misc/cd/ClusterStorage
enabled=1
gpgcheck=0


[rhel-vt]
name=cluster
baseurl=file:///misc/cd/VT
enabled=1
gpgcheck=0


安装所需软件(操作系统不同所需安装的软件不同)
yum install binutils-2.17.50.0.6                      -y
yum install compat-libstdc++-33-3.2.3                 -y
yum install elfutils-libelf-0.125                     -y
yum install elfutils-libelf-devel-0.125               -y
yum install elfutils-libelf-devel-static-0.125        -y
yum install gcc-4.1.2                                 -y
yum install gcc-c++-4.1.2                             -y
yum install glibc-2.5-24                              -y
yum install glibc-common-2.5                          -y
yum install glibc-devel-2.5                           -y
yum install glibc-headers-2.5                         -y
yum install kernel-headers-2.6.18                     -y
yum install ksh-20060214                              -y
yum install libaio-0.3.106                            -y
yum install libaio-devel-0.3.106                      -y
yum install libgcc-4.1.2                              -y
yum install libgomp-4.1.2                             -y
yum install libstdc++-4.1.2                           -y
yum install libstdc++-devel-4.1.2                     -y
yum install make-3.81                                 -y
yum install sysstat-7.0.2                             -y


[root@localhost ~]# yum install unixODBC-2.2.11*

selinux,防火墙,不必要服务,机器名
vi /etc/sysconfig/selinux
SELINUX=enforcing改成SELINUX=disabled
修改此参数后,一定要重启操作系统。
关掉防火墙
iptables -F


创建安装所需要的组:
[root@localhost rpm]# groupadd  -g 501  oinstall
建立oinstall 组主要是为了让属于这个组的用户能够对 oraInventory目录具有读写权限 ,对数据库能够重启资源,其中oracle和grid用户必须属于oinstall组


[root@localhost rpm]# groupadd -g 502 dba
创建dba组是为了让数据库的管理者oracle用户,能够登陆到asm实例上,dba组能够确定操作系统的用户能够管理数据库的权限


[root@localhost rpm]# useradd -u 1000 -g oinstall -G dba oracle
oracle用户主要是管理数据库软件


给oracle用户修改密码:
[root@localhost rpm]# passwd oracle
Changing password for user oracle.
New UNIX password: 
BAD PASSWORD: it is based on a dictionary word


配置内核参数
vi   /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 = 1048576

                         
配置内核参数

				Parameter 	Minimum Value 	File
				semmsl                250                               /proc/sys/kernel/sem
				semmns                  32000
				semopm                   100
				semmni                        128

				shmall	                2097152	                               /proc/sys/kernel/shmall
				shmmax	          Minimum: 536870912                    /proc/sys/kernel/shmmax
							Maximum: A value that is 1 byte less than 4 GB, or 4294967295
							 Recommended: More than half the physical memory
							See My Oracle Support Note 567506.1 for additional information about configuring shmmax.

				shmmni	                   4096                   	/proc/sys/kernel/shmmni
				file-max	                  6815744	                               /proc/sys/fs/file-max
				ip_local_port_range	Minimum: 9000        /proc/sys/net/ipv4/ip_local_port_range
								 Maximum: 65500

				rmem_default	     262144	/proc/sys/net/core/rmem_default
				rmem_max	    4194304	/proc/sys/net/core/rmem_max
				wmem_default	     262144	/proc/sys/net/core/wmem_default
				wmem_max	    1048576	/proc/sys/net/core/wmem_max
				aio-max-nr	   1048576
				Note: This value limits concurrent outstanding requests and should be set to avoid I/O subsystem failures.

  shmall kernel.shmall 参数是控制共享内存页数 。Linux 共享内存页大小为4KB,,可通过命令 getconf PAGESIZE获取内存页的大小, 共享内存段的大小都是共享内存页大小的整数倍。如果一个共享内存段的最大大小是16G,那么需要共享内存页数是 16GB/4KB=16777216KB/4KB=4194304 (页),也就是64Bit 系统下16GB 物理内存,设置 kernel.shmall = 4194304 才符合要求(几乎是原来设置2097152的两倍)。这时可以将shmmax 参数调整到 16G 了,同时可以修改SGA_MAX_SIZE 和  SGA_TARGET 为 12G(您想设置的SGA 最大大小,当然也可以是2G~14G 等,还要协调PGA参数及OS 等其他内存使用,不能设置太满,比如16G)。

                                                 [root@localhost ~]# getconf PAGESIZE
									4096
									

 shmmax 是单个段允许使用的大小,如果该参数设置小于Oracle SGA设置,那么SGA就会被分配多个共享内存段。这在繁忙的系统中可能成为性能负担,带来系统问题。 Linux上该参数的缺省值通常为32M。为了避免多个共享内存段,我们可以修改shmmax内核参数,使SGA存在于一个共享内存段中。所以一般来说,1-4G 的物理内存,可以直接设置shmmax 为最大物理内存即可,那么SGA 肯定在一个共享内存段中,32Bit Linux 系统物理内存大于4G 的设置为4G 即可 。总之,一般设置shmmax >=SGA (32Bit 系统是否支持到1.7G 以上SGA 需要注意) 。如果是64Bit 的Linux 操作系统,shmmax 设置为大于SGA_MAX_SIZE 即可。 
  kernel.shmmni  表示最小共享内存,缺省值为4096                 

kernel.sem   有四个参数, 这几个参数为固定值SEMMNS:系统信号量最大数,SEMOPM:每次semopm系统调用操作数,SEMMNI:系统辛苦量集数最大数。这4个参数为固定内容大小 
               semmsl :设置每个信号灯组中信号灯最大数量,推荐的最小值是250。对于系统中存在大量并发连接的系统,推荐将这个值设置为PROCESSES初始化参数加10。
               semmns:SEMMNS=SEMMNU = (SEMMNI * SEMMSL)
	       semopm:设置每次系统调用可以同时执行的最大信号灯操作的数量。由于一个信号灯组最多拥有SEMMSL个信号灯,因此有推荐将SEMOPM设置为SEMMSL的值。Oracle验证的10.2和11.1的SEMOPM的配置为100
               semmni:设置系统中信号灯组的最大数量。Oracle10g和11g的推荐值为142


net.ipv4.ip_local_port_range  tcp端口的范围 默认值是1024 65000
net.core.rmem_default :默认窗口接收大小
net.core.rmem_max :最大的tcp数据接收缓冲
net.core.wmem_default  默认的发送窗口大小
net.core.wmem_max :最大的tcp数据发送缓冲

		ps -ef|grep 3102
		 pmap 3102


				默认查看
				ipcs -sa
				[root@localhost ~]# ipcs -l
				------ Shared Memory Limits --------
				max number of segments = 4096
				max seg size (kbytes) = 67108864
				max total shared memory (kbytes) = 17179869184
				min seg size (bytes) = 1

				------ Semaphore Limits --------
				max number of arrays = 128
				max semaphores per array = 250
				max semaphores system wide = 32000
				max ops per semop call = 32
				semaphore max value = 32767

				------ Messages: Limits --------
				max queues system wide = 16
				max size of message (bytes) = 65536






检查资源限制:


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  at least 10240 KB at least 10240 KB, and at most 32768 KB


[root@localhost rpm]# cat /etc/security/limits.conf 
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240


设置环境变量:

[root@localhost ~]# mkdir -p /u01/app/oracle/product/
[root@localhost ~]# chown -R oracle:oinstall /u01/app/oracle
[root@localhost ~]#  chmod -R 775 /u01/app/oracle

vi .bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/dbs_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin
export PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH


安装数据库:
[oracle@localhost database]$ ./runInstaller 






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值