11 January 2012

How to enable Automatic Memory Management in Oracle 11G

How to enable Automatic Memory Management in Oracle 11G
1. Set MEMORY_TARGET as (memory_target = sga_target + max(pga_aggregate_target, maximum PGA allocated))
        ALTER SYSTEM SET MEMORY_TARGET = mM SCOPE = SPFILE;
2. Set parameter MEMORY_MAX_TARGET
        ALTER SYSTEM SET MEMORY_MAX_TARGET = nM SCOPE = SPFILE;
Note:   1. n > m
                2. if don't specify MEMORY_TARGET it sets to zero by default
                        and you can manipulate its value dynamicaly not exceeding MEMORY_MAX_TARGET
3. Set SGA_TARGET to zero
        ALTER SYSTEM SET SGA_TARGET = 0;
4. Set PGA_AGGREGATE_TARGET to zero
        ALTER SYSTEM SET PGA_AGGREGATE_TARGET = 0;
       
Note:
The preceding steps instruct you to set SGA_TARGET and PGA_AGGREGATE_TARGET to zero
so that the sizes of the SGA and instance PGA are tuned up and down as required,
without restrictions. You can omit the statements that set these parameter values to zero
and leave either or both of the values as positive numbers.
In this case, the values act as minimum values for the sizes of the SGA or instance PGA.       

10 January 2012

How to clear mailbox queue on Linux


Clear mail queue
1. Login as root
cd /var/spool/mqueue
2. delete all files
rm *

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)