You are on page 1of 17

Microsoft Windows [Version 10.0.

15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\Administrator>sqlplus sys/Oracleuser_1@pdborcl as sysdba;

SQL*Plus: Release 12.1.0.2.0 Production on Wed May 30 10:28:21 2018

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing
options

SQL> show user;


USER is "SYS"
SQL> create user admin identified by admin;
create user admin identified by admin
*
ERROR at line 1:
ORA-01109: database not open

SQL> alter pluggable database pdborcl open;

Pluggable database altered.

SQL> alter session set container=PDBORCL;

Session altered.
SQL> drop user ADMIN;

User dropped.

SQL> create user ADMIN identified by admin;

User created.
SQL> show user;
USER is "SYS"
SQL> drop user ADMIN;

User dropped.

SQL> create user ADMIN identified by admin;

User created.

SQL> grant DBA to ADMIN;

Grant succeeded.

SQL> connect ADMIN/admin@pdborcl;


Connected.
SQL> show user;
USER is "ADMIN"
SQL> create user Biniam identified by biniam;

User created.
SQL> create user Mr_Amare identified by amare;

User created.

SQL> create user Mr_Worku identified by worku;

User created.

SQL> create user Mr_Feydu identified by feydu;

User created.
SQL> create user Mr_Kifile identified by kifile;

User created.

SQL> create role student ;

Role created.

SQL> create role Head ;

Role created.

SQL> create role Instractor;

Role created.

SQL> create role Dean;

Role created.

SQL> create role president;

Role created.

SQL> grant create table,create any table,select any table,create session,create


role to president;

Grant succeeded.

SQL> revoke create table,create any table,select any table,create session,create


role from president;

Revoke succeeded.

SQL>
SQL> create table REGISTERAR
(regID varchar(30) primary key,
Rname varchar(30),
Rlocation varchar(30));

Table created.

SQL> insert into REGISTERAR values('10','CIR','first floor')


insert into REGISTERAR values('11','EIR','second floor')
insert into REGISTERAR values('12','BIR','third floor')
insert into REGISTERAR values('13','EER','second floor')
SQL> insert into REGISTERAR values('10','CIR','first floor');

1 row created.

SQL> insert into REGISTERAR values('11','EIR','second floor');

1 row created.

SQL> insert into REGISTERAR values('12','BIR','third floor');

1 row created.

SQL> select * from REGISTERAR ;

REGID RNAME
------------------------------ ------------------------------
RLOCATION
------------------------------
10 CIR
first floor

11 EIR
second floor

12 BIR
third floor

SQL>

SQL> create table DEPARTMENT


( depID varchar(30) primary key ,
dep_name varchar(30),
dep_location varchar(30),regid varchar(30),
constraint fk_reg foreign key(regid) references REGISTERAR(regID));

Table created.
SQL> INSERT into DEPARTMENT values('20','IS','Second floor','10');

1 row created.

SQL> INSERT into DEPARTMENT values('21','CS','Second floor','11');

1 row created.

SQL> INSERT into DEPARTMENT values('22','SE','Second floor','12');

1 row created.

SQL> INSERT into DEPARTMENT values('23','IT','Second floor','10');

1 row created.

SQL> select * from DEPARTMENT;

DEPID DEP_NAME
------------------------------ ------------------------------
DEP_LOCATION REGID
------------------------------ ------------------------------
20 IS
Second floor 10

21 CS
Second floor 11

22 SE
Second floor 12

DEPID DEP_NAME
------------------------------ ------------------------------
DEP_LOCATION REGID
------------------------------ ------------------------------
23 IT
Second floor 10

SQL>
SQL> create table COURSE
( coursecode varchar(30) primary key,
courseName varchar(30),
credithour varchar(30),
coursetype varchar(30),
depID varchar(30),constraint fk_depID foreign key(depID) references
DEPARTMENT(depID));

Table created.

SQL> insert into COURSE values('INSY2031','C#','7','major','21');

1 row created.

SQL> insert into COURSE values('INSY2033','ADBMS','6','major','20');

1 row created.

SQL> insert into COURSE values('INSY2032','Networking','5','major','20');

1 row created.

SQL> select *from COURSE;

COURSECODE COURSENAME
------------------------------ ------------------------------
CREDITHOUR COURSETYPE
------------------------------ ------------------------------
DEPID
------------------------------
INSY2031 C#
7 major
21

INSY2033 ADBMS
6 major
20

COURSECODE COURSENAME
------------------------------ ------------------------------
CREDITHOUR COURSETYPE
------------------------------ ------------------------------
DEPID
------------------------------

INSY2032 Networking
5 major
20

SQL> drop table course;

Table dropped.

SQL> create table COURSE


( coursecode varchar(30) primary key,
courseName varchar(30),
credithour varchar(30),
coursetype varchar(30),
depID varchar(30),constraint fk_depID foreign key(depID) references
DEPARTMENT(depID));

Table created.

SQL> insert into COURSE values('INSY2033','C#','7','major','21');

1 row created.

SQL> insert into COURSE values('INSY3071','Networking','5','major','20');

1 row created.

SQL> insert into COURSE values('INSY2062','ADBMS','6','major','20');

1 row created.

SQL>
SQL> select *from COURSE;

COURSECODE COURSENAME
------------------------------ ------------------------------
CREDITHOUR COURSETYPE
------------------------------ ------------------------------
DEPID
------------------------------
INSY2033 C#
7 major
21

INSY3071 Networking
5 major
20

COURSECODE COURSENAME
------------------------------ ------------------------------
CREDITHOUR COURSETYPE
------------------------------ ------------------------------
DEPID
------------------------------
INSY2062 ADBMS
6 major
20

SQL>
SQL>
SQL> create table INSTRACTOR
(instID varchar(30) primary key,
fname varchar(30),
lname varchar(30),
gender varchar(30),
salary float,
birthdate date,
age int,
depId varchar(30) ,foreign key(depId) references DEPARTMENT(depID));

Table created.

SQL> insert into INSTRACTOR values('100','Habite','legebo','M',3000,'1 sep


1995','22','20');

1 row created.

SQL> insert into INSTRACTOR values('101','Zeru','Kelete','M',5000,'2 April


1995','22','22');

1 row created.

SQL> insert into INSTRACTOR values('102','Amare','kebede','M',4000,'2 May


1985','22','20');

1 row created.

SQL> select * from INSTRACTOR;

INSTID FNAME
------------------------------ ------------------------------
LNAME GENDER SALARY
------------------------------ ------------------------------ ----------
BIRTHDATE AGE DEPID
--------- ---------- ------------------------------
100 Habite
legebo M 3000
01-SEP-95 22 20

101 Zeru
Kelete M 5000
02-APR-95 22 22

INSTID FNAME
------------------------------ ------------------------------
LNAME GENDER SALARY
------------------------------ ------------------------------ ----------
BIRTHDATE AGE DEPID
--------- ---------- ------------------------------

102 Amare
kebede M 4000
02-MAY-85 22 20

SQL>
SQL> create table INSTRACTOR_PHONE
2 (
3 phoneID int primary key ,
4 phone varchar(30),
5 instID varchar(30), foreign key(instID) references INSTRACTOR(instID));

Table created.

SQL> insert into INSTRACTOR_PHONE values(1,'+251922345565','100')


2 insert into INSTRACTOR_PHONE values(2,'+251944453555','101')
3 insert into INSTRACTOR_PHONE values(3,'+251912335367','102')
4
SQL> insert into INSTRACTOR_PHONE values(1,'+251922345565','100');

1 row created.

SQL> insert into INSTRACTOR_PHONE values(2,'+251944453555','101');

1 row created.

SQL> insert into INSTRACTOR_PHONE values(3,'+251912335367','102');

1 row created.

SQL> select *from INSTRACTOR_PHONE;

PHONEID PHONE INSTID


---------- ------------------------------ ------------------------------
1 +251922345565 100
2 +251944453555 101
3 +251912335367 102

SQL>

SQL> create table STUDENT


(studID varchar(30) primary key,
Fname varchar(30),
Lname varchar(30),
sex varchar(1),
GPA float,
birthdate date,
age int,
section varchar(1),
yeare varchar(10),
depID varchar(30),foreign key(depID) references DEPARTMENT(depID),
regID varchar(30),foreign key(regID ) references REGISTERAR(regID));

Table created.

SQL> insert into STUDENT VALUES('CIR/100/08','sara','zeru','F',3.90,'10 may


1990',20,'A','third year','22','11');

1 row created.
SQL> insert into STUDENT VALUES('CIR/332/09','yenesew','Mola','F',3.90,'1 sep
2000',19,'B','third year','20','10');

1 row created.

SQL> insert into STUDENT VALUES('CIR/073/09','Bini','Tesfaye','M',3.92,'1 july


2000',22,'B','third year','21','11');

1 row created.

SQL> insert into STUDENT VALUES('CIR/160/10','abebe','zola','M',3.00,'10 may


2000',22,'D','first year','22','11');

1 row created.

SQL> select * from STUDENT;

STUDID FNAME
------------------------------ ------------------------------
LNAME S GPA BIRTHDATE AGE S YEARE
------------------------------ - ---------- --------- ---------- - ----------
DEPID REGID
------------------------------ ------------------------------
CIR/100/08 sara
zeru F 3.9 10-MAY-90 20 A third year
22 11

CIR/332/09 yenesew
Mola F 3.9 01-SEP-00 19 B third year
20 10

STUDID FNAME
------------------------------ ------------------------------
LNAME S GPA BIRTHDATE AGE S YEARE
------------------------------ - ---------- --------- ---------- - ----------
DEPID REGID
------------------------------ ------------------------------

CIR/073/09 Bini
Tesfaye M 3.92 01-JUL-00 22 B third year
21 11

CIR/160/10 abebe
zola M 3 10-MAY-00 22 D first year

STUDID FNAME
------------------------------ ------------------------------
LNAME S GPA BIRTHDATE AGE S YEARE
------------------------------ - ---------- --------- ---------- - ----------
DEPID REGID
------------------------------ ------------------------------
22 11

SQL>
SQL> create table STUDENT_PHONE
(
phoneID int primary key ,
phone varchar(30),
studID varchar(30) ,foreign key(studID ) references STUDENT(studID) );

Table created.

SQL> insert into STUDENT_PHONE values(1,'+251960745565','CIR/100/08')


insert into STUDENT_PHONE values(2,'+251913462555','CIR/332/09')
insert into STUDENT_PHONE values(3,'+251940788367','CIR/073/09')
insert into STUDENT_PHONE values(4,'+251977788245','CIR/160/10')

SQL> insert into STUDENT_PHONE values(1,'+251960745565','CIR/100/08');

1 row created.

SQL> insert into STUDENT_PHONE values(2,'+251913462555','CIR/332/09');

1 row created.

SQL> insert into STUDENT_PHONE values(3,'+251940788367','CIR/073/09');

1 row created.

SQL> insert into STUDENT_PHONE values(4,'+251977788245','CIR/160/10');

1 row created.

SQL>
SQL> select * from STUDENT_PHONE;

PHONEID PHONE STUDID


---------- ------------------------------ ------------------------------
1 +251960745565 CIR/100/08
2 +251913462555 CIR/332/09
3 +251940788367 CIR/073/09
4 +251977788245 CIR/160/10

SQL>
SQL> create table STUDENT_JUNCTION
(
studID varchar(30), foreign key(studID) references STUDENT(studID),
instID varchar(30), foreign key(instID) references INSTRACTOR(instID),
courseCode varchar(30), foreign key(courseCode) references
COURSE(courseCode),
constraint PKInsStuCour primary key (InstID, StudID,CourseCode));

Table created.
SQL> drop table STUDENT_JUNCTION;

Table dropped.

SQL> create table STUDENT_JUNCTION


(
studID varchar(30), foreign key(studID) references STUDENT(studID),
instID varchar(30), foreign key(instID) references INSTRACTOR(instID),
courseCode varchar(30), foreign key(courseCode) references
COURSE(courseCode),
constraint PKInsStuCour primary key (InstID, StudID,CourseCode));

Table created.
SQL> insert into STUDENT_JUNCTION values('CIR/332/09','101','INSY3071');

1 row created.

SQL> insert into STUDENT_JUNCTION values('CIR/100/08','101','INSY2062');

1 row created.
////////////////////////////////////////////////////////////////

SQL> CREATE PROFILE userProfile LIMIT


2 FAILED_LOGIN_ATTEMPTS 5
3 PASSWORD_LIFE_TIME 60
4 PASSWORD_REUSE_TIME 60
5 PASSWORD_REUSE_MAX 5
6 PASSWORD_LOCK_TIME 1/24
7 PASSWORD_GRACE_TIME 10;

Profile created.

SQL>

/////////////////////////////////

SQL> grant create session, Alter Database, Create Pluggable Database, Create Table,
Create
2 Any Table, Alter Any Table, Drop Any Table, Lock Any Table, Select Any Table,
Insert Any Table, Update
3 any table,Create Role, Drop Any Role, Grant Any Role, Create User, Alter
User, Drop User,
4 create any view to president;

Grant succeeded.
SQL> grant grant create session,create table,select any table,create view ,drop any
table,update any table to dean;

Grant succeeded.

SQL> grant grant create session,create table,select any table,create view ,drop any
table,update any table ,create session to head;

Grant succeeded.

SQL> grant grant create session,create table,select any table,create view ,drop any
table,update any table ,create session to dean;

Grant succeeded.

SQL> grant create session,create table,select any table,create view ,create


session to student;

Grant succeeded.

SQL> grant create session,create table,select any table,create view ,create session
to instractor;

Grant succeeded.
SQL>
SQL> GRANT DBA to ADMIN with ADMIN option;
Grant succeeded.
SQL> connect ADMIN/admin@pdborcl;
Connected.
SQL> show user;
USER is "ADMIN"
SQL>
SQL> grant select,update,delete on Mr_kifile.Student to head;
Grant succeeded.
SQL> grant select,update,delete on Mr_kifile.Course to head;
Grant succeeded.
SQL> grant head to Mr_amare;
Grant succeeded.
SQL> grant select,update,delete on Mr_kifile.Course to instractor;
Grant succeeded.
SQL> grant select,update,delete on Mr_kifile.student to instractor;
Grant succeeded.
SQL> grant instractor to Mr_worku;
Grant succeeded.
SQL> grant select,update,delete on Mr_kifile.student to student;
Grant succeeded.
SQL> grant student to biniam;
Grant succeeded.
////////////////////////////////////////////////////

SQL> Create or replace trigger BeforeAll_Student


2 Before Insert or Update or Delete on Student
3 For each row
4 Enable
5 Declare
6 userName varchar2(60);
7 Begin
8 select user into userName from dual;
9 If Inserting Then
10 DBMS_OUTPUT.PUT_LINE ('One Row Inserted By Mr. '||userName);
11 ElsIf Updating Then
12 DBMS_OUTPUT.PUT_LINE ('One Row Updated By Mr. '||userName);
13 ElsIf Deleting Then
14 DBMS_OUTPUT.PUT_LINE ('One Row Deleted By Mr. '||userName);
15 End If;
16 end;
17 /

Trigger created.

SQL> delete STUDENT;


One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
delete STUDENT
*
ERROR at line 1:
ORA-02292: integrity constraint (MR_KIFILE.SYS_C0010398) violated - child
record found
SQL> Create or replace trigger BeforeAll_REGISTERAR
2 Before Insert or Update or Delete on REGISTERAR
3 For each row
4 Enable
5 Declare
6 userName varchar2(60);
7 Begin
8 select user into userName from dual;
9 If Inserting Then
10 DBMS_OUTPUT.PUT_LINE ('One Row Inserted By Mr. '||userName);
11 ElsIf Updating Then
12 DBMS_OUTPUT.PUT_LINE ('One Row Updated By Mr. '||userName);
13 ElsIf Deleting Then
14 DBMS_OUTPUT.PUT_LINE ('One Row Deleted By Mr. '||userName);
15 End If;
16 end;
17 /

Trigger created.

SQL> DELETE REGISTERAR;


One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
DELETE REGISTERAR
*
ERROR at line 1:
ORA-02292: integrity constraint (MR_KIFILE.FK_REG) violated - child record
found

SQL> Set Serveroutput On;


SQL> Create or replace trigger BeforeAll_STUDENT
2 Before Insert or Update or Delete on STUDENT
3 For each row
4 Enable
5 Declare
6 userName varchar2(60);
7 Begin
8 select user into userName from dual;
9 If Inserting Then
10 DBMS_OUTPUT.PUT_LINE ('One Row Inserted By Mr. '||userName);
11 ElsIf Updating Then
12 DBMS_OUTPUT.PUT_LINE ('One Row Updated By Mr. '||userName);
13 ElsIf Deleting Then
14 DBMS_OUTPUT.PUT_LINE ('One Row Deleted By Mr. '||userName);
15 End If;
16 end;
17 /

Trigger created.

SQL> Create or replace trigger BeforeAll_COURSE


2 Before Insert or Update or Delete on COURSE
3 For each row
4 Enable
5 Declare
6 userName varchar2(60);
7 Begin
8 select user into userName from dual;
9 If Inserting Then
10 DBMS_OUTPUT.PUT_LINE ('One Row Inserted By Mr. '||userName);
11 ElsIf Updating Then
12 DBMS_OUTPUT.PUT_LINE ('One Row Updated By Mr. '||userName);
13 ElsIf Deleting Then
14 DBMS_OUTPUT.PUT_LINE ('One Row Deleted By Mr. '||userName);
15 End If;
16 end;
17 Trigger created.
18 /

Warning: Trigger created with compilation errors.

SQL> Create or replace trigger BeforeAll_COURSE


2 Before Insert or Update or Delete on COURSE
3 For each row
4 Enable
5 Declare
6 userName varchar2(60);
7 Begin
8 select user into userName from dual;
9 If Inserting Then
10 DBMS_OUTPUT.PUT_LINE ('One Row Inserted By Mr. '||userName);
11 ElsIf Updating Then
12 DBMS_OUTPUT.PUT_LINE ('One Row Updated By Mr. '||userName);
13 ElsIf Deleting Then
14 DBMS_OUTPUT.PUT_LINE ('One Row Deleted By Mr. '||userName);
15 End If;
16 end;
17 /

Trigger created.

SQL> Delete COURSE;


One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
Delete COURSE
*
ERROR at line 1:
ORA-02292: integrity constraint (MR_KIFILE.SYS_C0010406) violated - child
record found

SQL> Create or replace trigger BeforeAll_INSTRACTOR


2 Before Insert or Update or Delete on INSTRACTOR
3 For each row
4 Enable
5 Declare
6 userName varchar2(60);
7 Begin
8 select user into userName from dual;
9 If Inserting Then
10 DBMS_OUTPUT.PUT_LINE ('One Row Inserted By Mr. '||userName);
11 ElsIf Updating Then
12 DBMS_OUTPUT.PUT_LINE ('One Row Updated By Mr. '||userName);
13 ElsIf Deleting Then
14 DBMS_OUTPUT.PUT_LINE ('One Row Deleted By Mr. '||userName);
15 End If;
16 end;
17 /

Trigger created.

SQL> Delete INSTRACTOR;


One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
One Row Deleted By Mr. MR_KIFILE
Delete INSTRACTOR
*
ERROR at line 1:
ORA-02292: integrity constraint (MR_KIFILE.SYS_C0010405) violated - child
record found

Set Serveroutput On;


CREATE OR REPLACE TRIGGER Student_JunctionTrig Before
INSERT OR
UPDATE OR
DELETE ON Student_Junction FOR EACH row Enable BEGIN
If Updating Then
Update Student_Junction Set studid=:New.studid where studid= :Old.studid;
ElsIf Deleting Then
Delete From Student_Junction WherE studid=:Old.studid;
End If;
end;
Trigger created.

Create or replace trigger Student_Backup


Before Insert or Update or Delete on Student
For each row
Enable
Begin
If Inserting Then
Insert into Student_Backup(Fname)Values(:New.Fname);

ElsIf Updating Then


Update Student_Backup Set Fname=:New.Fname where Fname= :Old.Fname;
ElsIf Deleting Then
Delete From Student_Backup WherE Fname=:Old.Fname;
End If;
end;

SQL> connect Mr_kifile/kifile@pdborcl;


Connected.
SQL> show user;
USER is "MR_KIFILE"

//////////////////////////////////////////////////////

SQL> Create Table Student_Backup As Select * From Student Where 1=2;

Table created.

Create or replace trigger Student_Backup


Before Insert or Update or Delete on Student
For each row
Enable
Begin
If Inserting Then
Insert into Student_Backup(Fname)Values(:New.Fname);

ElsIf Updating Then


Update Student_Backup Set Fname=:New.Fname where Fname= :Old.Fname;
ElsIf Deleting Then
Delete From Student_Backup WherE Fname=:Old.Fname;
End If;
end;

//////////////////////////////audit student
SQL> Create table Student_Audit(
2 New_Name varchar2(30),
3 Old_Name varchar2(50),
4 User_Name varchar2(20),
5 Entry_Date varchar2(80),
6 Operation varchar2(30)
7 );

Table created.
//////////////////////////////audit trigger
SQL> Create or replace trigger BeIUD_Student
2 Before Insert or Update or Delete on Student
3 For each row
4 Enable
5 Declare
6 V_user varchar2(60);
7 V_date varchar2(70);
8 Begin
9 select user, to_CHAR (Sysdate, 'DD/MoN/YYY HH24:MI:SS')into V_user, V_date
from
10 Dual;
11 If Inserting Then
12 Insert into Student_Audit(New_Name, Old_Name, User_Name, Entry_Date,
Operation)
13 Values(:New.Fname, Null, V_user, V_date, 'Insert');
14 ElsIf Updating Then
15 Insert into Student_Audit(New_Name, Old_Name, User_Name, Entry_Date,
Operation)
16 Values(:New.Fname, :Old.Fname, V_user, V_date, 'Update');
17 ElsIf Deleting Then
18 Insert into Student_Audit(New_Name, Old_Name, User_Name, Entry_Date,
Operation)
19 Values(Null, :Old.Fname, V_user, V_date, 'Delete');
20 End If;
21 end;
22 /

Trigger created.

SQL>
/////////////////////////////////////24.by schema audit
SQL> Create Table Schema_Audit (
2 DDL_Date Date,
3 DDL_User Varchar(30),
4 Object_Created Varchar(40),

5 Object_Name Varchar(40),
6 DDL_Operation Varchar(60)
7 );

Table created.

SQL>
/////////////////////////////////////////////--HR Schema Audit

SQL> Create or replace trigger Hr_Schema_Audit


2 After DDL On Schema
3 Insert into Schema_Audit Values(Sysdate,
4 Sys_context('USERENV', 'CURRENT_USER'),
5 Ora_Dict_Obj_Type,
6 Ora_Dict_Obj_Name,
7 Ora_Sysevent);
8 End;
9 /
Table created.
///////////////////////////////////////////////////////23.DBA_audit_trial
SQL> audit select on student;

Audit succeeded.

SQL> audit update,delete on student;

Audit succeeded.

SQL> audit select,update,delete on course;

Audit succeeded.

SQL> audit select,update,delete on Registerar;

Audit succeeded.

SQL> select *from DBA_AUDIT_TRIAL;


audit successed.
///////////////////////////////////////////////////logon triger

SQL> Create Table DB_Event_Audit (


2 Event_type Varchar2(40),
3 Logon_date date,
4 Logon_time Varchar2(50),
5 Logoff_date date,
6 Logoff_time Varchar2(50)
7 );

Table created.

SQL> Create or Replace Trigger DB_Logon_Audit


2 After Logon On Schema
3 Begin
4 Insert into DB_Event_Audit values
5 (Ora_sysevent,Sysdate,To_Char(Sysdate, 'HH24:MI:SS'),Null,Null);
6 Commit;
7 End;
8 /

Trigger created.

Create Table DB_Event_Audit (


User_name Varchar2(40),
Event_type Varchar2(40),
Logon_date date,
Logon_time Varchar2(50),
Logoff_date date,
Log

Create or Replace Trigger DB_Logoff_Audit


Before Logoff On Database
Begin
Insert into DB_Event_Audit values(
User,
Ora_sysevent,
Null,
Null,
Sysdate,
To_Char(Sysdate, 'HH24:MI:SS')
);
Commit;
End;

You might also like