Thursday, December 31, 2009

Happy New Year

Just wanted to say Happy new year to everybody i wish new year will bring lot of happiness and success in our personal and professional life. One of my new year resolution is to keep this blog active and informative :)

Best wishes,
Baig

Monday, December 28, 2009

Setting up VNC Server on Linux

Hi all,

These days it is common that DBAs are required to work on different databases located at various geographical locations. DBAs can connect to their servers using various protocols like telnet, ssh etc etc. but they are usually command line tools what if u want to work on the server in GUI mode. Heres comes VNC in this situation i m not goin into details what VNC is u can easily find info on google or wikipedia. Just basic info for this setup you are required two components VNC Server and VNC Viewer.

In this post i m going to show how to setup a VNC Server on Linux Machine and running viewer on windows.

1. Download Free VNC Server version for Linux and Viewer for Windows from http://www.realvnc.com/products/free/4.1/download.html
Note: Make sure u have downloaded VNC Free Edition for Linux RPM and VNC Free Edition Viewer for Windows

2. Log on to Linux Machine using root and create seperate user and group for VNC.

# groupadd vncuser
# useradd vncuser -g vncuser
# passwd vncuser

 3. Install the rpm package on Linux machine which will become your VNC server.

# rpm -U package-name

4. Edit the file /etc/sysconfig/vncserver and add line
VNCSERVERS="9:vncuser"


file look like this


# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# .

# VNCSERVERS="1:myusername"
# VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERS="9:vncuser"


5. Login with vncuser account
 # su - vncuser
6. Run the following command from vncuser to start the VNC server on Linux machine
$ vncserver :9

Note: ":9 means that VNC server will listen to Port Number 5909 u can use any number depends on your settings port will always be 5900 plus"
This command will ask for password as well.

7. To verify whether VNC server is running or not run the following command

$ ps -ef | grep Xvnc

Output would be similar to this

vncuser   4193     1  0 Dec28 ?        00:08:57 Xvnc :9 -desktop server.com:9                 (vncuser) -httpd /usr/share/vnc/classes -auth /home/vncuser/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /home/vncuser/.vnc/passwd -rfbport                 5909 -pn

8. Edit the xstartup file in $HOME/.vnc folder of vncuser'sHOME (/home/vncuser/.vnc) and uncomment the following parameters

SESSION_MANAGER
/etc/X11/xinit/xinitrc

file output would be like this

[vncuser@server .vnc]$ cat xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

if everything looks good then move to the viewer setup.

7. Run the downloaded viewer file from Windows client.

9. Click Options select Full colors in Color section


10. Enter IP Address or Hostname along with VNC Server Port
VNC Server-IP-Address or VNC Server Hostname :5909
e,g 192.168.0.254:5909





11. Click OK
Note: You can change VNC password from /usr/bin/vncpasswd command as well

12.Now enjoy your session and work in viewer like as your server is in front of you :)



Any comments suggestions are welcome.

Cheers,

Baig

Saturday, November 28, 2009

How to set JDeveloper Timezone / ORA-01882: timezone region not found error

Problem:
If you in Run Oracle ADF Fusion application based on ADFBC in countries other than USA you might face this problem. While running Application Module or JSF page with different regional settings in control panel e.g (Russian or Kazakh settings).

 I got the same issue when I started ADF and yesterday I was in ADF seminar the instructor got the same problem as well. I experienced the error in 2 different cases.

If you run right click and Choose Run on your Application Module error appears similar to this

oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.sql.SQLDataException, 
msg=ORA-01882: timezone region  not found

While running JSF page in the browser only Loading.. logo appears rest is blank the log file which would contains lines similar to this

oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.sql.SQLDataException, 
msg=ORA-01882: timezone region  not found
Seems like common problem if you are on different Time zone other than America.

Solution:
1. In the Project properties of (Model and ViewController) go by double clicking on them.
2.Go to Run/Debug/Profile on the Left Pane.
3.If you are using Project Settings Click on Edit by selecting your Profile most of the cases it is Default.
4.Select Launch Settings on the left pane and in Java option enter this value Note: you can change according to your Timezone.
-Duser.timezone="+06:00" 
5.Click OK and OK again Save your project exit JDeveloper and open again.
6. Run your application again.

You can avoid this by setting Time zone in java options in the default Project properties of Jdeveloper so any new project you add it will automatically contain the Time zone settings.

Hope it helps,
Baig