Professional Web Applications Themes

DB2 v7.1 create Database via SQL? - IBM DB2

Hi NG! Is there a way to create a new database in DB2 v7.1 via SQL like in mysql: "CREATE DATABASE foobar;"? best regards, Moritz...

  1. #1

    Default DB2 v7.1 create Database via SQL?

    Hi NG!

    Is there a way to create a new database in DB2 v7.1 via SQL like in
    mysql: "CREATE DATABASE foobar;"?

    best regards,

    Moritz
    Moritz Guest

  2. #2

    Default Re: DB2 v7.1 create Database via SQL?

    "Moritz Utzsch" <de> wrote in message
    news:com... 

    There is a command called Create Database, but it is not SQL. Check out the
    Command Reference manual. You can download manuals here:
    www-3.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v8pubs.d2w/en_m
    ain
    caution--this link may split onto 2 lines


    Mark Guest

  3. #3

    Default Re: DB2 v7.1 create Database via SQL?

    Mark A wrote:
     

    Thanks, I try this one.

    It doesn't matter, wether it's SQL or not, but it should work via an
    java-application and jdbc 2.0.

    Regards,

    Moritz
    Moritz Guest

  4. #4

    Default Re: DB2 v7.1 create Database via SQL?

    Yes. Look at your command Ref. in the online books:
    CREATE DB foobar

    By default, the pathe/drive where the db will go is the default
    oppath/drive where the instance directory is.
    By default, also, this instance directory will be created in the
    path/drive where DB2 was installed (SQLLIB).
    Assume on Windows, you installed DB2 on the F: drive, then:
    DB2 is at F:\Program Files\SQLLIB
    Instance is at: F:\Program Files\SQLLIB\instname
    The DB will be at:
    F:\instname\NODE0000\SQL00001

    HTH, Pierre.
    Moritz Utzsch wrote: 

    --
    Pierre Saint-Jacques
    IBM DB2 Cerified Solutions Expert - Administration
    SES Consultants Inc.

    P. Guest

  5. #5

    Default Re: DB2 v7.1 create Database via SQL?

    Only on z/OS. For UDB, CREATE DATABASE is a command, not a SQL statement. I
    do not know why.
    "Moritz Utzsch" <de> wrote in message
    news:com... 


    Mark Guest

  6. #6

    Default Re: DB2 v7.1 create Database via SQL?

    "Mark Yudkin" <org> wrote in message
    news:bmdigf$508$news.aol.com... 


    A database in DB2 for z/OS and OS/390 is totally different than a database
    in DB2 for Windows, Unix, and Linux.

    A database is in DB2 for Windows, Unix, and Linux is "more like" a DB2
    Subsystem in DB2 for z/OS and OS/390.

    A database in DB2 for z/OS and OS/390 is "more like" a schema in DB2 for
    Windows, Unix, and Linux.

    Before anyone s a fuse, I said "more like" and not "the same as."


    Mark Guest

  7. #7

    Default Re: DB2 v7.1 create Database via SQL?

    It's a C api call...you could access it via JNI if you need to drive it
    through a Java app.

    Moritz Utzsch wrote:
     
    >
    >
    > Thanks, I try this one.
    >
    > It doesn't matter, wether it's SQL or not, but it should work via an
    > java-application and jdbc 2.0.
    >
    > Regards,
    >
    > Moritz[/ref]

    Sean Guest

  8. #8

    Default Re: DB2 v7.1 create Database via SQL?

    IMHO, "more like" is still a wild overstatement.

    A database in DB2 UDB is "nothing like" a DB2 subsystem in DB2 for z/OS. A
    DB2 for z/OS subsystem is "more like" a DB2 instance in DB2 UDB.

    Schemas in z/OS and UDB are almost "the same" - they are the object owner in
    both cases. One does not "connect" to a schema in either system, one
    connects to databases.

    "Mark A" <net> wrote in message
    news:Tesib.1707$uswest.net... [/ref]
    statement. 
    >
    > A database in DB2 for z/OS and OS/390 is totally different than a database
    > in DB2 for Windows, Unix, and Linux.
    >
    > A database is in DB2 for Windows, Unix, and Linux is "more like" a DB2
    > Subsystem in DB2 for z/OS and OS/390.
    >
    > A database in DB2 for z/OS and OS/390 is "more like" a schema in DB2 for
    > Windows, Unix, and Linux.
    >
    > Before anyone s a fuse, I said "more like" and not "the same as."
    >
    >[/ref]


    Mark Guest

  9. #9

    Default Re: DB2 v7.1 create Database via SQL?

    > "Mark A" <net> wrote in message [/ref]
    > statement. 
    > >
    > > A database in DB2 for z/OS and OS/390 is totally different than a[/ref][/ref]
    database [/ref]
    "Mark Yudkin" <org> wrote in message
    news:bmis0p$cba$news.aol.com... 
    in 

    I never said that one connects to a schema. In DB2 for OS/390 you connect to
    a DB2 sub-system. In DB2 for Linux, Unix, and Windows you connect to a
    database. A DB2 for Linux, Unix, and Windows database has its own system
    catalog, just like a DB2 for OS/390 subsystem. That is why I said (among
    many other reasons) that a DB2 for Linux, Unix, and Windows database is
    closest to a DB2 for OS/390 sub-system. I think you misread my statement.

    The term database in DB2 for OS/390 has a totally different meaning.
    Creating a database in DB2 for OS/390 is an administrative grouping of
    objects (sort of like a schema), which is why it is an SQL statement (to
    answer your original question).

    A DB2 OS/390 installation can have multiple sub-systems. All sub-systems in
    that installation share the same DB2 code.

    A DB2 for Linux, Unix, and Windows instance can have multiple databases. All
    databases in the instance share the same DB2 code.

    The IBM developers who created the original DB2 for Linux, Unix, and Windows
    (which was first released as OS/2 Database Manager) paid little attention of
    DB2 mainframe conventions other than DML (but even that was not completely
    compatible). At that time, the OS/2 Database development team reported up
    through OS/2 development and had relatively little interface with Santa
    Teresa. Customers who wanted to develop mainframe applications on PC's using
    Micro-Focus Cobol where told by IBM to use XDB (a DB2 mainframe compatible
    database that ran on PC's).




    Mark Guest

  10. #10

    Default Re: DB2 v7.1 create Database via SQL?

    We can definitely agree with the last paragraph - it's a continual source of
    annoyance (BTW even the DML has multiple gratuitous differences).

    I know that a database on MVS is a pure administrative entity, unlike UDB
    where it's a connection target.

    For the rest, we'll have to agree to differ.

    "Mark A" <net> wrote in message
    news:j47jb.640$uswest.net... 
    > > statement. [/ref]
    > database [/ref][/ref]
    for [/ref]
    > "Mark Yudkin" <org> wrote in message
    > news:bmis0p$cba$news.aol.com... [/ref]
    A [/ref]
    owner 
    >
    > I never said that one connects to a schema. In DB2 for OS/390 you connect[/ref]
    to 
    in 
    All 
    Windows 
    of 
    using 


    Mark Guest

Similar Threads

  1. Create Database
    By lh83 in forum Coldfusion Database Access
    Replies: 0
    Last Post: February 8th, 08:15 AM
  2. Create Database Connection
    By backpages in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: December 23rd, 06:45 PM
  3. Create a Report from a Database
    By cavagnaro in forum Macromedia Dreamweaver
    Replies: 1
    Last Post: July 10th, 12:12 AM
  4. Create 9.2.0 database manually
    By santosh in forum Oracle Server
    Replies: 4
    Last Post: January 6th, 03:20 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139