简体   繁体   中英

db2 database creation

I installed db2 client in my system for personal use. I am not able to understand from where to create the database so that i can create tables on that db and play around with sql queries as of now.

This is totally related to my personal use and learning purpose.

Please inform how to create a dummy database and play around with it with db2 client?

Regards,

Are you on Windows? Are you using DB2 Express-C ? I'm assuming you are, since you say this is for personal work.

After you have the DB2 binaries installed, you should have been prompted with the "DB2 First Steps" application, where you could have the application go through a GUI to create the database for you. If you missed it, you should be able to find it in your start menu with Start -> Programs -> IBM DB2 -> DB2COPY1 (Default) -> Set-up Tools -> First Steps .

If you prefer the command line, you can use the following:

First, determine if your installation created a default instance (on Windows, this will be called DB2 ) by using the db2ilist command. In the DB2 Command Window, if you're not on the instance you want to create a database in, you can switch with the following command:

set db2instance=DB2

Be sure to not include spaces around the equal sign.

Now, in order to create a database in the current instance, you use this command:

db2 create database mydatbase

For further reading, IBM has produced a Getting Started ebook , and I would highly recommend you check it out!

The DB2 client is just that - a client only. It does not include the database engine.

To create a database you have to install the server. The server includes the client portions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM