欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Solaris10下安装Oralce10g

程序员文章站 2022-05-25 22:54:10
...
安装准备:
1.首先以root用户登录,编辑几个跟内存分配有关的系统参数。
# vi /etc/system


set shmsys:shminfo_shmmax=4294967295(给oracle最大内存设置为2G)
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
set semsys:seminfo_semmni=110
set semsys:seminfo_semmns=310

Oracle安装时缺省的设置为:
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=15
set semsys:seminfo_semmns=200
set semsys:seminfo_semmni=70
set ulimit=3000000
set semsys:seminfo_semmni=315
set semsys:seminfo_semmsl=300
set semsys:seminfo_semmns=630
set semsys:seminfo_semopm=315
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmni=315
set shmsys:shminfo_shmseg=10
set shmsys:shminfo_shmmin=1

其中这些参数的含义

shmmax - 共享内存段的最大字节数,建议设大点,甚至可以大过物理内存的字节数
shmmin - 共享内存段的最小尺寸.
shmmni - 共享内存段的最大数目.
shmseg - 每个进程可分配的最大共享内存段数目.
shmall - 最大的并发共享内存段数目,比SGA还要大.
semmns - 信号灯的最大数量,跟ORACLE的PROCESS数有关.
semmsl - 每个信号灯集合中最多的信号灯数目.

2.创建用户和组

# groupadd dba
# groupadd oinstall
# useradd –g dba -G oinstall –d /export/home/oracle –m oracle
# passwd oracle

3.设置必要的目录权限
# chmod -R 777 /export/home/oracle

4.设定oracle用户的环境参数
ORACLE_BASE=/export/home/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orionuat
NLS_LANG=AMERICAN_AMERICA.WE8MSWIN1252(默认字符集)
PATH=$ORACLE_HOME/bin:/sbin:/usr/ccs/bin:/usr/local/bin:/usr/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/usr/local/lib:/usr/lib
TMPDIR=/var/tmp
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export NLS_LANG
export PATH
export LD_LIBRARY_PATH

DISPLAY=127.0.0.1:0.0
export DISPLAY

umask 022

5.开始安装。安装文件为10202_database_solx86.zip
# unzip 10202_database_solx86.zip
# cd database
# ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be 5.10. Actual 5.10
Passed

Checking Temp space: must be greater than 250 MB. Actual 6645 MB Passed
Checking swap space: must be greater than 500 MB. Actual 7077 MB Passed
Checking monitor: must be configured to display at least 256 colors
>>> Could not execute auto check for display colors using command /usr/openwin/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<

Some requirement checks failed. You must fulfill these requirements before

continuing with the installation,at which time they will be rechecked.

Continue? (y/n) [n]

若遇到此错误,可以在root用户下执行
# xhost +

然后再回到oracle用户下,重新执行runInstaller
# su oracle
$ bash
bash-3.00$ cd /export/home/oracle/software/database/
bash-3.00$ ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be 5.10. Actual 5.10
Passed

Checking Temp space: must be greater than 250 MB. Actual 6644 MB Passed
Checking swap space: must be greater than 500 MB. Actual 7077 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed

All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-09-01_08-55-23AM. Please wait ...bash-3.00$ Warning: Cannot convert string "-hanyi-ming-medium-r-normal--*-140-*-*-m-*-big5-1" to type FontStruct
Oracle Universal Installer, Version 10.2.0.2.0 Production
Copyright (C) 1999, 2006, Oracle. All rights reserved.

然后出现安装界面,根据提示可以完成安装。

错误解答:
1. 在安装过程中创建Oracle实例时,有可能会提示ORA-27102 "Out of Memory"错误,可能是内存设置不当造成的,可以修改max-shm-memory参数。
2. 在启动Listener时出现Permission denied错误(引用自[url]http://www.stblog.net/article/tech/304.htm[/url]):
$lsnrctl start
LSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 19-APR-2007 16:38:17
Copyright (c) 1991, 2005, oracle. All rights reserved.
Starting /opt/oracle/oracle10/app/oracle10/product/10.2.0/Db_1/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
System parameter file is /opt/oracle/oracle10/app/oracle10/product/10.2.0/Db_1/network/admin/listener.ora
Log messages written to /opt/oracle/oracle10/app/oracle10/product/10.2.0/Db_1/network/log/listener.log
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-12546: TNS:permission denied
TNS-12560: TNS:protocol adapter error
TNS-00516: Permission denied
Solaris Error: 13: Permission denied
Listener failed to start. See the error message(s) above...

原因及解决方法:
The Unix permissions for the hidden directory /tmp/.oracle should be:
Owner = the oracle user who performed the database install,
Group = the dba group of the oracle user,
and the directory's Unix permissions should be drwxrwxrwx
Change the permissions on the .oracle directory:
1) cd /var/tmp(on Solaris) or /tmp(on Hp and IBM)
2) Change the ownership and group of the ".oracle" directory to "oracle/dba":
# chown -R oracle10:dba .oracle
or
3) Change the permissions on the directory:
# chmod 777 .oracle