 |
Forums |
Admin Start New Thread
By: Liu Kaige
RE: Fail to create database using IBM_DB.createDB [ reply ] 2013-03-12 05:14
|
Hi Praveen,
I have used the method you suggested, and this is the error info.
test.rb:29:in `create_database': Failed to connect to server due to: uncaught throw `Connection failed: [IBM][CLI Driver] SQL1097N The node name was not found in the node directory. SQLSTATE=42720 SQLCODE=-1097' (RuntimeError)
connection string:
DRIVER={IBM DB2 ODBC DRIVER};ATTACH=true;UID=db2inst1;PWD=passw0rd;
By the way, this method works in Windows XP, but failed in Ubuntu.
Thanks for your help!
|
By: Praveen Devarao
RE: Fail to create database using IBM_DB.createDB [ reply ] 2013-03-12 04:35
|
Hi Liu,
Kindly specify only ATTACH=true along with username/password when trying to create database locally. This error is seen because there is catalog of database being created twice and the catalog fails the second time and the error is flagged.
We have a defect looged for this and would be fixed in upcoming versions.
Until the fix kindly use the workaround mentioned above of just specifying ATTACH=true when trying to create a database locally.
Thanks
Praveen
|
By: Liu Kaige
Fail to create database using IBM_DB.createDB [ reply ] 2013-03-12 02:45
|
When I use IBM_DB.createDB to create a database, I met a error.
ERROR DETAIL:
test.rb:44:in `create_database': Could not create Database due to: [IBM][CLI Driver][DB2/LINUXX8664] SQL1005N The database alias "TEST8" already exists in either the local database directory or system database directory. SQLCODE=-1005 (RuntimeError)
ENVIROMENT:
OS:ubuntu12.04 X86_64
DB2:V9.7fp4
ruby: 1.8.7
MY CODE:
connectStr = 'DRIVER={IBM DB2 ODBC DRIVER};ATTACH=true;HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;UID=db2inst1;PWD=password;'
createConn = IBM_DB.connect(connectStr,'','')
IBM_DB.createDB(createConn,'TEST8',nil,nil)
The error shows that there is already exits a database called TEST8 in my DB2. In fact, DB2 didn't have a TEST8 db, further more, after executing createDB method, TEST8 was created, but it can't be connected with a error :
SQL1035N The database is currently in use. SQLSTATE=57019
|
|
 |