Sunday, March 30, 2014

Oracle database architecture tutorial

Oracle Instance

An oracle instance is a set of different memory structures and the processes which manages all database activities, such as transaction processing, database recovery, form generation, and so on. There is different type of memory block which are accessed by different type of background processes

It is also commonly known as  System Global area. It solve many purpose like storing parsed SQL qyeries/ Parsed Pl-sqL code and redo buffer cache.
It has below memory pools
  • shared pool : 
  • Data Dictionary Cache:
  • Buffer Cache:
  • Redo Log Buffer:
  • Large Pool:
  • Java Pool :
Although the result of SQL statement parsing is stored in library cache, but the value of binding variable will be stored in PGA. Why? Because it must be private or not be shared among users. The PGA is also used for sort area.

Oracle Background Process:

There some back ground process which keep on running to fulfill DB requests.
  • DBWR
  • LGWR
  • CKPT
  • SMON
  • PMON
  • ARCH
  • DISPATCHER PROCESSES
  • RECO
  • SNPn
  • LCKn
  • Pnnn
Thanks for reading article !! I found a full explanation of these component here

Thursday, March 27, 2014

unix interview question with answer

unix interview question  Below are some list of some unix  interview question , which are commonly asked in unix interview.

1) How to print/display the last line of a file?
A) $> tail -1 file.txt
2) How to display n-th line of a file?
A) $> sed –n ' p' file.txt
3) How to remove the first line / header from a file?
A) $> sed '1 d' file.txt
4) How to remove the last line/ trailer from a file in Unix script?
A) $> sed –i '$ d' file.txt
5) How to remove certain lines from a file in Unix?
A) $> sed –i '5,7 d' file.txt
6) How to remove the last n-th line from a file?
A) $> sed –i '96,100 d' file.txt # alternative to command [head -95 file.txt]
7) How to check the length of any line in a file?
A) $> sed –n ' p' file.txt
8) How to get the nth word of a line in Unix?
A) cut –f -d' '
9) How to reverse a string in unix?
A) $> echo "unix" | rev
xinu
10) How to get the last word from a line in Unix file?
A) $>echo "C for Cat" | rev | cut -f1 -d' ' | rev
Cat
11)What are some common shells and what are their indicators?
sh – Bourne shell
csh – C SHell
bash – Bourne Again Shell
tcsh – enhanced C Shell
zsh – Z SHell
ksh – Korn SHell
12) What is a directory?
Every file is assigned to a directory. A directory is a specialized form of file that maintains a list of all files in it.
An inode is an entry created on a section of the disk set aside for a file system. The inode contains nearly all there is to know about a file, which includes the location on the disk where the file starts, the size of the file, when the file was last used, when the file was last changed, what the various read, write and execute permissions are, who owns the file, and other information.
14) You have a file called tonky in the directory honky. Later you add new material to tonky. What changes take place in the directory, inode, and file?
The directory entry is unchanged, since the name and inode number remain unchanged. In the inode file, the file size, time of last access, and time of last modification are updated. In the file itself, the new material is added.
For more good article on unix interview question with answer , pls check here.



Saturday, March 8, 2014

Rank Transformation in Informatica with Example

Rank Transformation in Informatica , is a connected and active /Passive transformation which select top/bottom rows of   input. It is something similar to Rank analytical data function or oracle. Only difference is that, it also filter out the remaining rows  (which are not a part of top/bottom threshold).

Must check : Please also check how to create Aggregator Transformation

How Rank Transformation works in Informatica?

It first cache all the input data and then performs the rank calculation per group , filter out the unwanted records.

Steps to create an Rank transformation:

  • In the Mapping Designer, open a Mapping.
  • Click Transformation > Create. Select Rank transformation.
  • Enter a name and click Done.
  • You will see one port RANKINDEX port already there. This port store the ranking of each   record  and can be used to populate target as well
  • Add all additional port from source input which  are going to be use in following transformation.
  • Open the port tab and first check the Group by option for desired column ( for example deptno in our case)
  • Rank Transformation Part-1
  • Also  check the Rank (R) option for the port which you want to do ranking. For example salary in our case.
Note: We can define Group by indicator for multiple port, but  Ranking can be done   on single port only.
  • Go to the properties tab, select the Top/Bottom value as Top and the Number of Ranks property as per need.
  • Rank Transformation Part-2
  • Click OK.
  • Connect output ports of Rank Transformation to other transformation or target
Must Read : Learn more about informatica coding standard Example of Rank Transformation in Informatica: A good example of Rank transformation with different type of join can be found here. For more explanation on Rank transformation , you can read it here and also check here for informatica interview question on Rank transformation