Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2008
    Posts
    4

    Unanswered: How to Create schema and execute DDLs

    Hello Everyone,

    I am very new to DB2.

    1) I have installed DB2 server Personal edition only in my system.

    2) I have a set of DDLs in a file(app_ddl.txt size: 200 KB) that starts with

    create schema XXXX
    ...
    ...
    create table XXXX.YYYY(......)
    ...
    create table XXXX.AAAA(......)
    ...
    ...
    create view XXXX.ZZZZ..... (blah..blah..blah)

    3) Now I need to have the above database schema in my system using the "app_ddl.txt".

    Please help me providing the steps(right from start after installation) for the setting up the DB asap.

    Thanks in Advance,

    Anand

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    1) create the database (see the CREATE DATABASE command)--If you have not already.
    2) Bring up DB2 command window and Connect to the database
    3) run db2 -tvsf app_ddl.txt


    Andy

  3. #3
    Join Date
    Jan 2008
    Posts
    4

    Smile How to connect to the database?

    Thanks Dude!

    How to connect to the database? I don't think, I have given any passwords other than admin username and admin pwd...

    Help me out.

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    What DB2 version and OS?

    Start here:
    http://publib.boulder.ibm.com/infoce...n/c0006305.htm

    Andy

  5. #5
    Join Date
    Jan 2008
    Posts
    4

    Smile DB2 9.5 and Windows XP

    DB2 9.5 and Windows XP

    Also that, I will be moving soon to Windows NT box as well

    Please let me know, how to ahead in the above two instances...

    Thanks in Advance.

    -Anand

  6. #6
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Setting up users and password is accomplished through the OS. Please read the manuals.

    Andy

  7. #7
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399
    Quote Originally Posted by sanandkannan
    Hello Everyone,

    I am very new to DB2.

    1) I have installed DB2 server Personal edition only in my system.

    2) I have a set of DDLs in a file(app_ddl.txt size: 200 KB) that starts with

    create schema XXXX
    ...
    ...
    create table XXXX.YYYY(......)
    ...
    create table XXXX.AAAA(......)
    ...
    ...
    create view XXXX.ZZZZ..... (blah..blah..blah)

    3) Now I need to have the above database schema in my system using the "app_ddl.txt".

    Please help me providing the steps(right from start after installation) for the setting up the DB asap.

    Thanks in Advance,
    Anand
    no need to create schema. if it does not exist yet, it will be created implicitly when you create a table
    DB2 9.5/9.7 on Unix/AIX 6.1/Linux

  8. #8
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    Not sure why you have resurrected an old thread, but now that you did...

    Yes, you are correct. Schema will be created once you issue "Create table.." statement. However, you have to be aware of that when you do so, DB2 by default will grant CREATEIN on this schema to Public.

    Where is if you define schema first and then build table, then access on this schema is restricted to your ID only unless you grant access to others.

    Not sure about you, but there are two things that I see problematic with letting Db2 create schema.

    1. Access is granted to Public by default
    2. I, DBA, now have lost all control on the schema that I support.
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

  9. #9
    Join Date
    Dec 2008
    Location
    Toronto, Canada
    Posts
    399
    Quote Originally Posted by Cougar8000
    Not sure why you have resurrected an old thread, but now that you did...

    Yes, you are correct. Schema will be created once you issue "Create table.." statement. However, you have to be aware of that when you do so, DB2 by default will grant CREATEIN on this schema to Public.

    Where is if you define schema first and then build table, then access on this schema is restricted to your ID only unless you grant access to others.

    Not sure about you, but there are two things that I see problematic with letting Db2 create schema.

    1. Access is granted to Public by default
    2. I, DBA, now have lost all control on the schema that I support.
    thank you. It's good to know this...
    DB2 9.5/9.7 on Unix/AIX 6.1/Linux

Posting Permissions

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