Skip to main content

Posts

Showing posts from February, 2014

Most Common UNIX Commands Part - V

Lets see about some more loop statements which can be used in unix shell scripting while: while followed by condition then set of statements to be executed do,done act as flower braces Syntax: while [condition/statement]              do              statement 1              statement 2              :              :               statement n               done  eg: #!/bin/sh a=0 while [ $a -lt 10 ] do    echo $a    a=`expr $a + 1` done Output will be as follows 0 1 2 3 4 5 6 7 8 9 Until: This command functionality is viceversa of while command. In while the loops continues to execute when condition is true , but in until the loops continues to execute until the condition is false. Syntax: until [condition/statement]              do              statement 1              statement 2              :              :               statement n               done eg: #!/bin/sh a=0 until [ ! $a -lt 10 ] do    echo $a    a=`expr $a + 1` done

Most Common UNIX Commands Part - IV

There might be a scenario where we need a same statement  be executed for some 'n' number of times in those cases we usually go for loop commands. We have used these in c,c++,java.The same can be used even in unix shell scripting too Let's see about some loop commands which can be used in shell scripting. If,For,While,Until. IF-   If  keyword followed by condition then set of statements that should be executed upon satisfying the condition and then if loop will be ended with fi keyword syntax:        if [expression/condition]         then         statements to be executed         fi eg:    #!/bin/sh a=10 b=20 if [ $a == $b ] then    echo "a is equal to b" fi  for if-else it will be as follows #!/bin/sh a=10 b=20 if [ $a == $b ] then    echo "a is equal to b" else   echo "a is not equal to b" fi For nested if else it should be represented in the following way #!/bin/sh

Teradata Architecture

We have many relational databases available in market, teradata is one such RDBMS it is usually preferred when we are dealing data with tera bytes in size and when we need a very fast quick response for retrieval data. Teradata main advantage is its parallelism architecture and utilities.Lets get to know more about it in a deeper way we have Parsing engine which has 4 components a)Session control- It checks for user/login credentials before processing the query b)Parser-It checks for the SQL syntax and user rights to access various database objects referred in the SQL query submitted by user c)Optimizer-It generates the query execution plan d)Dispatcher-It passes execution plan to bynet and receives all the responses and sends back to user Next we have Bynet it is the communication layer between PE (parsing engine) and AMP's ( access module processors).There are two bynets available Bynet-0 and Bynet-1 which help in continuous communication between AMP's and P

Most Common UNIX Commands Part - III

Continuing the unix commands left at part II, lets get to know some more unix commands Paste- This command is used to merge lines of file of a single file or multiple files.for example if we give paste dummy.txt. It will display contents of file similar to cat command. $ paste dummy.txt aaa bbb  ccc $paste -s dummy.txt aaa bbb ccc  -s joins all lines of file since no delimiter is specified, default delimiter tab is being used $paste -d, -s dummt.txt aaa,bbb,ccc -d is it the delimiter option $ paste file1 file2  In here it merges both the files parallellely merged nslookup - This command is used to find the ip address if you know the domain name and vice versa $nslookup abc.com Name: abc.com Address: 209.132.183.181 $nslookup  209.132.183.181 Name: abc.com finger- This command is used to know the information of a user i.e name,home directory, last logged info etc. finger dvader [mentor.cc.purdue.edu]   Login name: dvader                      I

Dynamic File Creation in Informatica using Transaction Control transformation

In here we will see how to generate files dynamically. The requirement is, Consider i have an employee table with the following fields Name,Salary,Department,ID The files should be generated with employee name as file name and that particular file should have the details of that respective employee only, if the employee has more than one record then both the records should be pulled into the file. We need to create a port in the target instance named as file name we need to create a port present in the right end corner it will be named as "Add FileName column to this table" Create the mapping in the following way In the expression, give the conditions in the following way In transaction control information give the condition as So by this for each new ename a file would be created, the duplicate values for the same ename also would be saved in the same file. Hope this article helps you in understanding dynamic file creation

Types of Joins in Oracle/Teradata

In Data warehousing, irrespective of schema (snow flake schema or star schema) we are using, we should join dimension and fact tables to analyze the business. Below are the frequently used joins: Inner join Left outer Join Right outer Join Cross join Inner Join: Inner join will give you the matching rows from both the tables. If the join condition is not matching then zero records will return. We should use ON keyword to give join condition. Example: Table1: ID Name 1 Krishna 2 Anirudh 4 Ashok Table2: ID Location 1 Bangalore 3 Chennai 4 Chennai We can join above two tables using inner join based on key column ID. SELECT T1.ID, T1.Name, T2.Location FROM Table1 T1 INNER JOIN Table2 T2 ON T1.ID = T2.ID     If we are using inner join, it will give us matching rows from both the table. Here in this example, we have 2 matching rows i.e. ID 1 and 4. Below will be the result set for the above example query wit