分类: Oracle
2010-03-27 09:46:29
1、 安装X Windows
mount光盘
#mount -t iso9660 -r /dev/cdrom /media/cdrom/
进入光盘的RPMS目录并安装相应的包,黑体部分为存在循环依赖的包,必须同时安装。
#cd /media/cdrom/RedHat/RPMS
#rpm -i xorg-x11-font-utils-6.8.2-1.EL.52.i386.rpm
#rpm -i fonts-xorg-base-6.8.2-1.EL.noarch.rpm chkfontpath-1.10.0-2.i386.rpm xorg-x11-xfs-6.8.2-1.EL.52.i386.rpm ttmkfdir-3.0.9-20.el4.i386.rpm
# rpm -i xorg-x11-xauth-6.8.2-1.EL.52.i386.rpm
# rpm -i switchdesk-4.0.6-3.noarch.rpm
# rpm -i cpp-3.4.6-10.i386.rpm
# rpm -i xorg-x11-6.8.2-1.EL.52.i386.rpm xinitrc-4.0.14.3-3.noarch.rpm
#startx后报错,无法找到字体’fixed’
查看X的log:
# cat /var/log/Xorg.0.log
X Window System Version 6.8.2
…………………………………………………………………………………………
Could not init font path element unix/:7100, removing from list!
Fatal server error:
could not open default font ‘fixed’
Please consult the The X.Org Foundation support
at
for help.
Please also check the log file at "/var/log/Xorg.0.log" for additional information.
编辑X的配置文件:
#vi /etc/X11/xorg.conf
将”FontPath Unix/:7100”行注释掉,startx后继续报错:
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!
安装字体75和100dpi的字体包:
# rpm -i fonts-xorg-100dpi-6.8.2-1.EL.noarch.rpm
# rpm -i fonts-xorg-75dpi-6.8.2-1.EL.noarch.rpm
startx之后不报错了,但图形界面一闪而过然后提示:
waiting for x server to shut down –初步判断是没有安装GNOME或者KDE的缘故
——解决办法:安装xterm,然后使用xinit启动xterm.
服务
查看rel4上是否开启ftp服务:ntsysv
将gssftp勾上,以后ftp服务可以开机自启动了。
vi /etc/xinetd.d/gssftp //编辑ftp服务的配置文件gssftp的设置
修改两项内容:
1、server_args = -l –a 去掉-a 改为server_args = -l (注意是英文的l)
2、disable=yes改为disable=no
然后激活服务:
service xinetd restart(ftp 是挂在xinetd 底下的,所以自然只要重新激活 xinetd 就能够将 xinetd 里头的设定重新读进来,所以刚刚设定的ftp自然也就可以被激活。)
3、 检查硬件需求
内存:
[root@localhost ~]# cat /proc/meminfo |grep MemTotal
MemTotal: 514332 kB
Oracle需要至少1G内存。不过少于1G也可以强制安装,当然生产环境是不能这么搞。
Swap空间:
[root@localhost ~]# cat /proc/meminfo |grep SwapTotal
SwapTotal: 1132572 kB
Oracle的Swap需求:
Between 1024 MB and 2048 MB 1.5 times the size of RAM
Between 2049 MB and 8192 MB Equal to the size of RAM
More than 8192 MB 0.75 times the size of RAM
硬件平台:
[root@localhost database]# grep "model name" /proc/cpuinfo
model name : Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz
model name : Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz
4、 检查软件需求
检查操作系统及内核版本:
[root@localhost database]# cat /etc/issue
Red Hat Enterprise Linux AS release 4 (Nahant Update 7)
[root@localhost database]# uname -r
2.6.9-78.ELsmp
支持的操作系统及其内核版本:
Red Hat Enterprise Linux 3.0 and Asianux 1.0
->2.4.21-27.EL or Later
Red Hat Enterprise Linux 4.0 and Asianux 2.0
->2.6.9-5.0.5.EL or Later
SUSE Linux Enterprise Server 9
->2.6.5-7.97 or Later
5、 创建用户和组
需要创建的用户和组:
The Oracle Inventory group (oinstall)
The OSDBA group (dba)
The Oracle software owner (oracle)
An unprivileged user (nobody)
检查oinstall、dba组是否存在:
[root@localhost database]# more /etc/oraInst.loc
/etc/oraInst.loc: No such file or directory //不存在
[root@localhost database]# grep dba /etc/group //无输出表示不存在
创建oinstall和dba组:
[root@localhost database]# groupadd oinstall
[root@localhost database]# groupadd dba
检查oracle用户是否存在:
[root@localhost database]# id oracle
id: oracle: No such user
创建oracle用户并设置密码:
[root@localhost database]# /usr/sbin/useradd -g oinstall -G dba oracle
[root@localhost ~]# passwd oracle
检查nobody用户[非必须]是否存在:
[root@localhost database]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
修改系统内核参数:
[root@localhost database]#vi /etc/sysctl.conf
添加如下参数:
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
大于或者等于这些推荐值
然后使用sysctl –p重新加载配置并检验参数是否存在
一些内核参数的解释可以参考:http://space.itpub.net/35489/viewspace-374870
修改用户Oracle的Shell限制:
Maximum number of open file descriptors{nofile 65536}
Maximum number of processes available to a single user{nproc 16384}
添加如下内容至/etc/security/limits.conf文件:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
添加如下内容至/etc/pam.d/login:
session required /lib/security/pam_limits.so
6、 创建所需的文件夹并赋予相应权限
# mkdir -p /mount_point/app/oracle_sw_owner
# chown -R oracle:oinstall /mount_point/app/oracle_sw_owner (注意:命令只能改变oracle目录的所有者,而不能改变其上层目录的所有者)
# chmod -R 775 /mount_point/app/oracle_sw_owner
7、 切换至oracle用户,检查所使用的SHELL
#su – oracle
#echo $SHELL
8、 修改用户的profile文件:
$vi /home/oracle/.bash_profile##————————————–
# Oracle Settings
TMP=/tmp;
export TMP
TMPDIR=$TMP;
export TMPDIR
ORACLE_BASE=/u01/app/oracle;
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1;
export ORACLE_HOME
ORACLE_SID=orcl;
export ORACLE_SID
ORACLE_TERM=xterm;
export ORACLE_TERM
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/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export CLASSPATH
#LD_ASSUME_KERNEL=2.4.1;
export LD_ASSUME_KERNEL
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
10、使profile生效
$. ./.bash_profile
11、设置tmp环境变量
$ TEMP=/tmp
$ TMPDIR=/tmp
$ export TEMP TMPDIR
12、将oracle的zip包上传至服务器的oracle用户目录下并解压缩
unzip 10201_database_linux32.zip
13、运行安装程序
[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer…
Checking installer requirements…
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-02-04_08-27-33PM. Please wait …[oracle@localhost database]$ Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2010-02-04_08-27-33PM/jre/1.4.2/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.security.action.LoadLibraryAction.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.NativeLibLoader.loadLibraries(Unknown Source)
at sun.awt.DebugHelper.
at java.awt.Component.
缺少xorg-x11-deprecated-libs包:
[root@localhost RPMS]# rpm -i xorg-x11-deprecated-libs-6.8.2-1.EL.52.i386.rpm
14、设置DISPLAY参数
$ DISPLAY=本机IP:0.0; export DISPLAY
[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer…
Checking installer requirements…
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-02-04_08-34-30PM. Please wait …[oracle@localhost database]$ Exception in thread "main" java.lang.InternalError: Can’t connect to X11 window server using ‘172.16.4.105:0.0′ as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
at java.awt.Window.init(Unknown Source)
at java.awt.Window.
at java.awt.Frame.
at oracle.ewt.popup.PopupFrame.
at oracle.ewt.lwAWT.BufferedFrame.
at
oracle.sysman.oio.oioc.OiocOneClickInstaller.
at oracle.sysman.oio.oioc.OiocOneClickInstaller.main(OiocOneClickInstaller.java:2091)
无法连接X server。
startx启动X server:
Fatal server error:
PAM authentication failed, cannot start X server.
Perhaps you do not have console ownership?
权限问题,切换至root。
startx:
waiting for X server to shut down
缺少xterm,安装xterm即可:
[root@localhost RPMS]# rpm -i xterm-192-8.el4.i386.rpm
使用Xmanager用xterm登陆:
./runInstaller
Starting Oracle Universal Installer…
Checking installer requirements…
Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-02-04_09-08-49PM. Please wait …[oracle@localhost database]$ X connection to localhost:10.0 broken (explicit kill or server shutdown).
此错误具体原因不明,在reboot之后再次运行就没有了。
缺少gcc和libaio,安装即可:
安装gcc:
[root@localhost RPMS]# rpm -ivh glibc-kernheaders-2.4-9.1.103.EL.i386.rpm
warning: glibc-kernheaders-2.4-9.1.103.EL.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing… ########################################### [100%]
1:glibc-kernheaders ########################################### [100%]
[root@localhost RPMS]# rpm -ivh glibc-headers-2.3.4-2.41.i386.rpm glibc-devel-2.3.4-2.41.i386.rpm gcc-3.4.6-10.i386.rpm
warning: glibc-headers-2.3.4-2.41.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing… ########################################### [100%]
1:glibc-headers ########################################### [ 33%]
2:glibc-devel ########################################### [ 67%]
3:gcc ########################################### [100%]
安装libaio:
[root@localhost RPMS]# rpm -ivh libaio-0.3.105-2.i386.rpm
warning: libaio-0.3.105-2.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Preparing… ########################################### [100%]
1:libaio ########################################### [100%]
安装程序check一个warning(内存大小不够),一个not executed(Network),忽略。
15、以ROOT身份运行两段脚本:
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh
[root@localhost oraInventory]# ./orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@localhost db_1]# sh root.sh
Running Oracle10 root.sh script…
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin …
Copying oraenv to /usr/local/bin …
Copying coraenv to /usr/local/bin …
Creating /etc/oratab file…
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
参考:
-EOF-