- 浏览: 5139 次
- 性别:
- 来自: 杭州
-
最近访客 更多访客>>
最新评论
-
lemonseed:
呵呵,我下载了标准的启动不了,后来看了日志才知道,社区版的才是 ...
在linux系统实现java service
(1)可以运行如下命令检查所需包是否都已安装
# rpm -q make gcc glibc compat-db compat-gcc compat-gcc-c++ compat-libstdc++ \compat-libstdc++-devel openmotif21 setarch libaio \
# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel
如果没有出现“not found”字样则表示已安装。
如果没有安装这些包的话,可以在CentOS安装光盘的CentOS目录下找到相应的rmp文件来安装,如果你的服务器可以联网的话,也可以通过yum的方式下载安装,在终端中执行以下命令:
# yum –y install 没有发现的包名字
(2)关闭防火墙,关闭SELIINUX
vi /etc/selinux/config 确保以下内容:
SELINUX=disabled
(3)=========检查系统硬件配置情况
查看内存空间
[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal: 1034584 kB
查看交换空间swap大小
[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal: 524280 kB
检查安装空间要求
[root@localhost ~]# df –h
以确定oracle安装在那个硬盘内较好.
注意:为SWAP分配的空间要超过1G,要不然后面装Oralce会因为空间不足而无法安装。
(4) 修改host文件
Hosts File
# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
10.1.130.78 localhost.localdomain localhost
10.1.130.78 dvrvmg78.boldtech.internal
注意:你要把10.1.130.78改成你自己的IP。
(5) 配置Linux内核参数,设置内核参数
# vi /etc/sysctl.conf
在行末添加以下内容
#use for oracle
kernel.shmall = 268435456
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 或1048576
net.core.rmem_max = 262144 或1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
再运行sysctl -p应用以上参数
# /sbin/sysctl –p
(6) ==Oracle建议对每个Linux帐户可以使用的进程数和打开的文建树设置限制,设置最大打开文件数
在"# End of file"前加入以下几行
# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
(7) 设置会话
# vi/etc/pam.d/login
行末添加以下内容
sessionrequired /lib/security/pam_limits.so
session required pam_limits.so(这句话我没有增加也行)
(8) ==对Bourne、Bash、Korn shell,用编辑器gedit打开文件/etc/profile中加入以下几行(最下面)
# vi /etc/profile
#add for installing oracle 10g
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
For the C shell (csh or tcsh), add the following lines to the /etc/csh.login.
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
endif
(9) 建立oracle用户及组
# groupadd oinstall
# groupadd dba
# groupadd oper
# useradd -g oinstall -G dba oracle
# passwd oracle
(10) 建立ORACLE_HOME目录,解压数据库安装文件, 安装文件可以在以下路径找到:\\hangzhou4\Public\Oracle For Linux
# unzip 10201_database_linux32.zip
# mv database /tmp/
# chown -R oracle.oinstall /tmp/database
(11) 修改操作系统版本标识
# vi /etc/redhat-release
#CentOS release 5.2 (Final) (删除掉而不是简单的注销)
redhat-4
(12) 修改ORACLE环境变量
# su - oracle
$ vi .bash_profile
#export PATH
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/apps/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db102; export ORACLE_HOME
ORACLE_SID=GEHGAL; export ORACLE_SID
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
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
(13) 配置XDMCP
对于GDM
# vi /etc/gdm/custom.conf
[xdmcp]
Enable=1
注意:custom.conf这个文件可能是只读文件,需要改成可写属性才能修改。
(14) 因为默认centos5.1不支持10.2,0.1,修改安装文件
#vi /tmp/database/install/oraparam.ini
找到### #[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,centos-5,UnitedLinux-1.0,asianux-1,asianux-2再后面添加
[Linux-centos-5.2-optional]
TEMP_SPACE=80
SWAP_SPACE=150
MIN_DISPLAY_COLORS=256
(15) 创建oracle安装目录
[root@shree ~]# mkdir -p /apps/oracle
[root@shree ~]# chown -R oracle:oinstall /apps/oracle
[root@shree ~]# chmod -R 775 /apps/oracle
(16) 安装vnc
1. 下载
vnc有免费版本和收费版本,我们使用免费的版本就足够了。
官方网站是:
http://www.realvnc.com
2、安装Linux版的vnc
从以下地址:\\hangzhou4\Projects\GEH_GAL\tools\install拿到安装包:vnc-4_1_3-x86_linux.tar.gz,vnc-4_1_3-x86_win32_viewer.zip,先把vnc-4_1_1-x86_linux.tar.gz放到需要远程控制的机器10.1.130.78上,然后解压到/opt目录:
tar xzvf vnc-4_1_1-x86_linux.tar.gz -C /opt
cd /opt/vnc-4_1_1-x86_linux/
安装:
./vncinstall /usr/local/vnc
安装成功后,进行设置,运行:#vncpasswd,输入两次远程控制的密码。
====================================
VNC connect to CentOS:
1. Login using PuTTy
2. Create .vnc for user
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ ./vncserver
3. Change xstartup configuration
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ cd ~
[chemy.chen@dvrvmg78 ~]$ cd .vnc
[chemy.chen@dvrvmg78 ~]$ sudo vi xstartup
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &
Save and exit.
4. Stop vnc and restart
[chemy.chen@dvrvmg78 .vnc]$ ps -ef | grep vnc
root 1291 1 0 09:49 pts/3 00:00:00 Xvnc :3 -desktop dvrvmg78:3 (root) -httpd /usr/share/vnc/classes -auth /home/chemy.chen/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/chemy.chen/.vnc/passwd -rfbport 5903 -pn
root 1301 1 0 09:49 pts/3 00:00:00 vncconfig -iconic
1053 2110 30899 0 09:54 pts/3 00:00:00 grep vnc
root 23576 1 0 Apr03 ? 00:00:23 Xvnc :1 -desktop dvrvmg78:1 (root) -httpd /usr/share/vnc/classes -auth /home/tao.xu/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/tao.xu/.vnc/passwd -rfbport 5901 –pn
[chemy.chen@dvrvmg78 .vnc]$ cd /opt/vnc-4_1_3-x86_linux/
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ sudo ./vncserver -kill 3
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ sudo ./vncserver
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ ps -ef | grep vnc
root 1291 1 0 09:49 pts/3 00:00:00 Xvnc :3 -desktop dvrvmg78:3 (root) -httpd /usr/share/vnc/classes -auth /home/chemy.chen/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/chemy.chen/.vnc/passwd -rfbport 5903 -pn
root 1301 1 0 09:49 pts/3 00:00:00 vncconfig -iconic
1053 2500 30899 0 09:59 pts/3 00:00:00 grep vnc
root 23576 1 0 Apr03 ? 00:00:23 Xvnc :1 -desktop dvrvmg78:1 (root) -httpd /usr/share/vnc/classes -auth /home/tao.xu/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/tao.xu/.vnc/passwd -rfbport 5901 –pn
5. Connect from client
Open vnc-4_1_3-x86_win32_viewer.exe in client machine, provide “Server” as: 10.1.130.78:3.0
6. Provide password as what you set in step 2, and login successfully;
====================================
3. 以vnc client远程连接服务器安装oracle
(17) 安装oracle数据库
以root身份login,
# xhost +
# su - oracle
$ export DISPLAY= 10.2.9.112:1.0
$ /tmp/database/runInstaller
Choose Enterprise setup
(18) 成功后恢复操作系统版本
# vi /etc/redhat-release
CentOS release 5.2 (Final)
(19) 设置数据库开机自动启动
# vi /etc/oratab
GEHGAL:/apps/oracle/product/10.2.0/db102:Y
$ vi /apps/oracle/product/10.2.0/db102/bin/dbstart
第78行修改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
vi /etc/init.d/oracle
#!/bin/bash
# chkconfig: 0356 95 1
# description: init script to start/stop Oracle Database 10gR2, TNS listener, isQL*Plus, EMS
# match these values to your environment:
export ORACLE_BASE=/apps/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db102
export ORACLE_SID=GEHGAL
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
su - "$ORACLE_USER" -c "$ORACLE_HOME/bin/dbstart"
su - "$ORACLE_USER" -c "$ORACLE_HOME/bin/isqlplusctl start"
su - "$ORACLE_USER" -c "$ORACLE_HOME/bin/emctl start dbconsole"
;;
stop)
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
su - "$ORACLE_USER" -c "$ORACLE_HOME/bin/isqlplusctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
保存退出后:
sudo chmod +x /etc/init.d/oracle
chkconfig --add oracle
(20) 数据库相关命令
$ dbstart [ start | status | stop ]
$ lsnrctl [ start | status | stop ]
$ emctl [ start | status | stop ] console
$ dbshut
$dbstop
$ sqlplus /nolog
>connect system/passwd as sysdba
su – oracle
DBCA - Database Configuration Assistant: $ dbca
Network Configuration Assistant: $ netca
(21) 启动EM
$ emctl start dbconsole
如果出现TZ(时区)错误,按下列方法:
[HowTo] Update Timezone on CentOS/RedHat
[root]# yum install system-config-date
[root]# setup
Go-to -> Timezone configuration -> Select your local time zone -> Click OK -> Quit.
To check your current timezone:
[root]# date
$ echo $TZ
$ emctl resetTZ agent
将出现下面的信息:
TZ set to Etc/GMT-7
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Updating /dgalai/resen/product/102/svr68.srs2.com_h11h99/sysman/config/emd.properties...
Time zone set to Etc/GMT-7.
To complete this process, you must either:
connect to the database served by this DBConsole as user 'sysman', and execute:
SQL> exec mgmt_target.set_agent_tzrgn('svr68.srs2.com:3938',’ Etc/GMT-7’)
-- or --
connect to the database served by this DBConsole as user 'sys', and execute:
SQL> alter session set current_schema = SYSMAN;
SQL> exec mgmt_target.set_agent_tzrgn('svr68.srs2.com:3938', ‘Etc/GMT-7’)
暂时不管它,我们先重建EM(下面红色部份)。附相关文档:
症状:
进入EM控制台(http://172.19.111.38:1158/em)后,没有输入用户名和密码就直接登陆并显示数据库状态信息;
另外刚开始数据库监听没有起来,所以EM控制台显示信息也是说监听没有起来,后来监听起来了,EM控制台还是显示旧信息,刷新页面也那样。
问题原因和解决办法:
重启控制台服务后也没有效果:
$ emctl status dbconsole
$ emctl stop dbconsole
$ emctl start dbconsole
可能时原先监听未成功启动过,或者由于我修改过监听端口(1521改成1528)造成的。
重建em资料库:
$ emctl stop dbconsole
$ emca -repos recreate
...
Enter the following information:
Database SID: orcl10
Listener port number: 1528
PassWord for SYS user: Oracle10
Password for SYSMAN user: oracle10
Do you wish to continue? [yes(Y)/no(N)]: y
...
INFO: Repository sUCcessfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 19, 2007 6:20:22 PM
配置dbcontrol:
$ emca -config dbcontrol db
Enter the following information:
Database SID: orcl10
Database Control is already
configured for the database orcl10
You have chosen to configure
Database Control for managing
the database orcl10
This will remove the existing configuration
and the default settings and perform a fresh
configuration
Do you wish to continue? [yes(Y)/no(N)]: y
Listener port number: 1528
Password for SYS user: oracle10
Password for DBSNMP user: oracle10
Password for SYSMAN user: oracle10
Email address for notifications (optional):
Outgoing Mail (SMTP) server for
notifications (optional):
...
Do you wish to continue? [yes(Y)/no(N)]: y
...
Enterprise Manager configuration
completed successfully
FINISHED EMCA at Apr 19, 2007 6:27:44 PM
然后再进入 http://172.19.111.38:1158/em 查看正常了。
Oracle10G的EM采用了web方式,并且分成了2个产品,database control和grid control。Grid control需要下载单独的光盘安装。在用DBCA建库的时候,可以选择是否启用dbcontrol,启用的话需要在数据库中建立一个sysman的schema,用于保存EM的一些数据,这个就是EM的资料库(repository)。使用命令行工具emca可以创建,修改,重建或者删除dbcontrol的配置。
由于要在数据库中建EM资料库,数据库和监听都必须已经启动并正常工作。
emca -repos create 创建一个EM资料库
emca -repos recreate 重建一个EM资料库
emca -repos drop 删除一个EM资料库
emca -config dbcontrol db
配置数据库的 Database Control
emca -deconfig dbcontrol db
删除数据库的 Database Control配置
emca -reconfig ports
重新配置db control和agent的端口
emctl start console
启动EM console服务,使用前需要先
设置ORACLE_SID环境变量
emctl stop console 停止EM console服务,
使用前需要先设置ORACLE_SID环境变量
注:通过查看$ORACLE_HOME/install/portlist.ini
文件可以知道当前dbcontrol正在使用的端口,
默认dbcontrol http端口1158,agent端口3938。
假如要重新配置端口,可以使用如下命令:
emca -reconfig ports -dbcontrol_http_port 1159
emca -reconfig ports -agent_port 3939
使用命令行工具emctl可以启动/停止console服务,察看服务状态等。
访问http://localhost:1158/em/,端口号可能已经改变,如果还是不能访问,通过查看$ORACLE_HOME/install/portlist.ini文件,以确定当前dbcontrol正使用的端口是多少。
Login正常后,我们再执行以下命令:
$sqlplus /nolog
SQL> conn
Enter user-name: SYSMAN
Enter password:
Connected.
SQL> exec mgmt_target.set_agent_tzrgn('10.1.130.78:3938','Etc/GMT-7');
It is OK.
附:
检查EM dbconsole 配置属性
‑} Z!`4RZ9Qn1L&f K(k0检查$ORACLE_HOME/<hostname>_<SERVICE_NAME>/sysman/config下的ITPUB个人空间r
]~
kT3emoms.properties。
# rpm -q make gcc glibc compat-db compat-gcc compat-gcc-c++ compat-libstdc++ \compat-libstdc++-devel openmotif21 setarch libaio \
# rpm -q gcc make binutils openmotif setarch compat-db compat-gcc compat-gcc-c++ compat-libstdc++ compat-libstdc++-devel
如果没有出现“not found”字样则表示已安装。
如果没有安装这些包的话,可以在CentOS安装光盘的CentOS目录下找到相应的rmp文件来安装,如果你的服务器可以联网的话,也可以通过yum的方式下载安装,在终端中执行以下命令:
# yum –y install 没有发现的包名字
(2)关闭防火墙,关闭SELIINUX
vi /etc/selinux/config 确保以下内容:
SELINUX=disabled
(3)=========检查系统硬件配置情况
查看内存空间
[root@localhost ~]# grep MemTotal /proc/meminfo
MemTotal: 1034584 kB
查看交换空间swap大小
[root@localhost ~]# grep SwapTotal /proc/meminfo
SwapTotal: 524280 kB
检查安装空间要求
[root@localhost ~]# df –h
以确定oracle安装在那个硬盘内较好.
注意:为SWAP分配的空间要超过1G,要不然后面装Oralce会因为空间不足而无法安装。
(4) 修改host文件
Hosts File
# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
10.1.130.78 localhost.localdomain localhost
10.1.130.78 dvrvmg78.boldtech.internal
注意:你要把10.1.130.78改成你自己的IP。
(5) 配置Linux内核参数,设置内核参数
# vi /etc/sysctl.conf
在行末添加以下内容
#use for oracle
kernel.shmall = 268435456
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 或1048576
net.core.rmem_max = 262144 或1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
再运行sysctl -p应用以上参数
# /sbin/sysctl –p
(6) ==Oracle建议对每个Linux帐户可以使用的进程数和打开的文建树设置限制,设置最大打开文件数
在"# End of file"前加入以下几行
# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
(7) 设置会话
# vi/etc/pam.d/login
行末添加以下内容
sessionrequired /lib/security/pam_limits.so
session required pam_limits.so(这句话我没有增加也行)
(8) ==对Bourne、Bash、Korn shell,用编辑器gedit打开文件/etc/profile中加入以下几行(最下面)
# vi /etc/profile
#add for installing oracle 10g
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
For the C shell (csh or tcsh), add the following lines to the /etc/csh.login.
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
endif
(9) 建立oracle用户及组
# groupadd oinstall
# groupadd dba
# groupadd oper
# useradd -g oinstall -G dba oracle
# passwd oracle
(10) 建立ORACLE_HOME目录,解压数据库安装文件, 安装文件可以在以下路径找到:\\hangzhou4\Public\Oracle For Linux
# unzip 10201_database_linux32.zip
# mv database /tmp/
# chown -R oracle.oinstall /tmp/database
(11) 修改操作系统版本标识
# vi /etc/redhat-release
#CentOS release 5.2 (Final) (删除掉而不是简单的注销)
redhat-4
(12) 修改ORACLE环境变量
# su - oracle
$ vi .bash_profile
#export PATH
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/apps/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db102; export ORACLE_HOME
ORACLE_SID=GEHGAL; export ORACLE_SID
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
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
(13) 配置XDMCP
对于GDM
# vi /etc/gdm/custom.conf
[xdmcp]
Enable=1
注意:custom.conf这个文件可能是只读文件,需要改成可写属性才能修改。
(14) 因为默认centos5.1不支持10.2,0.1,修改安装文件
#vi /tmp/database/install/oraparam.ini
找到### #[Certified Versions]
Linux=redhat-3,SuSE-9,redhat-4,centos-5,UnitedLinux-1.0,asianux-1,asianux-2再后面添加
[Linux-centos-5.2-optional]
TEMP_SPACE=80
SWAP_SPACE=150
MIN_DISPLAY_COLORS=256
(15) 创建oracle安装目录
[root@shree ~]# mkdir -p /apps/oracle
[root@shree ~]# chown -R oracle:oinstall /apps/oracle
[root@shree ~]# chmod -R 775 /apps/oracle
(16) 安装vnc
1. 下载
vnc有免费版本和收费版本,我们使用免费的版本就足够了。
官方网站是:
http://www.realvnc.com
2、安装Linux版的vnc
从以下地址:\\hangzhou4\Projects\GEH_GAL\tools\install拿到安装包:vnc-4_1_3-x86_linux.tar.gz,vnc-4_1_3-x86_win32_viewer.zip,先把vnc-4_1_1-x86_linux.tar.gz放到需要远程控制的机器10.1.130.78上,然后解压到/opt目录:
tar xzvf vnc-4_1_1-x86_linux.tar.gz -C /opt
cd /opt/vnc-4_1_1-x86_linux/
安装:
./vncinstall /usr/local/vnc
安装成功后,进行设置,运行:#vncpasswd,输入两次远程控制的密码。
====================================
VNC connect to CentOS:
1. Login using PuTTy
2. Create .vnc for user
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ ./vncserver
3. Change xstartup configuration
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ cd ~
[chemy.chen@dvrvmg78 ~]$ cd .vnc
[chemy.chen@dvrvmg78 ~]$ sudo vi xstartup
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &
Save and exit.
4. Stop vnc and restart
[chemy.chen@dvrvmg78 .vnc]$ ps -ef | grep vnc
root 1291 1 0 09:49 pts/3 00:00:00 Xvnc :3 -desktop dvrvmg78:3 (root) -httpd /usr/share/vnc/classes -auth /home/chemy.chen/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/chemy.chen/.vnc/passwd -rfbport 5903 -pn
root 1301 1 0 09:49 pts/3 00:00:00 vncconfig -iconic
1053 2110 30899 0 09:54 pts/3 00:00:00 grep vnc
root 23576 1 0 Apr03 ? 00:00:23 Xvnc :1 -desktop dvrvmg78:1 (root) -httpd /usr/share/vnc/classes -auth /home/tao.xu/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/tao.xu/.vnc/passwd -rfbport 5901 –pn
[chemy.chen@dvrvmg78 .vnc]$ cd /opt/vnc-4_1_3-x86_linux/
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ sudo ./vncserver -kill 3
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ sudo ./vncserver
[chemy.chen@dvrvmg78 vnc-4_1_3-x86_linux]$ ps -ef | grep vnc
root 1291 1 0 09:49 pts/3 00:00:00 Xvnc :3 -desktop dvrvmg78:3 (root) -httpd /usr/share/vnc/classes -auth /home/chemy.chen/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/chemy.chen/.vnc/passwd -rfbport 5903 -pn
root 1301 1 0 09:49 pts/3 00:00:00 vncconfig -iconic
1053 2500 30899 0 09:59 pts/3 00:00:00 grep vnc
root 23576 1 0 Apr03 ? 00:00:23 Xvnc :1 -desktop dvrvmg78:1 (root) -httpd /usr/share/vnc/classes -auth /home/tao.xu/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/tao.xu/.vnc/passwd -rfbport 5901 –pn
5. Connect from client
Open vnc-4_1_3-x86_win32_viewer.exe in client machine, provide “Server” as: 10.1.130.78:3.0
6. Provide password as what you set in step 2, and login successfully;
====================================
3. 以vnc client远程连接服务器安装oracle
(17) 安装oracle数据库
以root身份login,
# xhost +
# su - oracle
$ export DISPLAY= 10.2.9.112:1.0
$ /tmp/database/runInstaller
Choose Enterprise setup
(18) 成功后恢复操作系统版本
# vi /etc/redhat-release
CentOS release 5.2 (Final)
(19) 设置数据库开机自动启动
# vi /etc/oratab
GEHGAL:/apps/oracle/product/10.2.0/db102:Y
$ vi /apps/oracle/product/10.2.0/db102/bin/dbstart
第78行修改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
vi /etc/init.d/oracle
#!/bin/bash
# chkconfig: 0356 95 1
# description: init script to start/stop Oracle Database 10gR2, TNS listener, isQL*Plus, EMS
# match these values to your environment:
export ORACLE_BASE=/apps/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db102
export ORACLE_SID=GEHGAL
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
su - "$ORACLE_USER" -c "$ORACLE_HOME/bin/dbstart"
su - "$ORACLE_USER" -c "$ORACLE_HOME/bin/isqlplusctl start"
su - "$ORACLE_USER" -c "$ORACLE_HOME/bin/emctl start dbconsole"
;;
stop)
su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
su - "$ORACLE_USER" -c "$ORACLE_HOME/bin/isqlplusctl stop"
su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
保存退出后:
sudo chmod +x /etc/init.d/oracle
chkconfig --add oracle
(20) 数据库相关命令
$ dbstart [ start | status | stop ]
$ lsnrctl [ start | status | stop ]
$ emctl [ start | status | stop ] console
$ dbshut
$dbstop
$ sqlplus /nolog
>connect system/passwd as sysdba
su – oracle
DBCA - Database Configuration Assistant: $ dbca
Network Configuration Assistant: $ netca
(21) 启动EM
$ emctl start dbconsole
如果出现TZ(时区)错误,按下列方法:
[HowTo] Update Timezone on CentOS/RedHat
[root]# yum install system-config-date
[root]# setup
Go-to -> Timezone configuration -> Select your local time zone -> Click OK -> Quit.
To check your current timezone:
[root]# date
$ echo $TZ
$ emctl resetTZ agent
将出现下面的信息:
TZ set to Etc/GMT-7
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Updating /dgalai/resen/product/102/svr68.srs2.com_h11h99/sysman/config/emd.properties...
Time zone set to Etc/GMT-7.
To complete this process, you must either:
connect to the database served by this DBConsole as user 'sysman', and execute:
SQL> exec mgmt_target.set_agent_tzrgn('svr68.srs2.com:3938',’ Etc/GMT-7’)
-- or --
connect to the database served by this DBConsole as user 'sys', and execute:
SQL> alter session set current_schema = SYSMAN;
SQL> exec mgmt_target.set_agent_tzrgn('svr68.srs2.com:3938', ‘Etc/GMT-7’)
暂时不管它,我们先重建EM(下面红色部份)。附相关文档:
症状:
进入EM控制台(http://172.19.111.38:1158/em)后,没有输入用户名和密码就直接登陆并显示数据库状态信息;
另外刚开始数据库监听没有起来,所以EM控制台显示信息也是说监听没有起来,后来监听起来了,EM控制台还是显示旧信息,刷新页面也那样。
问题原因和解决办法:
重启控制台服务后也没有效果:
$ emctl status dbconsole
$ emctl stop dbconsole
$ emctl start dbconsole
可能时原先监听未成功启动过,或者由于我修改过监听端口(1521改成1528)造成的。
重建em资料库:
$ emctl stop dbconsole
$ emca -repos recreate
...
Enter the following information:
Database SID: orcl10
Listener port number: 1528
PassWord for SYS user: Oracle10
Password for SYSMAN user: oracle10
Do you wish to continue? [yes(Y)/no(N)]: y
...
INFO: Repository sUCcessfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 19, 2007 6:20:22 PM
配置dbcontrol:
$ emca -config dbcontrol db
Enter the following information:
Database SID: orcl10
Database Control is already
configured for the database orcl10
You have chosen to configure
Database Control for managing
the database orcl10
This will remove the existing configuration
and the default settings and perform a fresh
configuration
Do you wish to continue? [yes(Y)/no(N)]: y
Listener port number: 1528
Password for SYS user: oracle10
Password for DBSNMP user: oracle10
Password for SYSMAN user: oracle10
Email address for notifications (optional):
Outgoing Mail (SMTP) server for
notifications (optional):
...
Do you wish to continue? [yes(Y)/no(N)]: y
...
Enterprise Manager configuration
completed successfully
FINISHED EMCA at Apr 19, 2007 6:27:44 PM
然后再进入 http://172.19.111.38:1158/em 查看正常了。
Oracle10G的EM采用了web方式,并且分成了2个产品,database control和grid control。Grid control需要下载单独的光盘安装。在用DBCA建库的时候,可以选择是否启用dbcontrol,启用的话需要在数据库中建立一个sysman的schema,用于保存EM的一些数据,这个就是EM的资料库(repository)。使用命令行工具emca可以创建,修改,重建或者删除dbcontrol的配置。
由于要在数据库中建EM资料库,数据库和监听都必须已经启动并正常工作。
emca -repos create 创建一个EM资料库
emca -repos recreate 重建一个EM资料库
emca -repos drop 删除一个EM资料库
emca -config dbcontrol db
配置数据库的 Database Control
emca -deconfig dbcontrol db
删除数据库的 Database Control配置
emca -reconfig ports
重新配置db control和agent的端口
emctl start console
启动EM console服务,使用前需要先
设置ORACLE_SID环境变量
emctl stop console 停止EM console服务,
使用前需要先设置ORACLE_SID环境变量
注:通过查看$ORACLE_HOME/install/portlist.ini
文件可以知道当前dbcontrol正在使用的端口,
默认dbcontrol http端口1158,agent端口3938。
假如要重新配置端口,可以使用如下命令:
emca -reconfig ports -dbcontrol_http_port 1159
emca -reconfig ports -agent_port 3939
使用命令行工具emctl可以启动/停止console服务,察看服务状态等。
访问http://localhost:1158/em/,端口号可能已经改变,如果还是不能访问,通过查看$ORACLE_HOME/install/portlist.ini文件,以确定当前dbcontrol正使用的端口是多少。
Login正常后,我们再执行以下命令:
$sqlplus /nolog
SQL> conn
Enter user-name: SYSMAN
Enter password:
Connected.
SQL> exec mgmt_target.set_agent_tzrgn('10.1.130.78:3938','Etc/GMT-7');
It is OK.
附:
检查EM dbconsole 配置属性
‑} Z!`4RZ9Qn1L&f K(k0检查$ORACLE_HOME/<hostname>_<SERVICE_NAME>/sysman/config下的ITPUB个人空间r
]~
kT3emoms.properties。
相关推荐
Centos 5.2 下 ORACLE 10G安装
Centos5.2下 oracle10g的安装配置,看着操作,没有顾虑
本TXT文件为第一章:Linux 下安装 JDK 测试环境:...Tomcat5.5 第三章Linux 下安装 Mysql5.0 第三章Linux 下安装 Oracle 10g 第五章Linux 下配置 CVS服务器 第六章Linux 下安装 Eclipse+MyEclipse
CentOS5.5+Oracle10g安装配置RAC详细步骤,存储方式包含ASM、OCFS及裸磁盘等多种方式。
目前最全面最详细的Oracle 11g for Linux CentOS 5.2 安装步骤(带图解)
部署tomcat服务使自动运行 三步完成安装,其他安装请见: 第一章:Linux 下安装 JDK 第三章Linux 下安装 Mysql5.0 第三章Linux 下安装 Oracle 10g 第五章Linux 下配置 CVS服务器 第六章Linux 下安装...
这是我搜索网络资料和官方文档,自己实际安装,最后总结的文档.花费3天时间的结果
最全oracle 11g安装指南,带目录: 1 前言 2 2 数据库软件安装 3 2.1 设置静态IP 3 2.2 关闭防火墙 3 2.3 关闭Selinux 3 2.4 修改主机名: 4 2.5 添加主机与ip对应关系 4 2.6 修改内核参数 4 2.7 添加系统资源配置 5...
为用户分配权限 附加2:加密密码 附件3:创建多个仓库 其他安装请见: 第一章Linux 下安装 JDK 第二章Linux 下安装 Tomcat5.5 第三章Linux 下安装 Mysql5.0 第四章Linux 下安装 Oracle 10g ...
在 CentOS 6 64 位系统上安装 Oracle 11g 需要遵循一系列步骤,确保系统满足所有先决条件并正确配置。以下是详细的过程: ### 1. 安装前准备 #### 1.1 准备文件 首先,你需要从 Oracle 官方网站下载适用于 64 位 ...
在安装Oracle数据库软件的过程中,确保所有必要的依赖包都已安装是非常关键的步骤。在CentOS 7.2系统上,Oracle数据库的一个重要依赖是PDKSH(Public Domain Korn Shell)。PDKSH是一个轻量级的shell环境,它在许多...
首先在oracle官方上下载一个oracle 11g(特别说明一下在安装CentOS 5.2时尽量是把开发包装全一些,这样您在安装包检测的时候就会少装一些包。还有一点:安装大概需要5G多的空间,空间不够就老是出错。oralcle安装目录...
目前最全面最详细的Oracle 11g for Linux CentOS 5.2 安装步骤(带图解) ,当然redhat也可以。
描述中提到,这个软件包在安装Oracle 11g时是必要的,用于解决特定的环境配置问题。在实际操作中,用户可能需要根据自己的系统环境选择合适的pdksh版本,如5.2.14-alt5.x86_64.rpm。 PDKSH,全称为Public Domain ...
8. **禁用Selinux和防火墙**:Oracle数据库可能与Selinux和防火墙的默认设置冲突,因此在安装前可能需要临时禁用它们。 9. **创建Oracle基目录**:在已分配的/oracle分区下创建适当的目录结构,如`/u01/app/oracle`...
4. **系统参数和用户配置**: 在安装前,需要修改系统参数以满足Oracle的要求。打开`/etc/sysctl.conf`文件,添加或修改必要的内核参数,例如调整内存分配策略和文件句柄限制。此外,创建一个专门用于Oracle服务的...
在本篇【CENTOS5[1].2__64_ORACLE10.2.0.1安装手册】中,我们将探讨在CentOS 5.2 64位系统上安装Oracle 10.2.0.1数据库的详细步骤。这个安装过程对于企业和个人在搭建数据库环境时具有很高的参考价值。 首先,我们...
运行方法 第七步:导入SQL文件,生成数据库 其他安装请见: 第一章Linux 下安装 JDK 第二章Linux 下安装 Tomcat5.5 第四章Linux 下安装 Oracle 10g 第五章Linux 下配置 CVS服务器 第六章Linux ...
VirtualBox全球免费开源软件,开发者首选最多的虚拟机之一,它操作简单,可以安装配置各种类型的操作系统:ubuntu、centos常用的镜像都能轻而易举的安装使用该版本为64位;如果用户出现了,电脑原因无法选择64位操作...
**PDKSH (Public Domain Korn Shell) 是一个...如果在安装过程中遇到缺失PDKSH的情况,可以通过RPM工具快速安装`pdksh_X86_64.rpm`文件,以满足Oracle的系统需求。正确处理这类依赖关系是成功部署Oracle数据库的基础。