Professional Documents
Culture Documents
ASSIGNMENT 03
Complex Computing Problem
Marks: 10
Instructions
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___________________