DB2 Flashcards

1
Q

What is an instance?

A

An instance is an independent environment where applications can run, and the databases can be created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the names of default instances on Windows and Linux when you intalled DB2 EXPRESS-C Edition on your computer?

A

The name of default instance on Windows is DB2 and on Linux its name is db2inst1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Are the instances independent in a database?

A

Yes, because you can perform operations on one instance, but that operations won’t affect other instance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the command to create an instance on DB2?

A

The command to create an instance on DB2 is db2icrt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Do each instance have a port number or not?

A

Yes, each instance have a port number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the command on DB2 to list the instances?

A

The command to li the instances on DB2 is db2ilist

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you switch between instances on Linux?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the command to create a database on DB2?

A

The command to create a database on DB2 is “db2 create database or db2 create db “.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the command to list all your database on your DB2 server?

A

The command to list all my databases on my DB2 server is “db2 list db directory”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a database?

A

A database is a collection of objects like tables, views, indexes, and so on.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Can the databases share objects?

A

No, they can’t share objects, because they are independent units.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What kind of objects are created by default when you create a database on DB2?

A

The objects created by default when a database is created are table spaces, tables, a buffer pool and log files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the names of objects created by default when a database is created?

A

The names of objects by default are SYSCATSPACE, TEMPSPACE1 and USERSPACE1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the name of SYSCATSPACE in other relational database management systems and what do they store?

A

The name of SYSCATSPACE in other relational database management systems is data dictionary and they store the type of data of the data objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Why does DB2 need a table space that its name is TEMPSPACE1?

A

Because The Table spaces TEMPSPACE1 is used by DB2 when it needs additional space to perform some operations such as sorts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why are there a table space that its name is USERSPACE1?

A

Because It is used to store user database tables if there is no table space specified when creating a table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the command to create a table space on DB2?

A

The command to create a table space is “CREATE TABLESPACE “.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a buffer pool on DB2?

A

A buffer pool is basically a memory cache used by the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the page size of the buffer pool?

A

There should always be one buffer pool with a page size that matches the page size of existing table spaces.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Why are the log files used for?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What can you create inside a table space?

A

You can create objects inside the table space such as tables, views and indexes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How many levels exist to configure a DB2 servers and What are they?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Where can you configure a DB2 server in each level?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are environment variables?

A

They are variables set at the operating system level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Give an example of an environment variable:

A

One key environment variable is DB2INSTANCE. This variable indicates the active instance you are working on, and for which your DB2 commands wold apply.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What does dbm cfg (database manager configuration file) includes at?

A

It includes parameters that affect the instance and all the databases contained within.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What is the command to retrieve information about the dbm cfg?

A

It is “db2 get dbm cfg”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is the command to update the value of a dbm cfg parameter?

A

It is “db2 update dbm cfg using “.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is the command to retrievee information about the db cfg for a specific database?

A

It is “get db cfg for “.

30
Q

What is the command to update a value of a db cfg parameter?

A

It is “update db cfg for using “.

31
Q

What does a script do?

A

It performs several DB2 commands or SQL statements repeatedly.

32
Q

What is the command to execute a SQL Script?

A

db2 -tvf script.db2 -z script.log.

33
Q

What does -z indicate at?

A

It indicates that the file specified after this flag is used for appending screen output for later analysis.

34
Q

What does -t indicate at?

A

It indicates that statements use the default statement termination character a semi-colon.

35
Q

What does -f indicate at?

A

It indicates that the filename after this flag is the script file.

36
Q

What does -v indicate at?

A

It indicates verbose mode; causing db2 to echo the command being executed.

37
Q

What is the command to change the default statement termination?

A

It is “db2 -td! -v -f functions.db2 -z functions.log”.

38
Q

What do operating system scripts provide?

A

They provide greater flexibility and power than SQL scripts, as they give you the possibility to add additional programming logic.

39
Q

What is the extention of an operating system scripts?

A

It is “.bat”.

40
Q

What is the main process and thread on DB2?

A

They are called db2sysc.

41
Q

What is a page?

A

A page is the minimum unit of storage in DB2. Allowed page sizes are; 4k, 8k, 16k and 32k.

42
Q

What is an extent?

A

It is a grouping of pages.

43
Q

What is a buffer pool?

A

It is a real memory cache for table and index data. The buffer pools are allocated in memory units of 4k, 8k, 16k, 32k pages. There should be at least one buffer pool per database, and at least one matching buffer pool for a table space of a given page size.

44
Q

What is the command to create a buffer pool?

A

It is “CREATE BUFFERPOOL”.

45
Q

What are the table spaces?

A

They are a logical interface between logical tables and the system’s physical memory (buffer pool) and containers (disks).

46
Q

What is a table?

A

A table is a collection of related data logically arranged in columns and rows.

47
Q

What is a view?

A

It is a representation of the data in tables. The data for the view is not stored separately, but is obtained when the view is invoked.

48
Q

What is a index?

A

It is an ordered set of keys each of which points to a row in a table.

49
Q

What does referential integrity allow?

A

It allows your database to manage relationships between tables.

50
Q

where are buffer pool and logs reside?

A

They reside on disk, we recommend both don’t keep on the same disk.

51
Q

What does the CHNGPGS_THRES parameter indicate?

A

it indicates the percentage of the buffer pool with “dirty pages”, that is, pages containing changes.

52
Q

When the old and new values are stored on disk?

A

When the CHNGPGS_THRES threshold are reached.

53
Q

What type of logs exist?

A

There are two type of logs:

Primary logs and Secondary logs.

54
Q

What are the name of parameters to set the number of primary logs and secondary logs?

A

They are LOGPRIMARY and LOGSECOND.

55
Q

What are the names of types of logging?

A

They are circular logging and archive logging.

56
Q

What is the default loggin and when it is enabled?

A

The default logging is circular logging and it is enabled when both of the LOGARCHMETH1 and LOGARCHMETH2 database configuration parameters are set to OFF.

57
Q

What does BLK_LOG_DSK_FUL configuration parameter do?

A

this gives the DBA some time to find new space, so that the transaction can continue.

58
Q

What are the forms to store the data in a database and How are they called?

A

If
data is stored in a tabular form then it is called a relational database. When data is
organized in a tree structure form, it is called a hierarchical database. Data stored as
graphs representing relationships between objects is referred to as a network database

59
Q

What is a database management system?

A

Database management system, or simply
DBMS, is a set of software tools that control access, organize, store, manage, retrieve and
maintain data in a database.

60
Q

What is the main purpose of a information Model is?

A

It is to model managed objects at a conceptual
level, independent of any specific implementations or protocols used to transport the data.
The degree of detail of the abstractions defined in the Information Model depends on the
modeling needs of its designers. In order to make the overall design as clear as possible,
an Information Model should hide all protocol and implementation details. Another
important characteristic of an Information Model is that it defines relationships between
managed objects.

61
Q

What is a Data Model?

A

Data Models, on the other hand, are defined at a more concrete level and include many
details. They are intended for software developers and include protocol-specific constructs.
A data model is the blueprint of any database system

62
Q

What is a DBA?

A

It is is responsible for the maintenance, performance, integrity
and security of a database.

63
Q

What does a relational model have?

A

It has a solid mathematic foundation based on set theory and predicate calculus.

64
Q

Who invent the relational model?

A

It was invented by Codd.

65
Q

What was coad goal when he created the relational model?

A

his goal was to deliver a model that provided better data independence.

66
Q

What were codd’s proposals?

A

His proposal was threefold:

  1. Store the data in a simple data structure (tables).
  2. Access it throug a high level set-at-a-time Data Manipulation Language (DML).
  3. Be independent from physical storage.
67
Q

Who proposed the entity-relationship?

A

Peter Chen proposed the entity-relationship in the mid 1970’s.

68
Q

What was the alternative to relational model?

A

It was entity-relationship proposed by Peter Chen in the mid 1970’s.

69
Q

What is entity-relationship about?

A

He
proposed thinking of a database as a collection of instances of entities. Entities are objects
that have an existence independent of any other entities in the database. Entities have
attributes, which are the data elements that characterize the entity. One or more of these
attributes could be designated to be a key. Lastly, there could be relationships between
entities. Relationships could be 1-to-1, 1-to-n, n-to-1 or m-to-n, depending on how the
entities participated in the relationship. Relationships could also have attributes that
described the relationship.

70
Q
A