Sunday, July 6, 2014

DB2 Instance

From the manual:

database manager instance
(1) A logical database manager environment similar to an image of the actual database manager environment. It is possible have several instances of the database manager product on the same workstation. Use these instances to separate the development environment from the production environment, tune the database manager to a particular environment and protect sensitive information.
(2) The DB2 code that manages data. An instance has its own databases (which other instances cannot access), and all its database partitions share the same system directories. It also has separate security from other instances on the same computer.

Quoted from here:
Take this as you are a client connecting to a server, so you sees a server(database host) as node providing you information about the instance and the database that is under that instance.so you catalog that node and starts taking to that database under that instance.
So any times you want to interface to that database , you must go through that instance(that has its own service name/port that is using to listen to the client).

The client also has its own instance, that provide you code/libraries to do all type of work as a client.

Now you are at machine(local) that hosts a database,so you create a instance(infact a instance is nothing but links to various libraries of the same db2 code and various binaries).
so if you want to connect to an instance you attached to it(attached is nothing more than attaching to shared structure that a running instance will have provided through its ipc daemon/listener).
Once you attached to an instance, you ask that instance to connect me to that database(infact every local database is automatically catalog during the creation).

Now in db2 terminology when you are at the local machines or mutiple machines, you can create partitions that are spread across mutiple physcial machines or as logical partitions at the same machine.These are all database partitions that are sharing the same instance and all the other things are unshared.In version 7 or earliar this database partition was known as node partition(infact all the commands the has node clause also work in V8)

No comments:

Post a Comment