iptables for dummies

  1. edit /etc/sysconfiog/iptables
  2. add new rules
  3. save file
  4. restart iptables

vnc server

  1. edit /etc/sysconfig/vncservers
  2. add user:port_number:setting
    1. VNCSERVERS=”<port_number>:leopard”
    2. VNCSERVERARGS[<port_number>]=”-geometry 1024×768 -depth 16″
  3. edit /home/<user>/.vnc/xstartup
    1. # Uncomment the following two lines for normal desktop:
      unset SESSION_MANAGER
      exec /etc/X11/xinit/xinitrc
  4. user need to login from remete....type vncpasswd
  5. login to vnc

				

extra c4$h

more RMAN command

  1. list backup summary
  2. validate backupset <bck#>
  3. delete obsolete recovery window of 5 days

statpack setup

  1. create perfstat tablespace ~ 100M
  2. create temp tablespace ~ 100M
  3. run ?/rdbms/admin/spcreate.sql
  4. execute statspack.snap
  5. run ?/rdbms/admin/spreport.sql

if needed:- run ?/rdbms/admin/spdrop.sql to drop perfstat schema.

Put DB on Achivelog mode

  1. Startup mount
  2. alter database archivelog
  3. alter database open

- to check

  1. select log_mode from v$database;
  2. show parameter log_archive start;

- to change

  1. alter system archive log start ‘<arc location>’;
  2. archive log list;

RMAN backup script

CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 4 DAYS;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE  --
 --- TYPE DISK TO '/u03/backup/rman/controlfile/%d_CTL_%F';

run {
  crosscheck backupset;
  delete noprompt expired backupset;
  DELETE NOPROMPT OBSOLETE RECOVERY WINDOW OF 7 DAYS;

  #backup datafile, controlfile and archivelogs
  allocate channel ch1 type disk format
'/u03/backup/rman/datafile/FULL_%d_DB_%u_%s_%p';
  backup database;
  release channel ch1;
  }

run {
  # Backup outdated archlogs and delete them
  allocate channel ch1 type disk format --
 --- '/u03/backup/rman/archive/%d_ARCH_%u_%s_%p';
  sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
  backup archivelog all delete input;
  release channel ch1;
  }

more script

find . -depth -type d | xargs rmdir 2> /dev/null

sed ‘s/$/,’`ls | cut -c 1-5`’/g’ `ls`

My Load-balance script

Script to copy from WebServer-A to WebServer-B. This to enable Load-balance.

At WebServer-A:-

  1. ssh-keygen -t rsa
  2. scp id_rsa.pub root@WebServer-B:/root/.ssh/authorized_keys
  3. vi copyall and write rsync -ave ssh –numeric-ids –delete /var/www/html WebServer-B:/var/www/html
  4.  add entry in cronjob for every 1/2 hour.

At Webserver-B:-

  1. as root, chmod 644 /root/.ssh/authorized_keys

About Me

Kamarudin Samsudin live in Kuala Lumpur, Malaysia.

I am a Software Engineer but most of the time I’m dealing with DBA’s stuff. I need to maintain MySQL and Oracle databases. Sometime, I involves in web-based development team but not as coder, more as architecture implementer (install & configure servers and etc).
Because of my working nature, I’m very interested in MySQL, Oracle and Web-based technology stuff. Currently, I’m tried to implement MySQL Cluster and learn Ruby so it can be my 1st scripting language. My aims, I will be Certified MySQL DBA by end of this year and an OCA by next year.
I have BEng in Electronics with Computing Science from University Of Wales, UK.

« Older entries

Follow

Get every new post delivered to your Inbox.