vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| "Moritz Utzsch" <mofutz@gmx.de> wrote in message news:u75iov8un13fgf17r8g2c2eesjh4r6f3fb@4ax.com... > 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 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 A wrote: >There is a command called Create Database, but it is not SQL. Check out the >Command Reference manual. 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 |
| |||
| 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: > 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 -- Pierre Saint-Jacques IBM DB2 Cerified Solutions Expert - Administration SES Consultants Inc. |
| |||
| Only on z/OS. For UDB, CREATE DATABASE is a command, not a SQL statement. I do not know why. "Moritz Utzsch" <mofutz@gmx.de> wrote in message news:u75iov8un13fgf17r8g2c2eesjh4r6f3fb@4ax.com... > 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 |
| |||
| "Mark Yudkin" <myudkinATcompuserveDOTcom@nospam.org> wrote in message news:bmdigf$508$1@ngspool-d02.news.aol.com... > Only on z/OS. For UDB, CREATE DATABASE is a command, not a SQL statement. I > do not know why. 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 blows a fuse, I said "more like" and not "the same as." |
| |||
| 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: > Mark A wrote: > > >>There is a command called Create Database, but it is not SQL. Check out the >>Command Reference manual. > > > 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 |
| |||
| 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" <ma@switchboard.net> wrote in message news:Tesib.1707$bY6.89613@news.uswest.net... > "Mark Yudkin" <myudkinATcompuserveDOTcom@nospam.org> wrote in message > news:bmdigf$508$1@ngspool-d02.news.aol.com... > > Only on z/OS. For UDB, CREATE DATABASE is a command, not a SQL statement. > I > > do not know why. > > 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 blows a fuse, I said "more like" and not "the same as." > > |
| |||
| > "Mark A" <ma@switchboard.net> wrote in message > news:Tesib.1707$bY6.89613@news.uswest.net... > > "Mark Yudkin" <myudkinATcompuserveDOTcom@nospam.org> wrote in message > > news:bmdigf$508$1@ngspool-d02.news.aol.com... > > > Only on z/OS. For UDB, CREATE DATABASE is a command, not a SQL > statement. > > I > > > do not know why. > > > > 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 blows a fuse, I said "more like" and not "the same as." > > "Mark Yudkin" <myudkinATcompuserveDOTcom@nospam.org> wrote in message news:bmis0p$cba$1@ngspool-d02.news.aol.com... > 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. 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). |
| ||||
| 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" <ma@switchboard.net> wrote in message news:j47jb.640$sA4.52401@news.uswest.net... > > "Mark A" <ma@switchboard.net> wrote in message > > news:Tesib.1707$bY6.89613@news.uswest.net... > > > "Mark Yudkin" <myudkinATcompuserveDOTcom@nospam.org> wrote in message > > > news:bmdigf$508$1@ngspool-d02.news.aol.com... > > > > Only on z/OS. For UDB, CREATE DATABASE is a command, not a SQL > > statement. > > > I > > > > do not know why. > > > > > > 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 blows a fuse, I said "more like" and not "the same as." > > > > "Mark Yudkin" <myudkinATcompuserveDOTcom@nospam.org> wrote in message > news:bmis0p$cba$1@ngspool-d02.news.aol.com... > > 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. > > 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). > > > > |