Google
Information Storage and Retrieval: 2011

Pages

Monday, September 19, 2011

Object Oriented Programming: Some Basic Concepts

All computer programs consist of 2 parts: code and data. So, a program can be conceptually organized around its code or around its data. So, there are 2 approaches of writing computer programs: Programs that are written around "what is happening" and programs that are written around "who is being affected". The first approach is known as process-oriented approach. Procedural languages like C follow this model. The second approach is known as 'object-oriented' approach. Languages like C++ and Java follow this approach.

Object -Oriented approach helps in managing complexity better as it is more similar in nature to as how humans manage complexity. Human beings manage complexity through abstraction. e.g people do not think of a car as a set of thousands of individual parts or as a set of thousands of different processes that undergo in running a car. Instead they look at it as a well-defined object with its own unique behaviour. People can easily ignore the complex details of  how the engine, transmission and breaking systems work, while they drive a car. So a car can be visualized as a single object containing of several subsystems(with each of its unique behaviour) like steering, breakes, sound-system etc. In a similar fashion, a program can be written wherein data can be transformed by abstraction into its component objects and each of these objects describes its own unique behaviour.

Every object has state and behaviour. e.g Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). In similar fashion, software objects  too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication.

Encapsulation:

Encapsulation is a mechanism that binds together code and data it manipulates and keeps both safe from outside interference and misuse. Class is an example of encapsulation.

Inheritance:

Inheritance is the process by which one object acquires the properties of another object. So a class can have a subclass. The subclass will inherit the state and behaviour of its parent class plus it can have its own state and behaviour.

Polymorphism:

Polymorphism is a concept that allows one interface to be used for a general class of actions. e.g if in a program you need 3 differnt kind of stacks: 1 used for integers, one for characters and one for floating point numbers, then you can use 3 methods with the same name.

Thursday, August 4, 2011

Unusable Indexes

To load data in a table efficiently, we can make Indexes as UNUSABLE. However, the TRUNCATE operation should be done before making the indexes unusable. If table is truncated after the indexes are made unusable, then it will have no effect. The TRUNCATE will automatically make the index USABLE. so the correct order to load data will be as follows:

  • truncate the table
  • set the indexes to unusable
  • load the data
  • rebuild the indexes

Saturday, July 30, 2011

All about TNS and Making a connection request to an Oracle Database

What happens when an Oracle client issues a request to connect to a database e.g

sqlplus scott/tiger@ora10g.localdomain

Here SQLPLUS is the client program, scott/tiger is the username/password and ora10g.localdomain is a TNS service name. TNS stans for Transparent Network Substrate and is a foundation software built into Oracle client to handle remote connections and allowing peer-to-peer communication. The TNS connection string tells the Oracle software how to connect to the remote database. Generally, the client software will read a configuration file "tnsnames.ora" which contains the details such as hostname, port number and the service name of the database on the host to which we wish to connect. A sample TNS entry:


gaurav_ora =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ora10g)
    )
  )

Here host machine is localhost and "ora10g" is the database service name. 1521 is the port number on which a "TNS listener" process will accept connections.

So now, our client software knows where to connect to. It will open a TCP/IP socket connection to the server with the hostname localhost on port 1521. The TNS Listener process inspects this request and using its own configuration file either accepts or rejects the request.

Tuesday, July 26, 2011

New Features of Informatica 9.0

Following are some new features introduced in Informatica 9.0 :

1.  New Client tools:

Informatica 9 includes the Informatica Developer and Informatica Analyst client tools.


The Informatica Developer tool is eclipse-based and supports both data integration and data quality for enhanced productivity. The Informatica Analyst tool is a browser-based tool for analysts, stewards and line of business managers.  This tool supports data profiling, specifying and validating rules (Scorecards), and monitoring data quality.


2. Informatica Administrator:

The PowerCenter Administration Console has been renamed the Informatica Administrator.


The Informatica Administrator is now a core service in the Informatica Domain that is used to configure and manage all Informatica Services, Security and other domain objects (such as connections) used by the new services.
The number of objects stored in the domain has increased to accommodate these new requirements.

3.  Session Log size:

You can limit the size of session logs for real-time sessions. You can limit the size by time or by file size. You can also limit the number of log files for a session.
4. Lookup Transformation:
  > Cache updates


     You can update the lookup cache based on the results of an expression. When an expression is true, you can add to or update the lookup cache. You can update the dynamic lookup cache with the results of an expression.

  > Database deadlock resilience
       
      In previous releases, when the Integration Service encountered a database deadlock during a lookup, the session failed. Effective in 9.0, the session will not fail. When a deadlock occurs, the Integration Service attempts to run the last statement in a lookup. You can configure the number of retry attempts and time period between attempts. 

  > Multiple rows return. 

     You can configure the Lookup transformation to return all rows that match a lookup condition. A Lookup transformation is an active transformation when it can return more than one row for any given input row.


 > SQL overrides for uncached lookups

   In previous versions you could create a SQL override for cached lookups only. You can create an SQL override for uncached lookup. You can include lookup ports in the SQL query.
  

Tuesday, January 18, 2011

Character Sets and Code Pages

In computer science, the terms character encoding, character map, character set or code page were historically synonymous.

A character set is an agreement on what numeric value, a symbol has. A computer does not understand 'A' or 'B' , it only knows numeric(binary) values of a symbol, defined in the character set used by its Operating system. A computer only 'understands' numbers, hence there is a need of character sets.

ASCII is a 7-bit character set. So, it knows only 128 (2^7) symbols. 'UTF-8' a Unicode multibyte characterset (UTF8/AL32UTF8 in Oracle).

Code page is another name for character encoding. It consists of a table of values that describes the character set for a particular language. Vendors often allocate their own code page number to a character encoding, even if it is better known by another name (for example UTF-8 character encoding has code page numbers 1208 at IBM, 65001 at Microsoft, 4110 at SAP)