Mandalika has Published 470 Articles

How to start a DB2 database DSNDB001 using the command panel?

Mandalika

Mandalika

Updated on 12-Sep-2020 15:02:20

137 Views

We can start the DB2 database by giving below command in panelDB2 ACTIVATE DSNDB001The DB2 ACTIVATE is followed by the name of the database which needs to be started.

How to recover a DB2 table space TABSPC1 using the image copy TOLASTCOPY?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:57:10

673 Views

The DB2 provides an utility RECOVER which is used to restore the tablespace. This utility uses image copy and DB2 logs to restore the changes. The following command can be used to recover the tablespace to the last image copy that was taken.RECOVER TABLESPACE DBSET1.TABSPAC1 TOLASTCOPYThe RECOVER TABLESPACE is followed ... Read More

How to do a full & incremental MERGECOPY for a DB2 table TAB1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:54:11

341 Views

The MERGECOPY is just opposite of IMAGECOPY. This DB2 utlility is used to combine the multiple image copy datasets into a new full or incremental image copy. This is mainly used to restore the backup in the DB2 table.The below JCL step can be used for the incremental MERGECOPY for ... Read More

Purpose and table creation syntax of “Declared temporary table”

Mandalika

Mandalika

Updated on 12-Sep-2020 14:52:17

114 Views

The declared temporary tables are also non-permanent tables but unlike created temporary tables they can be defined in the application program. The existence of a declared temporary table is limited to program execution. Since the declared temporary tables are created and deleted at the runtime, their entries are not stored ... Read More

Purpose and table creation syntax of “Created temporary table”

Mandalika

Mandalika

Updated on 12-Sep-2020 14:50:40

157 Views

The Created temporary tables are non-permanent DB2 tables that exist as long as the process using this table is active. For example any batch program. The created temporary tables are best suited for the sequential access and hence system performance is not a concern over here.The created temporary tables can ... Read More

There is a DB2 view VIEW1. How to get the definition of this view?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:47:14

3K+ Views

To get a DB2 view definition we can use the SYSIBM.SYSVIEW DB2 system table. The SYSVIEW table stores the details about all the views that exist in DB2. We can give below SQL statement to find the view definition.SELECT NAME, SEQNO, TEXT    FROM SYSIBM.SYSVIEWS WHERE NAME = ‘VIEW1’   ... Read More

How to get the list of all COBOL-DB2 programs using a DB2 table TAB1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:45:24

2K+ Views

SYSIBM.SYSTABAUTH is a DB2 system table which records the privileges that users/program hold on tables and views. We can use this table to find out the list of programs accessing a particular table and what action the program is performing on the table like SELECT, UPDATE, INSERT or DELETE. The ... Read More

How to find out all the indexes for a DB2 table TAB1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:42:05

8K+ Views

To find out all the indexes built on the DB2 table TAB1 we can use the DB2 system table SYSIBM.SYSINDEXES. The SYSINDEXES database has one row for every index present in DB2. We can find indexes built on a particular table using the below SQL query.SELECT NAME, UNIQUERULE, CLUSTERING   ... Read More

How to find all the foreign keys of a DB2 table TAB1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:40:55

5K+ Views

The foreign key of a DB2 table can be found using SYSIBM.SYSFOREIGNKEYS table and SYSIBM.SYSRELS table. The SYSFOREIGNKEYS is a DB2 system table which contains one row for every column of every foreign key. The SYSRELS table contains details about the referential constraints. In order to find out the foreign ... Read More

How to find the primary key of a DB2 table TAB1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:39:04

7K+ Views

We can find the primary key of any table using the SYSIBM.SYSCOLUMNS table. The SYSIBM.SYSCOLUMNS is a DB2 system table which contains one row for every column of each table. It also contains the data related to the views. Below SQL query can be fired in order to find the ... Read More

Advertisements