DB2 Instance or Database Manager
- An Instance is also called as database Manager as it manages all the database within it.
- It has it own
- processes
- configuration file
- diagnostic log files.
- A log file "db2diag.log" per instance is generated. It location is specified by the dbm cfg file parameter "Diagnostic data directory path (DIAGPATH)"
- Depth of logging Level in "db2diag.log" is specified by the dbm cfg file parameter "Diagnostic error capture level (DIAGLEVEL) ", by default its level is set to 3.
- Following are the five levels of diagnostic log: -
- No diagnostic messages captured (not recommended)
- Severe errors only
- All errors
- All errors and warnings (default)
- All errors and warnings and informational messages
- Following are the List of commands for Creating, Managing and Dropping Instance.(Note:- All commands are executed at windows level command prompt)
- db2icrt
- Create a DB2® instance, including a DB2 pureScale® instance.
- db2idrop
- Removes a DB2® instance that was created by db2icrt.
- db2ilist
- Lists all the instances that are created using the db2icrt command
- db2imigr(db2iupgrade in 10.1 version)
- The db2iupgrade command upgrades an instance from a DB2 copy of a previous release to a DB2 copy of the current release.
- db2iupdt
- The db2iupdt command can be used to update an instance to a higher level within a release
- db2start
- To start an instance
- db2stop
- To stop an instance
- db2iauto
- Enables or disables the autostart of an instance after each system restart. This command is available on Linux and UNIX operating systems only
- db2instance
- The db2instance command is used to query the state of a DB2® instance
- db2iprune
- The db2iprune command can reduce the size of your DB2® product installation image before installation.
- db2isetup
- Starts the DB2 Instance Setup wizard, which is a graphical user interface (GUI) tool for creating, configuring, and extending instances.
DB2 Environment has three layered Hierarchy
- Physical Server Machine
- Workstation on which database is installed forms the highest element in this hierarchy.It an physical machine.
- Virtual Server Machine
- An Virtual Server is created on the machine when we install the DB2 Setup. It is commonly know as DAS( DB2 Admin Server).
- It is collection of Instances.
- It runs as a Windows services which can be start or stop using services.msc console.
- It can also be start or stop using command prompt as
- db2admin stop or
- db2admin start commands
- It is required for
- Network database discovery
- Remote Administration
- Tools Catalog task scheduling
- DB2 Virtual Registry( DB2 Profile Registry)
- Similar to the Windows registry, which is used to save windows related info/path into variables, DB2 Profile registry also save Environment related information into variables.
- From the command prompt ""db2set" is used to view or change all the option
- Database Instance or Database Manager (DBM)
- Instance can be defined as collection of processes which are used by the user to access the database as well as collection of resources.(memory)
- In a single installation of DB2, we can generate multiple Instances from installation files.
- Instance acts as an manager for all the database residing within it.
- It can be started or stopped using command "db2start" or "db2stop" command ( Note:- this command needs to be executed from the db2 prompt unlike the command prompt)
- It consists of DB2 Database Manager Configuration File per instance.( DBM CFG)
- DBM CFG can be accessed using the command "get dbm cfg"( Note:- this command needs to be executed from the db2 prompt unlike the command prompt)
- Instance configuration file consists of
- security plan
- performance attributes
- communication
- There are four types of Instances
- ESE
- WSE
- Standalone
- Client
- Database
- Database can be defined as collection of tables and related objects.
- Each database include
- system catalog tables
- database configuration file
- recovery log
- Similar to the Instance configuration file, each database consists of its own configuration file.(DB CFG)
- DB CFG can be accessed using command "get db cfg".( Note:- this command needs to be executed from the db2 prompt unlike the command prompt)