全部博文(78)
分类: Oracle
2009-06-26 15:27:37
1、环境变量
讲一下内容写到~oracle/.bash_profile或者写到.bashrc,本文写到~oracle/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
## For Oracle ##
export EDITOR=vi
export ORACLE_SID=ccdb
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/11.1.0/crs_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
#export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
#export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64/
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$PATH
umask 022
#export NLS_LANG='AMERICAN_AMERICA.UTF8'
export NLS_LANG=AMERICAN_AMERICA.ZHS16CGB231280
#export NLS_LANG=AMERICAN_AMERICA.ZHT16BIG5
#export NLS_LANG="traditional chinese_taiwan.ZHT16BIG5"
#export LC_CTYPE=en_US.UTF-8
export LANG=en_US
alias sqlplus="uniread sqlplus"
alias rman="uniread rman"
alias adrci="uniread adrci"
################
2、内核参数调整
编辑/etc/sysctl.conf文件添加以下内容
## For Oracle ##
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
################
fs.file-max = 6553600
注意:如果是启动vnc远程安装一定要运行+xhost命令
oracle安装时调整内核参数的意义:
Name |
Description |
Reasonable Values |
SHMMAX |
Maximum size of shared memory segment (bytes) |
250kB + 8.2kB * shared_buffers + 14.2kB * max_connections or infinity |
SHMMIN |
Minimum size of shared memory segment (bytes) |
1 |
SHMALL |
Total amount of shared memory available (bytes or pages) |
if bytes, same as SHMMAX; if pages, ceil(SHMMAX/PAGE_SIZE) |
SHMSEG |
Maximum number of shared memory segments per process |
only 1 segment is needed, but the default is much higher |
SHMMNI |
Maximum number of shared memory segments system-wide |
like SHMSEG plus room for other applications |
SEMMNI |
Maximum number of semaphore identifiers (that is, sets) |
>= ceil(max_connections / 16) |
SEMMNS |
Maximum number of semaphores system-wide |
ceil(max_connections / 16) * 17 + room for other applications |
SEMMSL |
Maximum number of semaphores per set |
>= 17 |
SEMMAP |
Number of entries in semaphore map |
see text |
SEMVMX |
Maximum value of semaphore |
>= 255 (The default is often 32767, do not change unless asked to.) |
kernel.shmall = 2097152 ------可用共享内存的总量,单位页,在32位系统上一页=4k,也就是4096字节。按照这个设置2097152*4k/1024/1024 = 8G, 就是说可用共享内存一共 8G
kernel.shmmax = 2147483648-----单个共享内存段的最大数,2147483648/1024/1024=2048M=2G
kernel.shmmni = 4096 -------单个共享内存段的最小值1096b=4k
修改/etc/sysctl.conf文件。其中的几个参数的含义是:
kernel.shmmax表示最大共享内存,如果小的话可以按实际情况而定,一般为物理内存的一半,不过我的虚拟机只有256M,所以就全部算进去了。
shmmni表示最小共享内存固定4096KB
shmall表示所有内存大小
sem 4个参数依次是SEMMSL:每个用户拥有信号量最大数,SEMMNS:系统信号量最大数,SEMOPM:每次semopm系统调用操作数,SEMMNI:系统辛苦量集数最大数。这4个参数为固定内容大小。
file-max固定大小65536
ip_local_port_range表示端口的范围,为指定的内容。