0 votes
in DBMS by
How to Create Non-restrictive Database in DB2?

1 Answer

0 votes
by

db2 create database command is used to create a non-restrictive database.

DB2 Create Database

CREATE DATABASE command is used to create a database in an instance. All databases are created with the default storage group "IBMSTOGROUP", which is created at the time of creating an instance.

In DB2, all the database tables are stored in "tablespace", which use their respective storage groups.


Create Non-restrictive Database

db2 create database command is used to create a non-restrictive database.

Syntax:

  1. db2 create database <database name>  

Example:

  1. let's create a database named "XYZ"  

After installation, you have to switch to that user to have rights to create a new database. Depending on the version you installed, that username might be changed. But DB2 uses db2inst1 by default as administrator user.

Check your /home directory. You will see a new user(most probably db2inst1). Then switch to that user with:

  1. su - db2inst1  

then issue:

  1. db2 CREATE DATABASE XYZ  

Related questions

+1 vote
+1 vote
asked Aug 21, 2020 in DBMS by DavidAnderson
+1 vote
+1 vote
+1 vote
asked Aug 21, 2020 in DBMS by DavidAnderson
...