Results 1 to 3 of 3

Thread: DB2 Schema

  1. #1
    Join Date
    Mar 2008
    Posts
    4

    Question Unanswered: DB2 Schema

    Dear Techies ,

    I have created own database in DB2 , and i have imported my DB Scripts ,

    while accessing the table called name , the schema is Administrator.name like that taking (default system username), as per my requirement, DB2.name like this it
    should be , So how to change the schema of the whole database (not one table) ....

    plz help me ,

    Thanks in advance ..

    Thangavel.L

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    The RENAME statement doesn't help you, so you may have a chance to use the ALTER_OBJ procedure. Other than that, you could work-around this issue with aliases, or you have to re-create all objects.

    p.s: In standard SQL (and also DB2), all table names are comprised of a qualifier - the schema name - and an unqualified table name. It seems that you ignored that during table creation. My recommendation is usually to always fully qualify all database objects when using them (except built-in functions) to avoid such problems.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Put the following in front of your sql script used to create the schema:

    set schema db2;
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

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