top of page

Db2 Databases Cheat Sheet

  • Writer: Jha Chandan
    Jha Chandan
  • Aug 26, 2021
  • 2 min read

A Db2 database is a group of data treated collectively as a unit. A database is a large structured set of persistent data, and its purpose is to store, retrieve and manipulate related information.


Db2 databases have logical structures and physical structures which the DBMS manages separately. The physical storage of data can be managed without affecting the access to logical storage structures. Db2 databases are created using Data Definition Language, or DDL, commands and are composed of tablespaces, tables with rows and columns, views, indexes, stored procedures and other supporting structures.


A database administrator (DBA) uses Db2, which is DBMS or database server, to create and use Db2 databases. Once created, a DBA or developer can use a Db2 database and its underlying structures to create, read, update and delete data to support an organization's business requirements.


The Db2 DBMS operates as the server to manage data in databases across a multiuser environment, enabling many concurrent users to access the same data simultaneously. The Db2 DBMS also prevents unauthorized access, provides utilities for backing up and recovering data and offers performance tools and data management capabilities.

ree

In this blogpost you will see and learn Db2 Databases related syntaxes and methods which help you using Db2 database product.


Creating non-restrictive database

db2 create database <database name>

Creating restrictive database

db2 create database <db_name> restrictive 

Creating database with different user defined location

db2 create database '<db_name>' on '<data location>' dbpath on '<db_path_location>'  

Viewing local or system database directory files

db2 list database directory 

Activating database

db2 activate db <db_name> 

Deactivating database

db2 deactivate db <db_name>

Connecting to database

db2 connect to <database name> 

Verifying if database is restrictive

db2 get db cfg for <db_name> | grep -i restrict 

Configuring the database manager and the database

  • Database Manager Configuration Parameters

Get the information of Instance Database manager

db2 get database manager configuration   

Update instance database manager

db2 update database manager configuration   

Reset previous configurations

db2 reset database manager configuration  
  • Database Configuration Parameters

Get the information of Database

db2 get database configuration   

Update the database configuration

db2 update database configuration    

Reset the previously configured values in database configuration

db2 reset database configuration     

Dropping Database

db2 drop database <db_name>

That's all in this post. If you liked this blog and interested in knowing more about IBM Db2. Please Like, Follow, Share & Subscribe to www.ImJhaChandan.com


Comments


jc_logo.png

Hi, thanks for stopping by!

Welcome to my “Muse & Learn” blog!
Muse a little, learn a lot.✌️

 

Here you’ll find practical SQL queries, troubleshooting tips with fixes, and step-by-step guidance for common database activities. And of course, don’t forget to pause and muse with us along the way. 🙂
 

I share insights on:​​

  • Db2

  • MySQL

  • SQL Server

  • Linux/UNIX/AIX

  • HTML …and more to come!
     

Whether you’re just starting out or looking to sharpen your DBA skills, there’s something here for you.

Let the posts
come to you.

Thanks for submitting!

  • Instagram
  • Facebook
  • X
2020-2025 © TechWithJC

Subscribe to Our Newsletter

Thanks for submitting!

  • Facebook
  • Instagram
  • X

2020-2025 © TechWithJC

bottom of page