Linux – Know network usage by applications

A few days back, the network monitor was showing very high download speed in my openSuSE 11.4… even though I had no downloads or browsers running. This got me worried and a search began to find out the applications using network. Here is what I did. Install “iftop” from the repos. Just like “top”, “iftop” lists out the applications by their network usage. The command is:
sudo /usr/sbin/iftop -i wlan0
“-i” is for interface to use, I was on the wifi network so used “wlan0′. To check network usage for LAN or Cable network, the interface most probably will be “eth0”. [/caption] You can use “p” to toggle ports. Here the port used by first application is 25747. We will use this port to find out the application which is using network with the command “lsof”.
vivek@linux-og8s:~/Misc/downloads> lsof -w -n -i tcp:25747
COMMAND   PID  USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME                                                                                                                                                                                                                     
java    32504 vivek   68u  IPv6 1231661      0t0  TCP 192.168.1.2:25747->85.118.229.164:vce (ESTABLISHED)        
Here below the “COMMAND” application name listed is “java”. Right now there is vuze running on my system which is downloading the latest openSuSE 12.1 DVD. This way you can check if there is some application using guzzling your network unnecessarily.

ORA-12541: TNS no listener

So you have bumped on this error. You have started your database, you have started your listeners… successfully, but still the client is adamant that there is are “no listeners”.

All the website will ask you politely, just to “start your listeners”(lsnrctl start). You can ping the host machine but tnsping gives error. tnsnames.ora, listener.ora and sqlnet.ora are as perfect as they can get… but still “ORA-12541: TNS: no listener”. There is one precaution you need to do. The sequence of starting your database should be:
  • Start the database
  • And then start the listeners
Because listeners register with the database you have started. If you have not started the database, or started listeners before starting the database… listeners do not know which database to register with.

Hold on, you do not need to shutdown your database. If you have already started the database and then the listeners, then go to sqlplus and issue the command
 ALTER SYSTEM REGISTER
 
This should make your client listen to your database 🙂

Software Developers in India

Today, it will be my five years in the Information Technology. So, I think this is the right time to put my thoughts on the state of IT in India – mainly from the perspective of a “Software Developer”

A few days ago I came across this website where the author was wondering why the life of “Software Developer” is just about five years in India, when software developers in West are coding for 20 or 30 years and are still happily developers.

So, what is there in India that we have developers yearning to go into the management since the day they join the corporate world. Hmmm…Well, Let us first go into the kind of work that software developers in India are doing on day to day basis, what kind of work is going on in world class Indian IT companies. The IT in India, is mainly a back office job as of today. Barring a few companies(very minuscule) and projects (much more minuscule) what we in India do is more or less of a support.. Some call it maintenance also :P. Yes, support and maintenance (mainly). Not that much of developing systems(SDLC, from beginning to end- No way!!). We are just the back office guys of the real IT in the west, or better – back office developers. Some guy in UK or USA asks us to put some “.” somewhere in the code, we oblige him by just doing that, no more no less. Every code change we want to do has to be okayed by someone sitting at “on site”.

And the IT guys sitting and coding in Europe and USA just know that. I have come across many instances where the people there just refuse to handover some chunk of work as they do not consider “offshore” as competent enough. Sending work to India, does mean compromising on quality. Do not believe me? Just check this popular web hosting site HostMonster, one of the points they boast about is 100% support based in USA. But, I will not blame the Europeans or Americans for nurturing this perspective of Indian software engineers. It is we Indians, who have nurtured this perspective and that too with so much of dexterity. In a job which just needs nice working logical brains in your head, we Indians have managed to create a class hierarchy. From “junior developers” to “Delivery Managers” and beyond. Why are we so obsessed with creating slaves and masters.. I wonder why! Right now, I am working in Agile software methodology… Which specifically asks that every member in the team should be an expert, does not matter if s/he has 1 year experience or 20 years experience. I remember when I was in my induction and our trainer was telling us explaining this, one of the experienced colleagues pointed out that Agile does not take hierarchy into consideration and is bound to fail in India! He wanted “respect” from his “junior” colleagues and just could not live with the fact after working so many years in IT, he will be just another “expert” in the team.

And, the higher you go into the hierarchy, the less you are supposed to code and the more time should be spent in adding eye candy and bing to your Microsoft excels. That’s when you stop being a developer.

Unfortunately, the kind of management in India also does not inspire good “software developers”. What managers want is “Deliveries”, plain and simple, that he can show to his bosses and in-turn boast about his revenue generating capabilities. Least is he interested in technical or domain expertise of “his” developers who actually are making “deliveries”, as long as they are delivering something on day to day basis(Or at least weekly basis). A developer in turn becomes totally ninsensitive to the quality, as his reputation(in turn ratings which in turn convert to appraisals and/or bonuses) depend more on quantity rather than quality. Delivering more is important than “wasting” your time in increasing your domain and/or technical knowledge. A developer stops digging further, s/he stops learning as the only thing that seems to take him/her further “up” is how well he able to add bing to the excel documents.

In short-term, everyone is doing good to himself or herself. But we are doing a great dis-service to the brand India. Better stop acting like slaves and start living like humans who can “think”.

How to install Oracle on openSuSE 11.3

Note: I am writing this for people who just want to install Oracle for personal use, for learning Oracle. This tutorial is not for installing Oracle for production systems or any critical use. The instructions are for 32 bit systems, it should be same for 64 bit systems but I am not sure. I am installing on openSuSe 11.3, but these steps can also work for 11.1 and 11.2, but again I am not sure 🙂

I will write down the instructions as a series of steps.
  • Step 1: Download Oracle from Oracle Website. This is a 32-bit install. For 64-bit systems download from here. You will need UserId for Oracle. You will also need to accept the license agreement. The downloaded file will be “linux_11gR1_database_1013.zip”.

  • Step 2: Install “C/C++ Development” environment from Yast.

  • Step 3: Dwonload and install Orarun package. You will now get a User for Oracle. Open Yast(Adminsitration Settings), Select “Security and Users” tab and from there open “User Group Management”. On the resulting window set filter to “System Users”. From the list select “Oracle” and edit it. Set the password for user oracle on “User Data” tab. Go to “Deatils” tab and set the Login shell to “/bin/bash” (It will be /bin/false there). Save the changes and exit.
  • Step 4: Just some cosmetic changes, if needed. Open “/etc/profile.d/oracle.sh”. Check parameters ORACE_BASE, ORACLE_HOME, ORACLE_SID. You can change ORACLE_SID if you want it to be something different, by default it is “ORCL”. Modify the following parameters in “/etc/sysconfig/oracle”. [code lang=”perl”] AIO_MAX_SIZE=1048576 FILE_MAX_KERNEL=6815744 IP_LOCAL_PORT_RANGE="9000 65500" [/code] Modify the following parameters in /etc/init.d/oracle:
    test -f /proc/sys/fs/aio-max-nr && echo "  AIO_MAX_SIZE=${AIO_MAX_SIZE:-1048576}"
    test -f /proc/sys/fs/aio-max-nr && echo ${AIO_MAX_SIZE:-1048576} > /proc/sys/fs/aio-max-nr
    test -f /proc/sys/fs/aio-max-nr || echo
    You will need superuser priviliges for modifying these files.
  • Step 5: Start Oracle server.
    sudo /usr/sbin/rcoracle start
    You will get a output like:
  • Step 6: Either logg off and log in as Oracle user. Or you can Switch to Oracle user (Application Launcher -> Leave -> Switch USer). Login user id is “oracle” and use the password you hav set in Step 2. After logging inCheck some details.

    no images were found

  • Step 7: Unzip the download oracle installation zip file ( Step 1).
    unzip linux_11gR1_database_1013.zip
    You will now get a new directory “database”. Go to that directory and run “runInstaller” script. Before running set the execution permissions for whole database directory. Check the snapshot below:
  • Step 8: Now the oracle installer will fire up. Tick the “Create Starter Database” checkbox if you want the example databses to be installed and enter the password of your choice and click Next button. You may get a warning that directory does not exist, click OK button and move forward. Next window will be to Specify inventory localtion. This should be
    /opt/oracle/oraInventory
    You will get a warning, click YES there. The installer will check for pre-requisites and will throw some warnings and requirements. You need to manually tick those warnings and requirements. After that hit Next button and you will be taken to “Oracle Configuration Manager Registration”. You can skip this window by hitting Next button. Now will come the summary of software which will be installed. Verify and click Next. The installation will start. The installation process will take time so be patient. After installation will finish a window will pop up giving deatils of the installation. If you want to unlock accounts and set custom password you can do it by clicking on “Password Management” here. After finishing with this, oracle will display a window which will display scrips which you need to run as root. Run the scripts and the oracle installation finishes.
Now, whenever you want to start your oracle, First fire up konsole and start Oracle service
sudo /usr/sbin/oracle start

Then become oracle user (You do not need to login from GUI as you did in Step 6, but doing it from konsole will do). Start Oracle Listner.

lsnrctl start
Now login to idle session of oracle and connect as sys and start the database.
sqlplus /nolog
Connect as sys user.
connect sys as sysdba
And start the Oracle database.
startup
Check the snapshots below:

Let me know if this post has helped you or if I have missed something.

My openSuSE 11.3 Setup

After experimenting with kernel and KDE version since the release of openSuSE 11.3, I decided to have a stable system till the next SuSE release, that is till openSuSE 11.4 is released. That means no KDE 4.5 as I do not want to change anything released in SuSE 11.3. Here are a few snapshots which I took after getting everything up and running… I am sure you are going to love it 🙂
Next I am planning to migrate to ext4 from ntfs completely, but that is going to take time.
1 3 4 5 6 7 10