Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59

    Red face Unanswered: Changing the schema name

    Hi all,
    I would be highly obliged if anyone knows how to change the schema name of an existing table to a new name. I have searched on the web but to no avail. Or if there is any other way around. My java aplication does not use schema qualifier and as a result the table name gets prefixed with the defualt schema name which is the instance name/ userid.
    Suppose by instance name is db2inst2. And I have restored a database to this instance using a image of another instance name db2inst1.
    The instance db2inst2 now has the tables with schema name as db2inst1
    My java application does not use the schema qualifier and as a result all the tables in the db2inst2 instance get prefixed with db2inst2 schema name which is the default. I am running 2 instances on the same server.
    How do i get around this problem.

    any insight will be appreciated.

    rgds
    brat.

  2. #2
    Join Date
    Sep 2002
    Posts
    456

    Re: Changing the schema name

    Create alias for each table with the schema you want. Nice and easy....

    dollar

    Originally posted by brat4
    Hi all,
    I would be highly obliged if anyone knows how to change the schema name of an existing table to a new name. I have searched on the web but to no avail. Or if there is any other way around. My java aplication does not use schema qualifier and as a result the table name gets prefixed with the defualt schema name which is the instance name/ userid.
    Suppose by instance name is db2inst2. And I have restored a database to this instance using a image of another instance name db2inst1.
    The instance db2inst2 now has the tables with schema name as db2inst1
    My java application does not use the schema qualifier and as a result all the tables in the db2inst2 instance get prefixed with db2inst2 schema name which is the default. I am running 2 instances on the same server.
    How do i get around this problem.

    any insight will be appreciated.

    rgds
    brat.

  3. #3
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59

    Thumbs up Re: Changing the schema name

    Thanks really helped with the tables but unfortunately i still do have a problem with the triggers and stored procedures.

    rgds
    brat.



    Originally posted by dollar489
    Create alias for each table with the schema you want. Nice and easy....

    dollar
    Last edited by brat4; 04-25-03 at 05:55.

  4. #4
    Join Date
    Jul 2002
    Location
    ATL
    Posts
    170

    Re: Changing the schema name

    Try to execute the command from your java code

    set schema schemaname

    Originally posted by brat4
    Hi all,
    I would be highly obliged if anyone knows how to change the schema name of an existing table to a new name. I have searched on the web but to no avail. Or if there is any other way around. My java aplication does not use schema qualifier and as a result the table name gets prefixed with the defualt schema name which is the instance name/ userid.
    Suppose by instance name is db2inst2. And I have restored a database to this instance using a image of another instance name db2inst1.
    The instance db2inst2 now has the tables with schema name as db2inst1
    My java application does not use the schema qualifier and as a result all the tables in the db2inst2 instance get prefixed with db2inst2 schema name which is the default. I am running 2 instances on the same server.
    How do i get around this problem.

    any insight will be appreciated.

    rgds
    brat.

  5. #5
    Join Date
    Jul 2002
    Location
    ATL
    Posts
    170

    Re: Changing the schema name

    The best way to get away with this problem is you should login with user id same as Schema name.
    or you should execute the command "set schema schemaname" from your java code.


    Originally posted by brat4
    Hi all,
    I would be highly obliged if anyone knows how to change the schema name of an existing table to a new name. I have searched on the web but to no avail. Or if there is any other way around. My java aplication does not use schema qualifier and as a result the table name gets prefixed with the defualt schema name which is the instance name/ userid.
    Suppose by instance name is db2inst2. And I have restored a database to this instance using a image of another instance name db2inst1.
    The instance db2inst2 now has the tables with schema name as db2inst1
    My java application does not use the schema qualifier and as a result all the tables in the db2inst2 instance get prefixed with db2inst2 schema name which is the default. I am running 2 instances on the same server.
    How do i get around this problem.

    any insight will be appreciated.

    rgds
    brat.

Posting Permissions

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