Search code examples
db2db2-luw

unable to create new database in DB2 11


I am using Data Studio 4.1.0.1 and DB2 Version 11.

When i try to create a new DB, I am getting instance not valid error, which however should not be the case, because i can see the instance name in the environment variables, and I am giving the correct name.

Also the instances are running which, the list of valid instances taken from output of db2ilist.exe command

Tried executing via command line..

CREATE DATABASE RD_TEST AUTOMATIC STORAGE YES ON 'C:\' DBPATH ON 'C:\' USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM PAGESIZE 8192;

geting error as unexpected token "8192".

How can I create a new DB? is a different version of DS is required for DB2v11?


Solution

  • If you are running that command in the db2cmd.exe window (the window started by db2cwadmin.bat), then you must omit the trailing semicolon. So your full command line would look like:

    db2 CREATE DATABASE RD_TEST AUTOMATIC STORAGE YES ON 'C:\' DBPATH ON 'C:\' USING CODESET UTF-8 TERRITORY US COLLATE USING SYSTEM PAGESIZE 8192
    

    As a separate matter, with Db2-LUW it is wise to ensure you are always on the latest build of IBM Data Studio. But that is unrelated to the operation of commands in the regular db2cmd.exe window.