Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2012
    Posts
    177

    Unanswered: How to rename the schema name?

    Hi all,

    In our setup db2 v9.7 with fixpack 4

    Under db2inst1 we have 2 databases.

    Database with the name to TIS contains 150 tables it's having schema with name of "db2DWH"

    Issue:
    =====

    Java peoples are not able to call the stored procedure by using this schema name "db2DWH"

    They are asking to rename the schema name by "DB2DWH"

    create schema with the name "DB2DWH"

    db2 create schema DB2DWH

    When i tried ADMIN_COPY_SCHEMA"
    ============================

    db2 "call SYSPROC.ADMIN_COPY_SCHEMA ('db2DWH','DB2DWH','COPY', NULL, NULL, NULL, 'COPYSCHEMA', 'COPYERROR')"

    The parameter mode OUT or INOUT is not valid for a parameter in the routine named "ADMIN_COPY_SCHEMA" with specific name "ADMIN_COPY_SCHEMA" (parameter number "7", name "ERRORTABSCHEMA").. SQLCODE=-469, SQLSTATE=42886, DRIVER=4.12.79


    Create the schema with the name of "DB2DWH"

    The name of the object to be created is identical to the existing name "DB2DWH" of type "SCHEMA".. SQLCODE=-601, SQLSTATE=42710, DRIVER=4.12.79

    How to create the schema?


    Thanks,
    laxman..

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You are either going to have to have the java programmers use CALL "db2DWH"."MyProcedure"(...), or use db2move to "Change" the table schema to case insensitive.

    Andy

  3. #3
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Or you can create an alias, something like:

    > db2 "create table \"db2DWH\"."testit" (c1 int)"
    DB20000I The SQL command completed successfully.

    > db2 "create alias db2dwh.testit for \"db2DWH\"."testit""
    DB20000I The SQL command completed successfully.

    > db2 list tables for all | grep -i testit
    TESTIT DB2DWH A 2012-11-06-13.05.47.711586
    TESTIT db2DWH T 2012-11-06-13.05.16.770228

  4. #4
    Join Date
    Sep 2012
    Posts
    177
    Hi ,

    Thanks for your kind reply.

    I am new for db2, Schema contains 150 tables, people who are asking no need to change the database name...

    I had gone through the db2move command, it's for move the schema to some other database..

    How to I change the schema name without move to some other database?

    Thanks,
    laxman..

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You could use db2look and then LOAD FROM CURSOR to do the work also. The alias option looks like it might work with little down time.

    Andy

Posting Permissions

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