July 2011

Linux / Unix : What command used to see the login and logout information?

Administrator point of view, they might require to see the list of users who login, logout, how long used, which IP used to login, putty/ftp which software used to login the system for security reasons.

last command which provides these informations.

1. last
It display the all users, all time login information.

Linux / Unix - Display the nonprinting characters - cat -v

cat command mainly used to join two or more file. It also used to display a file in the screen. It used to display small files. To display big files can use more or less commands.

DB2 Interview Questions - III for Refresh

1.What are the disadvantages of PAGE level lock?

High resource utilization, if large updates are to be done.

2. Can I use LOCK TABLE on a View?
No. To lock a VIEW, take lock on the underlying tables.

3. What is ALTER?
SQL command used to change the definition of DB2 Objects.

Differences between base table, auxiliary table and temporary table

Base Table

1. A base table is a table created with the SQL statement CREATE TABLE.
2. Used to hold persistent user data

RUNSTATS Commands in DB2

The RUNSTATS utility collects statistics about DB2 objects. These statistics can be stored in the DB2 catalog, and are used during the bind process by optimizer to choose the path in accessing data.

If you never use RUNSTATS and subsequently rebind your packages or plans DB2 will not have the information that it needs to choose the most efficient access path. This can result in unnecessary I/O operations and excessive processor consumption.

It also collects statistics used for space management.

Run RUNSTATS at least once against each table and its associated indexes, After a load, or after mass updates, inserts, deletes, or after REORG...

Linux / Unix : How to remove files and sub directories in the particular directory Recursively?

To remove files and directories recursively use r or R option with rm.

rm -r directory

which removes the directory, its sub-directory and its files.

For example:

$rm -r animals
deletes animals , wild_animals & pet_animals (sub directories) and its files.

With r option, you can use f option to force to delete. It won't prompt before removal. If you want prompt before remove, use i option with rm.

Linux / Unix : How to get the MAC address?

What is MAC Address?

MAC - Media Access Control Address. It is an unique hardware address in LAN or Ethernet address in Ethernet LAN.

How to get the MAC address?

There are two ways to get MAC address:

1. Login as root user and issue ifconfig -a

2. If the system is not yet booted and want to get the MAC address then use banner in ok prompt.

The resolution table maps the MAC address and IP address in the LAN. So How to get the IP address?. Use the same ifconfig -a command which displays all the network interfaces in the systems with IP address.

CICS- difference between TDQ & TSQ?

Temporary Storage Queues Transient Data Queues
Read randomly Read sequentially
Data can be read any number of times as it remains in the queue until the entire Queue is deleted Data item can be read once only. To reuse the TDQ, it must be closed and reopened.
Data can be changed Data cannot be changed
Can be written to Auxiliary or Main


Always written to Disk
Defined dynamically Needs to be defined in the DCT
Will be 1 to 8 characters long Will be 1 to 4 characters long

Linux / Unix : How to make the network interface as up / down?

The ifconfig command have option to make the interface as up or down. Here is the command to make it down or up.

$ ifconfig interfacename down

$ ifconfig interfacename up

MySQl : Flush Privileges statement

When mysqld starts the privileges like database, table, column and user privileges loaded into memory. Database, table and column privileges take into effect once. But the user privileges get effect when the user connects next time.

Use of Flush Privileges

It informs the server to re-read the grant tables. Normally we use this statement

DB2 - difference between static SQL and dynamic SQL

Static SQL

The static SQL statement is prepared before the program is executed and the operational form of the statement persists beyond the execution of the program. The source form of a static SQL statement is embedded within an application program written in a host language such as COBOL.

Dynamic SQL

Unlike static SQL, the dynamic statements are constructed and prepared at run time. The source form of a dynamic statement is a character string that is passed to DB2 by the program using the static SQL statement PREPARE or EXECUTE IMMEDIATE. Whether the operational form of the statement is persistent depends on whether dynamic statement caching is enabled.

Oracle / Perl : Converting / formating the DBIx resultset date field

Based on the NLS_DATE_FORMAT setting in the oracle, query return the date field values. For example dd-mon-yyyy or dd-mm-yyyy hh:mm:ss or ... based on NLS_DATE_FORMAT.

While using direct query, we can use to_char or to_date to convert the date format from one to another date format.

Using DBIx Schema resultset and want to display the date in different format and you have question on how to do this in DBIx schema level then this article is for you.

Compare Two VSAM Files

Normal flat file compare option 3.13 can be used to compare 2 VSAM files. Also if the compare needs to be any particular field then needs to use starting position and end position. See the below sample.

In the below sample starting position is 5 and ending position is 60. It will compare the values from position 5 to 60 and provide the result if any difference.

Linux / Unix : sqlplus in command prompt

In this article just describing what you have to do, to start use the sqlplus in the command prompt.

Before you start the sqlplus set the sid and oracle_home.

1. export ORACLE_SID=myblogstst
export ORACLE_HOME=path of oracle installation

Javascript Libraries

The collection of javascript code helps to develope the application easy.There are many javascript libraries available. Popular libraries like jQuery, Prototype, Dojo.. are provides functionalities like Ajax calls, event handling, effects. These javascript libraries combine with css makes page effects.

Various File Types and How to Open it?

We find lots of different file types while we download, browse or when view our system folders...

Sometimes, we are unaware which application to use to open the particular file type. So i here with most frequently used file types and which application can be used to open it.

Google+ Hangouts

Google+ Hangouts - it is free and cool for group video chat.

Google's new hangouts provides features like

* Focusing on the person who is talking currently.

* Up to ten people can use.

* Can create rooms to hangouts with different groups. It is browser based. Each hangout having different url.

* Everyone in hangout can share the feature to invite others.

* Can use hangouts to watch youtube video's with your friends.

It requires the plugins for voice and video chat. It is not working in mobile devices now. It is great product for group video chat.

FaceBook video chat - Skype Partnership

Facebook/Skype partnership gives us free one to one video chat feature in facebook.

When we click call button, the skype gets downloaded and call goes on. We can get this feature from facebook's home page or your friend's profile page.

Currently, it is not having group video chat. The one to one video chat currently not working in mobile devices. It won't be surprise to see the group video chat in near future.

A serious note about heart attacks:

Women should know that not every heart attack symptom is going to be the left arm hurting. Be aware of intense pain in the jaw line.

You may never have the first chest pain during the course of a heart attack..

Nausea and intense sweating are also common symptoms.