DB2 Flashcards
What is an instance?
An instance is an independent environment where applications can run, and the databases can be created.
What are the names of default instances on Windows and Linux when you intalled DB2 EXPRESS-C Edition on your computer?
The name of default instance on Windows is DB2 and on Linux its name is db2inst1.
Are the instances independent in a database?
Yes, because you can perform operations on one instance, but that operations won’t affect other instance.
What is the command to create an instance on DB2?
The command to create an instance on DB2 is db2icrt
Do each instance have a port number or not?
Yes, each instance have a port number.
What is the command on DB2 to list the instances?
The command to li the instances on DB2 is db2ilist
How can you switch between instances on Linux?
You can switch between instances when you switch between Linux operating system users, because an instance match a Linux operating system user. This user is known as the instance owner.
What is the command to create a database on DB2?
The command to create a database on DB2 is “db2 create database or db2 create db “.
What is the command to list all your database on your DB2 server?
The command to list all my databases on my DB2 server is “db2 list db directory”.
What is a database?
A database is a collection of objects like tables, views, indexes, and so on.
Can the databases share objects?
No, they can’t share objects, because they are independent units.
What kind of objects are created by default when you create a database on DB2?
The objects created by default when a database is created are table spaces, tables, a buffer pool and log files.
What are the names of objects created by default when a database is created?
The names of objects by default are SYSCATSPACE, TEMPSPACE1 and USERSPACE1.
What is the name of SYSCATSPACE in other relational database management systems and what do they store?
The name of SYSCATSPACE in other relational database management systems is data dictionary and they store the type of data of the data objects.
Why does DB2 need a table space that its name is TEMPSPACE1?
Because The Table spaces TEMPSPACE1 is used by DB2 when it needs additional space to perform some operations such as sorts.
Why are there a table space that its name is USERSPACE1?
Because It is used to store user database tables if there is no table space specified when creating a table.
What is the command to create a table space on DB2?
The command to create a table space is “CREATE TABLESPACE “.
What is a buffer pool on DB2?
A buffer pool is basically a memory cache used by the database.
What is the page size of the buffer pool?
There should always be one buffer pool with a page size that matches the page size of existing table spaces.
Why are the log files used for?
The log files are used for recovery. When you work on a database, not only is information stored in the disks for the database, but while you are working on the database, log files store all the operations executed on the data. Think of logs as temporary files where an autosave operation is performed.
What can you create inside a table space?
You can create objects inside the table space such as tables, views and indexes.
How many levels exist to configure a DB2 servers and What are they?
There are four different levels to configure a DB2 servers: *Environment variables *Database manager configuration file (dbm cfg) *Database configuration file (db cfg) DB2 profile registry
Where can you configure a DB2 server in each level?
environment variables are set at the operating system level of the server, while database manager configuration file parameters are set at the instance level. Database configuration parameters are set at the database level, and the DB2 profile registry is set either at the operating system or instance level.
What are environment variables?
They are variables set at the operating system level.
Give an example of an environment variable:
One key environment variable is DB2INSTANCE. This variable indicates the active instance you are working on, and for which your DB2 commands wold apply.
What does dbm cfg (database manager configuration file) includes at?
It includes parameters that affect the instance and all the databases contained within.
What is the command to retrieve information about the dbm cfg?
It is “db2 get dbm cfg”.
What is the command to update the value of a dbm cfg parameter?
It is “db2 update dbm cfg using “.