Posts

Showing posts from 2014

7474 VProc cannot be started. The node may need a reboot.

Explanation: This error occurs when a VProc cannot be started due to an invalid DBS state during StartUp. Generated By: AMP Startup modules. For Whom: Operator. Notes: For a VProc to start, the appropriate DBS state is either SysStartup, SysLogoff or SysLogon state. Remedy: Restart the DBS after booting the node.

7473 Requested sample is larger than table rows. All rows returned

Explanation: This is a warning message. It occurs when the total number of rows requested in the sample is larger than the total number of rows in the table. Generated By: AMP Sample Step code - stpsamp. For Whom: End User. Remedy: In this case, all the rows in the table will be returned. Each sample request will be honored until the total number of table rows has been reached. After that, no rows will be returned for the sample.

Query to identify the data distribution across AMP's in Teradata

The below query is used to identify the data distribution across AMP's in Teradata SELECT HASHAMP(HASHBUCKET(HASHROW( index_columns ))) AS AMP_NO , COUNT(*) FROM databasename.tablename GROUP BY 1 ORDER BY 1;

Query to find Table Space in Teradata

The below query helps you to identify the total space occupied by the tables in teradata system. SELECT databasename, tablename, SUM (currentperm)/1024**3 AS current_GB FROM dbc.allspace WHERE tablename IN ('TableName') AND databasename = 'DatabaseName' GROUP BY 1,2 ORDER BY 1,2; The above query will return 3 columns namely , database name , table name and amount of space table used in teradata system.

Teradata SQL Assistant Shortcuts

Teradata SQL Assistant Shortcuts ctrl + T This will clear all the queries in the Teradata Query Editor ctrl + Q This will format the query in the Teradata Query Editor ctrl + D This is used to comment and uncomment the selected query text in the Teradata Query Editor F11 This will get you the last error message ctrl + C This is used to copy the selected Text in the Teradata Query Editor Ctrl + P This is used to paste the copied content into the Teradata Query Editor Ctrl + F This is used to find a Text in Teradata Query Editor Ctrl + H This is used to Find and Replace the Text in Teradata Query Editor Shift + F10 + I This will get you the current date in the Teradata Query Editor F5 This will execute the Query in the Current Query Tab in the Teradata Query Editor F6 This will get you the execution plan for the query in the Query Editor F9 This is used to execute the Query in Parallel.

Tips to Learn Easier and Faster

Tips to Learn Easier and Faster 1) Visualization The idea of Visualization here is that you want to put abstract information into a picture. If you are struggling to understand a concept, visualization is a good technique to start with. 2) Interlinking Take two ideas and ask yourself how they relate. They can be ideas within a specific field (short roads) or between two completely different fields (freeways). By doing this you create a roadmap for traveling between information in your brain. I suggest reading my article on holistic learning if you want to find out more. 3) Diagram Draw it out. I love using diagrams for sorting large pieces of information. When I used to write computer programs fairly heavily, my desktop would have pieces of paper with hastily scratched diagrams. I consider creating a diagram to be the upgraded version of visualization. 4) Self-Test Give yourself a test. Testing is a good way to see if you know what your doing, so try it out. 5) ...

What Makes a Man Successful

What Makes a Man Successful The below are some of the qualities of a good person,     One who is kind and compassionate     Honest and hardworking.     Self-control and is respectful when he speaks to any women.     Willing to be corrected or counseled by you.     Faithful and reliable, he is able to forgive you when you do wrong.     Humble, generous and is a peacemaker as well.     Knows how to control his temper and has concerns for others.     Stays confident of himself.     Fears God and is obedient to his word.     Is not a jealous.     Always has a positive outlook on life. The above quality doesn’t make a Man Perfect. But if anyone having the above qualities then that person will be Good Man and not a perfect Man. Story: The Student, who is studying his graduation in a reputed college. He has many talents inside hi...

Read a file line by line in shell script

How to read a file line by line in shell script ? There are many ways to handle file operations in UNIX. here is the one way of paring the input file line by line in shell script. If you know the basic shell scripting then it will be easy to understand. filename=$1 cat $filename | while read line  do  echo “$line”  done 

Shell Script Best Practices

Shell Script Best Practices: 1.Constant variables or environment variables name should be UPPER-CASE 2. Changeable variables name should be lower-case 3. Variables in function should be named “_xxx_xx”, starting with underscore “_” to avoid conflict with global variables 4. Use ${xxx} to reference variable, don’t omit {} 5. Code Indent 6. Shell function Treat shell function as real function, and avoid to use global variables Try to put similar functions into a file, and write the test script to do function test Use return/echo to return integer from function, use echo to return string from function and use exit if you want the program to abort The function name should be end with “_func” 7. Comments File header comments should contain description, usage[optional], author, create/change date Line comments – leading line commends or end line comments Sections comments: comments for a block code just like line comments Function comments: should contain des...

PERL Data Types and Objects

PERL Data Types and Objects Perl has three data types: scalars  – Scalars can hold elementary data, i.e., string, integer, float … arrays of scalars  – Arrays of scalars in short arrays can hold arrays of scalar values. associative arrays of scalars.  – Associative arrays of scalars are also called as hashes contain key, value pairs. There are like arrays only but the difference is these are indexed by strings where arrays are indexed by integers. Declaration of scalar Syntax :    $var_name Example:  $name   # holds string value $num    #holds numeric value Note:  no differentiation in declaring string or numeric variable. Declaration of Arrays     Syntax :  @arr_name Example:  @name  #holds a list of scalar values Declaration of Hashes Syntax :  %hash_name Accessing Scalar: $var_name Accessing Arrays: Single element at index ‘i’ – $arr_name[i] All eleme...

Introduction to Perl

Introduction to Perl Perl is a interpreted language. It is almost available in all popular operating systems today. Perl will be  similar to C language and awk . Basics Perl script file mostly will have the extension  .pl In unix and Linux flavours, the perl file should have an  execution permission . Start the perl script file with  #!/usr/bin/perl Dont forget to terminate perl commands with  ; (semicolen) . eg.,  print “Hello worldn”; Program 1 Always the first program I try on any language is hello world, so perl’s hello world program is here for Linux and UNIX flavors, #!/usr/bin/perl print “Hello world.n”; In Windows the same program will look like, #!D:/perl/perl.exe print “Hello world.n”; The first line (in both examples) is a comment for perl, but for shell it tells which interpriter in what path to use on the file. The second command  print  is similar to  printf  in C language with som...

Relational and Logical Operators in PERL

Relational and Logical Operators in PERL All programming languages have Relational and logical operators. Lets discuss on what Perl has as relational & logical operators. The relational & logical operators are  used with conditional statements and looping statements . Perl’s relational and logical operators are  same as C language and shell script . All operators’ returns  true  if the condition satisfies else return  False . Relational operators The C way The shell script way Description > gt Greater than < lt Less than >= ge Greater than equal to <= le Less than equal to == eq Equals != ne Not equal Logical operator The C way Description && and operator || or operator ! not operator Other file operations Operators Description -e  filename File exist -f  filename Plane file -d  filename Directory -s  filename File size not zero -r...

Perl index() function

Perl index() function The  index()  function is used to identify or search for the  position of a letter or a substring in a string. It will return the position value of the  first occurance  of the substring within the string. $index = index(‘iguddy’, ‘gud’); print $index . “n”; This will print  1 , which is the index value of the start of the substring  gud The index() function is similar to a regular expression call, but without all the overhead of the regex search patterns. It simply returns the index value of the substring if it exists within the string. Example 1: Let’s consider you are searching for a particular letter ‘u’ in the following string “iguddy.com”. The following code snippet will help you find the letter ‘u’ in the String “IGuddy.com”  #!/usr/bin/perl my $string = ‘iguddy.com’; my $letter = ‘u’; my $result = index($string, $letter); print “Result: $resultn”; This program gives you:   Resul...

HTML/JAVASCRIPT