• Save
DB Security Oracle 11g-Application Context, Dynamic Views & Aduits
Upcoming SlideShare
Loading in...5
×
 

DB Security Oracle 11g-Application Context, Dynamic Views & Aduits

on

  • 616 views

 

Statistics

Views

Total Views
616
Slideshare-icon Views on SlideShare
616
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    DB Security Oracle 11g-Application Context, Dynamic Views & Aduits DB Security Oracle 11g-Application Context, Dynamic Views & Aduits Presentation Transcript

    • ERETAILORACLE DATABASE SECURITY PROJECT DBST Security UMUC SPRING 2012 By Sunny Okoro 1
    • Table of Contents ANALYSIS ............................................................................................................................................................................................ 4 BUNINESES REQUIREMENT ............................................................................................................................................................. 5 SYSTEM PROPOSAL .................................................................................................................................................................... 6 ENTITY RELATION DIAGRAM ....................................................................................................................................................... 8 DESIGN .............................................................................................................................................................................................. 10 DATABASE CREATION ................................................................................................................................................................... 11 TABLE POPULATION .......................................................................................................................................................................... 26 USER MANAGEMENT.................................................................................................................................................................... 26 APPLICATION CONTEXT ................................................................................................................................................................ 32 PASSWORD MANAGEMENT ........................................................................................................................................................ 34 AUDIT MANAGEMENT ................................................................................................................................................................. 38 VIRTUAL PRIVATE DATABAE ......................................................................................................................................................... 41 DYNAMIC VIEWS .......................................................................................................................................................................... 42 NON DUNAMIC VIEWS ................................................................................................................................................................. 45 DATABASE MANAGEMENT .......................................................................................................................................................... 48 IMPLMENTATION ............................................................................................................................................................................. 54 DATABASE CREATION ................................................................................................................................................................... 55 TABLE POPULATION .......................................................................................................................................................................... 65 USER MANAGEMENT.................................................................................................................................................................... 66 2
    • APPLICATION CONTEXT ................................................................................................................................................................ 66 PASSWORD MANAGEMENT ........................................................................................................................................................ 67 ADUIT MANAGEMENT................................................................................................................................................................. 67 VIRTUAL PRIVATE DATABAE ............................................................................................................................................................. 67 DYNAMIC VIEWS .......................................................................................................................................................................... 67 NON DUNAMIC VIEWS ................................................................................................................................................................. 67 DATABASE MANAGEMENT .......................................................................................................................................................... 68 QULATITY ASSURANCE .................................................................................................................................................................... 69 DATABASE DIAGRAM ................................................................................................................................................................... 70 DATABASE DICTIONARY .................................................................................................................................................................. 72 DATA VALIDATION ..................................................................................................................................................................... 76 DATA SECURITY ............................................................................................................................................................................... 77 AUDIT MANAGEMENT ................................................................................................................................................................. 93 3
    • ANALYSIS 4
    • BUSINESS REQUIREMENTS ERETAIL a Pacific Northwest based electronic retail store founded in 1995 as a regular neighborhood store needs a database system to support their ecommerce system that was launched in 2000 and other daily activities. The database system shall meet the following requirements. 1. The database shall process multiplesessions without causing connection problems. 2. The database shall allow employees to view their own employee records and human resources files 3. The database shall have a password requirement to prevent authorized access that could be caused by weak passwords. 4. The database shall allow employees to view their own records 5. To maintain data integrity no delete operation would be allowed in the database. 6. The database shall allow ERETAIL to manage its inventory and various projects. 5
    • SYSTEM PROPOSAL DataInc Solution a Washington D.C basedcompany proposed an oracle solution for ERetail that would be used to manage daily operations. The Oracle 11g database would be integrated with existing applications to retrieve and process data. 1. Application context would be used to allow customers and employees to view their own records. A trigger would be created on the underlying table to restrict data being updated or deleted to that of the user based on the application context definition. 2. A password profile and authentication validating rules would be used to validate each password based on established requirements. 3. An audit management would be implemented to audit each user’s behaviors and actions in the database. 4. Employees are given access to data based on the roles they are identified by within the organization. 5. To enhance security, a new customer card system is introduced to replace the one way customer id schema. When a user calls in for assistance, they would be asked for their account number instead of a customer identification number as in the current system. The customer representative would query the database and ask the customer toconfirm their identity. Having a customer card system would prevent the organization from disclosing the 6
    • customer identification numbers to any customers or from the public. Currently ERETAIL uses the same customer identification number given to customer to query internal database systems. A criminal who knows the customer identifications of individual customers can easily break into the system by providing the employee credentials in a query. The account system would eliminate that need. 6. Customer personal identifiers like address, birthdate and phone would be removed from views that are being utilized by employees whose role(s) does not require them to use for their assignments. 7. Inventory, customer cards and customer cards close tables would contain employee identification numbers to make it easier to know which employee issued a customer card or close the account and which employee updated the inventory table. 8. The Employee identification number is a public number departmental managers and project management team to identify the employee. Only the HR_ID isused for to access secure systems like payroll system which would prompt them to enter it along with their username. This would replace the use of employee identification number to access sensitive information. 9. Only the database administrator is allowed to create database objects and management of those objects. 7
    • ENTITY RELATION DIAGRAM 8
    • 9
    • DESIGN 10
    • DATABASE CREATION Table and Objects Creation /* creates table employee to hold all employee data */ create table EMPLOYEE (Employee_ID Number constraint employeeid_pk primary key, First_Name Varchar2(30), Middle_Name Varchar2(30), Last_Name Varchar2(30), Birth_Date varchar2(45), Gender Char(15), Marital_status Char(20), Address Varchar2(50), City Varchar2(35), State varchar(35), Postal_Code varchar2(20), Phone Varchar2(25), National_ID NUMBER ); /* Adds the customer column to the employee table*/ Alter table employee add customer_id number; 11
    • /*Adds the foreign key and not null constraints the employee table */ Alter table employee add constraint emp_custid_fk foreign key(customer_id) references customer(customer_id); Alter table employee modify(first_name constraint empl_fname_nn not null) modify(middle_name constraint empl_midname_nn not null) modify(last_name constraint empl_lastname_nn not null) modify(birth_date constraint empl_birthdate_nn not null) modify(gender constraint empl_gender_nn not null) modify(address constraint empl_address_nn not null) modify(city constraint empl_city_nn not null) modify(state constraint empl_state_nn not null) modify(postal_code constraint empl_postalcode_nn not null) modify(National_id constraint empl_nationalid_nn not null) modify(phone constraint empl_phone_nn not null); /* creates the sequence used to create the unique numbers for the national id column*/ CREATE SEQUENCE EMPNATIONALID_SEQ INCREMENT BY 120 start with 018892343 nocache nocycle order; /* creates the trigger to automatically populate the national id column */ begin execute immediate 'create or replace trigger nationalid '|| ' before insert on "SYSTEM"."EMPLOYEE" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."NATIONAL_ID" is null then '|| 12
    • ' select EMPNATIONALID_SEQ.nextval into :NEW."NATIONAL_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / /* creates the public snyonym for employee*/ create public synonym employee for employee; /*creates the table customer*/ create table customer (Customer_ID number constraint custo_custid_pk primary key, First_Name Varchar2(35), Middle_Name Varchar2(35), Last_Name Varchar2(35), Gender Char(15), Birth_Date Varchar2(45), Yearly_Income Number, Total_Childreen Number, Total_Cars_Owned Number, Marital_Status Varchar2(35), profession varchar2(34), Address Varchar2(50), City Varchar2(20), State char(35), Postal_Code varchar2(20), country varchar2(35), Phone Varchar2(25), Educational_Background varchar2(35) ); 13
    • /*Adds the not null constraint to the columns */ Alter table customer modify(first_name constraint cust_firstname_nn not null) modify(middle_name constraint cust_midname_nn not null) modify(last_name constraint cust_lastname_nn not null) modify(birth_date constraint cust_birthdate_nn not null) modify(gender constraint cust_gender_nn not null) modify(address constraint cust_address_nn not null) modify(city constraint cust_city_nn not null) modify(state constraint cust_state_nn not null) modify(postal_code constraint cust_postalcode_nn not null) modify(phone constraint cust__phone_nn not null); /* creates the public synonym for customer */ create public synonym customer for customer; /* creates the department table*/ CREATE TABLE DEPARTMENT (DEPARTMENT_ID NUMBER, NAME VARCHAR(20), MANAGER_ID NUMBER, CONSTRAINT DEPART_DEPARTSTRID_PK PRIMARY KEY(DEPARTMENT_ID), CONSTRAINT DEPTART_MANGID_FK FOREIGN KEY(MANAGER_ID) REFERENCES EMPLOYEE(EMPLOYEE_ID) ); /* creates the not null constraint to the department table */ Alter table Department 14
    • modify(department_id constraint dept_departid_nn not null ) modify(name constraint dept_name_nn not null); CREATE PUBLIC SYNONYM DEPARTMENT FOR DEPARTMENT; /* create the sequence for the department id column and the trigger to automatically populate it*/ CREATE SEQUENCE depart_deptid_seq increment by 89 start with 208 NOCYCLE nocache order; begin execute immediate 'create or replace trigger deptid_trgg '|| ' before insert on "SYSTEM"."DEPARTMENT" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."DEPARTMENT_ID" is null then '|| ' select DEPART_DEPTID_SEQ.nextval into :NEW."DEPARTMENT_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / /* creates the HRRECORD table to hold all the employee data */ CREATE TABLE HRRECORD (EMPLOYEE_ID NUMBER, HR_ID NUMBER, DEPARTMENT_ID NUMBER, SICK_HOURS NUMBER, VACATION_HOURS NUMBER, RANK CHAR(30), HIRE_DATE DATE, PAY_RATE NUMBER, 15
    • Office_Phone varchar2(35), CONSTRAINT HRREC_EMPHRID_PK PRIMARY KEY(EMPLOYEE_ID, HR_ID, DEPARTMENT_ID), CONSTRAINT HRREC_EMPHIRIDUK_UK UNIQUE (HR_ID), CONSTRAINT HRREC_HRDEPTID_FK FOREIGN KEY(DEPARTMENT_ID)REFERENCES DEPARTMENT(DEPARTMENT_ID) ON DELETE CASCADE, CONSTRAINT HRREC_EMPLOYEEID_FK FOREIGN KEY(EMPLOYEE_ID) REFERENCES EMPLOYEE (EMPLOYEE_ID) ON DELETE CASCADE ); CREATE PUBLIC SYNONYM HRRECORD FOR HRRECORD; /* creates the sequences to create primary key values and the trigger to generate them automatically*/ CREATE SEQUENCE HR_HRID_SEQ increment by 887977 start with 268 NOCYCLE nocache order; begin execute immediate 'create or replace trigger hrrid2_trgg '|| ' before insert on "SYSTEM"."HRRECORD" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."HR_ID" is null then '|| ' select HR_HRID_SEQ.nextval into :NEW."HR_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / /* creates the table product to hold all data relating to a product*/ 16
    • Create table product (Product_ID Number constraint prod_prodnumber_nn not null, product_Name varchar2(90), Product_Price number, Product_Brand Varchar2(35), Product_Description CLOB, Product_Category varchar2(30) ); /* creates the not null and primary key constraint */ Alter table product modify(Product_Price constraint prod_prodcost_nn not null) modify(product_name constraint prod_prodname_nn not null) modify(Product_Category constraint prod_prodcategory_nn not null); Alter table product modify(product_id constraint prod_productid_pk primary key); /*creates the tansactions table */ create table transactions (Transacton_ID VARCHAR2(60), Credit_Card_ID Number, Card_Type char(24), EXP_DATE DATE, Trans_Date Date, Amount_Charged Number, Brand Char(20), Constraint trans_transactionsid_pk PRIMARY KEY (Transacton_ID) ); /*creates the sequece used to populate the credit card values */ 17
    • Create or replace sequence creditcard start with 1200007800002345 increment by 809 nocycle nocache order; begin execute immediate 'create or replace trigger ccredit '|| ' before insert on "SYSTEM"."TRANSACTIONS" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."CREDIT_CARD_ID" is null then '|| ' select CREDITCARD.nextval into :NEW."CREDIT_CARD_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / /*Create the sales table */ create table sales (Customer_id number, Transacton_ID VARCHAR2(60), Product_id number, Order_ID Number, QTY_Ordered number, Product_Price_Original number, Product_price_WT_QTY number, Tax_Amount_Charged Number, Freight_Amount_charged number, Total_Amount Number, Order_Date Date, Constraint sales_custprodidtrand_pk primary key(customer_id, product_id, Transacton_ID, order_id) , constraint sales_salid_uk unique(Order_id) 18
    • , constraint sales_custid_fk foreign key(customer_id) references customer(customer_id) on delete cascade, constraint sales_pproductid_fk foreign key(product_id) references product(product_id) on delete cascade ); /* adds the foreign key constraint linking transaction to sales table */ Alter table sales add constraint saltransidU_fk foreign key (Transacton_ID) references transactions(Transacton_ID); /*creates table to hold all customer card information*/ create table customercards (Account_Number Number, customer_id Number, print_date date, print_employee_id number, status char(20), employee_id number, constraint custcard_empid_fk foreign key(print_employee_id) references employee(employee_id), constraint custcards_pk primary key (Account_Number,Customer_id, employee_Id), constraint custcards_custid_fk foreign key (customer_id) references customer(customer_id), constraint custcards_empid_fk foreign key(employee_id) references employee(employee_id), constraint custcard_ser_uk unique(Account_Number) ); /*creates the table to hold all cards closed or lost reported by customer*/ create table customercardsclose (serial_number number, Account_Number number, close_employee_ID number, 19
    • close_date number, notes clob, constraint custclcad_pk primary key(serial_number,Account_Number), constraint custclcad_sernum_uk unique (serial_number), constraint custclad_cempid_fk foreign key(close_employee_ID) references employee(employee_id) ); /*creates the table to hold all projects the company are working or has worked on*/ create table projects (project_id number, Manager_id Number, project_title number, start_date date, end_date date, Awarded_Amount number, notes clob, constraint project_proj_pk primary key (project_id, manager_id), constraint project_magid_fk foreign key(manager_id) references employee(employee_id), constraint project_projid_uk unique (project_id) ); /*creates the sequence to populate the peoject_id column of projects and the trigger to fire automatic inserts*/ create sequence projet_projeid_sq start with 054456 order nocycle nocache increment by 56; begin execute immediate 'create or replace trigger project_trgg '|| ' before insert on "SYSTEM"."PROJECTS" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."PROJECT_ID" is null then '|| ' select PROJET_PROJEID_SQ.nextval into :NEW."PROJECT_ID" from dual; '|| ' end if; '|| 20
    • ' end if; '|| 'end;'; END; / /*creates the project work book table to hold all important information relating to a project*/ create table Projectworkbook (project_id number, employee_id number, workbook_id number, Hours_Assign Number, Role varchar2(40), constraint projwork_pk primary key(employee_id, project_id, workbook_id), constraint projwork_wbk_uk unique (workbook_id), constraint projwork_wb_fk foreign key(project_id) references projects(project_id), constraint projwork_emp_id_fk foreign key(employee_id) references employee(employee_id) ); /*creates the sequence and trigger to fire inserts for pk column*/ create sequence pjwbk_wbid_seq start with 06745 increment by 34 nocycle order nocache; begin execute immediate 'create or replace trigger pjworkbook '|| ' before insert on "SYSTEM"."PROJECTWORKBOOK" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."WORKBOOK_ID" is null then '|| 21
    • ' select PJWBK_WBID_SEQ.nextval into :NEW."WORKBOOK_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / /*creates the inventory table*/ create table inventory (inventory_id number, employee_id number, product_id number, QTY_Stocked Number, QTY_remaing Number, Stack_date date, next_stack_date number, constraint inventory_invid_pk primary key(inventory_id,employee_id, product_id), constraint invent_invid_uk unique (inventory_id), constraint invent_empid_fk foreign key(employee_id) references employee(employee_id), constraint invent_prodid_fk foreign key(product_id) references product(product_id) ); /* creates the sequence and the trigger to fire pk values upon inserts*/ create sequence inventory_invid_seq start with 21344 increment by 78 nocycle nocache order; begin execute immediate 'create or replace trigger inventor '|| ' before insert on "SYSTEM"."INVENTORY" '|| ' for each row '|| 'begin '|| ' if inserting then '|| 22
    • ' if :NEW."INVENTORY_ID" is null then '|| ' select INVENTORY_INVID_SEQ.nextval into :NEW."INVENTORY_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / ---- Adjustments to the objects after they had been created.--------ALTER TABLE PRODUCT add PRODUCT_DESCRIPTION varchar2(2000); ALTER TABLE PRODUCT add account_name char(24); ALTER TABLE SALES MODIFY ORDER_DATE VARCHAR2(30); ALTER TABLE TRANSACTIONS MODIFY TRANS_DATE VARCHAR2(40); ALTER TABLE TRANSACTIONS MODIFY EXP_DATE VARCHAR2(40); ALTER TABLE INVENTORY MODIFY NEXT_STORAGE_DATE CHAR(40); ALTER TABLE INVENTORY ADD STORAGE_DATE CHAR(40); ALTER table hrrecord modify hire_date char(45); 23
    • ALTER TABLE HRRECORD MODIFY RANK VARCHAR2(45); ALTER TABLE DEPARTMENT MODIFY NAME VARCHAR2(40); ALTER TABLE CUSTOMERCARDS DROP COLUMN PRINT_EMPLOYEE_ID; ALTER TABLE CUSTOMER RENAME COLUMN TOTAL_CHILDREEN TO TOTAL_CHILDREN; ALTER TABLE CUSTOMERCARDSCLOSE ADD CUSTOMER_ID NUMBER; ALTER TABLE CUSTOMERCARDSCLOSE ADD CONSTRAINT CUSTCADCL_CUSTID_FK FOREIGN KEY(CUSTOMER_ID) REFERENCES CUSTOMER(CUSTOMER_ID); ALTER TABLE CUSTOMERCARDSCLOSE DROP PRIMARY KEY; ALTER TABLE CUSTOMERCARDSCLOSE ADD CONSTRAINT custclcad_pk primary key(serial_number, close_employee_Id, Account_Number); ALTER TABLE PROJECTS MODIFY PROJECT_TITLE VARCHAR2(200); ALTER TABLE INVENTORY RENAME COLUMN QTY_REMAING TO QTY_REMANING; ALTER TABLE INVENTORY MODIFY NEXT_STACK_DATE DATE; ALTER TABLE CUSTOMERCARDS MODIFY ACCOUNT_NUMBER CHAR(45); 24
    • ALTER TABLE CUSTOMERCARDSCLOSE MODIFY ACCOUNT_NUMBER CHAR(45); ALTER TABLE CUSTOMERCARDSCLOSE MODIFY CLOSE_DATE DATE; RENAME TRANSACTIONS TO TRANSHISTORY; UPDATETRANSHISTORY set exp_date = '09-march-2015'; ALTER TABLE authenticationemp RENAME COLUMN USER_NAME TO USERNAME; update department set manager_id = (select employee_id from hrrecord where employee_id = 50) where department_id = 653; Alter table authenticationemp Rename column employee_id to empid; /*This was done to make it easier to type username which is the same with the one found in database user directories */ Alter table authenticationem Rename colum user_name to username; /* This was done after the table has been created and populated to make it easier to remember*/ Rename authenticationemp to uemp; 25
    • TABLE POPULATION Insert statements for each of the tables. Please open them individually. EMPLOYEE_INSERTS.sql CUSTOMER_INSERTS.sql PRODUCT.sql TRANSACTION_SQL.txt SALES.sql department_insert.sql HRRCORD_INSERT.txt DATASETS.sql USER MANAGEMENT /*creates users*/ create user AlexHD identified by AlexdJHU password expire; 26
    • create user BrendaUDH identified by BrenDJK password expire; create user BerryHK identified by joeberr password expire; create user DavidMGI identified by Davortiz password expire; create user EricYMU identified by Ericjank password expire; create user SamarawickramaULP identified by Prasannasa password expire; create user RaymondPLK identified by SamRydmd password expire; create user AckermanJKP identified by PilarAcker password expire; create user RounthwaiteUHG identified by RobertRoun password expire; create user LiGeorgeTRW 27
    • identified by Georgehgy password expire; create user MichaelsThVY Identified by ThomasMichel password expire; create user AnnetteHiJ identified by hillannett password expire; create user NiswongerOIU identified by chadNwg; create user MohamedB2B identified by Mohamedshami password expire; create user RandallcythIK identified by cynthiaRnad password expire; create user MohansuOK identified by Suchitramsu password expire; create user IvoLKW identified by Salmreivo password expire; create user kaneVMP identified by kaneriol password expire; 28
    • create user ThierrydherLK identified by dhersthier password expire; create user PhilipsCLZ identified by Carolphilp password expire; create user caoJuIY identified by Junco password expire; create user fordjeffNK identified by jefferyfd password expire; CREATE USER STADICKDL identified by stadickbsty password expire; CREATE USER DAVYALOVSKY0 IDENTIFIED BY DVDB409 password expire; /*creates authentication table*/ create table authenticationEMP (EMPLOYEE_ID NUMBER, AUTHENTICATION_ID NUMBER, USER_NAME VARCHAR2(40), CONSTRAINT authent_authentpk primary key(Employee_id, authentication_id), constraint authent_employeeid_fk foreign key(employee_id) references employee(employee_id), constraint auth_username_uk unique (user_name), constraint auth_authentic_k unique (authentication_id) ); 29
    • /* creates the sequence to populate the primary key columns with a trigger defined below */ create sequence auth_authid_seq start with 0889373 increment by 203 nocycle order; begin execute immediate 'create or replace trigger AUTH '|| ' before insert on "SYSTEM"."AUTHENTICATIONEMP" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."AUTHENTICATION_ID" is null then '|| ' select AUTH_AUTHID_SEQ.nextval into :NEW."AUTHENTICATION_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; END; / INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 159, 'AlexHD'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID, USER_NAME) values(214,'BrendaUDH'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 264 ,'BerryHK'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 55, 'DavidMGI'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 245, 'EricYMU'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values(241, 'SamarawickramaULP' ); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 67, 'RaymondPLK'); 30
    • INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 87 ,'AckermanJKP'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 148, 'RounthwaiteUHG'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values(64, 'LiGeorgeTRW' ); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID ,USER_NAME) values( 198 , 'MichaelsThVY'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 268 ,'AnnetteHiJ'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 183, 'NiswongerOIU' ); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 138 ,'RandallcythIK'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID, USER_NAME) values( 70 ,'MohamedB2B'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 179, 'MohansuOK'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 28 ,'IvoLKW' ); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 201, 'kaneVMP'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID, USER_NAME) values( 6, 'ThierrydherLK'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 171, 'PhilipsCLZ'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 50, 'caoJuIY'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 17 , 'fordjeffNK'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID, USER_NAME) values(228, 'StadickDL'); INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 88 ,'DAVYALOVSKY0' ); 31
    • APPLICATION CONTEXT Employee Allows employee users to view their own records when they query certain table they have access like HRRecord, Employee and Projectwork. /* creates the application context*/ CREATE OR REPLACE CONTEXT EMPLOYE_SEC using EMPLYV1_CTX; /* creates the packages and procedures for the security context*/ create or replace package EMPLYV1_CTX AS PROCEDURE set_EMPID; PROCEDURE clear_EMPID; END EMPLYV1_CTX; / CREATE OR REPLACE PACKAGE BODY EMPLYV1_CTX AS ---------------------------------------PROCEDURE set_EMPID AS l_EMPID NUMBER; BEGIN SELECT EMPID 32
    • INTO l_EMPID FROM UEMP WHERE username = SYS_CONTEXT('USERENV', 'SESSION_USER'); DBMS_SESSION.SET_CONTEXT (namespace => 'EMPLOYE_SEC', ATTRIBUTE => 'EMPID', VALUE => l_EMPID); END set_EMPID; ----------------------------------------------PROCEDURE clear_EMPID AS BEGIN DBMS_SESSION.CLEAR_CONTEXT (namespace => 'EMPLOYE_SEC', ATTRIBUTE => 'EMPID'); END clear_EMPID; -----------------------------------------------------END EMPLYV1_CTX; / /* Creates the log in trigger that would validate user each time they log in to the database*/ CREATE OR REPLACE TRIGGER USRLOGIN AFTER LOGON ON DATABASE BEGIN system.EMPLYV1_CTX.SET_EMPID; EXCEPTION WHEN NO_DATA_FOUND THEN -- IF NO DATA IS FOUND, USER IS NOT IN THE DATABASE. --- MAY NOT BE ABLE TO LOGON. NULL; END; / 33
    • PASSWORD MANAGEMENT Password Authentication --------------------------Password Authentication---------------------------- /*creates the table to store and validate passwords*/ create table pwordauthenticate (username varchar2(45), passwd varchar2(45), verifier varchar2(30), constraint password_pword099_pk primary key (username, passwd) ); /*creates the index for username and the verifier*/ create index verifier on pwordauthenticate(username, verifier); /*creates the procedure to validate passwords*/ create or replace procedure feed_password (p_password in varchar2 default null) as l_new_password_verifier dba_users.PASSWORD%TYPE; l_password dba_users.PASSWORD%TYPE := UPPER (p_password); BEGIN FOR rec IN (SELECT username,password from dba_users) LOOP 34
    • IF (p_password is NULL) THEN ---PASSWORD IS EITHER PASSED AS PARAMETER OR SET SET USER'S NAME---l_password :=rec.username; END IF; -----CREATE NEW PASSWORD VERIFIER----------EXECUTE IMMEDIATE 'alter user' ||rec.username ||'identified by' ||l_password; ----RETERIVE NEW VERIFIER------------------------SELECT password into l_new_password_verifier from dba_users where username = rec.username; ---------------INSERT VALUE INTO PASSWORD TABLE-------INSERT INTO pwordauthenticate VALUES(rec.username, l_password, l_new_password_verifier); --set password back to its original value EXECUTE IMMEDIATE 'alter user' || rec.username ||'identified by values ''' || rec.password ||''''; end loop; end; / ------------------------------------------------end--------------------------------------. Password Requirements 35
    • Password requirement ensures that a user password meets the requirements established by the organization -----------------------Password Requirements----------------------------------/*creates the function to check the length and other requirements that a password must pass*/ create or replace function pword_strength (p_username varchar2, p_new_password varchar2, p_old_password varchar2) --- RETURN TRUE IF PASSWORD IS STRONG ENOUGH----RETURN BOOLEAN AS l_return_val BOOLEAN := TRUE; BEGIN ---CHECK TO BE SURE PASSWORD IS NOT THE SAME AS USERNAME---IF UPPER(p_new_password) = UPPER(p_username) THEN l_return_val :=FALSE; raise_application_error (-20001, 'Password same as username'); END IF; ----FORCES USER TO CHANGE PASSWORD TO SOMETHING NEW IF UPPER (p_new_password) = UPPER (p_old_password) THEN l_return_val :=FALSE; raise_application_error(-20004, 'Password has to be different then the old password'); END IF; 36
    • -- MAKE SURE PASSWORD IS NOT MADE UP OF NUMBERS ----IF(regexp_like(p_new_password, '[:alnum:]' ) = FALSE) THEN L_RETURN_VAL :=FALSE; raise_application_error (-20003 ,'Password must contain numbers, letters or character'); END IF; --MAKE SURE PASSWORD IS AT LEAST SIX CHARACTERS--IF LENGTH(p_new_password) <= 7 THEN l_return_val :=FALSE; raise_application_error(-20005, 'Password is too short'); END IF; RETURN l_return_val; END; / /* in real production the values would change to a higher value. This is set for testing reason.*/ CREATE PROFILE SPASSWORD LIMIT PASSWORD_LIFE_TIME 5 PASSWORD_GRACE_TIME 5 PASSWORD_REUSE_TIME 180 PASSWORD_REUSE_MAX UNLIMITED FAILED_LOGIN_ATTEMPTS 5 PASSWORD_LOCK_TIME .5 PASSWORD_VERIFY_FUNCTION pword_strength; -----------------------------end-------------------------------------- 37
    • AUDIT MANAGEMENT Ensures that database activities both by external and internal users are audited for recording purpose to maintain a good secured database state /*Enable the database audit */ Alter system set audit_trail=db_extended SCOPE=SPFILE; --------------------------AUDIT MANAGEMENT-------------------------------------------------------------------KEEPS TRACK OF USERS WHO ACCESSED THE DATABASE-----------BEGIN for rec IN (SELECT username, action_name, TO_CHAR(TIMESTAMP, 'Mon-DD HH24:MI') LOGON, TO_CHAR(logoff_time, 'Mon-DD HH24:MI') LOGOFF, priv_used, comment_text from dba_audit_trail) LOOP DBMS_OUTPUT.put_line('user: ' || rec.username); DBMS_OUTPUT.put_line('Action: ' || rec.action_name); DBMS_OUTPUT.put_line('Logon: ' || rec.LOGON); DBMS_OUTPUT.put_line('Logoff: ' || rec.LOGOFF); 38
    • DBMS_OUTPUT.put_line('priv_used: ' || rec.priv_used); DBMS_OUTPUT.put_line('comments: ' || rec.comment_text); DBMS_OUTPUT.put_line ('-------------------------------END of Record--------------------'); END LOOP; END; / --------------------------------------------------------------------------------------------------------------- --ADUITS USERS ACTIONS IN THE DATABASE---------------------------------------BEGIN FOR rec IN (SELECT audit_type, db_user, object_schema, object_name, extended_timestamp, sql_text from dba_common_audit_trail) LOOP DBMS_OUTPUT.put_line( 'Audit Type: ' || rec.audit_type); DBMS_OUTPUT.put_line( 'User: ' || rec.db_user); DBMS_OUTPUT.put_line('What: ' || rec.object_schema ||'.' || rec.object_name); DBMS_OUTPUT.put_line('When: ' || rec.extended_timestamp); 39
    • DBMS_OUTPUT.put_line('HOW: ' || rec.sql_text); DBMS_OUTPUT.put_line ('--------------------End Of Record--------------------'); END LOOP; END; / ----------------------------------------------------------------------------------- /* Audit was created after the views has been created illustrated in the next session*/ AUDIT SELECT, INSERT, UPDATE, DELETE ON EMPLOYEE BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON HRRECORD BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON CUSTOMER BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON PRODUCT BY ACCESS; AUDIT SELECT,INSERT, UPDATE, DELETE ON INVENTORY BY ACCESS; AUDIT SELECT,INSERT, UPDATE, DELETE ON TRANSHISTORY BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON SALES BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON ORDERS2 BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON CUSTOMERDATA BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON rCUSTOMERDATA BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON rorders BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON orders2 BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON EMPLOYEERV BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON EmployeeHR BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON PROJECTS BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON PROJECTWORKBOOK BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON PROJECT BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON PJWORK BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON CustCard BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON CARDCLOSE BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON customercards BY ACCESS; AUDIT SELECT, INSERT, UPDATE, DELETE ON customercardsclose BY ACCESS; 40
    • VIRTUAL PRIVATE DATABASE /*Creates the function to retrieve the employee id */ /*Allows employee to view the projects they have worked*/ Create or replace view projworkbook as select e.first_name , e.middle_name, e.last_name,d.name as department_name, p.hours_assign, p.role, j.project_title as Project_Tile, start_date, j.end_date,e.first_name||','||e.last_name as "Project Manager" from employee e inner join hrrecord h on h.employee_id = e.employee_id inner join department d on h.department_id = d.department_id inner join projects j on j.manager_id = e.employee_id inner join projectworkbook p on j.project_id = p.project_id; CREATE OR REPLACE FUNCTION EMPID_RET( p_schema IN VARCHAR2 DEFAULT NULL, p_object IN VARCHAR2 DEFAULT NULL) 41
    • RETURN VARCHAR2 AS BEGIN RETURN 'EMPID = SYS_CONTEXT (''EMPLOYE_SEC'',''EMPID'')'; END; / /*Allows employee to view all the projects they have worked*/ BEGIN DBMS_RLS.add_policy (object_schema =>‘SYSTEM’, OBJECT_NAME => 'projworkbook', POLICY_NAME => 'WORKBOOKPJ', FUNCTION_SCHEMA =>‘SYSTEM’, POLICY_FUNCTION => 'EMPID_RET', STATEMENT_TYPES => ' SELECT'); END; / DYNAMIC VIEW Allows users to create a restricted view based on their own user information /*create view that allows employee to see their basic information*/ create or replace view EmployeeRV AS 42
    • SELECT FIRST_NAME, MIDDLE_NAME, LAST_NAME, BIRTH_DATE, GENDER, EMPLOYEE_ID, MARITAL_STATUS, ADDRESS, CITY, STATE, POSTAL_CODE, PHONE FROM EMPLOYEE WHERE EMPLOYEE_ID = SYS_CONTEXT ('EMPLOYE_SEC','EMPID'); /*Restrict trigger to allow user update their own records*/ CREATE OR REPLACE TRIGGER DELUPD_RESTRICT_EMPLY BEFORE DELETE OR UPDATE ON EMPLOYEE FOR EACH ROW BEGIN IF(:OLD.EMPLOYEE_ID != SYS_CONTEXT ('EMPLOYE_SEC','EMPID')) THEN raise_application_error (-20001, CHR(10) || '** YOU CAN ONLY UPDATE YOUR OWN RECORD.' || CHR(10) ||'** YOUR EMPLOYEE ID IS' || SYS_CONTEXT ('EMPLOYE_SEC','EMPID') ); END IF; END; / /*create view to allow employee see their HR records*/ CREATE or replace view EmployeeHR AS SELECT E.FIRST_NAME ,E.MIDDLE_NAME ,E.LAST_NAME , H.SICK_HOURS, H.VACATION_HOURS, H.RANK, H.HIRE_DATE, H.PAY_RATE, H.OFFICE_PHONE, 43
    • D.NAME, G.FIRST_NAME||','||G.LAST_NAME AS "MANAGER_NAME" FROM EMPLOYEE E INNER JOIN HRRECORD H ON E.EMPLOYEE_ID = H.EMPLOYEE_ID INNER JOIN DEPARTMENT D ON H.DEPARTMENT_ID = D.DEPARTMENT_ID INNER JOIN EMPLOYEE G ON D.MANAGER_ID = G.EMPLOYEE_ID WHERE E.EMPLOYEE_ID = SYS_CONTEXT ('EMPLOYE_SEC','EMPID'); 44
    • NON-DYNAMIC VIEW /*Creates view used by customer representatives to query the database based on Account Card provided by the customer*/ CREATE VIEW CUSTOMERINFO AS SELECT A.ACCOUNT_NUMBER, A.CUSTOMER_ID, A.STATUS, C.FIRST_NAME, C.MIDDLE_NAME, C.LAST_NAME, C.ADDRESS, C.CITY, C.PHONE, C.STATE, C.BIRTH_DATE FROM CUSTOMERCARDS A INNER JOIN CUSTOMER C ON A.CUSTOMER_ID = C.CUSTOMER_ID; /*create view employee directory used by employee*/ Create view empdirectory as SELECT E.FIRST_NAME ||'-'||E.MIDDLE_NAME||','|| E.LAST_NAME AS EMPLOYEE, H.RANK, D.NAME AS "DEPARTMENT NAME", G.FIRST_NAME ||','||G.LAST_NAME AS "DEPARTMENT MANAGER" FROM EMPLOYEE E INNER JOIN HRRECORD H ON E.EMPLOYEE_ID = H.EMPLOYEE_ID INNER JOIN DEPARTMENT D 45
    • ON H.DEPARTMENT_ID = D.DEPARTMENT_ID INNER JOIN EMPLOYEE G ON G.EMPLOYEE_ID = D.MANAGER_ID ORDER BY D.DEPARTMENT_ID; /*create view used to retrieve others */ create view orders2rorders as SELECT C.FIRST_NAME ,C.MIDDLE_NAME,C.LAST_NAME ,C.CUSTOMER_ID, S.ORDER_ID, S.PRODUCT_ID, P.PRODUCT_NAME AS "NAME", S.QTY_ORDERED, S.PRODUCT_PRICE_ORIGINAL AS "Orginal-Price", S.TAX_AMOUNT_CHARGED AS "Tax", S.FREIGHT_AMOUNT_CHARGED AS "Shipping", S.TOTAL_AMOUNT AS "Final Amount", S.ORDER_DATE AS "Date-Ordered" from SALES S INNER JOIN CUSTOMER C ON S.CUSTOMER_ID = C.CUSTOMER_ID INNER JOIN PRODUCT P ON S.PRODUCT_ID = P.PRODUCT_ID; /* Create a view used by sales and marketing associates*/ CREATE VIEW CUSTOMERDATA AS SELECT c.customer_Id ,C.FIRST_NAME, C.MIDDLE_NAME, C.LAST_NAME, C.ADDRESS, C.CITY, C.PHONE, C.STATE, C.BIRTH_DATE FROM CUSTOMER C; 46
    • CREATE VIEW DEPARTMENTS AS SELECT E.FIRST_NAME ||','|| E.LAST_NAME AS MANAGER, D.NAME, H.OFFICE_PHONE FROM EMPLOYEE E INNER JOIN DEPARTMENT D ON E.EMPLOYEE_ID = D.MANAGER_ID INNER JOIN HRRECORD H ON H.EMPLOYEE_ID = E.EMPLOYEE_ID; /* Use by report analyst to crate reports. Again all the customers identifiers are removed.*/ create or replace view rorders as SELECT C.CUSTOMER_ID, S.ORDER_ID, S.PRODUCT_ID, P.PRODUCT_NAME AS "NAME", S.QTY_ORDERED, S.PRODUCT_PRICE_ORIGINAL AS "Orginal-Price", S.TAX_AMOUNT_CHARGED AS "Tax", S.FREIGHT_AMOUNT_CHARGED AS "Shipping", S.TOTAL_AMOUNT AS "Final Amount", S.ORDER_DATE AS "Date-Ordered" from SALES S INNER JOIN CUSTOMER C ON S.CUSTOMER_ID = C.CUSTOMER_ID INNER JOIN PRODUCT P ON S.PRODUCT_ID = P.PRODUCT_ID; CREATE or replace VIEW rCUSTOMERDATA 47
    • AS SELECT c.customer_Id, C.CITY, C.STATE, C.BIRTH_DATE, C.POSTAL_CODE, C.COUNTRY, C.GENDER, C.YEARLY_INCOME, C.MARITAL_STATUS , C.EDUCATIONAL_BACKGROUND ,C.TOTAL_CHILDREN ,C.TOTAL_CARS_OWNED,C.PROFESSION FROM CUSTOMER C; DATABASE MANAGEMENT /* Grant create session to employees */ GRANT CREATE SESSION TO BrendaUDH; GRANT CREATE SESSION TO BerryHK; GRANT CREATE SESSION TO DavidMGI; GRANT CREATE SESSION TO EricYMU; GRANT CREATE SESSION TO SamarawickramaULP; GRANT CREATE SESSION TO RaymondPLK; GRANT CREATE SESSION TO AckermanJKP; GRANT CREATE SESSION TO RounthwaiteUHG; GRANT CREATE SESSION TO LiGeorgeTRW; GRANT CREATE SESSION TO MichaelsThVY; GRANT CREATE SESSION TO AnnetteHiJ; GRANT CREATE SESSION TO NiswongerOIU; GRANT CREATE SESSION TO MohamedB2B; GRANT CREATE SESSION TO RandallcythIK; GRANT CREATE SESSION TO MohansuOK; 48
    • GRANT CREATE SESSION TO IvoLKW; GRANT CREATE SESSION TO kaneVMP; GRANT CREATE SESSION TO ThierrydherLK; GRANT CREATE SESSION TO PhilipsCLZ; GRANT CREATE SESSION TO caoJuIY; GRANT CREATE SESSION TO fordjeffNK; GRANT CREATE SESSION TO STADICKDL; GRANT CREATE SESSION TO DAVYALOVSKY0; /* Human Resources */ Create ROLE HR; Grant select, update , insert on HRRECORD to HR; Create or replace public synonym employee for employee; Grant SELECT , INSERT, UPDATE on employee to HR; Grant HR TO MohansuOK; /*Accountant*/ CREATE ROLE ACCOUNTANTS; CREATE OR REPLACE PUBLIC SYNONYM TRANSACTIONS FOR TRANSHISTORY; CREATE OR REPLACE PUBLIC SYNONYM SALES FOR SALES; CREATE OR REPLACE PUBLIC SYNONYM ORDER1 FOR ORDERS2; CREATE OR REPLACE PUBLIC SYNONYM CUSTDATA01 FOR CUSTOMERDATA; GRANT SELECT, UPDATE ON TRANSACTIONS TO ACCOUNTANTS; GRANT SELECT, UPDATE ON SALES TO ACCOUNTANTS; GRANT SELECT, UPDATE ON ORDER1 TO ACCOUNTANTS; GRANT SELECT ON CUSTDATA01 TO ACCOUNTANTS; GRANT ACCOUNTANTS TO AckermanJKP; GRANT ACCOUNTANTS TO RaymondPLK; GRANT ACCOUNTANTS TO kaneVMP; 49
    • /*RANALYST*/ CREATE ROLE RANALYST; CREATE OR REPLACE PUBLIC SYNONYM CUSTDATA02 FOR rCUSTOMERDATA ; GRANT SELECT ON CUSTDATA02 TO RANALYST; CREATE OR REPLACE PUBLIC SYNONYM ORDERS04 FOR rorders; GRANT SELECT ON ORDERS04 TO RANALYST; Grant RANALYST to DavidMGI; /*--SALES*/ CREATE ROLE SALES; GRANT SELECT ON TRANSACTIONS TO SALES; GRANT SELECT ON SALES TO SALES; GRANT SELECT ON ORDER1 TO SALES; GRANT SELECT ON CUSTDATA01 TO SALES; CREATE OR REPLACE PUBLIC SYNONYM PRODT FOR PRODUCT; GRANT SELECT, UPDATE, INSERT ON PRODT TO SALES; CREATE OR REPLACE PUBLIC SYNONYM INVENT FOR INVENTORY; CREATE OR REPLACE PUBLIC SYNONYM INVENT FOR INVENTORY; GRANT SELECT, UPDATE(PRODUCT_ID, NEXT_STACK_DATE, QTY_REMANING), INSERT ON INVENT TO SALES; GRANT SALES TO MohamedB2B; GRANT SALES TO ThierrydherLK ; /*--CUSTOMER REP*/ 50
    • CREATE ROLE CUSTOMERREP; CREATE OR REPLACE PUBLIC SYNONYM CUSTINFO FOR CUSTOMERINFO; GRANT SELECT, INSERT, UPDATE ON CUSTINFO TO CUSTOMERREP; CREATE OR REPLACE PUBLIC SYNONYM orders08 FOR orders2; GRANT SELECT, UPDATE ON orders08 to customerrep; GRANT CUSTOMERREP TO NiswongerOIU; GRANT CUSTOMERREP TO PhilipsCLZ; /*-Employees */ CREATE ROLE EMPLOYEE; /*EMPLOYEE DYNAMIC AND NON DYNAMIC VIEWS*/ CREATE OR REPLACE PUBLIC SYNONYM EMPLOYEERV FOR EMPLOYEERV; GRANT SELECT, UPDATE, INSERT ON EMPLOYEERV TO EMPLOYEE ; CREATE OR REPLACE PUBLIC SYNONYM EmployeeHR FOR EmployeeHR; GRANT SELECT, UPDATE, INSERT ON EmployeeHR TO EMPLOYEE; CREATE OR REPLACE PUBLIC SYNONYM EMPDIRECTORY FOR empdirectory; GRANT SELECT ON EMPDIRECTORY TO EMPLOYEE; CREATE OR REPLACE PUBLIC SYNONYM WORKBOOK FOR GRANT GRANT GRANT GRANT GRANT EMPLOYEE TO AlexHD; EMPLOYEE TO BerryHK; EMPLOYEE TO DavidMGI; EMPLOYEE TO EricYMU; EMPLOYEE To SamarawickramaULP; projworkbook; 51
    • GRANT EMPLOYEE TO RaymondPLK; GRANT EMPLOYEE TO AckermanJKP; GRANT EMPLOYEE TO RounthwaiteUHG; GRANT EMPLOYEE TO MichaelsThVY; GRANT EMPLOYEE TO AnnetteHiJ; GRANT EMPLOYEE TO NiswongerOIU; GRANT EMPLOYEE TO RandallcythIK; GRANT EMPLOYEE TO MohamedB2B; GRANT EMPLOYEE TO MohansuOK; GRANT EMPLOYEE TO IvoLKW; GRANT EMPLOYEE TO kaneVMP; GRANT EMPLOYEE TO ThierrydherLK; GRANT EMPLOYEE TO PhilipsCLZ; GRANT EMPLOYEE TO caoJuIY; GRANT EMPLOYEE TO fordjeffNK; GRANT EMPLOYEE TO StadickDL; GRANT EMPLOYEE TO DAVYALOVSKY0; GRANT EMPLOYEE TO BrendaUDH; /*-PROJECT MANAGERS*/ CREATE ROLE PJM; CREATE OR REPLACE PUBLIC SYNONYM PROJECT FOR PROJECTS; CREATE OR REPLACE PUBLIC SYNONYM PJWORK FOR PROJECTWORKBOOK; GRANT SELECT, INSERT, UPDATE ON PROJECT TO PJM; GRANT SELECT , INSERT, UPDATE ON PJWORK TO PJM; GRANT PJM TO StadickDL; GRANT PJM TO AnnetteHiJ; ------------------PART 2------------------------------------------------------- 52
    • CREATE OR REPLACE PUBLIC SYNONYM CustCard for customercards; CREATE OR REPLACE public SYNONYM CARDCLOSE FOR customercardsclose; GRANT SELECT, UPDATE(STATUS), INSERT ON CustCard to CUSTOMERREP; GRANT SELECT, INSERT ON CARDCLOSE TO CUSTOMERREP; GRANT SELECT, UPDATE(STATUS), INSERT ON CustCard TO ACCOUNTANTS; GRANT SELECT ON CARDCLOSE TO ACCOUNTANTS; CREATE ROLE DB; GRANT DB TO DAVYALOVSKY0; GRANT DBA TO DAVYALOVSKY0; 53
    • IMPLEMENNTATION 54
    • DATABASE CREATION /************************** Spool files of table, synonym, triggers and sequence creations *********************/ SQL> show user USER is "SYSTEM" SQL> SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 create table EMPLOYEE (Employee_ID Number constraint employeeid_pk primary key, First_Name Varchar2(30), Middle_Name Varchar2(30), Last_Name Varchar2(30), Birth_Date varchar2(45), Gender Char(15), Marital_status Char(20), Address Varchar2(50), City Varchar2(35), State varchar(35), Postal_Code varchar2(20), Phone Varchar2(25), National_ID NUMBER ); Table created. SQL> /* Adds the customer column to the employee table*/ SQL> SQL> Alter table employee 2 add customer_id number; Table altered. SQL> /* adds the not null constraint */ SQL> Alter table employee 2 modify(first_name constraint empl_fname_nn not null) 3 modify(middle_name constraint empl_midname_nn not null) 4 modify(last_name constraint empl_lastname_nn not null) 5 modify(birth_date constraint empl_birthdate_nn not null) 6 modify(gender constraint empl_gender_nn not null) 7 modify(address constraint empl_address_nn not null) 8 modify(city constraint empl_city_nn not null) 55
    • 9 10 11 12 modify(state constraint empl_state_nn not null) modify(postal_code constraint empl_postalcode_nn not null) modify(National_id constraint empl_nationalid_nn not null) modify(phone constraint empl_phone_nn not null); Table altered. SQL> SQL> CREATE SEQUENCE EMPNATIONALID_SEQ INCREMENT BY 120 start with 018892343 nocache nocycle order; Sequence created. SQL> SQL> SQL> 2 3 4 5 6 7 8 9 10 11 12 13 /* creates the trigger to automatically populate the national id column */ begin execute immediate 'create or replace trigger nationalid '|| ' before insert on "SYSTEM"."EMPLOYEE" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."NATIONAL_ID" is null then '|| ' select EMPNATIONALID_SEQ.nextval into :NEW."NATIONAL_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / PL/SQL procedure successfully completed. SQL> /* creates the public snyonym for employee*/ SQL> SQL> create public synonym employee for employee; Synonym created. SQL> SQL> 2 3 4 5 6 7 8 9 10 11 create table customer (Customer_ID number constraint custo_custid_pk primary key, First_Name Varchar2(35), Middle_Name Varchar2(35), Last_Name Varchar2(35), Gender Char(15), Birth_Date Varchar2(45), Yearly_Income Number, Total_Childreen Number, Total_Cars_Owned Number, Marital_Status Varchar2(35), 56
    • 12 13 14 15 16 17 18 19 20 profession varchar2(34), Address Varchar2(50), City Varchar2(20), State char(35), Postal_Code varchar2(20), country varchar2(35), Phone Varchar2(25), Educational_Background varchar2(35) ); Table created. SQL> Alter table employee 2 add constraint emp_custid_fk foreign key(customer_id) references 3 customer(customer_id); Table altered. SQL> SQL> SQL> Alter table customer 2 modify(first_name constraint cust_firstname_nn not null) 3 modify(middle_name constraint cust_midname_nn not null) 4 modify(last_name constraint cust_lastname_nn not null) 5 modify(birth_date constraint cust_birthdate_nn not null) 6 modify(gender constraint cust_gender_nn not null) 7 modify(address constraint cust_address_nn not null) 8 modify(city constraint cust_city_nn not null) 9 modify(state constraint cust_state_nn not null) 10 modify(postal_code constraint cust_postalcode_nn not null) 11 modify(phone constraint cust__phone_nn not null); Table altered. SQL> SQL> SQL> SQL> /* creates the public synonym for customer */ create public synonym customer for customer; Synonym created. SQL> SQL> SQL> SQL> 2 3 4 5 /* creates the department table*/ CREATE TABLE DEPARTMENT (DEPARTMENT_ID NUMBER, NAME VARCHAR(20), MANAGER_ID NUMBER, CONSTRAINT DEPART_DEPARTSTRID_PK PRIMARY KEY(DEPARTMENT_ID), 57
    • 6 CONSTRAINT DEPTART_MANGID_FK FOREIGN KEY(MANAGER_ID) REFERENCES EMPLOYEE(EMPLOYEE_ID) 7 ); Table created. SQL> SQL> /* creates the not null constraint to the department table */ SQL> SQL> Alter table Department 2 modify(department_id constraint dept_departid_nn not null ) 3 modify(name constraint dept_name_nn not null); Table altered. SQL> CREATE PUBLIC SYNONYM DEPARTMENT FOR DEPARTMENT; Synonym created. SQL> SQL> /* create the sequence for the department id column and the trigger to automatically populate it*/ SQL> SQL> CREATE SEQUENCE depart_deptid_seq increment by 89 start with 208 NOCYCLE nocache order; Sequence created. SQL> SQL> begin 2 execute immediate 'create or replace trigger deptid_trgg '|| 3 ' before insert on "SYSTEM"."DEPARTMENT" '|| 4 ' for each row '|| 5 'begin '|| 6 ' if inserting then '|| 7 ' if :NEW."DEPARTMENT_ID" is null then '|| 8 ' select DEPART_DEPTID_SEQ.nextval into :NEW."DEPARTMENT_ID" from dual; '|| 9 ' end if; '|| 10 ' end if; '|| 11 'end;'; 12 end; 13 14 / PL/SQL procedure successfully completed. SQL> 2 3 4 CREATE TABLE HRRECORD (EMPLOYEE_ID NUMBER, HR_ID NUMBER, DEPARTMENT_ID NUMBER, 58
    • 5 SICK_HOURS NUMBER, 6 VACATION_HOURS NUMBER, 7 RANK CHAR(30), 8 HIRE_DATE DATE, 9 PAY_RATE NUMBER, 10 Office_Phone varchar2(35), 11 CONSTRAINT HRREC_EMPHRID_PK PRIMARY KEY(EMPLOYEE_ID, HR_ID, DEPARTMENT_ID), 12 CONSTRAINT HRREC_EMPHIRIDUK_UK UNIQUE (HR_ID), 13 CONSTRAINT HRREC_HRDEPTID_FK FOREIGN KEY(DEPARTMENT_ID)REFERENCES DEPARTMENT(DEPARTMENT_ID) ON DELETE CASCADE, 14 CONSTRAINT HRREC_EMPLOYEEID_FK FOREIGN KEY(EMPLOYEE_ID) REFERENCES EMPLOYEE (EMPLOYEE_ID) ON DELETE CASCADE 15 ); Table created. SQL> SQL> CREATE PUBLIC SYNONYM HRRECORD FOR HRRECORD; Synonym created. SQL> SQL> SQL> SQL> /* creates the sequences to create primary key values and the trigger to generate them automatically*/ SQL> SQL> CREATE SEQUENCE HR_HRID_SEQ increment by 887977 start with 268 NOCYCLE nocache order; Sequence created. SQL> SQL> begin 2 execute immediate 'create or replace trigger hrrid2_trgg '|| 3 ' before insert on "SYSTEM"."HRRECORD" '|| 4 ' for each row '|| 5 'begin '|| 6 ' if inserting then '|| 7 ' if :NEW."HR_ID" is null then '|| 8 ' select HR_HRID_SEQ.nextval into :NEW."HR_ID" from dual; '|| 9 ' end if; '|| 10 ' end if; '|| 11 'end;'; 12 end; 13 14 / PL/SQL procedure successfully completed. SQL> SQL> /* creates the table product to hold all data relating to a product*/ 59
    • SQL> SQL> 2 3 4 5 6 7 8 Create table product (Product_ID Number constraint prod_prodnumber_nn not null, product_Name varchar2(90), Product_Price number, Product_Brand Varchar2(35), Product_Description CLOB, Product_Category varchar2(30) ); Table created. SQL> SQL> SQL> SQL> 2 3 4 /* creates the not null and primary key constraint */ Alter table product modify(Product_Price constraint prod_prodcost_nn not null) modify(product_name constraint prod_prodname_nn not null) modify(Product_Category constraint prod_prodcategory_nn not null); Table altered. SQL> SQL> 2 Alter table product modify(product_id constraint prod_productid_pk primary key); Table altered. SQL> SQL> /*creates the tansactions table */ SQL> SQL> 2 3 4 5 6 7 8 9 10 create table transactions (Transacton_ID VARCHAR2(60), Credit_Card_ID Number, Card_Type char(24), EXP_DATE DATE, Trans_Date Date, Amount_Charged Number, Brand Char(20), Constraint trans_transactionsid_pk ); PRIMARY KEY (Transacton_ID) Table created. /*creates the sequece used to populate the credit card values */ create sequence creditcard start with 1200007800002345 increment by 809 nocycle nocache order; 60
    • create sequence succeeded. begin execute immediate 'create or replace trigger ccredit '|| ' before insert on "SYSTEM"."TRANSACTIONS" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."CREDIT_CARD_ID" is null then '|| ' select CREDITCARD.nextval into :NEW."CREDIT_CARD_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / anonymous block completed SQL> SQL> /*Create the sales table */ SQL> SQL> create table sales 2 (Customer_id number, 3 Transacton_ID VARCHAR2(60), 4 Product_id number, 5 Order_ID Number, 6 QTY_Ordered number, 7 Product_Price_Original number, 8 Product_price_WT_QTY number, 9 Tax_Amount_Charged Number, 10 Freight_Amount_charged number, 11 Total_Amount Number, 12 Order_Date Date, 13 Constraint sales_custprodidtrand_pk primary key(customer_id, product_id, Transacton_ID, order_id) 14 , constraint sales_salid_uk unique(Order_id) 15 , constraint sales_custid_fk foreign key(customer_id) references customer(customer_id) on delete cascade, 16 constraint sales_pproductid_fk foreign key(product_id) references product(product_id) on delete cascade 17 ); Table created. SQL> SQL> /* adds the foreign key constraint linking transaction to sales table */ 61
    • SQL> Alter table sales 2 add constraint saltransidU_fk foreign key (Transacton_ID) references transactions(Transacton_ID); Table altered. SQL> /*creates table to hold all customer card information*/ create table customercards (Account_Number Number, customer_id Number, print_date date, print_employee_id number, status char(20), employee_id number, constraint custcard_empid_fk foreign key(print_employee_id) references employee(employee_id), constraint custcards_pk primary key (Account_Number,Customer_id, employee_Id), constraint custcards_custid_fk foreign key (customer_id) references customer(customer_id), constraint custcards_empid_fk foreign key(employee_id) references employee(employee_id), constraint custcard_ser_uk unique(Account_Number) ) create table succeeded. /*creates the table to hold all cards closed or lost reported by customer*/ create table customercardsclose (serial_number number, Account_Number number, close_employee_ID number, close_date number, notes clob, constraint custclcad_pk primary key(serial_number,Account_Number), constraint custclcad_sernum_uk unique (serial_number), constraint custclad_cempid_fk foreign key(close_employee_ID) references employee(employee_id) ) create table succeeded. /*creates the table to hold all projects the company are working or has worked on*/ create table projects (project_id number, Manager_id Number, project_title number, start_date date, end_date date, Awarded_Amount number, notes clob, 62
    • constraint project_proj_pk primary key (project_id, manager_id), constraint project_magid_fk foreign key(manager_id) references employee(employee_id), constraint project_projid_uk unique (project_id) ) create table succeeded. /*creates the sequence to populate the fire automatic inserts*/ peoject_id column of projects and the trigger to create sequence projet_projeid_sq start with 054456 order nocycle nocache increment by 56 create sequence succeeded. begin execute immediate 'create or replace trigger project_trgg '|| ' before insert on "SYSTEM"."PROJECTS" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."PROJECT_ID" is null then '|| ' select PROJET_PROJEID_SQ.nextval into :NEW."PROJECT_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; END; anonymous block completed /*creates the project work book table to hold all important information relating to a project*/ create table Projectworkbook (project_id number, employee_id number, workbook_id number, Hours_Assign Number, Role varchar2(40), constraint projwork_pk primary key(employee_id, project_id, workbook_id), constraint projwork_wbk_uk unique (workbook_id), constraint projwork_wb_fk foreign key(project_id) references projects(project_id) constraint projwork_emp_id_fk foreign key(employee_id) references employee(employee_id) ); create table succeeded. /*creates the sequence and trigger to fire inserts for pk column*/ create sequence pjwbk_wbid_seq start with 06745 increment by 34 nocycle order nocache 63
    • create sequence succeeded. begin execute immediate 'create or replace trigger pjworkbook '|| ' before insert on "SYSTEM"."PROJECTWORKBOOK" '|| ' for each row '|| 'begin '|| ' if inserting then '|| ' if :NEW."WORKBOOK_ID" is null then '|| ' select PJWBK_WBID_SEQ.nextval into :NEW."WORKBOOK_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; END; / anonymous block completed /*creates the inventory table*/ create table inventory (inventory_id number, employee_id number, product_id number, QTY_Stocked Number, QTY_remaing Number, Stack_date date, next_stack_date number, constraint inventory_invid_pk primary key(inventory_id,employee_id, product_id), constraint invent_invid_uk unique (inventory_id), constraint invent_empid_fk foreign key(employee_id) references employee(employee_id), constraint invent_prodid_fk foreign key(product_id) references product(product_id) ) create table succeeded. /* creates the sequence and the trigger to fire pk values upon inserts*/ create sequence inventory_invid_seq start with 21344 order increment by 78 nocycle nocache create sequence succeeded. begin execute immediate 'create or replace trigger inventor ' before insert on "SYSTEM"."INVENTORY" '|| ' for each row '|| 'begin '|| '|| 64
    • ' if inserting then '|| ' if :NEW."INVENTORY_ID" is null then '|| ' select INVENTORY_INVID_SEQ.nextval into :NEW."INVENTORY_ID" from dual; '|| ' end if; '|| ' end if; '|| 'end;'; end; / anonymous block completed SQL> set echo off; SQL> spool off; /****************************************END OF SPOOL FILE 1***********************************************************/ TABLE POPULATION Employee Insert Statement EMPLOYEEINSERT.SQL Customer Insert Statement CUSTOMERINSERT.SQL Product Insert Statement SQL loader was used to insert the product data. Please see the attached control and log files. product.ctl product.log product.sh Transaction Insert Statement TRANSACTION_FN.SQL 65
    • Sales Insert Statement SAL_FN.SQL Department Insert Statement DEPARTMENT.SQL Hrrecord Insert Statement HR_FN.SQL Project and Project Workbook PROJECT_SPOOL.SQL Inventory inventory_spool.sql CustomerCards and Customercardsclose customer_card_spool.sql USER MANAGEMENT SQL> show user USER is "DAVYALOVSKY0" SQL> SQL> 2 3 User create user AlexHD identified by AlexdJHU password expire; created. SQL> SQL> create user BrendaUDH 2 identified by BrenDJK 66
    • 3 password expire; User created. SQL> SQL> create user BerryHK 2 identified by joeberr 3 password expire; User created. SQL> SQL> create user DavidMGI 2 identified by Davortiz 3 password expire; User created. SQL> SQL> create user EricYMU 2 identified by Ericjank 3 password expire; User created. SQL> SQL> create user SamarawickramaULP 2 identified by Prasannasa 3 password expire; User created. SQL> SQL> create user RaymondPLK 2 identified by SamRydmd 3 password expire; User created. SQL> SQL> create user AckermanJKP 2 identified by PilarAcker 3 password expire; User created. SQL> SQL> create user RounthwaiteUHG 2 identified by RobertRoun 3 password expire; 67
    • User created. SQL> SQL> create user LiGeorgeTRW 2 identified by Georgehgy 3 password expire; User created. SQL> SQL> SQL> 2 3 User create user MichaelsThVY identified by ThomasMichel password expire; created SQL> SQL> SQL> create user AnnetteHiJ 2 identified by hillannett 3 password expire; User created. SQL> SQL> create user NiswongerOIU 2 identified by chadNwg 3 password expire; User created. SQL> SQL> create user MohamedB2B 2 identified by Mohamedshami 3 password expire; User created. SQL> SQL> create user RandallcythIK 2 identified by cynthiaRnad 3 password expire; User created. SQL> SQL> create user MohansuOK 2 identified by Suchitramsu 3 password expire; User created. 68
    • SQL> SQL> create user IvoLKW 2 identified by Salmreivo 3 password expire; User created. SQL> SQL> create user kaneVMP 2 identified by kaneriol 3 password expire; User created. SQL> SQL> create user ThierrydherLK 2 identified by dhersthier 3 password expire; User created. SQL> SQL> create user PhilipsCLZ 2 identified by Carolphilp 3 password expire; User created. SQL> SQL> create user caoJuIY 2 identified by Junco 3 password expire; User created. SQL> SQL> create user fordjeffNK 2 identified by jefferyfd 3 password expire; User created. SQL> SQL> CREATE USER STADICKDL 2 identified by stadickbsty 3 password expire; User created. SQL> 69
    • SQL> SQL> /*creates authentication table*/ SQL> SQL> create table authenticationEMP 2 (EMPLOYEE_ID NUMBER, 3 AUTHENTICATION_ID NUMBER, 4 USER_NAME VARCHAR2(40), 5 CONSTRAINT authent_authentpk primary key(Employee_id, authentication_id), 6 constraint authent_employeeid_fk foreign key(employee_id) references employee(employee_id), 7 constraint auth_username_uk unique (user_name), 8 constraint auth_authentic_k unique (authentication_id) 9 ); Table created. SQL> /* creates the sequence to populate the primary key columns with a trigger defined below */ SQL> SQL> create sequence auth_authid_seq start with 0889373 increment by 203 nocycle order; Sequence created. SQL> SQL> SQL> begin 2 execute immediate 'create or replace trigger AUTH '|| 3 ' before insert on "DAVYALOVSKY0"."AUTHENTICATIONEMP" '|| 4 ' for each row '|| 5 'begin '|| 6 ' if inserting then '|| 7 ' if :NEW."AUTHENTICATION_ID" is null then '|| 8 ' select AUTH_AUTHID_SEQ.nextval into :NEW."AUTHENTICATION_ID" from dual; '|| 9 ' end if; '|| 10 ' end if; '|| 11 'end;'; 12 END; 13 / PL/SQL procedure successfully completed. SQL> SQL> SQL> SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 159, 'AlexHD'); 70
    • 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID, USER_NAME) 2 values(214,'BrendaUDH'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 264 ,'BerryHK'); 1 row created. SQL> 2 INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 55, 'DavidMGI'); 1 row created. SQL> 2 INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) values( 245, 'EricYMU'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values(241, 'SamarawickramaULP' ); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 67, 'RaymondPLK'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 87 ,'AckermanJKP'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 148, 'RounthwaiteUHG'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values(64 'LiGeorgeTRW' ); values(64 'LiGeorgeTRW' ) * ERROR at line 2: ORA-00917: missing comma SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID ,USER_NAME) 71
    • 2 values( 198 , 'MichaelsThVY'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 268 ,'AnnetteHiJ'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 183, 'NiswongerOIU' ); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 138 ,'RandallcythIK'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID, USER_NAME) 2 values( 70 ,'MohamedB2B'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 179, 'MohansuOK'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 28 ,'IvoLKW' ); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 201, 'kaneVMP'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID, USER_NAME) 2 values( 6, 'ThierrydherLK'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 171, 'PhilipsCLZ'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 50, 'caoJuIY'); 72
    • 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 17 , 'fordjeffNK'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID, USER_NAME) 2 values(228, 'StadickDL'); 1 row created. SQL> INSERT INTO AUTHENTICATIONEMP(EMPLOYEE_ID,USER_NAME) 2 values( 88 ,'DAVYALOVSKY0' ); 1 row created. SQL> commit; Commit complete. SQL> set echo off SQL> spool off; APPLICATION CONTEXT > CREATE OR REPLACE CONTEXT EMPLOYE_SEC context EMPLOYE_SEC created. using EMPLYV1_CTX > create or replace package EMPLYV1_CTX AS PROCEDURE set_EMPID; PROCEDURE clear_EMPID; END EMPLYV1_CTX; PACKAGE EMPLYV1_CTX compiled > CREATE OR REPLACE PACKAGE BODY EMPLYV1_CTX AS ---------------------------------------PROCEDURE set_EMPID AS 73
    • l_EMPID NUMBER; BEGIN SELECT EMPID INTO l_EMPID FROM UEMP WHERE username = SYS_CONTEXT('USERENV', 'SESSION_USER'); DBMS_SESSION.SET_CONTEXT (namespace => 'EMPLOYE_SEC', ATTRIBUTE => 'EMPID', VALUE => l_EMPID); END set_EMPID; ----------------------------------------------PROCEDURE clear_EMPID AS BEGIN DBMS_SESSION.CLEAR_CONTEXT (namespace => 'EMPLOYE_SEC', ATTRIBUTE => 'EMPID'); END clear_EMPID; -----------------------------------------------------END EMPLYV1_CTX; PACKAGE BODY EMPLYV1_CTX compiled > CREATE OR REPLACE TRIGGER USRLOGIN AFTER LOGON ON DATABASE BEGIN system.EMPLYV1_CTX.set_EMPID; EXCEPTION WHEN NO_DATA_FOUND THEN -- IF NO DATA IS FOUND, USER IS NOT IN THE DATABASE. --- MAY NOT BE ABLE TO LOGON. NULL; END; TRIGGER USRLOGIN compiled PASSWORD MANAGEMENT Password Authentication --------------------------Password Authentication---------------------------/*creates the table to store and validate passwords*/ create table pwordauthenticate (username varchar2(45), passwd varchar2(45), verifier varchar2(30), constraint password_pword099_pk primary key (username, passwd) ) create table succeeded. 74
    • /*creates the index for username and the verifier*/ create index verifier on pwordauthenticate(username, verifier) create index succeeded. /*creates the procedure to validate passwords*/ create or replace procedure feed_password (p_password in varchar2 default null) as l_new_password_verifier dba_users.PASSWORD%TYPE; l_password dba_users.PASSWORD%TYPE := UPPER (p_password); BEGIN FOR rec IN (SELECT username,password from dba_users) LOOP IF (p_password is NULL) THEN ---PASSWORD IS EITHER PASSED AS PARAMETER OR SET SET USER'S NAME---l_password :=rec.username; END IF; -----CREATE NEW PASSWORD VERIFIER----------EXECUTE IMMEDIATE 'Alter user' ||rec.username ||'identified by' ||l_password; ----RETERIVE NEW VERIFIER------------------------SELECT password into l_new_password_verifier from dba_users where username = rec.username; ---------------INSERT VALUE INTO PASSWORD TABLE-------INSERT INTO pwordauthenticate VALUES(rec.username, l_password, l_new_password_verifier); --set password back to its original value EXECUTE IMMEDIATE 'alter user' || rec.username ||'identified by values ''' || rec.password ||''''; end loop; end; PROCEDURE FEED_PASSWORD compiled ------------------------------------------------end--------------------------------------Password Requirements create or replace function pword_strength (p_username varchar2, p_new_password varchar2, p_old_password varchar2) 75
    • --- RETURN TRUE IF PASSWORD IS STRONG ENOUGH----RETURN BOOLEAN AS l_return_val BOOLEAN := TRUE; BEGIN ---CHECK TO BE SURE PASSWORD IS NOT THE SAME AS USERNAME---IF UPPER(p_new_password) = UPPER(p_username) THEN l_return_val :=FALSE; raise_application_error (-20001, 'Password same as username'); END IF; ----FORCES USER TO CHANGE PASSWORD TO SOMETHING NEW IF UPPER (p_new_password) = UPPER (p_old_password) THEN l_return_val :=FALSE; raise_application_error(-20004, 'Password has to be different then the old password'); END IF; -- MAKE SURE PASSWORD IS NOT MADE UP OF NUMBERS ----IF(regexp_like(p_new_password, '[:alnum:]' ) = FALSE) THEN L_RETURN_VAL :=FALSE; raise_application_error (-20003 ,'Password must contain numbers, letters or character'); END IF; --MAKE SURE PASSWORD IS AT LEAST SIX CHARACTERS--IF LENGTH(p_new_password) <= 7 THEN l_return_val :=FALSE; raise_application_error(-20005, 'Password is too short'); END IF; RETURN l_return_val; END; / /* in real production the values would change to a higher value. This is set for testing reason.*/ CREATE PROFILE SPASSWORD LIMIT PASSWORD_LIFE_TIME 5 PASSWORD_GRACE_TIME 5 PASSWORD_REUSE_TIME 180 PASSWORD_REUSE_MAX UNLIMITED FAILED_LOGIN_ATTEMPTS 5 PASSWORD_LOCK_TIME .5 PASSWORD_VERIFY_FUNCTION pword_strength; -----------------------------end-----------------------------------------------FUNCTION pword_strength compiled profile SPASSWORD created. AUDIT MANAGEMENT 76
    • ---KEEPS TRACK OF USERS WHO ACCESSED THE DATABASE-----------BEGIN for rec IN (SELECT username, action_name, TO_CHAR(TIMESTAMP, 'Mon-DD HH24:MI') LOGON, TO_CHAR(logoff_time, 'Mon-DD HH24:MI') LOGOFF, priv_used, comment_text from dba_audit_trail) LOOP DBMS_OUTPUT.put_line('user: ' || rec.username); DBMS_OUTPUT.put_line('Action: ' || rec.action_name); DBMS_OUTPUT.put_line('Logon: ' || rec.LOGON); DBMS_OUTPUT.put_line('Logoff: ' || rec.LOGOFF); DBMS_OUTPUT.put_line('priv_used: ' || rec.priv_used); DBMS_OUTPUT.put_line('comments: ' || rec.comment_text); DBMS_OUTPUT.put_line ('-------------------------------END of Record--------------------'); END LOOP; END; anonymous block completed BEGIN FOR rec IN (SELECT audit_type, db_user, object_schema, object_name, extended_timestamp, sql_text from dba_common_audit_trail) LOOP DBMS_OUTPUT.put_line( 'Audit Type: ' || rec.audit_type); DBMS_OUTPUT.put_line( 'User: ' || rec.db_user); DBMS_OUTPUT.put_line('What: ' || rec.object_schema ||'.' || rec.object_name); DBMS_OUTPUT.put_line('When: ' || rec.extended_timestamp); DBMS_OUTPUT.put_line('HOW: ' || rec.sql_text); DBMS_OUTPUT.put_line ('--------------------End Of Record--------------------'); END LOOP; END; 77
    • anonymous block completed /* Audit was created after the views has been created*/ AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT AUDIT SELECT, INSERT, UPDATE, DELETE ON EMPLOYEE BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON HRRECORD BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON CUSTOMER BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON PRODUCT BY ACCESS; SELECT,INSERT, UPDATE, DELETE ON INVENTORY BY ACCESS; SELECT,INSERT, UPDATE, DELETE ON TRANSHISTORY BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON SALES BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON ORDERS2 BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON CUSTOMERDATA BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON rCUSTOMERDATA BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON rorders BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON orders2 BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON EMPLOYEERV BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON EmployeeHR BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON PROJECTS BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON PROJECTWORKBOOK BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON PROJECT BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON PJWORK BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON CustCard BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON CARDCLOSE BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON customercards BY ACCESS; SELECT, INSERT, UPDATE, DELETE ON customercardsclose BY ACCESS; select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select,insert, UPDATE, succeeded. select,insert, UPDATE, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. select, INSERT, succeeded. VIRTUAL PRIVATE DATABASE 78
    • SQL> SQL> SQL> 2 3 4 5 6 7 8 9 CREATE OR REPLACE FUNCTION EMPID_RET( p_schema IN VARCHAR2 DEFAULT NULL, p_object IN VARCHAR2 DEFAULT NULL) RETURN VARCHAR2 AS BEGIN RETURN 'EMPID = SYS_CONTEXT (''EMPLOYE_SEC'',''EMPID'')'; END; / Function created. SQL> SQL> /*Allows employee to view all the projects they have worked*/ Function created. SQL> SQL> 2 3 4 5 6 7 8 9 10 BEGIN DBMS_RLS.add_policy (object_schema => 'SYSTEM', OBJECT_NAME => 'projworkbook', POLICY_NAME => 'WORKBOOKPJ', FUNCTION_SCHEMA => 'SYSTEM', POLICY_FUNCTION => 'EMPID_RET', STATEMENT_TYPES => ' SELECT'); END; / DYNAMIC VIEWS > create or replace view EmployeeRV AS SELECT FIRST_NAME, MIDDLE_NAME, LAST_NAME, BIRTH_DATE, GENDER, EMPLOYEE_ID, MARITAL_STATUS, ADDRESS, CITY, STATE, POSTAL_CODE, PHONE FROM EMPLOYEE WHERE EMPLOYEE_ID = SYS_CONTEXT ('EMPLOYE_SEC','EMPID') view EMPLOYEERV created. > CREATE OR REPLACE TRIGGER DELUPD_RESTRICT_EMPLY BEFORE DELETE OR UPDATE ON EMPLOYEE FOR EACH ROW BEGIN IF(:OLD.EMPLOYEE_ID != SYS_CONTEXT ('EMPLOYE_SEC','EMPID')) THEN raise_application_error 79
    • (-20001, CHR(10) || '** YOU CAN ONLY UPDATE YOUR OWN RECORD.' || CHR(10) ||'** YOUR EMPLOYEE ID IS' || SYS_CONTEXT ('EMPLOYE_SEC','EMPID') ) ; END IF; END; TRIGGER DELUPD_RESTRICT_EMPLY compiled > CREATE or replace view EmployeeHR AS SELECT E.FIRST_NAME ,E.MIDDLE_NAME ,E.LAST_NAME , H.SICK_HOURS, H.VACATION_HOURS, H.RANK, H.HIRE_DATE, H.PAY_RATE, H.OFFICE_PHONE, D.NAME, G.FIRST_NAME||','||G.LAST_NAME AS "MANAGER_NAME" FROM EMPLOYEE E INNER JOIN HRRECORD H ON E.EMPLOYEE_ID = H.EMPLOYEE_ID INNER JOIN DEPARTMENT D ON H.DEPARTMENT_ID = D.DEPARTMENT_ID INNER JOIN EMPLOYEE G ON D.MANAGER_ID = G.EMPLOYEE_ID WHERE E.EMPLOYEE_ID = SYS_CONTEXT ('EMPLOYE_SEC','EMPID') view EMPLOYEEHR created. NON-DYNAMIC VIEWS SQL> 2 3 4 5 6 7 8 9 10 11 CREATE VIEW CUSTOMERINFO AS SELECT A.ACCOUNT_NUMBER, A.CUSTOMER_ID, A.STATUS, C.FIRST_NAME, C.MIDDLE_NAME, C.LAST_NAME, C.ADDRESS, C.CITY, C.PHONE, C.STATE, C.BIRTH_DATE FROM CUSTOMERCARDS A INNER JOIN CUSTOMER C ON A.CUSTOMER_ID = C.CUSTOMER_ID / View created. SQL> Create view empdirectory 2 as 80
    • 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 SELECT E.FIRST_NAME ||'-'||E.MIDDLE_NAME||','|| E.LAST_NAME AS EMPLOYEE, H.RANK, D.NAME AS "DEPARTMENT NAME", G.FIRST_NAME ||','||G.LAST_NAME AS "DEPARTMENT MANAGER" FROM EMPLOYEE E INNER JOIN HRRECORD H ON E.EMPLOYEE_ID = H.EMPLOYEE_ID INNER JOIN DEPARTMENT D ON H.DEPARTMENT_ID = D.DEPARTMENT_ID INNER JOIN EMPLOYEE G ON G.EMPLOYEE_ID = D.MANAGER_ID ORDER BY D.DEPARTMENT_ID; View created. SQL> create view orders2 2 as 3 SELECT C.FIRST_NAME ,C.MIDDLE_NAME,C.LAST_NAME ,C.CUSTOMER_ID, 4 S.ORDER_ID, S.PRODUCT_ID, P.PRODUCT_NAME AS "NAME", S.QTY_ORDERED, S.PRODUCT_PRICE_ORIGINAL AS "Orginal-Price", 5 S.TAX_AMOUNT_CHARGED AS "Tax", S.FREIGHT_AMOUNT_CHARGED AS "Shipping", S.TOTAL_AMOUNT AS "Final Amount", 6 S.ORDER_DATE AS "Date-Ordered" 7 from 8 SALES S 9 INNER JOIN CUSTOMER C 10 ON S.CUSTOMER_ID = C.CUSTOMER_ID 11 INNER JOIN 12 PRODUCT P 13 ON S.PRODUCT_ID = P.PRODUCT_ID; View created. SQL> 2 3 4 5 6 CREATE VIEW CUSTOMERDATA AS SELECT c.customer_Id ,C.FIRST_NAME, C.MIDDLE_NAME, C.LAST_NAME, C.ADDRESS, C.CITY, C.PHONE, C.STATE, C.BIRTH_DATE FROM CUSTOMER C; View created. SQL> 2 3 4 5 6 7 CREATE VIEW DEPARTMENTS AS SELECT E.FIRST_NAME ||','|| E.LAST_NAME AS MANAGER, D.NAME, H.OFFICE_PHONE FROM EMPLOYEE E INNER JOIN DEPARTMENT D ON 81
    • 8 9 10 11 12 SQL> SQL> 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 E.EMPLOYEE_ID = D.MANAGER_ID INNER JOIN HRRECORD H ON H.EMPLOYEE_ID = E.EMPLOYEE_ID; create view projworkbook as select e.first_name , e.middle_name, e.last_name,d.name as department_name, p.hours_assign, p.role, j.project_title as Project_Tile, start_date, j.end_date,e.first_name||','||e.last_name as "Project Manager" from employee e inner join hrrecord h on h.employee_id = e.employee_id inner join department d on h.department_id = d.department_id inner join projects j on j.manager_id = e.employee_id inner join projectworkbook p on j.project_id = p.project_id; View created. create or replace view rorders as SELECT C.CUSTOMER_ID, S.ORDER_ID, S.PRODUCT_ID, P.PRODUCT_NAME AS "NAME", S.QTY_ORDERED, S.PRODUCT_PRICE_ORIGINAL AS "Orginal-Price", S.TAX_AMOUNT_CHARGED AS "Tax", S.FREIGHT_AMOUNT_CHARGED AS "Shipping", S.TOTAL_AMOUNT AS "Final Amount", S.ORDER_DATE AS "Date-Ordered" from SALES S INNER JOIN CUSTOMER C ON S.CUSTOMER_ID = C.CUSTOMER_ID INNER JOIN PRODUCT P ON S.PRODUCT_ID = P.PRODUCT_ID; view RORDERS created. CREATE or replace VIEW rCUSTOMERDATA AS SELECT c.customer_Id, C.CITY, C.STATE, C.BIRTH_DATE, C.POSTAL_CODE, C.COUNTRY, C.GENDER, C.YEARLY_INCOME, C.MARITAL_STATUS , C.EDUCATIONAL_BACKGROUND ,C.TOTAL_CHILDREN ,C.TOTAL_CARS_OWNED,C.PROFESSION FROM CUSTOMER C; 82
    • view RCUSTOMERDATA created. View created. SQL> set echo off SQL> spool off; DATABASE MANAGEMENT > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION TO AlexHD TO BrendaUDH TO BerryHK TO DavidMGI TO EricYMU TO SamarawickramaULP TO RaymondPLK TO AckermanJKP TO RounthwaiteUHG TO LiGeorgeTRW TO MichaelsThVY TO AnnetteHiJ TO NiswongerOIU TO MohamedB2B TO RandallcythIK TO MohansuOK TO IvoLKW TO kaneVMP TO ThierrydherLK TO PhilipsCLZ TO caoJuIY 83
    • GRANT succeeded. > GRANT CREATE SESSION TO fordjeffNK GRANT succeeded. > GRANT CREATE SESSION TO STADICKDL GRANT succeeded. > GRANT CREATE SESSION TO DAVYALOVSKY0 GRANT succeeded. > show errors No Errors. > Create ROLE HR role HR created. > Grant select, update , insert on HRRECORD to HR Grant succeeded. > Create or replace public synonym employee for employee public synonym EMPLOYEE created. > Grant SELECT , INSERT, UPDATE on employee to HR Grant succeeded. > Grant HR TO MohansuOK Grant succeeded. > CREATE ROLE ACCOUNTANTS role ACCOUNTANTS created. > CREATE OR REPLACE PUBLIC SYNONYM TRANSACTIONS FOR TRANSHISTORY public synonym TRANSACTIONS created. > CREATE OR REPLACE PUBLIC SYNONYM SALES FOR SALES public synonym SALES created. > CREATE OR REPLACE PUBLIC SYNONYM ORDER1 FOR ORDERS2 public synonym ORDER1 created. > CREATE OR REPLACE PUBLIC SYNONYM CUSTDATA01 FOR CUSTOMERDATA public synonym CUSTDATA01 created. > GRANT SELECT, UPDATE ON TRANSACTIONS TO ACCOUNTANTS GRANT succeeded. > GRANT SELECT, UPDATE ON SALES TO ACCOUNTANTS GRANT succeeded. > GRANT SELECT, UPDATE ON ORDER1 TO ACCOUNTANTS GRANT succeeded. > GRANT SELECT ON CUSTDATA01 TO ACCOUNTANTS GRANT succeeded. > GRANT ACCOUNTANTS TO AckermanJKP GRANT succeeded. > GRANT ACCOUNTANTS TO RaymondPLK GRANT succeeded. > GRANT ACCOUNTANTS TO kaneVMP GRANT succeeded. > CREATE ROLE RANALYST role RANALYST created. > CREATE OR REPLACE PUBLIC SYNONYM CUSTDATA02 FOR rCUSTOMERDATA public synonym CUSTDATA02 created. > GRANT SELECT ON CUSTDATA02 TO RANALYST GRANT succeeded. > CREATE OR REPLACE PUBLIC SYNONYM ORDERS04 FOR rorders public synonym ORDERS04 created. > GRANT SELECT ON ORDERS04 TO RANALYST GRANT succeeded. > Grant RANALYST to DavidMGI Grant succeeded. 84
    • > CREATE ROLE SALES role SALES created. > GRANT SELECT ON TRANSACTIONS TO SALES GRANT succeeded. > GRANT SELECT ON SALES TO SALES GRANT succeeded. > GRANT SELECT ON ORDER1 TO SALES GRANT succeeded. > GRANT SELECT ON CUSTDATA01 TO SALES GRANT succeeded. > CREATE OR REPLACE PUBLIC SYNONYM PRODT FOR PRODUCT public synonym PRODT created. > GRANT SELECT, UPDATE, INSERT ON PRODT TO SALES GRANT succeeded. > CREATE OR REPLACE PUBLIC SYNONYM INVENT FOR INVENTORY public synonym INVENT created. > CREATE OR REPLACE PUBLIC SYNONYM INVENT FOR INVENTORY; GRANT SELECT, UPDATE(PRODUCT_ID, NEXT_STACK_DATE, QTY_REMANING), INSERT ON INVENT TO SALES; GRANT succeeded. > GRANT SALES TO MohamedB2B GRANT succeeded. > GRANT SALES TO ThierrydherLK GRANT succeeded. > CREATE ROLE CUSTOMERREP role CUSTOMERREP created. > CREATE OR REPLACE PUBLIC SYNONYM CUSTINFO FOR CUSTOMERINFO public synonym CUSTINFO created. > GRANT SELECT, INSERT, UPDATE ON CUSTINFO TO CUSTOMERREP GRANT succeeded. > CREATE OR REPLACE PUBLIC SYNONYM orders08 FOR orders2 public synonym ORDERS08 created. > GRANT SELECT, UPDATE ON orders08 to customerrep GRANT succeeded. > GRANT CUSTOMERREP TO NiswongerOIU GRANT succeeded. > GRANT CUSTOMERREP TO PhilipsCLZ GRANT succeeded. > CREATE ROLE EMPLOYEE role EMPLOYEE created. > /*EMPLOYEE DYNAMIC AND NON DYNAMIC VIEWS*/ > CREATE OR REPLACE PUBLIC SYNONYM EMPLOYEERV FOR EMPLOYEERV public synonym EMPLOYEERV created. > GRANT SELECT, UPDATE, INSERT ON EMPLOYEERV TO EMPLOYEE GRANT succeeded. > CREATE OR REPLACE PUBLIC SYNONYM EmployeeHR FOR EmployeeHR public synonym EMPLOYEEHR created. > GRANT SELECT, UPDATE, INSERT ON EmployeeHR TO EMPLOYEE GRANT succeeded. > CREATE OR REPLACE PUBLIC SYNONYM EMPDIRECTORY FOR empdirectory public synonym EMPDIRECTORY created. > GRANT SELECT ON EMPDIRECTORY TO EMPLOYEE GRANT succeeded. > CREATE OR REPLACE PUBLIC SYNONYM WORKBOOK FOR projworkbook public synonym WORKBOOK created. > GRANT EMPLOYEE TO AlexHD GRANT succeeded. > GRANT EMPLOYEE TO BerryHK GRANT succeeded. 85
    • > GRANT EMPLOYEE TO DavidMGI GRANT succeeded. > GRANT EMPLOYEE TO EricYMU GRANT succeeded. > GRANT EMPLOYEE To SamarawickramaULP GRANT succeeded. > GRANT EMPLOYEE TO RaymondPLK GRANT succeeded. > GRANT EMPLOYEE TO AckermanJKP GRANT succeeded. > GRANT EMPLOYEE TO RounthwaiteUHG GRANT succeeded. > GRANT EMPLOYEE TO MichaelsThVY GRANT succeeded. > GRANT EMPLOYEE TO AnnetteHiJ GRANT succeeded. > GRANT EMPLOYEE TO NiswongerOIU GRANT succeeded. > GRANT EMPLOYEE TO RandallcythIK GRANT succeeded. > GRANT EMPLOYEE TO MohamedB2B GRANT succeeded. > GRANT EMPLOYEE TO MohansuOK GRANT succeeded. > GRANT EMPLOYEE TO IvoLKW GRANT succeeded. > GRANT EMPLOYEE TO kaneVMP GRANT succeeded. > GRANT EMPLOYEE TO ThierrydherLK GRANT succeeded. > GRANT EMPLOYEE TO PhilipsCLZ GRANT succeeded. > GRANT EMPLOYEE TO caoJuIY GRANT succeeded. > GRANT EMPLOYEE TO fordjeffNK GRANT succeeded. > GRANT EMPLOYEE TO StadickDL GRANT succeeded. > GRANT EMPLOYEE TO DAVYALOVSKY0 GRANT succeeded. > GRANT EMPLOYEE TO BrendaUDH GRANT succeeded. > CREATE ROLE PJM role PJM created. > CREATE OR REPLACE PUBLIC SYNONYM PROJECT FOR PROJECTS public synonym PROJECT created. > CREATE OR REPLACE PUBLIC SYNONYM PJWORK FOR PROJECTWORKBOOK public synonym PJWORK created. > GRANT SELECT, INSERT, UPDATE ON PROJECT TO PJM GRANT succeeded. > GRANT SELECT , INSERT, UPDATE ON PJWORK TO PJM GRANT succeeded. > GRANT PJM TO StadickDL GRANT succeeded. > GRANT PJM TO AnnetteHiJ create or replace GRANT succeeded. public synonym invtuser for inventory_usr1; 86
    • grant select on invtuser to sales; GRANT succeeded. GRANT succeeded. > show errors No Errors. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. > GRANT CREATE SESSION GRANT succeeded. TO AlexHD TO BrendaUDH TO BerryHK TO DavidMGI TO EricYMU TO SamarawickramaULP TO RaymondPLK TO AckermanJKP TO RounthwaiteUHG TO LiGeorgeTRW TO MichaelsThVY TO AnnetteHiJ TO NiswongerOIU TO MohamedB2B TO RandallcythIK TO MohansuOK TO IvoLKW TO kaneVMP TO ThierrydherLK TO PhilipsCLZ TO caoJuIY TO fordjeffNK 87
    • > GRANT CREATE SESSION TO STADICKDL GRANT succeeded. > GRANT CREATE SESSION TO DAVYALOVSKY0 GRANT succeeded. > show errors No Errors. 88
    • QUALITY ASSURANCE 89
    • DATABASE DIAGRAM 90
    • DATABASE DICTIONARY SELECT TABLE_NAME, CONSTRAINT_NAME, CONSTRAINT_TYPE, DELETE_RULE,STATUS, INDEX_NAME FROM USER_CONSTRAINTS WHERE TABLE_NAME ='PRODUCT' OR TABLE_NAME = 'EMPLOYEE' OR TABLE_NAME = 'DEPARTMENT' OR TABLE_NAME = 'HRRECORD' OR TABLE_NAME = 'CUSTOMER' OR TABLE_NAME = 'sales' OR TABLE_NAME =' TRANSHISTORY' OR TABLE_NAME = 'INVENTORY' OR TABLE_NAME = 'PROJECTS' OR TABLE_NAME = 'PROJECTOWKRBOOK' OR TABLE_NAME = 'CUSTOMERCARDS' OR TABLE_NAME = 'Customercardsclose' OR TABLE_NAME = ' uemp' ORDER BY TABLE_NAME; TABLE_NAME -----------------------------CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMERCARDS CUSTOMERCARDS CUSTOMERCARDS CUSTOMERCARDS DEPARTMENT DEPARTMENT DEPARTMENT DEPARTMENT EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE HRRECORD HRRECORD HRRECORD HRRECORD INVENTORY INVENTORY INVENTORY INVENTORY PRODUCT PRODUCT PRODUCT PRODUCT PRODUCT PROJECTS PROJECTS PROJECTS CONSTRAINT_NAME -----------------------------CUSTO_CUSTID_PK CUST_FIRSTNAME_NN CUST_MIDNAME_NN CUST_LASTNAME_NN CUST_BIRTHDATE_NN CUST__PHONE_NN CUST_ADDRESS_NN CUST_CITY_NN CUST_STATE_NN CUST_POSTALCODE_NN CUST_GENDER_NN CUSTCARDS_PK CUSTCARD_SER_UK CUSTCARDS_CUSTID_FK CUSTCARDS_EMPID_FK DEPTART_MANGID_FK DEPART_DEPARTSTRID_PK DEPT_NAME_NN DEPT_DEPARTID_NN EMPL_POSTALCODE_NN EMPL_NATIONALID_NN EMPL_PHONE_NN EMPL_STATE_NN EMPL_CITY_NN EMPL_ADDRESS_NN EMPL_GENDER_NN EMPL_LASTNAME_NN EMPL_BIRTHDATE_NN EMPL_MIDNAME_NN EMPL_FNAME_NN EMPLOYEEID_PK EMP_CUSTID_FK HRREC_EMPLOYEEID_FK HRREC_HRDEPTID_FK HRREC_EMPHIRIDUK_UK HRREC_EMPHRID_PK INVENTORY_INVID_PK INVENT_PRODID_FK INVENT_EMPID_FK INVENT_INVID_UK PROD_PRODUCTID_PK PROD_PRODCATEGORY_NN PROD_PRODNUMBER_NN PROD_PRODNAME_NN PROD_PRODCOST_NN PROJECT_PROJID_UK PROJECT_MAGID_FK PROJECT_PROJ_PK CONSTRAINT_TYPE --------------P C C C C C C C C C C P U R R R P C C C C C C C C C C C C C P R R R U P P R R U P C C C C U R P DELETE_RULE STATUS ----------- -------ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED NO ACTION ENABLED NO ACTION ENABLED NO ACTION ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED NO ACTION ENABLED CASCADE ENABLED CASCADE ENABLED ENABLED ENABLED ENABLED NO ACTION ENABLED NO ACTION ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED ENABLED NO ACTION ENABLED ENABLED INDEX_NAME -----------------------------CUSTO_CUSTID_PK CUSTCARDS_PK CUSTCARD_SER_UK DEPART_DEPARTSTRID_PK EMPLOYEEID_PK HRREC_EMPHIRIDUK_UK HRREC_EMPHRID_PK INVENTORY_INVID_PK INVENT_INVID_UK PROD_PRODUCTID_PK PROJECT_PROJID_UK PROJECT_PROJ_PK 48 rows selected SELECT CONSTRAINT_NAME, CONSTRAINT_TYPE, TABLE_NAME, SEARCH_CONDITION FROM USER_CONSTRAINTS WHERE TABLE_NAME ='PRODUCT' OR TABLE_NAME = 'EMPLOYEE' OR TABLE_NAME = 'DEPARTMENT' OR TABLE_NAME = 'HRRECORD' OR TABLE_NAME = 'CUSTOMER' OR TABLE_NAME = 'SALES ' OR TABLE_NAME ='TRANSHISTORY' OR TABLE_NAME = 'INVENTORY' OR TABLE_NAME = 'PROJECTS' OR TABLE_NAME = 'PROJECTOWKRBOOK' OR TABLE_NAME = 'CUSTOMERCARDS' OR TABLE_NAME = 'Customercardsclose'OR TABLE_NAME = 'uemp' ORDER BY TABLE_NAME; CONSTRAINT_NAME -----------------------------CUSTO_CUSTID_PK CUST_FIRSTNAME_NN CUST_MIDNAME_NN CUST_LASTNAME_NN CUST_BIRTHDATE_NN CUST__PHONE_NN CUST_ADDRESS_NN CUST_CITY_NN CUST_STATE_NN CUST_POSTALCODE_NN CUST_GENDER_NN CUSTCARDS_PK CUSTCARD_SER_UK CUSTCARDS_CUSTID_FK CUSTCARDS_EMPID_FK DEPTART_MANGID_FK DEPART_DEPARTSTRID_PK DEPT_NAME_NN DEPT_DEPARTID_NN EMPL_POSTALCODE_NN EMPL_NATIONALID_NN EMPL_PHONE_NN CONSTRAINT_TYPE --------------P C C C C C C C C C C P U R R R P C C C C C TABLE_NAME -----------------------------CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMER CUSTOMERCARDS CUSTOMERCARDS CUSTOMERCARDS CUSTOMERCARDS DEPARTMENT DEPARTMENT DEPARTMENT DEPARTMENT EMPLOYEE EMPLOYEE EMPLOYEE SEARCH_CONDITION -------------------------------------------------------------------------------"FIRST_NAME" IS NOT NULL "MIDDLE_NAME" IS NOT NULL "LAST_NAME" IS NOT NULL "BIRTH_DATE" IS NOT NULL "PHONE" IS NOT NULL "ADDRESS" IS NOT NULL "CITY" IS NOT NULL "STATE" IS NOT NULL "POSTAL_CODE" IS NOT NULL "GENDER" IS NOT NULL "NAME" IS NOT NULL "DEPARTMENT_ID" IS NOT NULL "POSTAL_CODE" IS NOT NULL "NATIONAL_ID" IS NOT NULL "PHONE" IS NOT NULL 91
    • EMPL_STATE_NN EMPL_CITY_NN EMPL_ADDRESS_NN EMPL_GENDER_NN EMPL_LASTNAME_NN EMPL_BIRTHDATE_NN EMPL_MIDNAME_NN EMPL_FNAME_NN EMPLOYEEID_PK EMP_CUSTID_FK HRREC_EMPLOYEEID_FK HRREC_HRDEPTID_FK HRREC_EMPHIRIDUK_UK HRREC_EMPHRID_PK INVENTORY_INVID_PK INVENT_PRODID_FK INVENT_EMPID_FK INVENT_INVID_UK PROD_PRODUCTID_PK PROD_PRODCATEGORY_NN PROD_PRODNUMBER_NN PROD_PRODNAME_NN PROD_PRODCOST_NN PROJECT_PROJID_UK PROJECT_MAGID_FK PROJECT_PROJ_PK C C C C C C C C P R R R U P P R R U P C C C C U R P EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE EMPLOYEE HRRECORD HRRECORD HRRECORD HRRECORD INVENTORY INVENTORY INVENTORY INVENTORY PRODUCT PRODUCT PRODUCT PRODUCT PRODUCT PROJECTS PROJECTS PROJECTS "STATE" IS NOT NULL "CITY" IS NOT NULL "ADDRESS" IS NOT NULL "GENDER" IS NOT NULL "LAST_NAME" IS NOT NULL "BIRTH_DATE" IS NOT NULL "MIDDLE_NAME" IS NOT NULL "FIRST_NAME" IS NOT NULL "PRODUCT_CATEGORY" IS NOT NULL "PRODUCT_ID" IS NOT NULL "PRODUCT_NAME" IS NOT NULL "PRODUCT_PRICE" IS NOT NULL 48 rows selected SELECT TRIGGER_NAME, table_name , TRIGGER_TYPE, TRIGGERING_EVENT, TABLE_NAME, COLUMN_NAME, REFERENCING_NAMES, DESCRiPTION, ACTION_TYPE, status , base_object_type FROM USER_TRIGGERS; trigg_fn.txt SELECT * FROM USER_PROCEDURES; proced.txt SELECT * from user_tab_privs where grantee IN( 'RANALYST', 'ACCOUNTANTS', 'SALES' ,'CUSOMERREP','HR', 'EMPLOYEE', 'DB') ORDER BY grantee; GRANTEE GRANTABLE HIERARCHY OWNER TABLE_NAME GRANTOR PRIVILEGE ------------------------------ ------------------------------ ------------------------------ ------------------------------ --------------------------------------- --------- --------ACCOUNTANTS NO NO SYSTEM CUSTOMERCARDSCLOSE SYSTEM SELECT ACCOUNTANTS NO NO SYSTEM SALES SYSTEM SELECT ACCOUNTANTS NO NO SYSTEM SALES SYSTEM UPDATE ACCOUNTANTS NO NO SYSTEM ORDERS2 SYSTEM SELECT ACCOUNTANTS NO NO SYSTEM ORDERS2 SYSTEM UPDATE ACCOUNTANTS NO NO SYSTEM CUSTOMERDATA SYSTEM SELECT ACCOUNTANTS NO NO SYSTEM TRANSHISTORY SYSTEM UPDATE ACCOUNTANTS NO NO SYSTEM TRANSHISTORY SYSTEM SELECT ACCOUNTANTS NO NO SYSTEM CUSTOMERCARDS SYSTEM SELECT ACCOUNTANTS NO NO SYSTEM CUSTOMERCARDS SYSTEM INSERT DB NO SYSTEM UEMP SYSTEM INSERT SYSTEM UEMP SYSTEM SELECT SYSTEM UEMP SYSTEM UPDATE SYSTEM EMPLOYEERV SYSTEM SELECT SYSTEM EMPLOYEEHR SYSTEM SELECT NO DB NO NO DB NO NO EMPLOYEE NO NO EMPLOYEE NO NO 92
    • EMPLOYEE NO SYSTEM EMPDIRECTORY SYSTEM SELECT SYSTEM EMPLOYEERV SYSTEM UPDATE SYSTEM EMPLOYEEHR SYSTEM UPDATE SYSTEM EMPLOYEEHR SYSTEM INSERT SYSTEM EMPLOYEERV SYSTEM INSERT SYSTEM EMPLOYEE SYSTEM INSERT SYSTEM HRRECORD SYSTEM INSERT SYSTEM HRRECORD SYSTEM SELECT SYSTEM HRRECORD SYSTEM UPDATE SYSTEM EMPLOYEE SYSTEM SELECT SYSTEM EMPLOYEE SYSTEM UPDATE SYSTEM RORDERS SYSTEM SELECT SYSTEM RCUSTOMERDATA SYSTEM SELECT SYSTEM CUSTOMERDATA SYSTEM SELECT SYSTEM INVENTORY_USR1 SYSTEM SELECT SYSTEM INVENTORY SYSTEM INSERT SYSTEM INVENTORY SYSTEM SELECT SYSTEM INVENTORY SYSTEM UPDATE SYSTEM PRODUCT SYSTEM INSERT SYSTEM PRODUCT SYSTEM SELECT SYSTEM PRODUCT SYSTEM UPDATE SYSTEM ORDERS2 SYSTEM SELECT SYSTEM TRANSHISTORY SYSTEM SELECT SYSTEM SALES SYSTEM SELECT NO EMPLOYEE NO NO EMPLOYEE NO NO EMPLOYEE NO NO EMPLOYEE NO NO HR NO NO HR NO NO HR NO NO HR NO NO HR NO NO HR NO NO RANALYST NO NO RANALYST NO NO SALES NO NO SALES NO NO SALES NO NO SALES NO NO SALES NO NO SALES NO NO SALES NO NO SALES NO NO SALES NO NO SALES NO NO SALES NO NO 39 rows selected DESC CUSTOMER Name ---------------------CUSTOMER_ID FIRST_NAME MIDDLE_NAME LAST_NAME GENDER BIRTH_DATE YEARLY_INCOME TOTAL_CHILDREN TOTAL_CARS_OWNED MARITAL_STATUS PROFESSION ADDRESS CITY STATE POSTAL_CODE COUNTRY PHONE EDUCATIONAL_BACKGROUND Null -------NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NOT NOT NOT NULL NULL NULL NULL NOT NULL Type -----------NUMBER VARCHAR2(35) VARCHAR2(35) VARCHAR2(35) CHAR(15) VARCHAR2(45) NUMBER NUMBER NUMBER VARCHAR2(35) VARCHAR2(34) VARCHAR2(50) VARCHAR2(20) CHAR(35) VARCHAR2(20) VARCHAR2(35) VARCHAR2(25) VARCHAR2(35) DESC customercards Name Null Type -------------- -------- -------- 93
    • ACCOUNT_NUMBER NOT NULL CHAR(45) CUSTOMER_ID NOT NULL NUMBER PRINT_DATE DATE STATUS CHAR(20) EMPLOYEE_ID NOT NULL NUMBER DESC customercardsclose Name Null ----------------- -------SERIAL_NUMBER NOT NULL ACCOUNT_NUMBER NOT NULL CLOSE_EMPLOYEE_ID NOT NULL CLOSE_DATE NOTES CUSTOMER_ID DESC employee Name -------------EMPLOYEE_ID FIRST_NAME MIDDLE_NAME LAST_NAME BIRTH_DATE GENDER MARITAL_STATUS ADDRESS CITY STATE POSTAL_CODE PHONE NATIONAL_ID CUSTOMER_ID DESC hrrecord Name -------------EMPLOYEE_ID HR_ID DEPARTMENT_ID SICK_HOURS VACATION_HOURS RANK HIRE_DATE PAY_RATE OFFICE_PHONE Null -------NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NULL NOT NOT NOT NOT NOT NOT NULL NULL NULL NULL NULL NULL Null -------NOT NULL NOT NULL NOT NULL DESC DEPARTMENT Name Null ------------- -------DEPARTMENT_ID NOT NULL NAME NOT NULL MANAGER_ID DESC SALES Name ---------------------CUSTOMER_ID TRANSACTON_ID PRODUCT_ID ORDER_ID QTY_ORDERED PRODUCT_PRICE_ORIGINAL PRODUCT_PRICE_WT_QTY TAX_AMOUNT_CHARGED FREIGHT_AMOUNT_CHARGED TOTAL_AMOUNT ORDER_DATE DESC inventory Name --------------INVENTORY_ID EMPLOYEE_ID PRODUCT_ID QTY_STOCKED QTY_REMANING STACK_DATE NEXT_STACK_DATE STORAGE_DATE Type -----------NUMBER VARCHAR2(30) VARCHAR2(30) VARCHAR2(30) VARCHAR2(45) CHAR(15) CHAR(20) VARCHAR2(50) VARCHAR2(35) VARCHAR2(35) VARCHAR2(20) VARCHAR2(25) NUMBER NUMBER Type -----------NUMBER NUMBER NUMBER NUMBER NUMBER VARCHAR2(45) CHAR(45) NUMBER VARCHAR2(35) Type -----------NUMBER VARCHAR2(40) NUMBER Null -------NOT NULL NOT NULL NOT NULL NOT NULL DESC TRANSHISTORY Name Null -------------- -------TRANSACTON_ID NOT NULL CREDIT_CARD_ID CARD_TYPE EXP_DATE TRANS_DATE AMOUNT_CHARGED BRAND DESC product Name ------------------PRODUCT_ID PRODUCT_NAME PRODUCT_PRICE PRODUCT_BRAND PRODUCT_DESCRIPTION PRODUCT_CATEGORY Type -------NUMBER CHAR(45) NUMBER DATE CLOB NUMBER Type -----------NUMBER VARCHAR2(60) NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER DATE Type -----------VARCHAR2(60) NUMBER CHAR(24) DATE DATE NUMBER CHAR(20) Null -------NOT NULL NOT NULL NOT NULL Type -----------NUMBER VARCHAR2(90) NUMBER VARCHAR2(35) CLOB NOT NULL VARCHAR2(30) Null -------NOT NULL NOT NULL NOT NULL Type -------NUMBER NUMBER NUMBER NUMBER NUMBER DATE DATE CHAR(40) 94
    • DESC projects Name -------------PROJECT_ID MANAGER_ID PROJECT_TITLE START_DATE END_DATE AWARDED_AMOUNT NOTES Null -------NOT NULL NOT NULL DESC projectworkbook Name Null ------------ -------PROJECT_ID NOT NULL EMPLOYEE_ID NOT NULL WORKBOOK_ID NOT NULL HOURS_ASSIGN ROLE desc uemp Name ----------------EMPID AUTHENTICATION_ID USERNAME Type ------------NUMBER NUMBER VARCHAR2(200) DATE DATE NUMBER CLOB Type -----------NUMBER NUMBER NUMBER NUMBER VARCHAR2(40) Null -------NOT NULL NOT NULL Type -----------NUMBER NUMBER VARCHAR2(40) 95
    • DATA VALIDATION Please open the access database file below to view the output of each table select all statements. To reduce the pages and enhance readability, each table result is saved in an access database table. Only the transaction output is saved in a file because each credit card number resulted in a scientific notation. ERTAIL DATABASE.accdb Transhistory_fn.txt USERS.txt 96
    • DATA SECURITY VALIDATION 97
    • VIRTUAL PRIVATE DATABASE The virtual private database scripts did not execute as planned. I tested the function which was working properly but not the policy has technical errors that I could not resolved due to time constraint. . SELECT EMPID_RET predicate from DUAL EMPID = SYS_CONTEXT ('EMPLOYE_SEC','EMPID') PASSWORD MANAGEMENT PASSWORD AUTHENTICATION The password authentication when executed would set the user password to their user name. When the user logs in to their account, they would be required to change their password because of the underlying password requirement. For some technical reasons the code did not execute as designed. PASSWORD REQUIREMENT SPASSWORD was implemented by the organization to make sure certain requirements are meat for each password the user uses to access their database. The password must contain a digit, not less than seven characters and must include characters, letters or digits but should not be made up digits only. /* ASSIGN THE USER TO THE PASSWORD PROFILE*/ /*EMPLOYEES*/ Alter user AlexHD PROFILE SPASSWORD; Alter user BrendaUDH PROFILE SPASSWORD; 98
    • Alter user BerryHK PROFILE SPASSWORD; Alter user DavidMGI PROFILE SPASSWORD; Alter user EricYMU PROFILE SPASSWORD; Alter user SamarawickramaULP PROFILE SPASSWORD; Alter user RaymondPLK PROFILE SPASSWORD; Alter user AckermanJKP PROFILE SPASSWORD; Alter user RounthwaiteUHG PROFILE SPASSWORD; Alter user MichaelsThVY PROFILE SPASSWORD; Alter user AnnetteHiJ PROFILE SPASSWORD; ALTER USER NISWONGEROIU PROFILE SPASSWORD; Alter user RandallcythIK PROFILE SPASSWORD; Alter user MohamedB2B PROFILE SPASSWORD; Alter user MohansuOK PROFILE SPASSWORD; Alter user IvoLKW PROFILE SPASSWORD; 99
    • Alter user kaneVMP PROFILE SPASSWORD; Alter user ThierrydherLK PROFILE SPASSWORD; Alter user PhilipsCLZ PROFILE SPASSWORD; Alter user caoJuIY PROFILE SPASSWORD; Alter user fordjeffNK PROFILE SPASSWORD; Alter user StadickDL PROFILE SPASSWORD; Alter user DAVYALOVSKY0 PROFILE SPASSWORD; Spool file > /*EMPLOYEES*/ > Alter user AlexHD PROFILE SPASSWORD user ALEXHD altered. > Alter user BrendaUDH PROFILE SPASSWORD user BRENDAUDH altered. > Alter user BerryHK PROFILE SPASSWORD user BERRYHK altered. > Alter user DavidMGI PROFILE SPASSWORD user DAVIDMGI altered. > Alter user EricYMU PROFILE SPASSWORD user ERICYMU altered. > Alter user SamarawickramaULP PROFILE SPASSWORD user SAMARAWICKRAMAULP altered. > Alter user RaymondPLK PROFILE SPASSWORD user RAYMONDPLK altered. 100
    • > Alter user AckermanJKP PROFILE SPASSWORD user ACKERMANJKP altered. > Alter user RounthwaiteUHG PROFILE SPASSWORD user ROUNTHWAITEUHG altered. > Alter user MichaelsThVY PROFILE SPASSWORD user MICHAELSTHVY altered. > Alter user AnnetteHiJ PROFILE SPASSWORD user ANNETTEHIJ altered. > ALTER USER NISWONGEROIU PROFILE SPASSWORD user NISWONGEROIU altered. > Alter user RandallcythIK PROFILE SPASSWORD user RANDALLCYTHIK altered. > Alter user MohamedB2B PROFILE SPASSWORD user MOHAMEDB2B altered. > Alter user MohansuOK PROFILE SPASSWORD user MOHANSUOK altered. > Alter user IvoLKW PROFILE SPASSWORD user IVOLKW altered. > Alter user kaneVMP PROFILE SPASSWORD user KANEVMP altered. > Alter user ThierrydherLK PROFILE SPASSWORD user THIERRYDHERLK altered. > Alter user PhilipsCLZ PROFILE SPASSWORD user PHILIPSCLZ altered. > Alter user caoJuIY PROFILE SPASSWORD user CAOJUIY altered. > Alter user fordjeffNK PROFILE SPASSWORD user FORDJEFFNK altered. > Alter user StadickDL PROFILE SPASSWORD user STADICKDL altered. > Alter user DAVYALOVSKY0 PROFILE SPASSWORD user DAVYALOVSKY0 altered. 101
    • EXECUTION SQL> SQL> Alter user AlexHD 2 identified by 12334; Alter user AlexHD * ERROR at line 1: ORA-28003: password verification for the specified password failed ORA-20003: Password must contain numbers, letters or character SQL> SQL> Alter user AlexHD 2 identified by AlexHD; Alter user AlexHD * ERROR at line 1: ORA-28003: password verification for the specified password failed ORA-20001: Password same as username SQL> Alter user AlexHD 2 identified by aba2 3 / Alter user AlexHD * ERROR at line 1: ORA-28003: password verification for the specified password failed ORA-20005: Password is too short SQL> Alter user AlexHD 2 identified by yuabaaba2; User altered. alter user DAVYALOVSKY0 identified by homealone4me; User altered. 102
    • alter user DAVYALOVSKY0 identified by homealone4me; SQL Error: ORA-28007: the password cannot be reused 28007. 00000 - "the password cannot be reused" *Cause: The password cannot be reused for the specified number of days or for the specified nunmber of password changes *Action: Try the password that you have not used for the specified number of days or the specified number of password changes Refer to the password parameters in the CREATE PROFILE statement alter user DAVYALOVSKY0 identified by homealonem Spool file Password Requirement /*EMPLOYEES*/ Alter user AlexHD identified by yuabaaba2; SQL> Alter user BrendaUDH 2 identified by love4mealone; User altered. SQL> SQL> Alter user BerryHK 2 identified by sheeplover22; User altered. SQL> SQL> SQL> Alter user DavidMGI 2 identified by johnnywash9; 103
    • User altered. SQL> Alter user EricYMU 2 identified by erriewalker4; User altered. SQL> SQL> SQL> Alter user SamarawickramaULP 2 identified by churchhill4; User altered. SQL> SQL> SQL> Alter user RaymondPLK 2 identified by westernbell; User altered. SQL> SQL> SQL> Alter user AckermanJKP 2 identified by romanlover4me; User altered. SQL> Alter user RounthwaiteUHG 2 identified by chicatswow; User altered. SQL> SQL> SQL> SQL> Alter user MichaelsThVY 2 identified by rosebud45; User altered. SQL> SQL> SQL> 104
    • SQL> Alter user AnnetteHiJ 2 identified by annttmamma12; User altered. SQL> SQL> ALTER USER NISWONGEROIU 2 identified by moneywealtmd98; User altered. SQL> SQL> Alter user RandallcythIK 2 identified by honeyhoney34; User altered. SQL> SQL> Alter user MohamedB2B 2 identified by cake4dwaniou23; User altered. SQL> Alter user MohansuOK 2 identified by washhights2; User altered. SQL> Alter user IvoLKW 2 identified by klwunion3; User altered. SQL> SQL> Alter user kaneVMP 2 identified by gospelmark#2; User altered. SQL> SQL> SQL> Alter user ThierrydherLK 2 identified by cherryhillfunk2; 105
    • User altered. SQL> SQL> SQL> Alter user PhilipsCLZ 2 identified by philcousin#93; User altered. SQL> SQL> Alter user caoJuIY 2 identified by money4money; User altered. SQL> SQL> SQL> Alter user fordjeffNK 2 identified by junkyardjun6; User altered. SQL> Alter user StadickDL 2 identified by abamemom5; User altered. SQL> SQL> Alter user DAVYALOVSKY0 2 identified by home#home4; User altered. --------------------------------------EMPLOYEE LOG IN---------------------SQL> connect AlexHD/yuabaaba2 Connected. SQL> connect BrendaUDH /love4mealone Connected. SQL> show user USER is "BRENDAUDH" 106
    • SQL> connect AlexHD/yuabaaba2 Connected. SQL> show user USER is "ALEXHD" SQL> connect berryHK/sheeplover22 Connected. SQL> show user USER is "BERRYHK" SQL> connect davidmgi/johnnywash9; Connected. SQL> connect ericymu/erriewalker4 Connected. SQL> show user USER is "ERICYMU" SQL> connect davidmgi/johnnywash9; Connected. SQL> show user USER is "DAVIDMGI" SQL> connect SamarawickramaULP/churchhill4 Connected. SQL> show user USER is "SAMARAWICKRAMAULP" SQL> connect RaymondPLK/westernbell; Connected. SQL> show user USER is "RAYMONDPLK" SQL> connect AckermanJKP/romanlover4me Connected. SQL> show user USER is "ACKERMANJKP" SQL> SQL> connect RounthwaiteUHG/chicatswow Connected. USER is "ROUNTHWAITEUHG" SQL> connect MichaelsThVY/rosebud45 107
    • Connected. SQL> show user USER is "MICHAELSTHVY" SQL> SQL> SQL> connect AnnetteHiJ/annttmamma12 Connected. SQL> show user USER is "ANNETTEHIJ" SQL> SQL> connect NISWONGEROIU/moneywealtmd98 Connected. SQL> show user USER is "NISWONGEROIU" SQL> SQL> SQL> connect RandallcythIK/honeyhoney34 Connected. SQL> show user USER is "RANDALLCYTHIK" SQL> connect MohamedB2B /cake4dwaniou23 Connected. SQL> show user; USER is "MOHAMEDB2B" SQL> SQL> connect MohansuOK/washhights2; Connected. SQL> show user USER is "MOHANSUOK" SQL> SQL> SQL> connect IvoLKW/klwunion3 Connected. SQL> show user USER is "IVOLKW" SQL> SQL> connect kaneVMP/gospelmark#2 Connected. 108
    • SQL> show user USER is "KANEVMP" SQL> SQL> SQL> connect ThierrydherLK/cherryhillfunk2 Connected. SQL> show user USER is "THIERRYDHERLK" SQL> SQL> SQL> SQL> connect PhilipsCLZ/philcousin#93 Connected. SQL> show user USER is "PHILIPSCLZ" SQL> SQL> SQL> connect caoJuIY/money4money; Connected. SQL> show user USER is "CAOJUIY" SQL> SQL> connect fordjeffNK Connected. SQL> show user USER is "FORDJEFFNK" SQL> SQL> SQL> connect StadickDL Connected. SQL> show user USER is "STADICKDL" SQL> SQL> connect DAVYALOVSKY0 Connected. SQL> show user USER is "DAVYALOVSKY0" SQL> SQL> set echo off SQL> spool off ----------------------------------------------END----------------------------------------------------------- 109
    • DYNAMIC VIEWS /*Employee Human Resources view*/ Scenario: Each employee must view their information and contact HR for any changes connect stadickdl/abamemom5 SHOW USER select * from EmployeeHR; CONNECT AlexHD/yuabaaba2 SHOW USER select * from EmployeeHR; SPOOL FILE Connected USER is STADICKDL FIRST_NAME MIDDLE_NAME LAST_NAME SICK_HOURS VACATION_HOURS RANK HIRE_DATE PAY_RATE OFFICE_PHONE NAME MANAGER_NAME ------------------------------ ------------------------------ ----------------------------- ---------- -------------- -------------------------------------------- --------------------------------------------- -------- ---------------------------------- ---------------------------------------- -----------------------------------------------------------Betsy A Stadick 45 1300 Director of Operations- Development Thursday, August 12, 1999 60 X-4685 Project Manager Betsy,Stadick Connected USER is ALEXHD FIRST_NAME MIDDLE_NAME LAST_NAME SICK_HOURS VACATION_HOURS RANK HIRE_DATE PAY_RATE OFFICE_PHONE NAME MANAGER_NAME ------------------------------ ------------------------------ ----------------------------- ---------- -------------- -------------------------------------------- --------------------------------------------- -------- ----------- 110
    • ------------------------ ---------------------------------------- -----------------------------------------------------------Alex M Nayberg 40 2200 Web Application Developer Sunday, May 06, 2001 40 X-4652 Information Systems Ivo,Salmre Connection created by CONNECT script command disconnected /* Employee Records View*/ Scenario: Employees must view their information and update any changes connect stadickdl/abamemom5 SHOW USER select * from EMPLOYEERV; update EMPLOYEERV set middle_name = 'Annie'; CONNECT AlexHD/yuabaaba2 SHOW USER update EMPLOYEERV set middle_name = 'john' update EMPLOYEERV set middle_name = 'john' where first_name = 'Ben'; /*verify updates */ connect stadickdl/abamemom5 show user select * from EMPLOYEERV; CONNECT AlexHD/yuabaaba2 SHOW USER select * from EMPLOYEERV; 111
    • SPOOL FILE Connected USER is STADICKDL select * from EMPLOYEERV; FIRST_NAME MIDDLE_NAME LAST_NAME BIRTH_DATE GENDER EMPLOYEE_ID MARITAL_STATUS ADDRESS CITY STATE POSTAL_CODE PHONE ------------------------------ ------------------------------ ----------------------------- --------------------------------------------- ------------------------- -------------------- ------------------------------------------------- ----------------------------------- ---------------------------------- -------------------- ------------------------Betsy A Stadick 17-Jan-33 F 228 S 6058 Hill Street Bellevue WA 98004 405-555-0171 update EMPLOYEERV set middle_name = 'Annie'; 1 rows updated. Connected SHOW USER AlexHD update EMPLOYEERV set middle_name = 'john' 1 rows updated. update EMPLOYEERV set middle_name = 'john' where first_name = 'Ben'; 0 rows updated. Connected USER is STADICKDL FIRST_NAME BIRTH_DATE MARITAL_STATUS STATE MIDDLE_NAME GENDER ADDRESS POSTAL_CODE LAST_NAME EMPLOYEE_ID CITY PHONE 112
    • ------------------------------ ------------------------------ ----------------------------- --------------------------------------------- ------------------------- -------------------- ------------------------------------------------- ----------------------------------- ---------------------------------- -------------------- ------------------------Betsy Annie Stadick 17-Jan-33 F 228 S 6058 Hill Street Bellevue WA 98004 405-555-0171 Connected USER is ALEXHD FIRST_NAME MIDDLE_NAME LAST_NAME BIRTH_DATE GENDER EMPLOYEE_ID MARITAL_STATUS ADDRESS CITY STATE POSTAL_CODE PHONE ------------------------------ ------------------------------ ----------------------------- --------------------------------------------- ------------------------- -------------------- ------------------------------------------------- ----------------------------------- ---------------------------------- -------------------- ------------------------ALEX john Nayberg 14-May-80 M 159 M 9745 Bonita Ct. Bellevue WA 98004 819-555-0198 NON-DYNAMIC VIEWS SELECT STATEMENTS /-*Employee-*/ connect AlexHD/yuabaaba2; SELECT * FROm empdirectory; /--*Report Analyst---------*/ connect DavidMGI/johnnywash9; SHOW USER select * from ORDERS04; select * from CUSTDATA02; /--*Accountants--------*/ SHOW USER 113
    • connect AckermanJKP/romanlover4me; select * from sales; select * from ORDER1; select * from CUSTDATA01; /--*HR------*/ SHOW USER CONNECT MohansuOK/washhights2; SELECT * FROM HRRECORD; SELECT * FROM EMPLOYEE ; /---*SALES-----*/ SHOW USER CONNECT MohamedB2B/cake4dwaniou23 SELECT * FROM TRANSACTIONS; SELECT * FROM SALES; SELECT * FROM ORDER1; SELECT * FROM CUSTDATA01; SELECT * FROM PRODT; SELECT * FROM INVENT; /*---CUSTOMER REP------*/ CONNECT NiswongerOIU/moneywealtmd98 SHOW USER SELECT * FROM CUSTINFO; SELECT * FROM orders08; /*----PROJECT MANAGERS--------*/ CONNECT StadickDL/abamemom5 SHOW USER 114
    • SELECT * FROM PROJECT; SELECT * FROM PJWORK; Spool File > /--*Employee*---/ > connect AlexHD/yuabaaba2 Connected > SHOW USER USER is ALEXHD > SELECT * FROm empdirectory EMPLOYEE RANK DEPARTMENT NAME DEPARTMENT MANAGER ------------------------------------------------------------------------------------------- --------------------------------------------- --------------------------------------- -----------------------------------------------------------Janeth-M,Esteves Intern Information Systems Ivo,Salmre Shelley-N,Dyck Intern Information Systems Ivo,Salmre Susan-A,Metters Intern Information Systems Ivo,Salmre Brenda-M,Diaz Aplication Developer Information Systems Ivo,Salmre Eric-S,Kurjan Reporting Analyst Information Systems Ivo,Salmre Sootha-T,Charncherngkha Reporting Analyst Information Systems Ivo,Salmre George-Z,Li Senior System Adminstrator Information Systems Ivo,Salmre Alex-M,Nayberg Web Application Developer Information Systems Ivo,Salmre Ivo-William,Salmre Chief Information Officer Information Systems Ivo,Salmre David-J,Ortiz Reporting Analyst Information Systems Ivo,Salmre 115
    • David-A,Yalovsky Senior Database Adminstrator Ivo,Salmre Robert-J,Rounthwaite Systems Adiminstrator Ivo,Salmre David-N,Johnson Senor Reporting Analyst Ivo,Salmre Pilar-G,Ackerman Acountant Lori,Kane Raymond-K,Sam Accountant Lori,Kane Lori-A,Kane Chief Accounting Officer Lori,Kane Prasanna-E,Samarawickrama Purchase Aanalyst Thierry,D'Hers Christian-E,Kleinerman Makerting Specialist Thierry,D'Hers Jo-L,Berry Purchase Aanalyst Thierry,D'Hers Thierry-B,D'Hers Marketing / Sales Director Thierry,D'Hers Thomas-R,Michaels Senior Purchase Analyst Thierry,D'Hers Brian-Richard,Goldstein Sales Specialist Thierry,D'Hers Shammi-G,Mohamed Sales Specialist Thierry,D'Hers Nancy-A,Anderson Sales Specialist Thierry,D'Hers Annik-O,Stahl Sales Specialist Thierry,D'Hers Cynthia-S,Randall Makerting Specialist Thierry,D'Hers Eugene-O,Kogan Customer Service Specialist Carol,Philips Andrew-M,Cencini Customer Service Specialist Carol,Philips Information Systems Information Systems Information Systems Accounting-Finance Accounting-Finance Accounting-Finance Marketing-SaLes Marketing-SaLes Marketing-SaLes Marketing-SaLes Marketing-SaLes Marketing-SaLes Marketing-SaLes Marketing-SaLes Marketing-SaLes Marketing-SaLes Customer Service Customer Service 116
    • Sidney-M,Higa Customer Service Specialist Carol,Philips Chad-W,Niswonger Customer Service Specialist Carol,Philips David-J,Liu Customer Service Specialist Carol,Philips Carol-M,Philips Customer Service Director Carol,Philips Betsy-A,Stadick Director of Operations- Development Betsy,Stadick Bonnie-N,Kearney Project Manager Betsy,Stadick Annette-L,Hill Project Manager Betsy,Stadick Jun-T,Cao CEO Jun,Cao Jeffrey-L,Ford Vice President Jun,Cao Suchitra-O,Mohan Human Resource Specialist Carol,Philips José-Edvaldo,Saraiva Human Resource Specialist Carol,Philips Customer Service Customer Service Customer Service Customer Service Project Manager Project Manager Project Manager Executive Executive HR HR 39 rows selected > /--*Report Analyst---------*/ > connect DavidMGI/johnnywash9 Connected > SHOW USER USER is DAVIDMGI > select * from ORDERS04 CUSTOMER_ID ORDER_ID PRODUCT_ID NAME QTY_ORDERED Orginal-Price Tax Shipping Final Amount Date-Ordered ----------- -------- ---------- ----------------------------------------------------------------------------------------- ----------- ------------- --- ------- ------------ -----------11023 189056 54 Canon EOS 7D (Body Only) 18-megapixel Digital SLR 2 280 33.6 35 628.6 04-FEB-11 117
    • 11023 689055 55 Samsung ST65 14.2 Megapixel Digital Still 190 11.4 45 246.4 04-FEB-11 11023 5890590 56 Sony Cyber-shot® Digital Camera WX9- Black 2 240 28.8 35 543.8 20-AUG-12 11013 99059 61 Panasonic Lumix DMC-FH5K 16.1 Megapixel Digital Camera- Black 4 500 120 20 2140 25-AUG-11 1 2 11013 49056 1500 180 69.9 79 Samsung Q330 13.3" Notebook 3249.9 20-JAN-11 > select * from CUSTDATA02 CUSTOMER_ID CITY STATE BIRTH_DATE POSTAL_CODE COUNTRY GENDER YEARLY_INCOME MARITAL_STATUS EDUCATIONAL_BACKGROUND TOTAL_CHILDREN TOTAL_CARS_OWNED PROFESSION ----------- -------------------- ----------------------------------- -------------------------------------------- -------------------- ---------------------------------- --------------- ------------- ---------------------------------- ----------------------------------- -------------- ---------------- --------------------------------11012 Bremerton Washington 18-Jan68 98312 United States F 100000 M Bachelors 2 2 Management 11013 Lebanon Oregon 6-Aug-68 97355 United States M 100000 M Bachelors 2 3 Management 11016 Imperial Beach California 28-Apr79 91932 United States M 30000 M Partial College 0 1 Skilled Manual 11022 Bellingham Washington 12-Oct78 98225 United States M 40000 M Partial College 0 1 Skilled Manual 11023 Bellflower California 11-Oct78 90706 United States M 40000 M Partial College 0 1 Skilled Manual 11036 National City California 18-Dec78 91950 United States F 60000 M Partial College 0 2 Skilled Manual 11041 Glendale California 16-Oct77 91203 United States F 60000 M Partial College 0 2 Skilled Manual 11042 Los Angeles California 13-Jun77 90012 United States 118
    • F College 11043 76 M College 11049 80 F High School 11053 80 F College 11062 97205 40000 M 0 11066 73 F College 11067 76 M College 11081 66 F 2 11082 94536 130000 S 0 11083 66 F Degree 11087 91910 70000 M 3 11089 90802 80000 S 2 11129 98284 40000 S 0 11130 97355 30000 M 0 70000 M 0 California 91203 Glendale 60000 M 0 California 91910 Chula Vista 40000 S 0 California 92102 San Diego 60000 M 0 Portland Oregon United States Partial 2 Skilled Manual 24-FebUnited States Partial 2 Skilled Manual 18-JulUnited States Partial 2 Clerical 20-AugUnited States Partial 2 Skilled Manual 2-Sep-75 M High School 2 Skilled Manual Lebanon Oregon 97355 70000 M Port Orchard 0 Washington 98366 60000 S Concord 0 California 94519 27-NovUnited States Partial 2 Professional 25-SepUnited States Partial 2 Professional 24-JulUnited States Bachelors 120000 M 3 Management Fremont California 4-Aug-66 United States F Graduate Degree 3 Management Lincoln Acres California 15-Mar91950 United States 130000 M Graduate 0 3 Management Chula Vista California 3-Oct-57 United States F Partial College 0 Professional Long Beach California 5-Feb-57 United States F Bachelors 1 Management Sedro Woolley Washington 5-Aug-75 United States F High School 1 Skilled Manual Lebanon Oregon 6-Jan-80 United States F High School 2 Skilled Manual 119
    • 11135 94010 30000 S 0 11137 78 F 0 11140 77 M High School 11143 90712 40000 M 0 11145 97005 40000 S 0 11152 76 M 0 11153 76 F 0 11154 76 F College 11155 76 M College Burlingame California 3-Nov-79 United States M Partial High School 2 Clerical Spokane Washington 20-Jul99202 United States 40000 M High School 2 Skilled Manual Burbank California 11-Feb91502 United States 30000 S Partial 0 2 Clerical Lakewood California 4-Feb-77 United States M High School 2 Skilled Manual Beaverton Oregon 8-Dec-79 United States F High School 2 Skilled Manual Puyallup Washington 10-Jan98371 United States 40000 S High School 2 Skilled Manual Renton Washington 23-Jun98055 United States 40000 M High School 2 Skilled Manual Woodburn Oregon 21-Aug97071 United States 40000 S Partial 0 1 Skilled Manual Burbank California 26-Jan91502 United States 40000 S Partial 0 1 Skilled Manual 30 rows selected > /--*Accountants--------*/ > connect AckermanJKP/romanlover4me Connected > SHOW USER USER is ACKERMANJKP > select * from sales CUSTOMER_ID TRANSACTON_ID PRODUCT_ID ORDER_ID QTY_ORDERED PRODUCT_PRICE_ORIGINAL PRODUCT_PRICE_WT_QTY TAX_AMOUNT_CHARGED FREIGHT_AMOUNT_CHARGED TOTAL_AMOUNT ORDER_DATE ----------- ------------------------------------------------------------ --------- -------- ----------- ---------------------- -------------------- ----------------- ---------------------- ------------ ---------- 120
    • 11023 56 5890590 28.8 11013 79 49056 180 11013 61 99059 120 11023 54 189056 33.6 11023 55 689055 11.4 KGH4789076500 2 35 KGH8097899900 2 69.9 KGH6789054200 4 20 KGH11289789009 2 35 KGH11277789009 1 45 240 543.8 20-AUG-12 480 1500 3249.9 20-JAN-11 3000 500 2140 25-AUG-11 2000 280 628.6 04-FEB-11 560 190 246.4 04-FEB-11 190 > select * from ORDER1 FIRST_NAME MIDDLE_NAME LAST_NAME CUSTOMER_ID ORDER_ID PRODUCT_ID NAME QTY_ORDERED Orginal-Price Tax Shipping Final Amount Date-Ordered ----------------------------------- ----------------------------------- ---------------------------------- ----------- -------- ---------- --------------------------------------------------------------------------------------------------- ------------- --- -------- ------------ -----------Seth M Edwards 11023 189056 54 Canon EOS 7D (Body Only) 18-megapixel Digital SLR 2 280 33.6 35 628.6 04-FEB-11 Seth M Edwards 11023 689055 55 Samsung ST65 14.2 Megapixel Digital Still 1 190 11.4 45 246.4 04-FEB-11 Seth M Edwards 11023 5890590 56 Sony Cyber-shot® Digital Camera WX9- Black 2 240 28.8 35 543.8 20-AUG-12 Ian M Jenkins 11013 99059 61 Panasonic Lumix DMC-FH5K 16.1 Megapixel Digital Camera- Black 4 500 120 20 2140 25-AUG-11 Ian Jenkins Q330 13.3" Notebook 2 1500 180 M 11013 69.9 49056 79 Samsung 3249.9 20-JAN-11 > select * from CUSTDATA01 CUSTOMER_ID FIRST_NAME LAST_NAME CITY PHONE BIRTH_DATE MIDDLE_NAME ADDRESS STATE 121
    • ----------- ----------------------------------- ---------------------------------- ----------------------------------- ------------------------------------------------- -------------------- ------------------------- ---------------------------------- --------------------------------------------11012 Lauren M Walker 4785 Scott Street Bremerton 717-555-0164 Washington 18-Jan-68 11013 Ian M Jenkins 7902 Hudson Ave. Lebanon 817-555-0185 Oregon 6-Aug-68 11016 Wyatt L Hill 9666 Northridge Ct. Imperial Beach 135-555-0171 California 28-Apr-79 11022 Ethan G Zhang 1769 Nicholas Drive Bellingham 589-555-0185 Washington 12-Oct-78 11023 Seth M Edwards 4499 Valley Crest Bellflower 452-555-0188 California 11-Oct-78 11036 Jennifer C Russell 3981 Augustine Drive National City 115-555-0183 California 18-Dec-78 11041 Amanda M Carter 5826 Escobar Glendale 295-555-0145 California 16-Oct-77 11042 Megan J Sanchez 1397 Paraiso Ct. Los Angeles 404-555-0199 California 13-Jun-77 11043 Nathan M Simmons 1170 Shaw Rd Glendale 296-555-0181 California 24-Feb-76 11049 Carol C Rai 6064 Madrid Chula Vista 654-555-0180 California 18-Jul-80 11053 Ana E Price 1660 Stonyhill Circle San Diego 859-555-0113 California 20-Aug-80 11062 Noah D Powell 9794 Marion Ct Portland 767-555-0113 Oregon 2-Sep-75 11066 Grace T Butler 4739 Garden Ave. 122
    • Lebanon 27-Nov-73 11067 Caleb Carter Port Orchard 25-Sep-76 11081 Savannah Baker Concord 24-Jul-66 11082 Angela Butler Fremont 4-Aug-66 11083 Alyssa Cox Lincoln Acres 15-Mar-66 11087 Tamara Liang Chula Vista 3-Oct-57 11089 Abigail Price Long Beach 5-Feb-57 11129 Julia Wright Sedro Woolley 5-Aug-75 11130 Caroline Russell Lebanon 6-Jan-80 11135 Marcus Harris Burlingame 3-Nov-79 11137 Jasmine Taylor Spokane 20-Jul-78 11140 Javier Alvarez Burbank 11-Feb-77 11143 Jonathan Henderson Lakewood 4-Feb-77 11145 Jasmine Coleman Beaverton 8-Dec-79 712-555-0141 Oregon 944-555-0167 F 9563 Pennsylvania Blvd. Washington 478-555-0117 C 1210 Trafalgar Circle California 579-555-0195 L 6040 Listing Ct California 561-555-0140 F 867 La Orinda Place California 178-555-0152 L 3791 Rossmor Parkway California 532-555-0117 M 2685 Blackburn Ct California 456-555-0174 M 7397 Central Blvd. Washington 424-555-0137 L 3884 Bates Court Oregon 442-555-0119 L 9068 Quiet Place Drive California 557-555-0146 A 2457 Matterhorn Court Washington 763-555-0134 L 8935 Etcheverry Dr. California 149-555-0113 M 165 East Lane Road California 857-555-0115 L 1961 Oak Grove Road Oregon 123
    • 11152 Williams Puyallup 10-Jan-76 11153 James Renton 23-Jun-76 11154 Walker Woodburn 21-Aug-76 11155 Robinson Burbank 26-Jan-76 James 355-555-0153 J 6827 Seagull Court Washington 847-555-0111 R 8877 Weatherly Drive Washington 918-555-0186 G 6898 Holiday Hills Oregon 891-555-0125 J 8356 Mori Court California Angela Megan Hunter 30 rows selected > /--*HR------*/ > CONNECT MohansuOK/washhights2 Connected > SHOW USER USER is MOHANSUOK > SELECT * FROM HRRECORD EMPLOYEE_ID HR_ID DEPARTMENT_ID SICK_HOURS VACATION_HOURS RANK HIRE_DATE PAY_RATE OFFICE_PHONE ----------- ----- ------------- ---------- -------------- -------------------------------------------- --------------------------------------------- ------- ----------------------------------159 37295302 208 40 2200 Web Application Developer Sunday, May 06, 2001 40 X-4652 214 38183279 208 50 3000 Aplication Developer Monday, May 07, 2001 30 X-4653 264 39071256 386 70 450 Purchase Aanalyst Sunday, September 09, 2001 45 X-4654 55 39959233 208 45 259 Reporting Analyst Monday, September 10, 2001 35 X-4655 245 40847210 208 50 659 Reporting Analyst Tuesday, September 11, 2001 35 X-4656 257 41735187 208 89 900 Reporting Analyst Wednesday, September 12, 2001 35 X-4657 26 42623164 208 35 1200 Senor Reporting Analyst Friday, October 20, 2000 55 X-4658 124
    • 241 43511141 386 100 1300 Purchase Aanalyst Saturday, September 06, 2003 44 X-4659 67 44399118 297 89 1300 Accountant Wednesday, September 07, 2005 40 X-4660 87 45287095 297 89 1300 Acountant Thursday, September 08, 2005 40 X-4661 88 46175072 208 89 1300 Senior Database Adminstrator Friday, September 09, 2005 55 X-4662 148 47063049 208 89 1300 Systems Adiminstrator Saturday, January 09, 1999 50 X-4663 64 47951026 208 89 1300 Senior System Adminstrator Sunday, January 10, 1999 55 X-4664 198 48839003 386 89 1300 Senior Purchase Analyst Saturday, December 20, 1997 50 X-4665 268 49726980 564 89 1300 Project Manager Wednesday, May 05, 2004 60 X-4666 234 50614957 564 89 1300 Project Manager Thursday, May 06, 2004 60 X-4667 183 51502934 475 89 1300 Customer Service Specialist Friday, May 07, 2004 45 X-4668 15 52390911 475 89 1300 Customer Service Specialist Saturday, May 08, 2004 45 X-4669 215 53278888 475 89 1300 Customer Service Specialist Sunday, May 09, 2004 45 X-4670 142 54166865 475 89 1300 Customer Service Specialist Monday, May 10, 2004 45 X-4671 160 55054842 475 89 1300 Customer Service Specialist Tuesday, May 11, 2004 45 X-4672 226 55942819 386 55 1300 Sales Specialist Wednesday, May 12, 2004 45 X-4673 70 56830796 386 88 1300 Sales Specialist Thursday, May 13, 2004 45 X-4674 86 57718773 386 67 1300 Sales Specialist Friday, May 14, 2004 45 X-4675 59 58606750 386 89 1300 Sales Specialist Saturday, May 15, 2004 45 X-4676 138 59494727 386 89 1300 Makerting Specialist Sunday, May 16, 2004 45 X-4677 51 60382704 386 89 1300 Makerting Specialist Monday, May 17, 2004 45 X-4678 28 63046635 208 78 1300 Chief Information Officer Sunday, August 08, 1999 60 X-4681 125
    • 201 63934612 Officer 60 X-4682 6 64822589 Sales Director 60 X-4683 171 65710566 Service Director 60 X-4684 52 66598543 Sunday, August 12, 2012 218 67486520 Monday, August 13, 2012 115 68374497 Tuesday, August 14, 2012 50 69262474 Monday, July 20, 1998 17 70150451 Saturday, May 02, 1998 228 71038428 Operations- Development 60 X-4685 288 62158658 Specialist 45 X-4680 179 61270681 Specialist 45 X-4679 297 90 Monday, August 09, 1999 1300 Chief Accounting 386 66 1300 Marketing / Tuesday, August 10, 1999 475 208 55 1300 Customer Wednesday, August 11, 1999 200 1300 Intern 0 X-4686 208 120 1300 Intern 0 X-4687 208 88 1300 Intern 0 X-4688 653 70 1300 CEO 80 X-4689 653 90 1300 Vice President 80 X-4690 564 45 1300 Director of Thursday, August 12, 1999 742 80 Wednesday, May 19, 2004 1300 Human Resource 742 89 Tuesday, May 18, 2004 1300 Human Resource 39 rows selected > SELECT * FROM EMPLOYEE EMPLOYEE_ID FIRST_NAME MIDDLE_NAME LAST_NAME BIRTH_DATE GENDER MARITAL_STATUS ADDRESS CITY STATE POSTAL_CODE PHONE NATIONAL_ID CUSTOMER_ID ----------- ------------------------------ ------------------------------ ----------------------------- --------------------------------------------- -------------- -------------------- ------------------------------------------------- ----------------------------------- ---------------------------------- -------------------- ------------------------- ----------- ----------265 Ben T Miller 5-Jul-63 M M 3397 Rancho View Drive Redmond WA 98052 151-555-0113 18892343 159 Alex M Nayberg 14-May-80 M M 9745 Bonita Ct. Bellevue WA 98004 819-555-0198 18892463 214 Brenda M Diaz 31-Mar-73 126
    • F M Monroe 142-555-0139 264 Jo Berry F M Redmond 228-555-0159 55 David Ortiz M M Redmond 712-555-0119 245 Eric Kurjan M S Bellevue 265-555-0195 257 Sootha Charncherngkha M M Seattle 325-555-0137 26 David Johnson M S Monroe 166-555-0162 241 Prasanna Samarawickrama M M Renton 129-555-0199 67 Raymond 2-Apr-57 6387 Scenic Avenue WA 18893423 87 Pilar Ackerman M S Kenmore 577-555-0185 88 David Yalovsky M S Duvall 373-555-0142 148 Robert Rounthwaite M S Monroe 589-555-0147 64 George 18-May-67 3747 W. Landing Avenue WA 18892583 L 25-May-44 6369 Ellis Street WA 18892703 J 30-Jan-75 7297 RisingView WA 18892823 S 19-Oct-62 3067 Maya WA 18892943 T 5-Jan-33 874 Olivera Road WA 18893063 N 3-Dec-69 3841 Silver Oaks Place WA 18893183 E 1-Jun-43 1378 String Dr WA 18893303 K M M Bothell 98011 226-555-0197 G 11-Oct-62 4095 Cooper Dr. WA 18893543 A 4-Sep-71 1825 Corte Del Prado WA 18893663 J 1-Apr-75 9652 Los Angeles WA 18893783 Z M 98272 98052 98052 98004 98104 98272 98055 Sam 98028 98019 98272 Li M 127
    • 7166 Brock Lane WA 18893903 198 Thomas Michaels M M Renton 278-555-0118 268 Annette Hill F M Redmond 125-555-0196 234 Bonnie Kearney F M Seattle 264-555-0150 183 Chad Niswonger M M Bellevue 559-555-0175 15 Sidney Higa M M Monroe 424-555-0189 215 Andrew Cencini M S Edmonds 207-555-0192 142 David 8-Aug-73 4777 Rockne Drive WA 18894743 160 Eugene Kogan M S Duvall 173-555-0179 226 Brian Goldstein M S Seattle 730-555-0117 70 Shammi Mohamed M M Newport Hills 793-555-0179 86 Nancy Anderson 98104 Seattle 518-555-0199 R 11-Feb-76 9495 Limewood Place WA 18894023 L 1-Mar-68 2427 Notre Dame Ave. WA 18894143 N 11-Oct-76 8656 Lakespring Place WA 18894263 W 4-Sep-80 3919 Pinto Road WA 18894383 M 1-Oct-46 5734 Ashford Court WA 18894503 M 26-Oct-78 1061 Buskrik Avenue WA 18894623 J M M Bellevue 98004 646-555-0185 O 13-Mar-66 3977 Central Avenue WA 18894863 Richard 23-Jan-61 1102 Ravenwood WA 18894983 G 5-Nov-70 9687 Shakespeare Drive WA 18895103 A 21-Dec-78 98055 98052 98104 98004 98272 98020 Liu 98019 98104 98006 128
    • F M Seattle 970-555-0118 59 Annik Stahl M M Everett 499-555-0125 138 Cynthia Randall F S Snohomish 352-555-0138 51 Christian Kleinerman M M Seattle 846-555-0157 179 Suchitra Mohan F M Bothell 753-555-0129 288 José Saraiva M M Bothell 185-555-0169 28 Ivo Salmre M M Issaquah 115-555-0179 201 Lori Kane F S Sammamish 289-555-0196 6 Thierry D'Hers M M Redmond 168-555-0183 171 Carol Philips F M Monroe 609-555-0153 228 Betsy Stadick F S Bellevue 405-555-0171 52 Susan Metters 5025 Holiday Hills WA 18895223 O 27-Jan-67 7640 First Ave. WA 18895343 S 19-Sep-71 7230 Vine Maple Street WA 18895463 E 18-Feb-66 1064 Slow Creek Road WA 18895583 O 11-Jul-77 5747 Shirley Drive WA 18895703 Edvaldo 11-Jan-30 7484 Roundtree Drive WA 18895823 William 4-Feb-72 6580 Poor Ridge Court WA 18895943 A 19-Aug-70 6871 Thornwood Dr. WA 18896063 B 29-Aug-49 3768 Door Way WA 18896183 M 18-Nov-78 158 Walnut Ave WA 18896303 A 17-Jan-33 6058 Hill Street WA 18896423 A 3-May-73 98104 98201 98296 98104 98011 98011 98027 98074 98052 98272 98004 129
    • F S Seattle 639-555-0164 218 Shelley Dyck F S Renton 991-555-0184 115 Janeth Esteves F S Bellevue 540-555-0191 50 Jun 6-Aug-69 9104 Mt. Sequoia Ct. WA 18896903 17 Jeffrey Ford M S Kenmore 984-555-0185 1220 Bradford Way WA 18896543 N 8-Jan-77 2598 Breck Court WA 18896663 M 25-Aug-62 1343 Prospect St WA 18896783 T M S Sammamish 98074 299-555-0113 L 12-Aug-46 5553 Cash Avenue WA 18897023 98104 98055 98004 Cao 98028 40 rows selected > /---*SALES-----*/ > CONNECT MohamedB2B/cake4dwaniou23 Connected > SHOW USER USER is MOHAMEDB2B > SELECT * FROM TRANSACTIONS TRANSACTON_ID CREDIT_CARD_ID CARD_TYPE EXP_DATE TRANS_DATE AMOUNT_CHARGED BRAND ------------------------------------------------------------ -------------- ----------------------- --------- ---------- -------------- ------------------KGH987733301 1200007800016098 Credit 09-MAR-15 20-JAN-11 1319.6 MasterCard KGH8097899900 1200007800016907 Debit 09-MAR-15 20-JAN-11 3249.9 MasterCard KGH6789054200 1200007800017716 Credit 09-MAR-15 25-AUG-12 2140 MasterCard KGH4789076500 1200007800018525 Credit 09-MAR-15 20-AUG-12 543.8 MasterCard KGH5664320000 1200007800019334 Debit 09-MAR-15 06-JUN-12 633.6 MasterCard KGH1129789009 1200007800020143 Credit 09-MAR-15 09-OCT-12 1945.6 Discover KGH1123789009 1200007800020952 Debit 09-MAR-15 04-FEB-11 728.24 MasterCard 130
    • KGH11289789009 Credit KGH11277789009 Debit 09-MAR-15 04-FEB-11 09-MAR-15 04-FEB-11 1200007800021761 628.6 American Express 1200007800022570 246.4 Visa 9 rows selected > SELECT * FROM SALES CUSTOMER_ID TRANSACTON_ID PRODUCT_ID ORDER_ID QTY_ORDERED PRODUCT_PRICE_ORIGINAL PRODUCT_PRICE_WT_QTY TAX_AMOUNT_CHARGED FREIGHT_AMOUNT_CHARGED TOTAL_AMOUNT ORDER_DATE ----------- ------------------------------------------------------------ --------- -------- ----------- ---------------------- -------------------- ----------------- ---------------------- ------------ ---------11023 KGH4789076500 56 5890590 2 240 480 28.8 35 543.8 20-AUG-12 11013 KGH8097899900 79 49056 2 1500 3000 180 69.9 3249.9 20-JAN-11 11013 KGH6789054200 61 99059 4 500 2000 120 20 2140 25-AUG-11 11023 KGH11289789009 54 189056 2 280 560 33.6 35 628.6 04-FEB-11 11023 KGH11277789009 55 689055 1 190 190 11.4 45 246.4 04-FEB-11 > SELECT * FROM ORDER1 FIRST_NAME MIDDLE_NAME LAST_NAME CUSTOMER_ID ORDER_ID PRODUCT_ID NAME QTY_ORDERED Orginal-Price Tax Shipping Final Amount Date-Ordered ----------------------------------- ----------------------------------- ---------------------------------- ----------- -------- ---------- --------------------------------------------------------------------------------------------------- ------------- --- -------- ------------ -----------Seth M Edwards 11023 189056 54 Canon EOS 7D (Body Only) 18-megapixel Digital SLR 2 280 33.6 35 628.6 04-FEB-11 Seth M Edwards 11023 689055 55 Samsung ST65 14.2 Megapixel Digital Still 1 190 11.4 45 246.4 04-FEB-11 Seth M Edwards 11023 5890590 56 Sony Cyber-shot® Digital Camera WX9- Black 2 240 28.8 35 543.8 20-AUG-12 Ian M Jenkins 11013 99059 61 Panasonic 131
    • Lumix DMC-FH5K 16.1 Megapixel Digital Camera- Black 4 500 120 20 2140 25-AUG-11 Ian Jenkins Q330 13.3" Notebook 2 1500 180 M 11013 69.9 49056 79 Samsung 3249.9 20-JAN-11 > SELECT * FROM CUSTDATA01 CUSTOMER_ID FIRST_NAME MIDDLE_NAME LAST_NAME ADDRESS CITY PHONE STATE BIRTH_DATE ----------- ----------------------------------- ---------------------------------- ----------------------------------- ------------------------------------------------- -------------------- ------------------------- ---------------------------------- --------------------------------------------11012 Lauren M Walker 4785 Scott Street Bremerton 717-555-0164 Washington 18-Jan-68 11013 Ian M Jenkins 7902 Hudson Ave. Lebanon 817-555-0185 Oregon 6-Aug-68 11016 Wyatt L Hill 9666 Northridge Ct. Imperial Beach 135-555-0171 California 28-Apr-79 11022 Ethan G Zhang 1769 Nicholas Drive Bellingham 589-555-0185 Washington 12-Oct-78 11023 Seth M Edwards 4499 Valley Crest Bellflower 452-555-0188 California 11-Oct-78 11036 Jennifer C Russell 3981 Augustine Drive National City 115-555-0183 California 18-Dec-78 11041 Amanda M Carter 5826 Escobar Glendale 295-555-0145 California 16-Oct-77 11042 Megan J Sanchez 1397 Paraiso Ct. Los Angeles 404-555-0199 California 13-Jun-77 11043 Nathan M Simmons 1170 Shaw Rd Glendale 296-555-0181 California 24-Feb-76 132
    • 11049 Carol Rai Chula Vista 18-Jul-80 11053 Ana Price San Diego 20-Aug-80 11062 Noah Powell Portland 2-Sep-75 11066 Grace Butler Lebanon 27-Nov-73 11067 Caleb Carter Port Orchard 25-Sep-76 11081 Savannah Baker Concord 24-Jul-66 11082 Angela Butler Fremont 4-Aug-66 11083 Alyssa Cox Lincoln Acres 15-Mar-66 11087 Tamara Liang Chula Vista 3-Oct-57 11089 Abigail Price Long Beach 5-Feb-57 11129 Julia Wright Sedro Woolley 5-Aug-75 11130 Caroline Russell Lebanon 6-Jan-80 11135 Marcus Harris Burlingame 3-Nov-79 11137 Jasmine Taylor 654-555-0180 C 6064 Madrid California 859-555-0113 E 1660 Stonyhill Circle California 767-555-0113 D 9794 Marion Ct Oregon 712-555-0141 T 4739 Garden Ave. Oregon 944-555-0167 F 9563 Pennsylvania Blvd. Washington 478-555-0117 C 1210 Trafalgar Circle California 579-555-0195 L 6040 Listing Ct California 561-555-0140 F 867 La Orinda Place California 178-555-0152 L 3791 Rossmor Parkway California 532-555-0117 M 2685 Blackburn Ct California 456-555-0174 M 7397 Central Blvd. Washington 424-555-0137 L 3884 Bates Court Oregon 442-555-0119 L 9068 Quiet Place Drive California A 2457 Matterhorn Court 133
    • Spokane 20-Jul-78 11140 Alvarez Burbank 11-Feb-77 11143 Henderson Lakewood 4-Feb-77 11145 Coleman Beaverton 8-Dec-79 11152 Williams Puyallup 10-Jan-76 11153 James Renton 23-Jun-76 11154 Walker Woodburn 21-Aug-76 11155 Robinson Burbank 26-Jan-76 557-555-0146 Washington 763-555-0134 L 8935 Etcheverry Dr. California 149-555-0113 M 165 East Lane Road California 857-555-0115 L 1961 Oak Grove Road Oregon 355-555-0153 J 6827 Seagull Court Washington 847-555-0111 R 8877 Weatherly Drive Washington 918-555-0186 G 6898 Holiday Hills Oregon 891-555-0125 J 8356 Mori Court California Javier Jonathan Jasmine James Angela Megan Hunter 30 rows selected > SELECT * FROM PRODT PRODUCT_ID PRODUCT_NAME PRODUCT_PRICE PRODUCT_BRAND PRODUCT_DESCRIPTION PRODUCT_CATEGORY ---------- ----------------------------------------------------------------------------------------- ------------- ----------------------------------- ------------------------------------------------------------------------------ -----------------------------360 Insignia- 42" Class- Plasma 400 Insignia 720p / 600Hz / HDTV Televsion 321 Insignia - 51" Class / Plasma 880 Insignia 720p / 600Hz / HDTV Televsion 322 Samsung - 43" Class/Plasma 680 Samsung 720p / 600Hz / HDTV Televsion 405 Samsung - 51" Class /Plasma 880 Samsung 1080p / 600Hz / HDTV Televsion 134
    • 426 Samsung - 51" Class /Plasma 980 Samsung 1080p / 600Hz / 3D /HDTV Televsion 355 Panasonic - 50" Class / Plasma 1200 Panasonic 1080p / 600Hz / HDTV Televsion 491 Panasonic - 50" Class / Plasma 1590 Panasonic 1080p / 600Hz / HDTV/3D Televsion 495 Panasonic - 46" Class / Plasma 1400 Panasonic 720p / 600Hz / HDTV/3D Televsion 356 Panasonic - VIERA 65" Class / Plasma 3800 Panasonic 1080p / 600Hz / 3D / HDTV Televsion 379 Panasonic - VIERA 50" Class / Plasma 2600 Panasonic 1080p / 600Hz / 3D / HDTV Televsion 402 Samsung - 32" Class /LCD 380 Samsung 720p / 60Hz / HDTV Televsion 403 Samsung - 19" Class/ LCD 280 Samsung 720p / 60Hz / HDTV Televsion 525 Panasonic 32" Class /LCD 340 Panasonic 720p / 60Hz / HDTV Televsion 1 LG-42" Class /LCD 500 LG 1080p / 600Hz / HDTV Televsion 2 LG-32" Class /LCD 400 LG 1080p / 600Hz / HDTV Televsion 3 Samsung - 40" Class/ LCD 400 Samsung 720p / 60Hz / HDTV Televsion 4 LG-47" Class/ LCD 800 LG 1080p / 120Hz / HDTV Televsion 5 Toshiba-32" Class /LCD 360 Toshiba 720/60Hz/HDTV Televsion 6 Toshiba-55" Class /LCD 900 Toshiba 1080p / 120Hz / LCD HDTV Televsion 7 LG-47" Class/ LCD 880 LG 1080p / 120Hz / LCD HDTV Televsion 8 SONY-BRAVIA "46 Class/LCD 750 SONY 1080p / 120Hz / LCD HDTV Televsion 9 SONY-BRAVIA "32 Class/LCD 400 SONY 720p/60Hz/HDTV Televsion 135
    • 10 Toshiba-40" Class/LCD 512 Toshiba 720p/60Hz/HDTV Televsion 11 RCA-46" Class/LCD 630 RCA 1080p/120Hz/HDTV Televsion 12 RCA-32" Class/LCD 550 RCA 1080p/120Hz/HDTV Televsion 13 RCA-55" Class/LCD 780 RCA 1080p/120Hz/HDTV Televsion 14 SHARP-32" Class/LCD 640 SHARP 1080p/120Hz/HDTV Televsion 15 SHARP-46" Class/LCD 780 SHARP 1080p/120Hz/HDTV Televsion 16 SHARP-55" Class/LCD 900 SHARP 1080p/120Hz/HDTV Televsion 17 SHARP-32" Class/Plasma 1100 SHARP 1080p / 600Hz / HDTV Televsion 18 SHARP-40" Class/Plasma 1200 SHARP 720p / 600Hz / HDTV/3D Televsion 19 SHARP-55" Class/Plasma 1350 SHARP 1080p / 600Hz / 3D / HDTV Televsion 20 SHARP-60" Class/Plasma 1450 SHARP 1080p / 600Hz / 3D / HDTV Televsion 21 Sony - Progressive-Scan DVD Player with MP3 Playback - Black 38.99 SONY DVD 22 Sony - DVD Player with HD Upconversion 55.99 SONY DVD 23 Toshiba - Progressive Scan DVD Player/VCR Combo with JPEG Playback 90 Toshiba DVD 24 Philips - DVD Player with HD Upconversion 50 Philips DVD 25 Samsung - DVD Player with HD Upconversion 58 Samsung DVD 26 Toshiba - DVD Player 40 Toshiba DVD 27 Magnavox - DVD Player with HDMI 50 Magnavox DVD 136
    • 28 Samsung - 3D Wi-Fi Built-In Blu-ray Player 200 Samsung DVD 29 Samsung - 3D Wi-Fi Ready Blu-ray Player 161 Samsung DVD 30 Panasonic - 3D Wi-Fi Ready Blu-ray Player 150 Panasonic DVD 31 Insignia - 3D Wi-Fi Built-In Blu-ray Player 130 Insignia DVD 32 Samsung - 3D / Wi-Fi Built-In Blu-ray Disc Player 300 Samsung DVD 33 Sharp - 3D Wi-Fi Ready Blu-ray Player 160 SHARP DVD 34 SONY- DVD Player 90 SONY DVD 35 RCA-DVD Player 80 RCA DVD 36 Toshiba TOSHIBA 720P LED DVD COMBO 490 Toshiba Televsion/DVD 37 RCA 22" LCD HDTV/DVD Combo 240 RCA 21.6 Diagonal/ Class 1080p Televsion/DVD 38 Sony Handycam 330 SONY 2.7 in. LCD Camcorder 39 Sony Full HD Camcorder - 680K 60X Optical Zoom-Black 512 SONY 30x Optical Zoom Camcorder 40 Sony Handycam- 1080p 25X Optical Zoom 400 SONY 2.7 in. LCD Camcorder 41 JVC Flash Memory Camcorder 190 JVC Camcorder 42 JVC Everio 1080P HD Digital Camcorder w/Dual Card Slot 294 JVC Camcorder 43 Samsung F50 Digital Camcorder with 2.7" LCD 180 Samsung Camcorder 44 Canon VIXIA HF M41 Flash Memory High Definition 680 Samsung Camcorder 45 Samsung Waterproof Full HD W200 Camcorder - Red 150 Samsung Camcorder 137
    • 46 Panasonic 80GB SD Camcorder Black 340 Panasonic Camcorder 47 Panasonic 16 GB HD Camcorder Black 490 Panasonic Camcorder 48 Panasonic 1080p HD Camcorder Black 1300 Panasonic Camcorder 49 Kodak EasyShare Camera Bundle - C1530 - Red 90 Kodax Camera 50 Canon G12 10MP Digital Camera 5x Optical Stabilized 480 Canon Camera 51 Nikon CoolPix P500 Digital Camera - Red 480 Nikon Camera 52 Canon EOS Rebel T2i Digital 780 Canon Camera 53 Sony Cyber-shot® Digital Camera W530- Black 118 SONY Camera 54 Canon EOS 7D (Body Only) 18-megapixel Digital SLR 180 Canon Camera 55 Samsung ST65 14.2 Megapixel Digital Still 100 Samsung Camera 56 Sony Cyber-shot® Digital Camera WX9- Black 190 SONY Camera 57 Kodak Zi8 Pocket 1080p HD Video Camera - Rasberry 280 Kodax Camera 58 Kodak Digital 8796062 Kodak ZI8 Pocket Video Camera 310 Kodax Camera 59 Samsung SH100 14.2 Megapixel WiFi Digital Camera- Silver 180 Samsung Camera 60 Nikon COOLPIX L24 Red 130 Nikon Camera 61 Panasonic Lumix DMC-FH5K 16.1 Megapixel Digital Camera- Black 145 Panasonic Camera 62 Sony Cyber-shot® Digital Camera W530- Blue 120 SONY Camera 138
    • 63 Nikon COOLPIX S3100 Blue 140 Nikon Camera 64 Coby 2.0" 8GB Video MP3 Player - Black 24 Coby Portable Media Player 65 SanDisk 2GB Sansa® Clip+ MP3 Player, Black 30 ScanDisk Portable Media Player 66 SanDisk 4GB Sansa® Clip+ MP3 Player, Black 40 ScanDisk Portable Media Player 67 SanDisk Sansa 4 GB Black Flash Portable Media Player 40 ScanDisk Portable Media Player 68 Sandisk Sansa Clipzip Media Player (Black) 65 ScanDisk SDMX22-008G-A57K 8GB Portable Media Player 69 Sandisk Sansa Clipzip Media Player (Red) 45 ScanDisk SDMX22-004G-A57R 4GB Portable Media Player 70 Coby MP768 8 GB Flash Portable Media Player 50 Coby Portable Media Player 71 Memorex MMP8565C 1 GB Flash Portable Media Player 44 Memorex Portable Media Player 72 Microsoft Zune 4GB MP3 Player, Green 140 Microsoft Portable Media Player 73 Microsoft Zune 4GB MP3 Player, Red 140 Microsoft Portable Media Player 74 Microsoft Zune 4GB MP3 Player, Black 140 Microsoft Portable Media Player 75 Microsoft Zune 4GB MP3 Player, Pink 140 Microsoft Portable Media Player 76 Sony Walkman NWZ-S544RED 8 GB Red Flash 98 SONY Portable Media Player 77 Sony Walkman NWZ-E353BLK 4 GB Black Flash 98 SONY Portable Media Player 78 Microsoft 32GB Zune HD Video MP3 Player 240 Microsoft Portable Media Player 79 Samsung Q330 13.3" Notebook 880 Samsung Intel Core i5-480M-2.67GHz , 4GB DDR3 Memory, 500GB HDD, DVD Super Multi-Drive, Noetbook 139
    • 80 Lenovo IdeaPad Z560 680 Lenovo Intel Core i5-480M 3.19GHz with Turbo Boost, 4GB DDR3 Memory, 500 Noetbook 2.66GHz up to 93 rows selected > SELECT * FROM INVENT INVENTORY_ID EMPLOYEE_ID PRODUCT_ID QTY_STOCKED QTY_REMANING NEXT_STACK_DATE STORAGE_DATE ------------ ----------- ---------- ----------- --------------------- ---------------------------------------21344 241 525 2000 900 JAN-12 21422 241 379 3500 1200 JAN-12 21500 241 402 90 50 FEB-12 21578 241 80 90 50 FEB-12 STACK_DATE ---------- ----30-DEC-11 10- 30-DEC-11 27- 09-FEB-12 14- 09-FEB-12 14- > /*---CUSTOMER REP------*/ > CONNECT NiswongerOIU/moneywealtmd98 Connected > SHOW USER USER is NISWONGEROIU > SELECT * FROM CUSTINFO ACCOUNT_NUMBER CUSTOMER_ID STATUS FIRST_NAME MIDDLE_NAME LAST_NAME ADDRESS CITY PHONE STATE BIRTH_DATE --------------------------------------------- ----------- ------------------- ----------------------------------- ----------------------------------- ---------------------------------- ------------------------------------------------- -------------------- ------------------------- ---------------------------------- --------------------------------------------AW2346785 11012 CURRENT Lauren M Walker 4785 Scott Street Bremerton 717-555-0164 Washington 18-Jan-68 AW79800106 11013 CURRENT Ian M Jenkins 7902 Hudson Ave. Lebanon 817-555-0185 Oregon 6-Aug-68 AW70559945 11016 CURRENT Wyatt L Hill 9666 Northridge Ct. Imperial Beach 135555-0171 California 28-Apr-79 140
    • AW76656345 Wyatt 9666 Northridge Ct. 555-0171 AW02768213 Ethan 1769 Nicholas Drive 555-0185 AW92668218 Seth Edwards Bellflower 11-Oct-78 11016 CLOSE L Imperial Beach 28-Apr-79 11022 CURREN California G Bellingham 12-Oct-78 11023 CURREN Washington 452-555-0188 Hill 135Zhang 589- M 4499 Valley Crest California 6 rows selected > SELECT * FROM orders08 FIRST_NAME MIDDLE_NAME LAST_NAME CUSTOMER_ID ORDER_ID PRODUCT_ID NAME QTY_ORDERED Orginal-Price Tax Shipping Final Amount Date-Ordered ----------------------------------- ----------------------------------- ---------------------------------- ----------- -------- ---------- --------------------------------------------------------------------------------------------------- ------------- --- -------- ------------ -----------Seth M Edwards 11023 189056 54 Canon EOS 7D (Body Only) 18-megapixel Digital SLR 2 280 33.6 35 628.6 04-FEB-11 Seth M Edwards 11023 689055 55 Samsung ST65 14.2 Megapixel Digital Still 1 190 11.4 45 246.4 04-FEB-11 Seth M Edwards 11023 5890590 56 Sony Cyber-shot® Digital Camera WX9- Black 2 240 28.8 35 543.8 20-AUG-12 Ian M Jenkins 11013 99059 61 Panasonic Lumix DMC-FH5K 16.1 Megapixel Digital Camera- Black 4 500 120 20 2140 25-AUG-11 Ian Jenkins Q330 13.3" Notebook 2 1500 180 M 11013 69.9 49056 79 Samsung 3249.9 20-JAN-11 > /*----PROJECT MANAGERS--------*/ > CONNECT StadickDL/abamemom5 Connected > SHOW USER USER is STADICKDL 141
    • > SELECT * FROM PROJECT PROJECT_ID MANAGER_ID PROJECT_TITLE START_DATE END_DATE AWARDED_AMOUNT NOTES ---------- ---------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------- --------- -------------- ------------------------------------------------------------------------------54456 268 MOBILE ECOMMERCE SYSTEMS UPGRADE 09-FEB-09 12-MAR-10 90000 54512 234 DATATBASE SYSTEM PROJECT 02-FEB-12 80000 54568 234 APPLICATIONS UPGRADE 02-DEC-13 50000 > SELECT * FROM PJWORK PROJECT_ID EMPLOYEE_ID WORKBOOK_ID HOURS_ASSIGN ROLE ---------- ----------- ----------- ------------ --------------------------------------54456 88 6745 2000 Database Specialist 54456 64 6779 2500 SYSTEMS DEVELOPER-Analyst 54456 159 6813 3000 Application Specialist 54456 87 6847 2000 Accounting Systems Analyst 54456 214 6881 200 Application Specialist 54512 88 6915 3000 Database Specialist 54512 64 6949 1500 SYSTEMS DEVELOPER-Analyst 54512 159 6983 240 Application Specialist 54512 87 7017 400 Accounting Systems Analyst 54512 214 7051 1000 Application Specialist 54568 64 7085 5500 SYSTEMS DEVELOPER-Analyst 11 rows selected Connection created by CONNECT script command disconnected Database Operations /*-----ACCOUNTANTs---*/. CONNECT kaneVMP/gospelmark#2; Scenario: A customer places an order but the transaction has been processed. Only the accountants can override the transaction. show user update sales set TAX_AMOUNT_CHARGED =50 142
    • where TRANSACTON_ID = 'KGH4789076500'; update sales set QTY_ORDERED = 4 where TRANSACTON_ID = 'KGH4789076500'; update sales set PRODUCT_PRICE_WT_QTY = 720 where TRANSACTON_ID = 'KGH4789076500'; update sales set FREIGHT_AMOUNT_CHARGED = 55 where TRANSACTON_ID = 'KGH4789076500'; update sales set TOTAL_AMOUNT = 825 where TRANSACTON_ID = 'KGH4789076500'; update transactions set AMOUNT_CHARGED = 825 where TRANSACTON_ID = 'KGH4789076500'; select * from sales where TRANSACTON_ID = 'KGH4789076500'; select * from transactions where TRANSACTON_ID = 'KGH4789076500'; select c.customer_Id, c.first_name, c.middle_name, c.last_name, c.city, c.phone from customer c where c.customer_id = 11023; SPOOL FILE: SQL> SQL> CONNECT kaneVMP/gospelmark#2; Connected. SQL> SQL> show user USER is "KANEVMP" SQL> SQL> update sales 2 set TAX_AMOUNT_CHARGED =50 3 where TRANSACTON_ID = 'KGH4789076500'; 1 row updated. SQL> SQL> update sales 143
    • 2 3 set QTY_ORDERED = 4 where TRANSACTON_ID = 'KGH4789076500'; 1 row updated. SQL> SQL> update sales 2 set PRODUCT_PRICE_WT_QTY = 720 3 where TRANSACTON_ID = 'KGH4789076500'; 1 row updated. SQL> SQL> update sales 2 set FREIGHT_AMOUNT_CHARGED = 55 3 where TRANSACTON_ID = 'KGH4789076500'; 1 row updated. SQL> SQL> update sales 2 set TOTAL_AMOUNT = 825 3 where TRANSACTON_ID = 'KGH4789076500'; 1 row updated. SQL> SQL> update transactions 2 set AMOUNT_CHARGED = 825 3 where TRANSACTON_ID = 'KGH4789076500'; 1 row updated. SQL> select * from sales where TRANSACTON_ID = 'KGH4789076500'; CUSTOMER_ID TRANSACTON_ID PRODUCT_ID ORDER_ID QTY_ORDERED PRODUCT_PRICE_ORIGINAL PRODUCT_PRICE_WT_QTY TAX_AMOUNT_CHARGED FREIGHT_AMOUNT_CHARGED TOTAL_AMOUNT ORDER_DATE ----------- ------------------------------------------------------------ --------- -------- ----------- ---------------------- -------------------- ----------------- ---------------------- ------------ ---------11023 KGH4789076500 56 5890590 4 240 720 50 55 825 20-AUG-12 SQL> select * from transactions where TRANSACTON_ID = 'KGH4789076500'; TRANSACTON_ID CREDIT_CARD_ID CARD_TYPE EXP_DATE TRANS_DATE AMOUNT_CHARGED BRAND ------------------------------------------------------------ -------------- ----------------------- --------- ---------- -------------- ------------------KGH4789076500 1200007800018525 Credit 09-MAR-15 20-AUG-12 825 MasterCard 144
    • select c.customer_Id, c.first_name, c.middle_name, c.last_name, c.city, c.phone from customer c where c.customer_id = 11023 CUSTOMER_ID FIRST_NAME MIDDLE_NAME LAST_NAME CITY PHONE ----------- ----------------------------------- ---------------------------------- ----------------------------------- -------------------- -----------------------11023 Seth M Edwards Bellflower 452-555-0188 SQL> commit; Commit complete. SQL> set echo off SQL> spool off /*-----HR INSERT---*/ --- Insert into the employee table--------Scenario: A new employee was hired in the company. CONNECT MohansuOK/washhights2; SHOW USER INSERT INTO EMPLOYEE (EMPLOYEE_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, BIRTH_DATE, GENDER, MARITAL_STATUS, ADDRESS, CITY, STATE, POSTAL_CODE, PHONE ) 145
    • VALUES (269, 'Rose','Annie', 'Hilldale', '20-Jul-75', 'F' , 'M', '2020 SpringRow Drv', 'Lake Washington','WA', '98052', '151-930-1940'); SPOOL FILE > CONNECT MohansuOK/washhights2 Connected > SHOW USER USER is MOHANSUOK > INSERT INTO EMPLOYEE (EMPLOYEE_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, BIRTH_DATE, GENDER, MARITAL_STATUS, ADDRESS, CITY, STATE, POSTAL_CODE, PHONE ) VALUES (269, 'Rose','Annie', 'Hilldale', '20-Jul-75', 'F' , 'M', '2020 SpringRow Drv', 'Lake Washington','WA', '98052', '151-930-1940') 1 rows inserted. Connection created by CONNECT script command disconnected INSERT INTO HRRECORD (EMPLOYEE_ID, DEPARTMENT_ID, SICK_HOURS, VACATION_HOURS, RANK, HIRE_DATE, PAY_RATE, OFFICE_PHONE ) VALUES (269,386,90,1200,'Audit Specialist','Monday April 02 2012',40,'x-4050'); 146
    • SPOOL FILE > CONNECT MohansuOK/washhights2 Connected > SHOW USER USER is MOHANSUOK > INSERT INTO HRRECORD (EMPLOYEE_ID, DEPARTMENT_ID, SICK_HOURS, VACATION_HOURS, RANK, HIRE_DATE, PAY_RATE, OFFICE_PHONE ) VALUES (269,386,90,1200,'Audit Specialist','Monday April 02 2012',40,'x-4050') 1 rows inserted. Connection created by CONNECT script command disconnected /* REPORT ANALYST*/ Scenario create reports containing customers in Washington and California and the number of products in sales table. CONNECT DavidMGI/johnnywash9; show user SELECT COUNT(CUSTOMER_ID)AS "CUSTOMER-WASH" FROM CUSTDATA02 WHERE STATE = 'Washington'; SELECT * from CUSTDATA02 where state = 'California'; select count(product_id) from ORDERS04; SPOOL FILE > CONNECT DavidMGI/johnnywash9 Connected > show user 147
    • USER is DAVIDMGI > SELECT * FROM CUSTDATA02 WHERE STATE = 'Washington' CUSTOMER_ID CITY STATE BIRTH_DATE POSTAL_CODE COUNTRY GENDER YEARLY_INCOME MARITAL_STATUS EDUCATIONAL_BACKGROUND TOTAL_CHILDREN TOTAL_CARS_OWNED PROFESSION ----------- -------------------- ----------------------------------- -------------------------------------------- -------------------- ---------------------------------- --------------- ------------- ---------------------------------- ----------------------------------- -------------- ---------------- --------------------------------11012 Bremerton Washington 18-Jan68 98312 United States F 100000 M Bachelors 2 2 Management 11022 Bellingham Washington 12-Oct78 98225 United States M 40000 M Partial College 0 1 Skilled Manual 11067 Port Orchard Washington 25-Sep76 98366 United States M 60000 S Partial College 0 2 Professional 11129 Sedro Woolley Washington 5-Aug-75 98284 United States F 40000 S High School 0 1 Skilled Manual 11137 Spokane Washington 20-Jul78 99202 United States F 40000 M High School 0 2 Skilled Manual 11152 Puyallup Washington 10-Jan76 98371 United States M 40000 S High School 0 2 Skilled Manual 11153 Renton Washington 23-Jun76 98055 United States F 40000 M High School 0 2 Skilled Manual 7 rows selected > SELECT * from CUSTDATA02 where state = 'California' CUSTOMER_ID CITY STATE BIRTH_DATE POSTAL_CODE COUNTRY GENDER YEARLY_INCOME MARITAL_STATUS EDUCATIONAL_BACKGROUND TOTAL_CHILDREN TOTAL_CARS_OWNED PROFESSION ----------- -------------------- ----------------------------------- -------------------------------------------- -------------------- ---------------------------------- --------------- ------------- ----------------------------- 148
    • ------ ----------------------------------- -------------- ---------------- --------------------------------11016 Imperial Beach California 28-Apr79 91932 United States M 30000 M Partial College 0 1 Skilled Manual 11023 Bellflower California 11-Oct78 90706 United States M 40000 M Partial College 0 1 Skilled Manual 11036 National City California 18-Dec78 91950 United States F 60000 M Partial College 0 2 Skilled Manual 11041 Glendale California 16-Oct77 91203 United States F 60000 M Partial College 0 2 Skilled Manual 11042 Los Angeles California 13-Jun77 90012 United States F 70000 M Partial College 0 2 Skilled Manual 11043 Glendale California 24-Feb76 91203 United States M 60000 M Partial College 0 2 Skilled Manual 11049 Chula Vista California 18-Jul80 91910 United States F 40000 S Partial High School 0 2 Clerical 11053 San Diego California 20-Aug80 92102 United States F 60000 M Partial College 0 2 Skilled Manual 11081 Concord California 24-Jul66 94519 United States F 120000 M Bachelors 2 3 Management 11082 Fremont California 4-Aug-66 94536 United States F 130000 S Graduate Degree 0 3 Management 11083 Lincoln Acres California 15-Mar66 91950 United States F 130000 M Graduate Degree 0 3 Management 11087 Chula Vista California 3-Oct-57 91910 United States F 70000 M Partial College 3 0 Professional 11089 Long Beach California 5-Feb-57 90802 United States F 80000 S Bachelors 2 1 Management 149
    • 11135 94010 30000 S 0 11140 77 M High School 11143 90712 40000 M 0 11155 76 M College Burlingame California 3-Nov-79 United States M Partial High School 2 Clerical Burbank California 11-Feb91502 United States 30000 S Partial 0 2 Clerical Lakewood California 4-Feb-77 United States M High School 2 Skilled Manual Burbank California 26-Jan91502 United States 40000 S Partial 0 1 Skilled Manual 17 rows selected > select count(product_id) from ORDERS04 COUNT(PRODUCT_ID) ----------------5 Connection created by CONNECT script command disconnected /* CUSTOMER REPRSENTATIVES */ Scenario: A customer lost their card. As a result the old card would be closed and a new one created to replace the old one. connect PhilipsCLZ/philcousin#93; show user /* verify the customer*/ select * from CUSTINFO where customer_id = 11012; /* verify the account both open and close*/ select * from CARDCLOSE where customer_id = 11012; select * from CustCard where customer_id = 11012; update CustCard 150
    • set status = 'CLOSE' WHERE CUSTOMER_ID = 11012 AND ACCOUNT_NUMBER = 'AW2346785'; INSERT INTO CARDCLOSE(SERIAL_NUMBER, ACCOUNT_NUMBER, CLOSE_EMPLOYEE_ID, CLOSE_DATE, NOTES, CUSTOMER_ID) VALUES (05041908, 'AW2346785', 171, '04-Apr-2012', 'lost the card at metro station sw of market rd',11012); Insert into custcard(Account_Number, Customer_id, print_date ,status, employee_id) values('AW5946085', 11012, '04-Apr-2012', 'Not Active', 171); select * from CARDCLOSE where customer_id = 11012; select * from CustCard where customer_id = 11012; SPOOL FILE cust_rep.txt cust_rep2.txt /*PROJECT MANAGERS*/ Scenario: Update a project to include date for the mobile ecommerce system project and add a new employee to the project. connect AnnetteHiJ/annttmamma12 desc PROJECT ; desc PJWORK; update project set end_date = '20-Dec-2012' where project_id = 54456; select * from project where project_id= 54456; 151
    • select * from project; select * from PJWORK; insert into PJWORK (project_id,employee_id, hours_assign, role ) values(54456,55,90, 'Report Analyst'); SPOOL FILE project.txt /* SALES SPECIALIST*/ connect ThierrydherLK/cherryhillfunk2 insert into PRODT(PRODUCT_NAME, PRODUCT_ID, PRODUCT_PRICE, PRODUCT_BRAND, PRODUCT_DESCRIPTION, PRODUCT_CATEGORY) VALUES('DELL STUDIO 120', 098788, 1200, 'DELL', 'Notebook with Windows 7 64. Skin color black', 'Notebook'); Select * from PRODT; INSERT INTO INVENT(INVENTORY_iD, EMPLOYEE_ID, PRODUCT_ID, QTY_STOCKED, STACK_DATE,QTY_REMANING) VALUES( 21909, 6,98788 , 50,'3-April-2012', 50); select * from invent; update invent set storage_date = '06-Apr-2012' where PRODUCT_ID = 98788; select * from invent; SPOOL FILE sales.txt 152
    • /* DATABASE ADMINSTRATOR */ Show user; /*perform basic database management work*/ create or replace synonym emp for system.employee; create or replace synonym hr for system.hrrecord; create table testing(test_id number); drop table testing; /* Creates an new user identification for new employee*/ select first_name, last_name from employee where employee_id = 269; CREATE USER ROSEDALEH4 IDENTIFIED BY ROSEDALEH4 Password expire; /*Apply the password requirements to their account */ Alter user ROSEDALEH4 PROFILE SPASSWORD; /*change the password*/ alter user rosedaleh4 identified by rosedaleh4; alter user rosedaleh4 identified by wooddale; INSERT INTO SYSTEM.UEMP(EMPID, USERNAME) VALUES(269, 'ROSEDALEH4'); SELECT * FROM SYSTEM.UEMP WHERE EMPID = 269; /* Grants the employee rights based on their role*/ Grant employee to rosedaleh4; 153
    • GRANT SALES TO ROSEDALEH4; Grant create session to rosedaleh4; SPOOL FILE QL> show user; USER is "DAVYALOVSKY0" /*peform basic database management work*/ SQL> create or replace synonym emp for system.employee; Synonym created. SQL> create or replace synonym hr for system.hrrecord; Synonym created. SQL> create table testing(test_id number); Table created. SQL> drop table testing; Table dropped. /* Creates an new user identification for new employee*/ 154
    • SQL> select first_name, last_name from employee where employee_id = 269; FIRST_NAME LAST_NAME ------------------------------ -----------------------------Rose Hilldale SQL> /* create a user for the new employee*/ create user ROSEDALEH4 identified by ROSEDALEH4 password expire; User created. /*Apply the password requirements to their account */ Alter user ROSEDALEH4 PROFILE SPASSWORD; /*change the password*/ alter user rosedaleh4 identified by rosedaleh4; ORA-20001: Password same as username alter user rosedaleh4 identified by wooddale; 155
    • SQL> INSERT INTO SYSTEM.UEMP(EMPID, USERNAME) 2 VALUES(269, 'ROSEDALEH4'); 1 row created. SQL> SELECT * FROM SYSTEM.UEMP WHERE EMPID = 269; EMPID AUTHENTICATION_ID USERNAME ---------- ----------------- ---------------------------------------269 917793 ROSEDALEH4 /* Grants the employee rights based on their role*/ > grant employee to rosedaleh4; Grant succeeded. SQL> GRANT SALES TO ROSEDALEH4; Grant succeeded. /*Apply the password requirements to their account */ Alter user ROSEDALEH4 PROFILE SPASSWORD; SQL> grant create session to rosedaleh4; QL> connect ROSEDALEH4/wooddale; Connected. SQL> desc sales; 156
    • Name Null? Type ----------------------------------------- -------- -----------------------CUSTOMER_ID NOT NULL NUMBER TRANSACTON_ID NOT NULL VARCHAR2(60) PRODUCT_ID NOT NULL NUMBER ORDER_ID NOT NULL NUMBER QTY_ORDERED NUMBER PRODUCT_PRICE_ORIGINAL NUMBER PRODUCT_PRICE_WT_QTY NUMBER TAX_AMOUNT_CHARGED NUMBER FREIGHT_AMOUNT_CHARGED NUMBER TOTAL_AMOUNT NUMBER ORDER_DATE DATE SQL> select customer_id, product_idf from sales; select customer_id, product_idf from sales * ERROR at line 1: ORA-00904: "PRODUCT_IDF": invalid identifier SQL> select customer_id, product_id from sales; CUSTOMER_ID PRODUCT_ID ----------- ---------11013 61 11013 79 11023 54 11023 55 11023 56 SQL> show user; USER is "ROSEDALEH4" Validating Roles; 157
    • /*A project Management team member trying to access data that belongs to sales and accounting groups */ SQL> connect StadickDL/abamemom5 ERROR: ORA-28002: the password will expire within 5 days Connected. SQL> select * from sales; select * from sales * ERROR at line 1: ORA-00942: table or view does not exist SQL> select * from ORDER1; select * from ORDER1 * ERROR at line 1: ORA-00942: table or view does not exist /*A sales team member trying to access data that belongs to project management team */ Connect MohamedB2B/cake4dwaniou23 ERROR: ORA-28002: the password will expire within 5 days SQL> select * from PJWORK; select * from PJWORK * ERROR at line 1: ORA-00942: table or view does not exist SQL> select * from PROJECT; select * from PROJECT * ERROR at line 1: ORA-00942: table or view does not exist /*A customer representative trying to access data not defined to their group */ SQL> connect PhilipsCLZ/philcousin#93 ERROR: ORA-28002: the password will expire within 5 days 158
    • Connected. SQL> select * from employee; select * from employee * ERROR at line 1: ORA-00942: table or view does not exist SQL> select * from TRANSACTIONS; select * from TRANSACTIONS * ERROR at line 1: ORA-00942: table or view does not exist /*A report analyst trying to access data not defined to their group */ SQL> connect DavidMGI/johnnywash9; ERROR: ORA-28002: the password will expire within 5 days Connected. SQL> select * from hrrecord; select * from hrrecord * ERROR at line 1: ORA-00942: table or view does not exist SQL> select * from employee; select * from employee * ERROR at line 1: ORA-00942: table or view does not exist AUDIT MANAGEMENT /* Display users actions in the database*/ create view aduits19 as select 159
    • USERNAME,OWNER,OBJ_NAME, ACTION_NAME, COMMENT_TEXT, PRIV_USED, EXTENDED_TIMESTAMP, SQL_TEXT,OBJ_EDITION_NAME from DBA_AUDIT_OBJECT where username = 'DAVYALOVSKY0' or username = 'NISWONGEROIU' or username = 'THIERRYDHERLK'; select * from aduits19 > select * from aduits19 USERNAME OWNER OBJ_NAME ACTION_NAME COMMENT_TEXT PRIV_USED EXTENDED_TIMESTAMP SQL_TEXT OBJ_EDITION_NAME ------------------------------ ------------------------------ ------------------------------------------------------------------------------------------------------------------------------ ---------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 160
    • ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ --------------------------------------- -------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ----------------------------NISWONGEROIU SYSTEM CUSTOMER SELECT 07-APR-12 07.01.57.842000000 AM AMERIC SELECT * FROM orders08 A/NEW_YORK NISWONGEROIU SYSTEM CUSTOMER SELECT 07-APR-12 07.02.14.800000000 AM AMERIC SELECT * FROM CUSTINFO 161
    • A/NEW_YORK NISWONGEROIU SYSTEM SALES SELECT 07-APR-12 07.40.08.203000000 AM AMERIC SELECT * FROM orders08 A/NEW_YORK NISWONGEROIU SYSTEM CUSTOMER SELECT 07-APR-12 07.40.08.204000000 AM AMERIC SELECT * FROM orders08 A/NEW_YORK NISWONGEROIU SYSTEM PRODUCT SELECT 07-APR-12 07.40.08.204000000 AM AMERIC SELECT * FROM orders08 A/NEW_YORK NISWONGEROIU SYSTEM ORDERS2 SELECT 07-APR-12 07.40.08.205000000 AM AMERIC SELECT * FROM orders08 A/NEW_YORK THIERRYDHERLK SYSTEM SELECT 07-APR-12 07.42.29.568000000 AM AMERIC Select * from PRODT PRODUCT A/NEW_YORK THIERRYDHERLK SYSTEM PRODUCT INSERT 07-APR-12 07.42.29.564000000 AM AMERIC insert into PRODT(PRODUCT_NAME, PRODUCT_ID, PRODUCT_PRICE, PRODUCT_BRAND, PRODUCT_DESCRIPTION, PRODUCT_CATEGORY) A/NEW_YORK VALUES('Apple Mac ', 09677, 1200, 'Apple', 'Skin color black', 'Notebook') DAVYALOVSKY0 CREATE USER CREATE USER AMERIC CREATE USER ROSEDALEH4 A/NEW_YORK DAVYALOVSKY0 CREATE USER CREATE USER AMERIC create user ROSEDALEH4 06-APR-12 03.37.38.773000000 PM IDENTIFIED BY ********** ROSEDALEH4 06-APR-12 04.11.01.103000000 PM ROSEDALEH4 162
    • A/NEW_YORK expire DAVYALOVSKY0 ALTER USER ALTER USER AMERIC Alter user ROSEDALEH4 A/NEW_YORK DAVYALOVSKY0 ALTER USER ALTER USER AMERIC Alter user ROSEDALEH4 A/NEW_YORK DAVYALOVSKY0 ALTER USER ALTER USER AMERIC Alter user ROSEDALEH4 A/NEW_YORK DAVYALOVSKY0 ALTER USER ALTER USER AMERIC alter user rosedaleh4 identified by ***********password ROSEDALEH4 06-APR-12 04.02.50.182000000 PM PROFILE SPASSWORD ROSEDALEH4 06-APR-12 04.06.38.535000000 PM PROFILE SPASSWORD ROSEDALEH4 06-APR-12 04.11.30.244000000 PM PROFILE SPASSWORD ROSEDALEH4 06-APR-12 04.14.50.895000000 PM identified by ********** A/NEW_YORK DAVYALOVSKY0 ALTER USER ALTER USER AMERIC alter user rosedaleh4 ROSEDALEH4 06-APR-12 04.15.03.328000000 PM identified by ********** A/NEW_YORK DAVYALOVSKY0 ALTER USER ALTER USER AMERIC alter user rosedaleh4 ROSEDALEH4 06-APR-12 04.15.59.145000000 PM identified by ******** A/NEW_YORK DAVYALOVSKY0 DROP USER DROP USER AMERIC drop user ROSEDALEH4 ROSEDALEH4 06-APR-12 04.09.45.552000000 PM A/NEW_YORK DAVYALOVSKY0 DROP USER ROSEDALEH4 163
    • DROP USER AMERIC drop user ROSEDALEH4 06-APR-12 04.10.15.863000000 PM A/NEW_YORK 18 rows selected /* Finds out users that logged on to database*/ create view logrec as SELECT username, action_name, TO_CHAR(TIMESTAMP, 'Mon-DD HH24:MI') LOGON, TO_CHAR(logoff_time, 'Mon-DD HH24:MI') LOGOFF, priv_used, comment_text from dba_audit_trail where username = 'DAVYALOVSKY0' or username = 'NISWONGEROIU' or username = 'THIERRYDHERLK' order by username; select * from logrec > select * from logrec USERNAME ACTION_NAME LOGON LOGOFF PRIV_USED COMMENT_TEXT ------------------------------ ---------------------------- ------------ ----------- ---------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 164
    • ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------DAVYALOVSKY0 LOGON Mar-31 22:15 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=51862)) DAVYALOVSKY0 LOGON Apr-01 12:30 CREATE SESSION Authenticated by: DATABASE DAVYALOVSKY0 LOGON Apr-05 13:44 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55035)) DAVYALOVSKY0 LOGON Apr-05 13:44 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55036)) DAVYALOVSKY0 LOGON Apr-05 13:44 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55039)) DAVYALOVSKY0 LOGON Apr-05 13:44 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55040)) DAVYALOVSKY0 LOGON Apr-05 13:44 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55041)) 165
    • DAVYALOVSKY0 LOGON Apr-05 13:53 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55186)) DAVYALOVSKY0 LOGON Apr-05 13:53 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55196)) DAVYALOVSKY0 LOGON Apr-05 13:53 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55205)) DAVYALOVSKY0 LOGON Apr-05 13:58 Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=55276)) DAVYALOVSKY0 LOGON Apr-05 13:59 Authenticated by: DATABASE DAVYALOVSKY0 LOGOFF Apr-05 15:34 Apr05 15:34 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=56941)) DAVYALOVSKY0 LOGOFF Apr-05 15:34 Apr05 15:34 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=56945)) DAVYALOVSKY0 LOGOFF Apr-05 15:34 Apr05 15:34 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=56950)) DAVYALOVSKY0 LOGOFF Apr-05 15:35 Apr05 15:35 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=56958)) DAVYALOVSKY0 LOGOFF Apr-05 15:36 Apr05 15:36 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=56983)) DAVYALOVSKY0 LOGOFF Apr-05 15:36 Apr05 15:36 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=56986)) DAVYALOVSKY0 LOGOFF Apr-05 15:37 Apr05 15:37 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=57001)) DAVYALOVSKY0 LOGOFF Apr-05 15:37 Apr05 15:37 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=57004)) DAVYALOVSKY0 LOGOFF Apr-05 16:29 Apr05 16:29 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=57909)) DAVYALOVSKY0 LOGOFF Apr-05 16:30 Apr05 16:30 CREATE SESSION Authenticated by: DATABASE; Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=57918)) DAVYALOVSKY0 LOGOFF Apr-06 15:19 Apr06 15:19 CREATE SESSION Authenticated by: DATABASE DAVYALOVSKY0 LOGOFF Apr-06 15:19 Apr06 16:03 CREATE SESSION Authenticated by: DATABASE DAVYALOVSKY0 CREATE USER Apr-06 15:37 CREATE USER DAVYALOVSKY0 SYSTEM GRANT Apr-06 15:52 GRANT ANY ROLE DAVYALOVSKY0 SYSTEM GRANT Apr-06 15:57 GRANT ANY ROLE 166
    • DAVYALOVSKY0 ALTER USER DAVYALOVSKY0 06 16:05 CREATE DAVYALOVSKY0 06 16:06 CREATE Client address: DAVYALOVSKY0 ALTER USER DAVYALOVSKY0 06 16:09 CREATE Client address: DAVYALOVSKY0 DROP USER DAVYALOVSKY0 06 16:10 CREATE Client address: DAVYALOVSKY0 DROP USER DAVYALOVSKY0 06 16:11 CREATE Client address: DAVYALOVSKY0 CREATE USER DAVYALOVSKY0 06 16:11 CREATE Client address: DAVYALOVSKY0 ALTER USER DAVYALOVSKY0 06 16:11 CREATE Client address: DAVYALOVSKY0 GRANT ANY ROLE DAVYALOVSKY0 06 16:12 CREATE Client address: DAVYALOVSKY0 06 16:12 CREATE Client address: DAVYALOVSKY0 GRANT ANY ROLE DAVYALOVSKY0 06 16:12 CREATE Client address: DAVYALOVSKY0 06 16:14 CREATE Client address: DAVYALOVSKY0 ALTER USER DAVYALOVSKY0 06 16:23 CREATE DAVYALOVSKY0 ALTER USER ALTER USER Apr-06 16:02 LOGOFF Apr-06 16:04 AprAuthenticated by: DATABASE LOGOFF Apr-06 16:06 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49263)) ALTER USER Apr-06 16:06 SESSION LOGOFF Apr-06 16:09 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49264)) DROP USER Apr-06 16:09 LOGOFF Apr-06 16:10 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49265)) DROP USER Apr-06 16:10 LOGOFF Apr-06 16:11 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49266)) CREATE USER Apr-06 16:11 LOGOFF Apr-06 16:11 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49267)) ALTER USER Apr-06 16:11 LOGOFF Apr-06 16:11 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49268)) SYSTEM GRANT Apr-06 16:11 LOGOFF Apr-06 16:12 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49269)) LOGOFF Apr-06 16:12 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49270)) SYSTEM GRANT Apr-06 16:12 LOGOFF Apr-06 16:12 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49271)) LOGOFF Apr-06 16:14 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49272)) ALTER USER Apr-06 16:14 LOGOFF SESSION ALTER USER Apr-06 16:15 AprAuthenticated by: DATABASE Apr-06 16:15 167
    • DAVYALOVSKY0 ALTER USER NISWONGEROIU 02 12:36 CREATE Client address: NISWONGEROIU 02 12:36 CREATE Client address: NISWONGEROIU NISWONGEROIU NISWONGEROIU NISWONGEROIU NISWONGEROIU NISWONGEROIU NISWONGEROIU 07 07:42 CREATE NISWONGEROIU 02 12:30 CREATE Client address: NISWONGEROIU 01 12:20 CREATE NISWONGEROIU 02 16:24 CREATE Client address: NISWONGEROIU 02 16:17 CREATE Client address: NISWONGEROIU 02 15:23 CREATE Client address: NISWONGEROIU 02 15:11 CREATE Client address: NISWONGEROIU 02 14:10 CREATE Client address: NISWONGEROIU 02 12:32 CREATE Client address: THIERRYDHERLK 05 13:17 CREATE Client address: THIERRYDHERLK 05 13:26 CREATE Client address: THIERRYDHERLK 05 13:28 CREATE Client address: THIERRYDHERLK 05 13:31 CREATE Client address: THIERRYDHERLK 05 13:32 CREATE Client address: ALTER USER Apr-06 16:15 LOGOFF Apr-02 12:36 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49351)) LOGOFF Apr-02 12:36 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49358)) SELECT Apr-07 07:40 SELECT Apr-07 07:40 SELECT Apr-07 07:40 SELECT Apr-07 07:40 SELECT Apr-07 07:02 SELECT Apr-07 07:01 LOGOFF Apr-07 07:01 AprSESSION Authenticated by: DATABASE LOGOFF Apr-02 12:30 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49339)) LOGOFF Apr-01 12:20 AprSESSION Authenticated by: DATABASE LOGOFF Apr-02 16:24 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49437)) LOGOFF Apr-02 16:17 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49436)) LOGOFF Apr-02 15:23 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49429)) LOGOFF Apr-02 15:11 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49421)) LOGOFF Apr-02 14:10 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49395)) LOGOFF Apr-02 12:32 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=49345)) LOGOFF Apr-05 13:17 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54547)) LOGOFF Apr-05 13:26 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54702)) LOGOFF Apr-05 13:28 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54741)) LOGOFF Apr-05 13:31 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54806)) LOGOFF Apr-05 13:32 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54810)) 168
    • THIERRYDHERLK 05 13:32 CREATE Client address: THIERRYDHERLK 05 13:32 CREATE Client address: THIERRYDHERLK 05 13:34 CREATE Client address: THIERRYDHERLK 05 13:38 CREATE Client address: THIERRYDHERLK 05 13:38 CREATE Client address: THIERRYDHERLK 05 13:38 CREATE Client address: THIERRYDHERLK 05 13:38 CREATE Client address: THIERRYDHERLK 05 13:39 CREATE Client address: THIERRYDHERLK 05 13:39 CREATE Client address: THIERRYDHERLK 05 13:40 CREATE Client address: THIERRYDHERLK 05 15:27 CREATE Client address: THIERRYDHERLK CREATE SESSION THIERRYDHERLK THIERRYDHERLK 05 13:17 CREATE Client address: THIERRYDHERLK 05 13:17 CREATE Client address: THIERRYDHERLK 05 13:16 CREATE Client address: THIERRYDHERLK 05 13:16 CREATE Client address: THIERRYDHERLK 05 13:15 CREATE Client address: THIERRYDHERLK 05 13:15 CREATE Client address: LOGOFF Apr-05 13:32 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54818)) LOGOFF Apr-05 13:32 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54824)) LOGOFF Apr-05 13:34 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54848)) LOGOFF Apr-05 13:38 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54916)) LOGOFF Apr-05 13:38 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54919)) LOGOFF Apr-05 13:38 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54928)) LOGOFF Apr-05 13:38 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54932)) LOGOFF Apr-05 13:39 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54939)) LOGOFF Apr-05 13:39 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54955)) LOGOFF Apr-05 13:40 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54971)) LOGOFF Apr-05 15:27 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=56818)) LOGON Apr-07 07:42 Authenticated by: DATABASE INSERT Apr-07 07:42 LOGOFF Apr-05 13:17 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54543)) LOGOFF Apr-05 13:17 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54537)) LOGOFF Apr-05 13:16 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54524)) LOGOFF Apr-05 13:16 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54517)) LOGOFF Apr-05 13:15 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54513)) LOGOFF Apr-05 13:15 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54512)) 169
    • THIERRYDHERLK 05 13:11 CREATE Client address: THIERRYDHERLK 05 13:10 CREATE Client address: THIERRYDHERLK 05 13:09 CREATE Client address: THIERRYDHERLK 05 13:09 CREATE Client address: THIERRYDHERLK 05 13:08 CREATE Client address: THIERRYDHERLK 05 13:08 CREATE Client address: THIERRYDHERLK 05 13:07 CREATE Client address: THIERRYDHERLK 05 13:07 CREATE Client address: THIERRYDHERLK 05 13:06 CREATE Client address: THIERRYDHERLK 05 13:06 CREATE Client address: THIERRYDHERLK THIERRYDHERLK 01 12:28 CREATE LOGOFF Apr-05 13:11 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54430)) LOGOFF Apr-05 13:10 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54416)) LOGOFF Apr-05 13:09 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54400)) LOGOFF Apr-05 13:09 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54396)) LOGOFF Apr-05 13:08 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54386)) LOGOFF Apr-05 13:08 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54381)) LOGOFF Apr-05 13:07 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54363)) LOGOFF Apr-05 13:07 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54359)) LOGOFF Apr-05 13:06 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54343)) LOGOFF Apr-05 13:06 AprSESSION Authenticated by: DATABASE; (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=54339)) SELECT Apr-07 07:42 LOGOFF Apr-01 12:27 AprSESSION Authenticated by: DATABASE 103 rows selected 170
    • REFERENCE Developer Note Customer and Employee Data sets used to implement customer and employee tables were imported from Microsoft SQLServer AdventureWorksData Warehouse and Database from SQL Server 2008. Auditing. Oracle-base.com. Retrieved from http://www.oracle-base.com/articles/8i/Auditing.php Knox, D(2004). Effective Oracke Database 10g Security by Design. Oracle Press. 171