Monday, April 27, 2009

steps needed for Xming

if you get the following error , that means you need add server name to x0.host or xN.host.

Xlib: connection to "162.106.51.66:0.0" refused by server
Xlib: No protocol specified


the file is located in the binary folder with xming. Just add your server name or IP in it.
also you can limit users.
eg.

servera
servera:oracle

reference: http://www.windowsreference.com/free-utilities/xming-free-x-windows-server-for-windows-2000xpvista/

create a oracle user authenticated by OS

1. make sure parameter OS_AUTHENT_PREFIX = "os_" is set.

2. create user in oracle database.

CREATE USER os_oracle IDENTIFIED EXTERNALLY
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp
;

GRANT dba TO oracle;

exit;

3. make sure the user oracle is in OS dba group.

Friday, April 24, 2009

Putty settings

On windows it is stored in registry.

to tranfer your setting to another machine you can export the setting and import the setting.

to export:
regedit /e putty.reg HKEY_CURRENT_USER\Software\SimonTatham\PuTTY

To import settings:
regedit /s putty.reg


I have run into a problem that the windows title is set and it then become fixed always show the title in the setting. To let dynamic title with server name back you need clear the the setting under windows behaviour. Or delete windowtitle from registry.

Monday, April 20, 2009

move oracle tablespace

reference to http://www.my-whiteboard.com/oracle-dba/oracle-performance-tuning-moving-table-from-one-tablespace-to-another-using-alter-database-move-command.html

1. Create a new locally managed tablespace

CREATE TEMPORARY TABLESPACE COSTPOINT_DATA4
TEMPFILE ‘K:\oradata\SIIT\COSTPOINT_DATA4_1.DBF’ SIZE 2000M
EXTENT MANAGEMENT LOCAL
UNIFORM SIZE 256K;

2, Create three sql files for moving tables to new tablespace, rebuild indexes and compute statistics

connect deltek/xxx@fin;
set heading off;
set feedback off;
set pagesize 1000;
spool C:\Oracle\job\reorg\reorg_tables.sql;

select 'connect deltek/xxx@fin;' from dual;
select ‘alter table ‘||table_name||’ move tablespace COSTPOINT_DATA4;’
from user_tables where tablespace_name=’COSTPOINT_DATA’;
spool off;

spool C:\Oracle\job\reorg\rebuild_index.sql;
select ‘connect deltek/xxx@fin;’ from dual;
select ‘alter index ‘|| INDEX_NAME|| ‘ rebuild TABLESPACE costpoint_INDEX1;’ from user_indexes
where table_name in (select table_name from user_tables where tablespace_name=’COSTPOINT_DATA’);
spool off;

spool C:\Oracle\job\reorg\compute_stat.sql;
select ‘connect deltek/xxx@fin;’ from dual;
select ‘analyze table ‘|| table_name|| ‘ compute statistics;’ from user_tables where tablespace_name=’COSTPOINT_DATA’;
spool off;

exit;

3, Run this batch file:

c:
cd C:\Oracle\job\reorg
sqlplus /nolog @reorg_tables.sql
sqlplus /nolog @rebuild_index.sql
sqlplus /nolog @compute_stat.sql

Thursday, April 16, 2009

windows RDP

run mstsc to start RDP(remote desktop)
run mstsc/console to get extra console connection if connection is full.

Wednesday, April 8, 2009

tricky of visual SVN

When you install VisualSVN on windows box, there is a little issue for repository name. Windows path name is not case sensitive, and apache URL is not case sensitive too. But the SVN program itself is case sensitive. So some time if you use wrong name with mixed upper case and lower case of repository or path name, you will get an error for no permission to commit.

The error itself is so weird and doesn't give you too much hits to find what's wrong of the setting. I have run into this issue and spent some tough time to google to find reason, finnaly I found it myself it's because of repository and path name not exactly same as server.
For example,

On server, the repository name is TestRepo
when you checkout you use http://server/svn/testRepo, you will succeed for checkout.
But when you commit changes back, it'll give you no permission errors.

So use lowercase for all repository name, folder name and file name. Don't mix upper case and lower case. It's the best practice for all program running cross platform but I just forgot it myself.

Hopefully you won't run into this issue again.

HTTP over SSH

  1. setup HTTP over SSH on Linux server
    • ssh -L 7878:localhost:8080 robin@boston
  2. from your desktop run putty
  3. create a new ssh connection to server, you still use ssh on port 22 to connect to boston.
  4. in setting, add a forward port
  5. bring up your browser, type address http://localhost:8080/. You can see the webpage
  6. test that is using SSH connection. http://boston:7878/, you can't connect it because is ssh connection. You can't connect http://localhost:8080/ if you haven't made a ssh connection with boston.
  7. other readings. http://jstrassburg.blogspot.com/2006/01/howto-tunneling-http-over-ssh-with-dd.html

Setup VNC Server in a Linux box

  1. Setup VNC server. It comes with most of Linux distribution.
    • su -
    • vi /etc/sysconfig/vncservers
      add following line
      VNCSERVERS="3:robin"
      VNCSERVERARGS[3]="-geometry 1240x980 -depth 16 -nohttpd"
    • other samples for this file
      VNCSERVERS="1:tiger 2:albatros 3:leopard"
      VNCSERVERARGS[1]="-geometry 1024x768 -depth 16"
      VNCSERVERARGS[2]="-geometry 800x600 -depth 8"
      VNCSERVERARGS[3]="-geometry 1024x768 -depth 16"
  2. cd user's home directory .vnc
    cd /home/robin/.vnc
  3. vi xstartup, change it to following which will bring up gnome desktop
    #!/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 &

    exec /usr/bin/gnome-session &
  4. run vncpasswd, create password
  5. run as root, chkconfig --level 35 vncserver on
  6. service vncserver restart
  7. connect to vncserver
    vncviewer [Server's IP]:[Port]:[Display]

    port is 5900 + display number. My example is 5903
  8. over ssh to connect to boston
     ssh -f -L 25903:boston:5903 robin@boston sleep 10;
    vncviewer 127.0.0.1:25903:3

  9. other readings
    http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/



A very good IT book website

http://www.scribd.com/

You can download a lot of e-book and somebody's learning notes from this website.