Documente Academic
Documente Profesional
Documente Cultură
Table of contents
Step
Step
Step
Step
Step
Step
0
1
2
3
4
5
How
How
How
How
How
How
to
to
to
to
to
to
Step 0 How to begin and what you need to know before you start ?
A printable copy of this experiment in pdf format is available here (www.uow.edu.au/~jrg/317/HOMEWORK/
e1-7.pdf).
At the beginning, dowload and uncompress SQL scripts in tar.gz format (www.uow.edu.au/~jrg/317/
HOMEWORK/home1.tar.gz) or scripts in zip format (www.uow.edu.au/~jrg/317/HOMEWORK/home1.zip)
used in this homework.
In this experiment we show how to create TPC-H benchmark database on your installation of Oracle 12c server at
home. The benchmark database has been already created on all data-pc.. servers (Win 7 based servers) located
at the database lab. Therefore, there is no need to do it again. You can connect as a users CSCI317 with a
password csci317 to any Oracle 12c database servers located in the database lab. The user CSCI317 owns TPC-H
benchmark database. You can use the links listed in the References to find more information about Transaction
Processing Council and about TPC-H benchmark database.
Step 2 How to create CSCI317 user that owns the relational tables ?
Next, you have to create a user that owns the sample database. While connected as a user SYSTEM execute the
following statements to create a user CSCI317 with a password csci317.
Step 5 How to discover the structures and contents of the relational tables ?
The benchmark database is frequently used in the remaining experiments. This is why, it is important to understand
a schema of the database and its contents.
Connect as a user CSCI317.
To list the names of all tables owned by the user create and execute a script list.sql (www.uow.edu.au/~jrg/
317/HOMEWORK/list.sql).
To list the descriptions of attributes and consistency constraints valid in a given table create and execute a script
tlist.sql (www.uow.edu.au/~jrg/317/HOMEWORK/tlist.sql).
To list all consistency constraints valid in all relational tables create and execute a script clist.sql (www.uow.
edu.au/~jrg/317/HOMEWORK/clist.sql).
A conceptual schema (a simplified UML class diagram) of TPC-H benchmark database can be found here (www.
uow.edu.au/~jrg/317/HOMEWORK/tpch.pdf).
To find the total number of rows in each of the relational tables execute a script dbcount.sql (www.uow.edu.
au/~jrg/317/HOMEWORK/dbcount.sql).
It is not recommended to SELECT * from the tables ! The tables are pretty large and listing of all rows will take
loooooooooong time. For example, to list the first 10 rows from a table LINEITEM execute a statement
SELECT *
FROM LINEITEM
WHERE rownum <= 10;
To list the rows between row number 10 and row number 20 and including row 10 and 20 execute a statement
SELECT *
FROM LINEITEM
WHERE rownum <= 20
MINUS
SELECT *
FROM LINEITEM
WHERE rownum < 10
References
Transaction Processing Council (TPC) Web site
(http://www.tpc.org/)
TPC-H benchmark database
(http://www.tpc.org/tpch/default.asp)