View previous topic :: View next topic |
Author |
Message |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Fri Oct 21, 2005 7:53 am Post subject: sample db2 test tables needed |
|
|
Hi all,
I am basically trying to set up a DB2 sample database for testing my application to run some queries.Can anyone provide me the links to sample tables descriptive with all keys declared where in i can feed data with all key contraints so that my testing of queries is done ? |
|
Back to top |
|
 |
haqshaik Beginner
Joined: 11 May 2005 Posts: 49 Topics: 19
|
Posted: Fri Oct 21, 2005 9:50 am Post subject: |
|
|
Shekar,
Run the query against the system catalog tables and you will get the definitions of the default tables. Once you get the table names, You can play around with them.
Hope this will be helpful.
Regards,
Salauddin |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Fri Oct 21, 2005 12:50 pm Post subject: sample db2 test tables needed |
|
|
haqshaik,
Thanks for your reply.Basically i am looking out to start from the scratch to create tables ,indexes,primary keys,foreign keys ,inserting values views,synonyms,allias and then with queries to play around.I need the link to create sample tables from the scratch and test data to insert which will be helpful for me.
Thanks
Shekar123 |
|
Back to top |
|
 |
haqshaik Beginner
Joined: 11 May 2005 Posts: 49 Topics: 19
|
Posted: Fri Oct 21, 2005 1:46 pm Post subject: |
|
|
Shekar,
The following steps needs to be done.
1) Creaion of a data base
2) Creation of a schema to logically group the tables.
3) Creation of a table space.
As you are authorised to create the tables, your id will be associated to a group and that group will become your shcema or if you do not know set the sqlid to your userid. What ever the tables you create will have the owner as your userid.
SET CURRENT SQLID = 'xxxxxx' --> Schema Name
CREATE
TABLESPACE XXXXXX ---> Table Sapce name
IN YYYYYY ----> Database name
USING STOGROUP zzzzzzzz --> Stogroup Name
PRIQTY aa ---> Space unit in KB
SECQTY 720 --> Space unit in KB
PCTFREE 0
LOCKSIZE ANY
BUFFERPOOL BP3
SEGSIZE 32
COMPRESS YES
CLOSE NO;
COMMIT;
5) Create table statement
CREATE TABLE table name(
col1 datatyp
PRIMARY KEY (coloumn name)
)
IN database.tablespace;
6) Creation of Index
CREATE UNIQUE INDEX index name ON table name
(
col1 ASC/DSC
)
USING STOGROUP zzzzzzz
PRIQTY aa
SECQTY bb
PCTFREE 0
CLUSTER
DEFER YES
BUFFERPOOL BP3
CLOSE NO ;
COMMIT;
if you search for stogrouo creation and database creation you can get the same from IBM manuals.
Hope this will be helpful.
Regards,
Salauddin |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sat Oct 22, 2005 7:44 am Post subject: |
|
|
haqshaik,
Shekhar does not have authority to create tables. He was inquiring if he can use some trial software to create tables and play around with them.
Shekhar123,
Try DB2 UDB Personal Edition . It is free and can be downloaded. Click the "trails and betas" link on the left in the below link
http://www-306.ibm.com/software/data/db2/udb/edition-pe.html
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Sat Oct 22, 2005 12:05 pm Post subject: db2 sample database needed |
|
|
Thanks Kolusu,
I am able to download the sample database and i am finding it really helpful for my practise purpose.The contents of the database are described very clearly and it is very useful and informative.Thanks once again .
Shekar123 |
|
Back to top |
|
 |
|
|