Mandalika

Mandalika

409 Articles Published

Articles by Mandalika

Page 21 of 41

Give and explain the panel command to display all the components of DB2 database DSNDB01 along with their status?

Mandalika
Mandalika
Updated on 12-Sep-2020 192 Views

A database contains multiple components like tablespace, indexspace, index, tables, etc. We can find out all the components within the database using the below panel command.DIS DB(DSNDB01)

Read More

What are the ways to calculate DB2 database size using DB2 utility and other methods?

Mandalika
Mandalika
Updated on 12-Sep-2020 829 Views

There are multiple ways in which we can estimate the size of the DB2 database. Few of them are listed below−By using inbuilt get_dbsize_info function.By using DB2 active transaction logs.The size of the dataset which was used with UNLOAD utility can be checked.Table/Index dataUsing STOSPACE utility in JCL as below//STEP1 EXEC DSNUPROC //SYSIN DD * STOSPACE DATABASE DSNDB01 //*

Read More

How to repair a pending state of an index IDX1?

Mandalika
Mandalika
Updated on 12-Sep-2020 542 Views

The pending state is set when the image copy is required for the table space or when the INDEX is in rebuild status. In this case a COPY PENDING/ REBUILD PENDING flag is set. We can repair this state by using the below JCL step.//STEP010 EXEC DSNUPROC REPAIR SET INDEX IDX1 NORBDPENDThis utility can also be used to repair the tablespace. For this we can use the REPAIR SET TABLESPACE statement. This is followed by the name of index or tablespace.

Read More

How to reorganize the DB2 tablespace TABSPAC1 to reclaim fragmented space?

Mandalika
Mandalika
Updated on 12-Sep-2020 606 Views

The tablespace reorganization is used to reorganize the data present in the system in order to reclaim the free space. This free space can be utilized to store the new data and therefore reorganization is very useful from a memory utilization point of view. We can reorganize any tablespace using DB2 REORG utility in JCL step as below.//STEP1 EXEC DSNUPROC,UID='IUJLU101.REORG', //UTPRINT DD SYSOUT=* //SYSIN DD * REORG TABLESPACE (DBSET1.TABSPAC1) //*The REORG TABLESPACE statement is followed by the name of the tablespace which needs to be reorganized qualified by dabasebase.

Read More

Updating and sampling of catalog statistics for DB2 tablespace

Mandalika
Mandalika
Updated on 12-Sep-2020 303 Views

The DB2 RUNSTAT utility records the details of tablespace, table, index, etc in the system catalog. The RUNSTAT generates the data like space available in table space, indexes, access paths, etc. We can use the below JCL step to update the catalog statistics of DB2 tablespace TABSPAC2 and to sample 25% of the rows.//STEP1 EXEC DSNUPROC //UTPRINT DD SYSOUT=* //SYSIN DD * RUNSTATS TABLESPACE DBSET1.TABSPAC1    TABLE(ALL) SAMPLE 25    INDEX(ALL)The SYSIN parameter can be used with RUNSTATS TABLESPACE statement followed by tablespace name qualified by database name.

Read More

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

Mandalika
Mandalika
Updated on 12-Sep-2020 198 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.

Read More

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

Mandalika
Mandalika
Updated on 12-Sep-2020 799 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 by the name of tablespace qualified by the database in which it resides. The TOLASTCOPY parameter will restore the image copy in the following way. If the most recent image copy is full image copy, then the full image copy is restored in the tablespace. If the most recent image ...

Read More

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

Mandalika
Mandalika
Updated on 12-Sep-2020 410 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 DB2 table TAB1 which is residing in the database DBSET1−//STEP010 EXEC DSNUPROC //COPY1 DD DSN=TEST.DB2.COPY1, DISP=(MOD, CATLG, CATLG), // UNIT=SYSDA, SPACE=(4000, (20, 20), , , ROUND) //COPY2 DD DSN=TEST.DB2.COPY2, DISP=(MOD, CATLG, CATLG), // UNIT=SYSDA, SPACE=(4000, (20, 20), , , ROUND) //SYSOUT DD SYSOUT=* //SYSIN DD * MERGECOPY TABLESPACE DBSET1.TBSPAC01 COPYDDN ...

Read More

Purpose and table creation syntax of "Created temporary table

Mandalika
Mandalika
Updated on 12-Sep-2020 210 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 be created using the DDL statement CREATE GLOBAL TEMPORARY TABLE followed by the name of the temporary table. This statement makes the entry of the new table in DB2 system table SYSIBM.SYSTABLES with type column as ‘G’.The created temporary table should always be created using the above DDL statement before ...

Read More

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

Mandalika
Mandalika
Updated on 12-Sep-2020 3K+ 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 below SQL query can be fired on SYSTABAUTH in order to get list of programs.SELECT GRANTEE, SELECTAUTH, UPDATEAUTH, INSERTAUTH, DELETEAUTH FROM SYSIBM.SYSABAUTH WHERE GRANTEETYPE = ‘P’ AND TNAME = ‘TAB1’The column SELECTAUTH, UPDATEAUTH, INSERTAUTH and DELETEAUTH represents SELECT, UPDATE, INSERT and DELETE authority respectively. In the WHERE clause we will ...

Read More
Showing 201–210 of 409 articles
« Prev 1 19 20 21 22 23 41 Next »
Advertisements