lab4
lab4
Oracle DBMS
OBJECTIVES:
ORACLE provides a centralized structure (the data dictionary) containing the description of all the objects (tables, views, users, etc.) managed
by this DBMS. This dictionary brings together all the necessary information for the working of the DBMS .It has the particularity of being itself
organized as a database (here we are talking about meta-base) and therefore being directly accessible through SQL. For reasons of integrity,
most of the tables in the dictionary cannot be modified by users (only the administrator of theSYSdatabase has access to them). On the other
hand, access to the content of the tables is generally authorized, which allow to sparsely explore the dictionary and better understand this
essential data structure to the DBMS. The tables of the dictionary are usually encrypted;however, their content is accessible through views.
There are mainly four types of view:
o Views related to a user's objects: USER_*
o Views related to objects accessible to a user.: ALL_*
o Admin Views: DBA_*
o Dynamic performance Views:V$*
During this lab, we will mainly focus on ALL and USER type views. To guide you in your work, you will find in the following table all the views of
the Oracle data dictionary of type USER.
Questions:
Connect to the database (the tables are already created during the previous labs);
1. Connect as« System ». List the “DICT” catalog. How many instances does it contain? Give its structure?
2. Give the role and structure of the following tables (or views): ALL_TAB_COLUMNS, USER_USERS, ALL_CONSTRAINTS and USER_TAB_PRIVS.
3. Find the username you are connected with.
4. Compare the structure and content of ALL_TAB_COLUMNS and USER_TAB_COLUMNS tables.
5. Check that the tables created during the previous lab were created. Give all the information on these tables.
6. List the tables of the "system" user and those of the DBASchool user (the Lab 1 user).
7. Give the description of the attributes of the STUDENT and ENROLMENT tables (use the USER_TAB_COLUMNS table).
8. How can we verify that there is a foreign key reference between the tables EXAM and COURSE?
9. Give all the constraints created during the previous lab and the information that characterizes them (use the USER_CONSTRAINTS table);
10. Find all the information needed to recreate the EXAM_RESULT table.
11. Find all privileges granted to Admin.
12. Find the roles given to Admin.
13. Find all objects belonging to Admin.
14. The administrator is looking for the owner of the EXAM_RESULT table, how can he find it?
15. Give the size of the EXAM_RESULT table in KB.
16. Check the effect produced by each of the previous lab’s data definition commands on the dictionary.