文档库 最新最全的文档下载
当前位置:文档库 › Linux+VNC+Oracle安装手册

Linux+VNC+Oracle安装手册

Linux+VNC+Oracle安装手册

作者:王岳

1.安装软件版本

1.1Linux

CentOS6.2、CentOS6.4

1.2VNC

tigervnc-server-1.1.0-5.el6_4.1.x86_64

1.3Oracle

Oracle 11g

2.安装VNC

2.1安装vncserver服务端和客户端

[root@localhost ~]# yum install tigervnc tigervnc-server–y

2.2安装fontforge

[root@localhost ~]# yum install fontforge-y

2.3安装桌面软件

[root@localhost ~]# yum groupinstall Desktop–y

2.4添加vncserver服务启动参数

[root@localhost /]# vi /etc/sysconfig/vncservers

VNCSERVERS="1:root 2:oracle"

VNCSERVERARGS[1]="-geometry 1024x768"

VNCSERVERARGS[2]="-geometry 1024x768"

这里的1和2代表使用VNC时可以用root或oracle用户登录,其连接接口号是1:root=5901、2:oracle=5902。

2.5配置相应的用户

[root@localhost /]# vncpasswd

Password:

Verify:

[root@localhost /]# su - oracle

[oracle@localhost ~]$ vncpasswd

Password:

Verify:

生成配置文件:

[root@localhost /]# vncserver

[oracle@localhost ~]$ vncserver

设置配置文件:

[root@localhost ~]# vi .vnc/xstartup

[oracle@localhost ~]$ vi .vnc/xstartup

将下列内容加入到文件最后:

#twm&

gnome-session&

2.6防火墙开放端口

在linux使用防火墙的情况下通过VNC连接,需要打开端口5901、5902或创建的VNC用户端口。需要修改配置文件iptables,然后重启iptables服务。

[root@localhost ~]# vi/etc/sysconfig/iptables

此文件下会有一个默认22端口开放配置,按22的配置参加5901、5902即可:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT

随便把数据库的端口1521也开放。

保存后重启:

[root@localhost ~]# /sbin/service iptables restart

2.7启停操作

启动:service vncserver start

停止:service vncserver stop

启停:service vncserver restart

正常启动结果:

正在启动 VNC 服务器:1:root

New 'linuxjcq0:1 (root)' desktop is linuxjcq0:1

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/linuxjcq0:1.log

2:oracle

New 'linuxjcq0:2 (oracle)' desktop is linuxjcq0:2

Starting applications specified in /home/oracle/.vnc/xstartup

Log file is /home/oracle/.vnc/linuxjcq0:2.log

[确定]

2.8问题解决方式

2.8.1查看是否已安装VNC

[root@localhost ~]# rpm -qa | grep vnc

显示版本如下:

tigervnc-server-1.1.0-5.el6_4.1.x86_64

tigervnc-1.1.0-5.el6_4.1.x86_64

如没有任何显示,说明没有安装VNC。

2.8.2无法正常启动或停止VNC服务

[root@localhost ~]# ps -ef | grep -i vnc | grep -v grep

把VNC所有进程kill掉。

2.8.3启动报错

Warning: testdb:1 is taken because of /tmp/.X1-lock

处理过程:

[root@localhost ~]# rm -f /tmp/.X1-lock

启动尝试,仍然报错:

Warning: testdb:1 is taken because of /tmp/.X11-unix/X1

同样的处理过程:

[root@localhost ~]# rm -f /tmp/.X11-unix/X1

如还有类似tmp目录下文件报错,继续删除该报错文件。

WARNING: the first attempt to star Xvnc failed,possibly because the font catalog is not properly configured, attempting to determine an appropriate font path for this system and restart Xvnc using that font path ...

解决办法:更新字体库,时间较长。

[root@localhost ~]# yum -y upgrade

3.安装Oracle数据库

3.1创建oracle用户及用户组

[root@localhost ~]# groupadd oinstall

[root@localhost ~]# groupadd dba

[root@localhost ~]# useradd -g oinstall -G dba oracle [root@localhost ~]# passwd oracle

3.2创建oracle需要的文件夹及赋予权限

[root@localhost ~]# usermod -g oinstall -G dba oracle [root@localhost ~]# mkdir -p /home/oracle/app

[root@localhost ~]# mkdir /home/oracle/app/oracle

[root@localhost ~]# mkdir /home/oracle/app/oradata

[root@localhost ~]# mkdir /home/oracle/app/oracle/product [root@localhost ~]# chown -R oracle:oinstall /home/oracle [root@localhost ~]# chmod -R 755 /home/oracle

3.3修改系统核心参数

3.3.1修改内核

[root@localhost ~]# vi /etc/sysctl.conf

将下列内容加入到文件最后:

fs.file-max = 6815744

fs.aio-max-nr = 1048576

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 4194304

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

[root@localhost ~]# sysctl -p

3.3.2为oracle用户设置Shell限制

[root@localhost ~]# vi /etc/security/limits.conf

将下列内容加入到 # End of file 之前:

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

3.3.3系统环境配置

[root@localhost ~]# vi /etc/pam.d/login

将下列内容加入到文件最后:

session required pam_limits.so

session required /lib/security/pam_limits.so

[root@localhost ~]# vi /etc/profile

将下列内容加入到文件最后:

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

[root@localhost ~]# vi /etc/csh.login

将下列内容加入到文件最后:

if ( $USER == "oracle") then

limit maxproc 16384

limit descriptors 65536

endif

[root@localhost ~]# vi /home/oracle/.bash_profile

将下列内容加入到文件最后:

umask 022

export ORACLE_BASE=/home/oracle/app

export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=orcl

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

执行下面内容让配置文件生效:

[root@localhost ~]# source /home/oracle/.bash_profile

执行下面内容安装oracle依赖包:

[root@localhost ~]# yum install binutils compat-libstdc++ elfutils-libelf

elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat compat-libstdc++-296 compat-libstdc++-33 pdksh unixODBC unixODBC-devel unixODBC

3.4安装Oracle11g

3.4.1上传安装文件及修改配置

上传安装文件(任意目录即可):

linux.x64_11gR2_database_1of2.zip

linux.x64_11gR2_database_2of2.zip

解压安装文件:

[root@localhost dba]# unzip linux.x64_11gR2_database_1of2.zip

[root@localhost dba]# unzip linux.x64_11gR2_database_2of2.zip

[root@localhost dba]# chown -R oracle:oinstall /dba/database

编辑install目录下面的oraparamSilent.ini文件,在“Certified Versions”的项目中添加“redhat-6”。

[root@localhost install]# vi /dba/database/install/oraparamsilent.ini

[Certified Versions]

Solaris=5.6,5.7,5.8,5.9

Linux=redhat-6,redhat-3,redhat-4

3.4.2VNC远程连接安装oracle

下载连接客户端:https://www.wendangku.net/doc/cd3813285.html,/download/viewer/

运行:VNC-Viewer-5.0.6-Windows-64bit.exe

注意:远程连接用户必须使用oracle用户,如使用root用户在切换到oracle运行安装时会报:oracle exception in thread "main" https://www.wendangku.net/doc/cd3813285.html,ng.noclassdeffounderrot

输入VNC用户密码(必须是端口号对应的用户密码):

连接成功:

打开终端:

执行./runInstaller

基本都是默认下一步,按图安装:

上图需要执行两个文件,在VNC中打开一个新的终端,切换到root用户执行以下命令:[root@localhost ~]# /home/oracle/oraInventory/orainstRoot.sh

[root@localhost ~]# /home/oracle/app/oracle/product/11.2.0/dbhome_1/root.sh

执行完后点击Ok

紧接着root用户下执行命令:

[root@localhost ~]# /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/relink all 大功告成,安装结束

3.5创建数据库监听

在oracle用户下执行命令:

[oracle@localhost ~]$ netca

创建结束。

3.6创建数据库实例

在使用DBCA创建数据库之前,使用root用户执行下面的命令,将dba组添加到系统内核中。[root@localhost ~]# echo 501 > /proc/sys/vm/hugetlb_shm_group

在VNC终端中执行命令:

[oracle@localhost ~]$ dbca

相关文档
相关文档 最新文档