06 December 2011

Oracle 11g Flash Cache


Owerview:
        Oracle Flash Cache looks like a Linux swap or Windows page file.
Requirements:
        Oracle 11g RDBMS must be run on Linux or Solaris
Purpose:
        Reduce db file sequential read  waiting
Configuration:
        Set parameter - db_flash_cache_file to the name of the file
        Set parameter - db_flash_cache_size to the size of Flash Cache (must be less than or equal to the physical memory size)

10 November 2011

Linux. To delete expiration interval of user password


Linux. To delete expiration interval of user password
1. login as root
        ls -lh /etc |grep shadow
       
2. change permition
        chmod 600 /etc/shadow
3. edit shadow
        vi /etc/shadow
                change the string
                        oracle:$1$/lFSo3aP$LHkIxXXxkGtveA8cAjk7//:15197:1:90:7:::
                to
                        oracle:$1$/lFSo3aP$LHkIxXXxkGtveA8cAjk7//:15197:1::7:::
4. change permission back
        chmod 400 /etc/shadow  

05 October 2011

Disable X Window in Red Hat

Edit inittab (as root)
   vi /etc/inittab
      replace line 
id:5:initdefault:
      with 
id:3:initdefault:

Run the commands
  init q
  init 3

X Window will not start next reboot.

07 July 2011

Linux ftp server

1.find
find -name vsftp*
./vsftpd-2.0.5-16.el5_5.1.x86_64.rpm

2. install
# rpm -Uvh vsftpd-2.0.5-16.el5_5.1.x86_64.rpm

3. configure
Default port: TCP / UDP - 21 and 20
The main configuration file: /etc/vsftpd/vsftpd.conf
Users that are not allowed to login via ftp: /etc/vsftpd/ftpusers
-------------------------------------
Open the configuration file, type:
# vi /etc/vsftpd/vsftpd.conf
Turn off standard ftpd xferlog log format:
xferlog_std_format=NO
Turn on verbose vsftpd log format. The default vsftpd log file is /var/log/vsftpd.log:
log_ftp_protocol=YES
Above to directives will enable logging of all FTP transactions. Lock down users to their home directories:
chroot_local_user=YES
Create warning banners for all FTP users:
banner_file=/etc/vsftpd/issue
Create /etc/vsftpd/issue file with a message compliant with the local site policy or a legal disclaimer
-------------------------------------

4. start and stop
Turn on vsftpd on boot:
# chkconfig vsftpd on

/sbin/service vsftpd start
/sbin/service vsftpd stop

Linux remote desktop

1. find
[]$ find .-name vnc*
vnc-4.1.2-14.el5_5.4.x86_64.rpm

vnc-server-4.1.2-14.el5_5.4.x86_64.rpm

2. install
[]$ rpm -Uvh vnc-server-4.1.2-14.el5_5.4.x86_64.rpm
 
3. configure
edit /home/.vnc/xstartup
----- example for gnome ------------------------------
#!/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 &
startx
----------------------------------------------------------------
edit
/etc/sysconfig/vncservers
-------------------------------------------------------------
# The VNCSERVERS variable is a list of display:user pairs.

#
# Uncomment the lines below to start a VNC server on display :2
# 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
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-nohttpd" to prevent web-based VNC clients connecting.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
VNCSERVERS="1:oracle"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
VNCSERVERARGS[2]="-geometry 1024x768 -depth 32"
-------------------------------------------------------------

4. start
vncserver
-- set password when start first time
-- or set passwd running
vncpasswd

5. start and stop
/sbin/service vncserver start

/sbin/service vncserver stop

6. use via http
in browser
http://server_name:port  (http://192.168.1.1:5801)

7. use on remote pc (linux)
export DISPLAY=1:
vncviewer server_name:port (192.168.1.1:5901)

13 April 2011

Rename & Move DB files

Rename&Move Controlfile
1. alter system
2. shutdown
3. rename OS
4. start
SQL> ALTER SYSTEM SET control_files='C:\ORACLE\PRODUCT\10.1.0\ORADATA\DB10G\RENAME_CONTROL01.CTL', - > 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\DB10G\CONTROL02.CTL', - > 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\DB10G\CONTROL03.CTL' SCOPE=SPFILE;
SQL> SHUTDOWN IMMEDIATE
SQL> HOST MOVE C:\ORACLE\ORADATA\DB10G\CONTROL01.CTL C:\ORACLE\ORADATA\DB10G\RENAME_CONTROL01.CTL
SQL> STARTUP

VMvare shared disk

To make disk shared for two or many servers find .vmx and set
disk.locking="FALSE"
diskLib.dataCacheMaxSize="0"
scsi.sharedBus="virtual"