You are on page 1of 7

NAME :- M.

SHAFAY ENROLLMENT NO :- 02-235192-046


Department of Computer Science
ITC-327: Database Administration & Management
BSIT- Semester 7 Section A (Fall 2022)

ASSIGNMENT 03
Complex Computing Problem

Marks: 10

Instructions

1. Students will perform this assignment individually.


2. Assignment should be uploaded on LMS
3. Deadline will not be extended for any reason.
4. Copied assignments would have zero marks.
5. Individual efforts would be appreciated.
6. Name, class, section, department and roll number on the sheets must be mentioned correctly.
7. Assignment marks are purely based on performance and viva.
8. Last date to submit the assignment is 26-Jun-2022

Solution must be designed by applying the following attributes/characteristics

Attribute Problem Solving description


Depth of analysis Has no obvious solution, and requires conceptual thinking and
required innovative analysis to formulate suitable abstract models

Depth of A solution requires the use of in-depth Databases knowledge


knowledge required provided in class & lab sessions.

1|Page
NAME :- M.SHAFAY ENROLLMENT NO :- 02-235192-046
BU, CS Department 2/3 BSIT Semester – 7 (Fall 2022)
ITC-327: DBA&M Assignment 03

Assignment Description

Question-1:
a. Create following two new users along with the privileges so that these users can create new
tables and insert records in the tables. Newly created users must not be given DBA or ALL
privileges:
i. Username= STAGING, password = STAGING
ii. Username = DWH, password = DWH

(Marks-1)
b. Replicate only the structures of EMP and DEPT tables from user SCOTT to user STAGING.
Replicated tables will have no record at the time of creation.
(Marks-1)
Question-2:
a. Alter the structures of EMP and DEPT tables in user STAGING such that EMP and DEPT
tables in user STAGING must have parent child relationship (DEPT is parent and EMP is
child table) and EMP table will also have a new attribute RECORD_HIST having data type
TIMESTAMP.

EMPNO and RECORD_HIST will be the COMPOSITE key in the EMP table in user STAGING.
(Marks-1)

b. Replicate only the structures of EMP and DEPT tables from user STAGING to user DWH.
Replicated tables will have no record at the time of creation.
(Marks-1)
Question-3
a. Write two triggers on EMP and DEPT tables in user SCOTT so that whenever any record is
INSERTED or UPDATED in these tables, the similar record must be inserted into the
respective EMP and DEPT tables in user STAGING including the SYSTEM TIMESTAMP
in the RECORD_HIST attribute in EMP table in the STAGING user.
(Marks 2)

b. Extract all the records of EMP and DEPT tables from user STAGING through UTL_FILE
package and load them into EMP and DEPT tables of user DWH using SQLLDR utility.

(Marks-3)

c. Create a materialized view EMP_DEPT_FACT in user DWH using tables EMP and DEPT
tables of DWH such that this materialized view will contain DEPTNO, JOB, TOTAL_SAL.
TOTAL_SAL will maintain subtotals of groups (DEPTNO, JOB), (DEPTNO) and GRAND
TOTAL of all the employees.
Materialized view must be refreshed automatically every after 24 hours.
(Marks-1)
NAME :- M.SHAFAY ENROLLMENT NO :- 02-235192-046

SOLUTION
NAME :- M.SHAFAY ENROLLMENT NO :- 02-235192-046
NAME :- M.SHAFAY ENROLLMENT NO :- 02-235192-046
NAME :- M.SHAFAY ENROLLMENT NO :- 02-235192-046
NAME :- M.SHAFAY ENROLLMENT NO :- 02-235192-046

____________________END___________________

You might also like