If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 database naming over 8 characters

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-02-10, 13:28
tempe tempe is offline
Registered User
 
Join Date: Oct 2010
Posts: 27
DB2 database naming over 8 characters

Hello..

I want to create database with name over than 8 characters...
as i know the limit of database naming in db2 is limited to 8 char only..

is there any other way to create database with name more than 8 char..

thanks..
Reply With Quote
  #2 (permalink)  
Old 10-02-10, 13:53
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
tempe, as you stated, the database name is limited to 8 characters. There is no way around this in DB2.
Reply With Quote
  #3 (permalink)  
Old 10-02-10, 13:59
tempe tempe is offline
Registered User
 
Join Date: Oct 2010
Posts: 27
gpt ladvis

thanks for quick reply..

is this limitation only for db2?

i kinda heard about map the database name(below 8 chars) to other name(8 chars above) on a table, but not really sure about that..
Reply With Quote
  #4 (permalink)  
Old 10-03-10, 14:28
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Quote:
... map the database name(below 8 chars) to other name(8 chars above) on a table, ...
Usually databese name is not used on a table name in DB2, except in CREATE NICKNAME statement for a table on a remote database.

I guessed that you might want to create a database for each application like in MS(or Sybase) SQL Server.
If so, that design strategy(or "design policy"?) is not usual in DB2 and schema may be used for that purpose in DB2(I think same in Oracle).
Reply With Quote
  #5 (permalink)  
Old 10-03-10, 21:36
tempe tempe is offline
Registered User
 
Join Date: Oct 2010
Posts: 27
thanks for the reply

Quote:
HTML Code:
[HTML]Usually database name is not used on a table name in DB2, except in CREATE NICKNAME statement for a table on a remote database.
[/HTML]
sorry i can't understand what you mean by this

i want to create databases to store document with version and the doc name on it..
as example.. document A version 2 revision 1
so i guess my db name would be like..
documentA_version2_revision1
Reply With Quote
  #6 (permalink)  
Old 10-04-10, 01:20
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
Quote:
i want to create databases to store document with version and the doc name on it..
as example.. document A version 2 revision 1
so i guess my db name would be like..
documentA_version2_revision1
sorry i can't understand what you mean by this

You may want to create a table to store documents.
The DDL of the table might be ...
Code:
CREATE TABLE your_schema.document
( doc_id   INTEGER  NOT NULL
, doc_name VARCHAR(100) NOT NULL
, version  SMALLINT NOT NULL DEFAULT 1
, revision SMALLINT NOT NULL DEFAULT 1
, contents_summary VARCHAR(200)
, text     CLOB
, ...
, PRIMARY KEY (doc_id , version , revision)
)
and store a codument to the table by:
INSERT INTO your_schema.document
VALUES (1 , 'A' , 2 , 1 , '...' , ...)

or normalize the table to document_base table and document_revision table, or more tables.
Reply With Quote
  #7 (permalink)  
Old 10-04-10, 11:00
JAYANTA_DATTA JAYANTA_DATTA is offline
Registered User
 
Join Date: Oct 2004
Location: DELHI INDIA
Posts: 336
you can create a Database Name beyond 8 characters and it's very much possible though DB2 doesn't allow it internally. You need to create modules on your operating systems with DB2 and the module code ( you can write in Shell, perl ) will intelligently route a Long Database Name to a smaller ( 8 char long) database name while making the actual connection. Consider, you create a database with name "DBPROD01" and with the help of your module, you map this database to a more logical name "NY_PD_SALES_01". So your application DBAs find it more easy to remember the name "NY_PD_SALES_01" and they will call the module while connecting to DB2, and then will submit something like "DB4 " connect to NY_PD_SALES_01". This "DB4" argument intelligently will route the NY_PD_SALES_01 to "DBPROD01" while passing the connection request.

You may discuss it further with your coder (on AIX/Unix) to see whether they find it feasible. We executed this in our environment and it worked.
__________________

Jayanta Datta
DB2 UDB DBA
IBM India, Global Delivery
New Delhi
Reply With Quote
  #8 (permalink)  
Old 10-04-10, 20:05
tempe tempe is offline
Registered User
 
Join Date: Oct 2010
Posts: 27
thank you very much JAYANTA_DATTA.. youre the man.

i can see a little hope here..
it will be grateful if you can explain it little more detail or post links for tutorial
sorry.. i'm a new to DB2..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On