| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |

01-16-08, 19:13
|
|
Registered User
|
|
Join Date: Jan 2008
Posts: 4
|
|
|
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
|
|

01-17-08, 08:05
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,575
|
|
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
|
|

01-17-08, 21:44
|
|
Registered User
|
|
Join Date: Jan 2008
Posts: 4
|
|
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.
|
|

01-17-08, 22:23
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,575
|
|
|
|

01-19-08, 13:31
|
|
Registered User
|
|
Join Date: Jan 2008
Posts: 4
|
|
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
|
|

01-21-08, 08:05
|
|
Registered User
|
|
Join Date: Jan 2003
Posts: 3,575
|
|
Setting up users and password is accomplished through the OS. Please read the manuals.
Andy
|
|

09-30-09, 09:44
|
|
Registered User
|
|
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
|
|
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 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
|
|

09-30-09, 11:41
|
|
Registered User
|
|
Join Date: Nov 2005
Location: IL
Posts: 554
|
|
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.1.0.2 os 5.3.0.0
|
|

09-30-09, 13:15
|
|
Registered User
|
|
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
|
|
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 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|