Mandalika has Published 470 Articles

How to create an ALIAS TAB2 for DB2 table TAB1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:36:43

400 Views

The ALIAS is basically a different name given to a particular object in a database. An ALIAS can be defined for a table, view or another alias and the existence of the object is not verified during the creation of the alias. The ALIAS is used to hide the location ... Read More

How to image copy the entire DB2 table TAB1 into a dataset?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:32:30

2K+ Views

The image copy allows us to download or copy the DB2 table into a mainframe dataset. There are two types of Image copy i.e. Full image copy and Incremental image copy. The full image copy is used to take the backup of the entire table. The incremental image copy refers ... Read More

How to create a DB2 segmented tablespace TABSPAC2 in storage group STOGRP1?

Mandalika

Mandalika

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

455 Views

A segmented table space is divided in multiple segments. A segment is defined as a contiguous set of fixed number of pages. This fixed number is defined during the table space definition using the SEGSIZE parameter. The SEGSIZE serves multiple purposes - It defines the tablespace as segmented and also ... Read More

How to create a DB2 tablespace TABSPAC1 in the database DBSPAC1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:27:21

150 Views

A tablespace is a collection of data files which resides inside a DB2 database. It is used to organize the data logically. Any DB2 database contains at least one tablespace and in the real world scenario there are multiple tablespaces within a database which are allocated for different business units. ... Read More

How to add a row compression to a DB2 table TAB1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:25:22

505 Views

A compression is used to save the DB2 disk space. The compression can be used either at row level or at a page level. In order to add a row compression in a DB2 table, we can give the following command−ALTER TABLE DBSET1.TAB1 COMPRESS YES STATICWe have to use ALTER ... Read More

How to delete all the DB2 packages in collection COLL1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:22:49

463 Views

A DB2 collection is a physical quantity which is used to group the packages. A collection can be simply termed as a group of DB2 packages. By using collections we can bind the same DBRM into different packages. In order to delete all the DB2 packers under a collection, we ... Read More

How to delete a DB2 table TAB1?

Mandalika

Mandalika

Updated on 12-Sep-2020 14:20:28

930 Views

We can delete the unused tables in the DB2. However, we must keep in mind that if we delete a table then all the indexes associated with the table are also dropped. Moreover, the triggers and views for the deleted table will become inaccessible. To delete any table in DB2, ... Read More

How to change the length of the Name column from CHAR(20) to CHAR(50)?

Mandalika

Mandalika

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

152 Views

DB2 gives us an option of modifying the attribute of the existing column in a table. We have to use the ALTER COLUMN parameter with ALTER TABLE as below in order to achieve this.ALTER TABLE DBSET1.TAB1    ALTER COLUMN NAME       SET DATATYPE CHAR(50);The ALTER TABLE reserved words ... Read More

How to create a table TAB2 having same attributes & columns as for table TAB1

Mandalika

Mandalika

Updated on 12-Sep-2020 14:13:49

274 Views

DB2 gives us an option to copy the structure of an existing table to a new table. To copy the attributes and column of table TAB1 to a new table TAB2 we can use the following command−CREATE TABLE DBSET1.TAB2    LIKE DBSET1.TAB1The CREATE TABLE reserved words are followed by table ... Read More

How to create a view on table TAB1 for column Name, age, enrollmentId & age > 10 years. >

Mandalika

Mandalika

Updated on 12-Sep-2020 13:20:28

300 Views

A view is an alternative way of representing the data stored in a table. A view can be used to increase the performance of the query since the view contains very limited rows as compared to its source table. We can use the below command to create a view on ... Read More

Advertisements