Adnan Khurshid on March 22nd, 2011

Normally, if you use the man command to find out the method to add routes to the SUN machine, it will come up with the ‘route add’ command but is that command enough to add the routes securely to the system? Well, let us find it out. Before getting involved, just for the sake of knowledge, you can use ‘man’ command with ‘-k’ option to find keywords in the SUN Unix manual.

Adding temporary routes

The ‘route add’ command is used to add the routes temporary to the system which effectively means that as soon as you reboot the system, boom!, the routes will be gone. Well, that happened to me on one site where our clients rebooted the system somehow without the knowledge that they had been adding the routes with ‘route add’ command in the system. We had to arrange a training session right after that break happened. Coming back to the point, let us see some examples to how you can add the routes temporarily.

#route  add  –host   202.12.16.100   202.12.17.1

Read the rest of this entry »

Tags: , , , ,

Adnan Khurshid on March 4th, 2011

Oracle Memory Structure

Let’s discuss the processes running in Oracle database and their functions.

DBW`: Database Writer, this process writes the data from buffer cache to the DB file and this operation of reading and writing is done in blocks. The default block size in Oracle is 8192 bytes, however it can be modified as required. Starting from Oracle 9i onwards, we can have multiple block sizes. The block size can be checked as follows:

SQL> show parameter db_block_size;

Read the rest of this entry »

Tags: , , , , , ,

Adnan Khurshid on February 22nd, 2011

Finding large files:

Suppose we are facing a disk space issue in one system user directory and we want to find out which files are using most of the disk space, we can run the following command to find it out:

<36 SMSC :/export/home2/mml/tmp> find /export/home2/mml/ -size +400000| sort –r| head –3

/export/home2/mml/sms/bin/core_20110119152929_14771
/export/home2/mml/sms/bin/core_20101231115847_13489
/export/home2/mml/sms/bin/core_20101204105309_5074

The command found out 3 core files for us. Let’s see what’s their space.

<38 itellin2 :/export/home2/mml/sms/bin>ls –l | grep core

-rw——-   1 mml  mml      486457128 Dec  4 10:53 core_20101204105309_5074

-rw——-   1 mml  mml      486104872 Dec 31 11:58 core_20101231115847_13489

-rw——-   1 mml  mml      486244136 Jan 19 15:29 core_20110119152929_14771

Read the rest of this entry »

Tags: , , ,

Well, we know that command ‘ps –aux’ will show all the processes currently running on the system. We can sort the output of this command by using sort command piped after ps. We discussed about sort command before, you might want to have a look at it here. Lets first check the output of ps –aux command as follows:

 

linux:~ # ps -aux
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   588  244 ?        S    Feb17   0:04 init [5]
root         2  0.0  0.0     0    0 ?        S    Feb17   0:00 [migration/0]
root         3  0.0  0.0     0    0 ?        SN   Feb17   0:00 [ksoftirqd/0]
root         4  0.0  0.0     0    0 ?        S    Feb17   0:00 [migration/1]
root         5  0.0  0.0     0    0 ?        SN   Feb17   0:00 [ksoftirqd/1]
root         6  0.0  0.0     0    0 ?        S<   Feb17   0:00 [events/0]
root         7  0.0  0.0     0    0 ?        S<   Feb17   0:00 [events/1]
root         8  0.0  0.0     0    0 ?        S<   Feb17   0:00 [kacpid]
root         9  0.0  0.0     0    0 ?        S<   Feb17   0:00 [kblockd/0]
root        10  0.0  0.0     0    0 ?        S<   Feb17   0:00 [kblockd/1]
root        11  0.0  0.0     0    0 ?        S    Feb17   0:00 [kirqd]

[output cut]

As you can see, there are lots of processes. Lets sort the output and determine which processes are taking most of my system memory.

linux:~ # ps aux| sort -k4 -r| head -5

Read the rest of this entry »

Tags: , , , ,

Adnan Khurshid on February 17th, 2011

This will be more understandable if we take it by an example. Let’s see how many users we have on the system:

linux:~ # cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/bin/bash
daemon:x:2:2:Daemon:/sbin:/bin/bash
lp:x:4:7:Printing daemon:/var/spool/lpd:/bin/bash
mail:x:8:12:Mailer daemon:/var/spool/clientmqueue:/bin/false
news:x:9:13:News system:/etc/news:/bin/bash
uucp:x:10:14:Unix-to-Unix CoPy system:/etc/uucp:/bin/bash
games:x:12:100:Games account:/var/games:/bin/bash
man:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash
at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash
wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
ftp:x:40:49:FTP account:/srv/ftp:/bin/bash
postfix:x:51:51:Postfix Daemon:/var/spool/postfix:/bin/false
sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/false
ntp:x:74:65534:NTP daemon:/var/lib/ntp:/bin/false
ldap:x:76:70:User for OpenLDAP:/var/lib/ldap:/bin/bash
nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash
informix:x:1000:100:informix:/home2/informix:/bin/csh
scu:x:1001:100:scu:/home2/scu:/bin/csh
smp:x:1002:100:smp:/home2/smp:/bin/csh
scusms:x:1003:100::/home2/scusms:/bin/csh
smpsms:x:1004:100::/home2/smpsms:/bin/csh
linux:~ #

Now, what if I need all the users column before the colon. To do so, I’ll run the following command:

linux:~ # cut -d: -f1 /etc/passwd

Read the rest of this entry »

Tags: ,

Adnan Khurshid on February 15th, 2011

The function of short message center is to receive, store and schedule messages for delivery. There are mainly three network flows involved in the message receiving and delivery. They are as follows:

1) Mobile Origination

2) Mobile Termination

3) Alert Message Flow

Lets analyze the flows one by one.

1) Mobile Origination

Most of the times, it is referred to as MO. This flow involves the sending of message from mobile originator to the short message center. The message is sent to the air interface to the BSC which forwards it to MSC which in turn sends this short message to the signaling gateway followed by actual short message server. The following diagram shows the simple operation of the MO flow.

image

Read the rest of this entry »

Tags: , , , , ,

Adnan Khurshid on February 11th, 2011

image

There are mainly 4 steps involved.

1) Create users for ISQL*PLUS DBA URL

2) Grant webdba role to those users

3) Restart the httpserver

4) Access the webpage @ http://localhost:port/isqlplus/dba

Let’s follow these steps.

1) To create users, first you’ll have to define java_home and oracle_home and then run this weird long command to get to the JAZN prompt.

E:\>set oracle_home=E:\oracle\product\10.1.0\db_1

E:\>set java_home=E:\oracle\product\10.1.0\db_1\jdk

Read the rest of this entry »

Tags: , , , , ,

Adnan Khurshid on February 11th, 2011

The default port to access iSQL*PLUS is 5560. You can access iSQL*PLUS with the following URL given that the oracle is installed on the local host ‘http://localhost:5560/isqlplus/

image

To change the port number, modify the file “http-web-site.xml” as given below:

Read the rest of this entry »

Tags: ,

Adnan Khurshid on February 10th, 2011

The command history is stored in the file ‘bash_history’ which you can access as follows:

linux:~ # less ~/.bash_history

The file contains a list of all the commands which are stored in the buffer. You can also see these commands in sequence with the line numbers by using ‘history’ command.

linux:~ # history

The history will show the same output as the contents of the file bash_history except that it shows the output with line numbers. The number of commands stored in the buffer are controlled by the environment parameter HISTSIZE. By default, the value of this variable is 1000 which means it can store 1000 lines in the history. You can change this value to get hold of greater set of history commands. Suppose we want to change the history size to 1500 lines, use the following command to server the purpose.

linux:~ # HISTSIZE=1500

Tags: , ,