Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2010
    Posts
    33

    Unanswered: 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..

  2. #2
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    tempe, as you stated, the database name is limited to 8 characters. There is no way around this in DB2.

  3. #3
    Join Date
    Oct 2010
    Posts
    33

    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..

  4. #4
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    ... 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).

  5. #5
    Join Date
    Oct 2010
    Posts
    33
    thanks for the reply

    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

  6. #6
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    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.

  7. #7
    Join Date
    Oct 2004
    Location
    DELHI INDIA
    Posts
    338
    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

  8. #8
    Join Date
    Oct 2010
    Posts
    33
    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..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •