Enhancing Database Security: Concepts and Tools for the DBA Scripts & Source Code. Passwords in Command Lines. Peter J. Magee, CDA SQRIBE Technologies

Size: px
Start display at page:

Download "Enhancing Database Security: Concepts and Tools for the DBA Scripts & Source Code. Passwords in Command Lines. Peter J. Magee, CDA SQRIBE Technologies"

Transcription

1 Enhancing Database Security: Concepts and Tools for the DBA Scripts & Source Code Peter J. Magee, CDA SQRIBE Technologies Passwords in Command Lines Fix for ctxctl script to eliminate appearance of CTXSYS password in command line. 1. Copy ctxctl to ctxctl.secure 2. In ctxctl.secure, replace the following command line (line 312): with these lines: $exe -user $username/$password -personality $mask >> /dev/null & CTX_PASS=$username/$password export CTX_PASS $ORACLE_HOME/bin/ctxsecure $exe $mask & CTX_PASS= export CTX_PASS 3. Create a script called ctxsecure in the $ORACLE_HOME/bin directory: # # File: ctxsecure # Location: $ORACLE_HOME/bin # # This file calls the specified ConText executable application, # but prevents the CTXSYS userid and password from appearing in # the command line. This prevents the user id and password from # being visible to a "ps -ef" command. # # Inputs: $1 Executable ConText file name # $2 Personality flag for server # $CTX_PASS An environment variable holding # the CTXSYS user id and password # $1 -personality $2 >> /dev/null <<CTXEND ${CTX_PASS} CTXEND Mini-Lesson M6, Scripts & Source Code/ Page 1

2 Note: do not place the characteristic $!/bin/sh in the first line of ctxsecure. If a new shell is opened, $CTX_PASS can not be found. ctxsecure should run in the same shell as ctxctl.secure. Once these steps are complete, use ctxctl.secure the same as you would use ctxctl. An additional process will be generated by ctxctl.secure for each ConText server, so "ps -ef" output would look something like this: oracle $ORACLE_HOME/bin/ctxsrv -personality LQ oracle /bin/sh ctxctl.secure Initialization Parameters Select values for security related initialization parameters from the data dictionary. select * from v$parameter where name in ('audit_trail', db_encrypt_login, 'resource_limit', 'remote_os_auth', 'remote_os_roles', 'os_roles', 'utl_file_dir'); SQL*Net Firewalls A sample protocol.ora file, located in the $ORACLE_HOME/network/admin directory: tcp.validnode_checking = yes tcp.invited_nodes = (drummer.us.com, , ) Application Users (OPS$ Users) Identify externally authenticated user accounts. select username, password from dba_users where password='external'; System Privileges Identify system privileges granted to users other than SYS, SYSTEM, or DBSNMP. select p.grantee, p.privilege from dba_sys_privs p, dba_users u where (u.username = p.grantee or p.grantee='public') and p.grantee not in ('SYS','SYSTEM','DBSNMP'); Identify system privileges granted to roles other than DBA, RESOURCE, IMP_FULL_DATABASE, EXP_FULL_DATABASE, CONNECT, and SNMPAGENT. select p.grantee, p.privilege from dba_sys_privs p, dba_roles r where r.role = p.grantee and r.role not in ('DBA','RESOURCE','IMP_FULL_DATABASE','EXP_FULL_DATABASE', 'CONNECT','SNMPAGENT'); Mini-Lesson M6, Scripts & Source Code / Page 2

3 The following System Privileges should only be granted to administrators, never application users: ANALYZE ANY ALTER ANY ROLE SELECT ANY TABLE AUDIT ANY DROP ANY ROLE INSERT ANY TABLE AUDIT SYSTEM GRANT ANY ROLE UPDATE ANY TABLE ALTER ANY CLUSTER DROP ROLLBACK SEGMENT DELETE ANY TABLE DROP ANY CLUSTER RESTRICTED SESSION TABLESPACE ALTER DATABASE CREATE ANY SEQUENCE MANAGE TABLESPACE CREATE ANY INDEX ALTER ANY SEQUENCE UNLIMITED TABLESPACE ALTER ANY INDEX DROP ANY SEQUENCE FORCE TRANSACTION DROP ANY INDEX SELECT ANY SEQUENCE FORCE ANY TRANSACTION GRANT ANY PRIVILEGE ALTER ANY SNAPSHOT CREATE ANY TRIGGER CREATE ANY PROCEDURE DROP ANY SNAPSHOT ALTER ANY TRIGGER ALTER ANY PROCEDURE CREATE ANY SYNONYM DROP ANY TRIGGER DROP ANY PROCEDURE DROP ANY SYNONYM BECOME USER EXECUTE ANY PROCEDURE ALTER SYSTEM CREATE ANY VIEW CREATE PROFILE CREATE ANY TABLE DROP ANY VIEW ALTER PROFILE ALTER ANY TABLE CREATE DATABASE LINK DROP PROFILE BACKUP ANY TABLE CREATE PUBLIC DATABASE LINK ALTER RESOURCE COST DROP ANY TABLE DROP PUBLIC DATABASE LINK DROP PUBLIC DATABASE LINK LOCK ANY TABLE CREATE PUBLIC SYNONYM DROP PUBLIC SYNONYM COMMENT ANY TABLE DROP PUBLIC SYNONYM Object Privileges Identify users other than SYS and SYSTEM that have been granted ALTER or REFERENCES priveleges. select t.grantee, t.owner '.' t.table_name, t.privilege from dba_tab_privs t, dba_users u where (u.username = t.grantee or t.grantee = 'PUBLIC') and t.privilege in ('ALTER','REFERENCES') and t.grantee not in ('SYS','SYSTEM'); Identify roles other than DBA, RESOURCE, IMP_FULL_DATABASE, EXP_FULL_DATABASE, and CONNECT that have been granted ALTER or REFERENCES privileges. select t.grantee, t.owner '.' t.table_name, t.privilege from dba_tab_privs t, dba_roles r where r.role = t.grantee and t.privilege in ('ALTER','REFERENCES') and r.role not in ('DBA','RESOURCE','IMP_FULL_DATABASE', 'EXP_FULL_DATABASE','CONNECT'); Administration Privileges Identify users other than SYS and SYSTEM that have ADMIN privileges on system and object privileges. Mini-Lesson M6, Scripts & Source Code/ Page 3

4 select p.grantee, p.privilege, p.admin_option from dba_sys_privs p, dba_users u where (u.username = p.grantee or p.grantee='public') and p.admin_option='yes' and p.grantee not in ('SYS','SYSTEM'); Identify users other than SYS and SYSTEM that have ADMIN privileges on the Oracle default roles. select r.grantee, r.granted_role, r.admin_option from dba_role_privs r, dba_users u where u.username = r.grantee and r.granted_role in ('DBA','RESOURCE','IMP_FULL_DATABASE','EXP_FULL_DATABASE', 'CONNECT','SNMPAGENT') and r.admin_option='yes' and r.grantee not in ('SYS','SYSTEM'); Predefined Roles Identify users that have been granted one of the Oracle default roles. select r.grantee, r.granted_role from dba_role_privs r where r.granted_role in ('DBA','EXP_FULL_DATABASE', 'IMP_FULL_DATABASE','OSOPER','OSDBA') and r.grantee not in ('SYS','SYSTEM','DBA'); Application Roles Identify application roles and their properties. select r.role, r.password_required from dba_roles r where r.role not in ('DBA','RESOURCE','IMP_FULL_DATABASE', 'EXP_FULL_DATABASE','CONNECT','SNMPAGENT'); Identify users that have been assigned to application roles. select r.grantee, r.granted_role, r.admin_option from dba_role_privs r, dba_users u where u.username = r.grantee and r.granted_role not in ('DBA','RESOURCE','IMP_FULL_DATABASE', 'EXP_FULL_DATABASE','CONNECT','SNMPAGENT'); User Profiles Identify the idle time limit for each database user. select u.username, p.limit from dba_users u, dba_profiles p where u.profile = p.profile and p.resource_name='idle_time'; Alter the profile idle time. alter profile [profile name] limit idle_time [# minutes]; Mini-Lesson M6, Scripts & Source Code / Page 4

5 Oracle7 Profiles Lock a User Account: Alter encrypted password to all lowercase; Oracle can t translate so account is disabled alter user [username] identified by values disabled ; Oracle8 Profiles User Profile Creation: Create a profile that will do the following: The user will be timed out (disconnected) after 15 minutes of idle time. The account will be locked after 3 failed logins. The account can only be unlocked by the DBA. The user has 3 grace logins to change their password after expiration. The user cannot repeat passwords until they have been changed at least 10 times. The password expires after 90 days. The stored procedure verify_password will be used to verify password complexity. To create the profile execute the following script. CREATE PROFILE APP_USER LIMIT IDLE_TIME 15 FAILED_LOGIN_ATTEMPTS 3 ACCOUNT_LOCK_TIME UNLIMITED PASSWORD_GRACE_TIME 3 PASSWORD_REUSE_MAX 10 PASSWORD_LIFE_TIME 90 PASSWORD_VERIFY_FUNCTION verify_password; Once the profile is created, it is assigned to the user with the ALTER USER command: ALTER USER username PROFILE app_user; Password Varification Function: based on sample function in Oracle documentation, but more strict. CREATE OR REPLACE FUNCTION verify_function (username varchar2, password varchar2, old_password varchar2) RETURN boolean IS n boolean; m integer; differ integer; isdigit boolean; Mini-Lesson M6, Scripts & Source Code/ Page 5

6 ischar boolean; ispunct boolean; digitarray varchar2(20); punctarray varchar2(25); chararray varchar2(52); BEGIN digitarray:= ' '; chararray:= 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'; punctarray:='!"#$%&()``*+,-/:;<=>?_'; Check if the password is same as the username IF password = username THEN raise_application_error(-20001, 'Password same as user'); END IF; Check for the minimum length of the password (must be 6 or more) IF length(password) < 6 THEN raise_application_error(-20002, 'Password length less than 6'); END IF; Check if the password is too simple. A dictionary of words may be maintained and a check may be made so as not to allow the words that are too simple for the password. IF NLS_LOWER(password) IN ('welcome', 'database', 'account', 'user', 'password', 'oracle', 'computer', 'abcd') THEN raise_application_error(-20002, 'Password too simple'); END IF; Check if the password contains at least one letter and one digit 1. Check for the digit isdigit:=false; m := length(password); FOR i IN LOOP FOR j IN 1..m LOOP IF substr(password,j,1) = substr(digitarray,i,1) THEN isdigit:=true; GOTO findchar; END IF; Mini-Lesson M6, Scripts & Source Code / Page 6

7 END LOOP; END LOOP; IF isdigit = FALSE THEN raise_application_error(-20003, Password should contain at least one digit, one character and one punctuation'); END IF; 2. Check for the character <<findchar>> ischar:=false; FOR i IN 1..length(chararray) LOOP FOR j IN 1..m LOOP IF substr(password,j,1) = substr(chararray,i,1) THEN ischar:=true; GOTO findpunct; END IF; END LOOP; END LOOP; IF ischar = FALSE THEN raise_application_error(-20003,'password should contain at least one END IF; digit, one character and one punctuation'); <<endsearch>> Check if the password differs from the previous password by at least 3 letters IF old_password = '' THEN raise_application_error(-20004, 'Old password is null'); END IF; Everything is fine; return TRUE ; differ := length(old_password) - length(password); IF abs(differ) < 3 THEN IF length(password) < length(old_password) THEN m := length(password); ELSE m:= length(old_password); END IF; Mini-Lesson M6, Scripts & Source Code/ Page 7

8 differ := abs(differ); FOR i IN 1..m LOOP IF substr(password,i,1)!= substr(old_password,i,1) THEN differ := differ + 1; END IF; END LOOP; IF differ < 3 THEN raise_application_error(-20004, 'Password should differ by at \ least 3 characters'); END IF; END IF; Everything is fine; return TRUE ; RETURN(TRUE); END; Lock User Account: alter user [username] account lock; Statement Level Audits Generate a list of all statement level audits. select audit_option, success, failure from dba_stmt_audit_opts; Enable minimum required statement level audits: audit ALTER SYSTEM ; audit INDEX ; audit NOT EXISTS ; audit SYSTEM GRANT ; audit SYSTEM AUDIT ; audit TABLE ; audit TABLESPACE ; audit USER ; audit SESSION ; audit RESTRICTED SESSION ; Object Level Audits Generate a list of all object level audits. select owner, object_name, object_type from dba_obj_audit_opts where ren = '-/-'; Identify all audits on the audit trail table. select owner '.' object_name, object_type, alt aud com del gra ind ins loc ren sel upd ref exe Mini-Lesson M6, Scripts & Source Code / Page 8

9 from dba_obj_audit_opts where owner like 'SYS%' and object_name='aud$' and object_type='table'; Set audit rename by default on all objects created after command: audit rename on default; Audit actions on the audit trail: audit all on sys.aud$; or audit all on system.aud$; (if ownership has been changed) Privilege Level Audits Generate a list of all privilege level audits. select privilege, success, failure from dba_priv_audit_opts; Enable minimum required privilege level audits: audit ANALYZE ANY ; audit AUDIT ANY ; audit AUDIT SYSTEM ; audit ALTER ANY CLUSTER ; audit DROP ANY CLUSTER ; audit ALTER DATABASE ; audit CREATE ANY INDEX ; audit ALTER ANY INDEX ; audit DROP ANY INDEX ; audit GRANT ANY PRIVILEGE ; audit CREATE ANY PROCEDURE ; audit ALTER ANY PROCEDURE ; audit DROP ANY PROCEDURE ; audit EXECUTE ANY PROCEDURE ; audit CREATE PROFILE ; audit ALTER PROFILE ; audit DROP PROFILE ; audit ALTER RESOURCE COST ; audit DROP PUBLIC DATABASE LINK ; audit DROP PUBLIC SYNONYM ; audit ALTER ANY ROLE ; audit DROP ANY ROLE ; audit GRANT ANY ROLE ; audit DROP ROLLBACK SEGMENT ; audit CREATE ANY SEQUENCE ; audit ALTER ANY SEQUENCE ; audit DROP ANY SEQUENCE ; audit SELECT ANY SEQUENCE ; audit ALTER ANY SNAPSHOT ; Mini-Lesson M6, Scripts & Source Code/ Page 9

10 audit DROP ANY SNAPSHOT ; audit CREATE ANY SYNONYM ; audit DROP ANY SYNONYM ; audit CREATE ANY TABLE ; audit ALTER ANY TABLE ; audit BACKUP ANY TABLE ; audit DROP ANY TABLE ; audit LOCK ANY TABLE ; audit COMMENT ANY TABLE ; audit SELECT ANY TABLE ; audit INSERT ANY TABLE ; audit UPDATE ANY TABLE ; audit DELETE ANY TABLE ; audit MANAGE TABLESPACE ; audit UNLIMITED TABLESPACE ; audit FORCE TRANSACTION ; audit FORCE ANY TRANSACTION ; audit CREATE ANY TRIGGER ; audit ALTER ANY TRIGGER ; audit DROP ANY TRIGGER ; audit CREATE USER ; audit BECOME USER ; audit ALTER USER ; audit DROP USER ; audit CREATE ANY VIEW ; audit DROP ANY VIEW ; audit CREATE PUBLIC DATABASE LINK ; audit DROP PUBLIC DATABASE LINK ; audit CREATE PUBLIC SYNONYM ; audit DROP PUBLIC SYNONYM ; audit CREATE DATABASE LINK ; Audit Trail Maintenance Set the following init.ora parameters and restart the database to initialize the Oracle Job Queue: JOB_QUEUE_PROCESSES = 1 JOB_QUEUE_INTERVAL = 30 Create the following stored procedure as SYSTEM through Server Manager or SQL*Plus: Oracle7 Version: CREATE PROCEDURE TRIM_AUDIT_TRAIL AS BEGIN Mini-Lesson M6, Scripts & Source Code / Page 10

11 DELETE FROM SYS.AUD$ WHERE TIMESTAMP < TRUNC(SYSDATE-7); COMMIT; END TRIM_AUDIT_TRAIL; Oracle8 Version: CREATE PROCEDURE TRIM_AUDIT_TRAIL AS BEGIN DELETE FROM SYS.AUD$ WHERE TIMESTAMP# < TRUNC(SYSDATE-7); COMMIT; END TRIM_AUDIT_TRAIL; Set the job to run once per day at midnight using Server Manager or SQL*Plus: VARIABLE JOBNUM NUMBER; BEGIN DBMS_JOB.SUBMIT(:JOBNUM,'SYSTEM.TRIM_AUDIT_TRAIL; ', TRUNC(SYSDATE+1),'TRUNC(SYSDATE+1)'); END; Check on the status of the job using the DBA_JOBS or USER_JOBS views. Eagle Original Eagle DDL (by Jay Mehta, IOUG-A Select Magazine, April, 1997): REM Name: eddl.sql REM Description: Creates Objects(Tables/Indexes) in USERS and USERS_IDX tablespace REM Usage: Run this script from SQL*Plus, Use Eagle Oracle account REM CREATE TABLE WATCH ( WATCH_ID VARCHAR2(12) NOT NULL, NAME VARCHAR2(30) NOT NULL, PREPARE1_CLAUSE VARCHAR2(512) PREPARE2_CLAUSE VARCHAR2(512) NULL, NULL, INSERT_CLAUSE VARCHAR2(512) NOT NULL, SELECT_CLAUSE VARCHAR2(512) NOT NULL, WHERE_CLAUSE VARCHAR2(512) NULL, CLOSE1_CLAUSE VARCHAR2(512) NULL, CLOSE2_CLAUSE VARCHAR2(512) NULL, CONSTRAINT WATCK_PK PRIMARY KEY (WATCH_ID) USING INDEX TABLESPACE USERS_IDX STORAGE(INITIAL 16K NEXT 16K PCTINCREASE 0) ) TABLESPACE USERS STORAGE (INITIAL 16K NEXT 16K PCTINCREASE 0) ; Mini-Lesson M6, Scripts & Source Code/ Page 11

12 CREATE TABLE DATABASE ( DB_ID VARCHAR2(12) NOT NULL, NAME VARCHAR2(30) NOT NULL, DB_LINK VARCHAR2(30) NOT NULL, CONSTRAINT DATABASE_PK PRIMARY KEY (DB_ID) USING INDEX TABLESPACE USERS_IDX STORAGE (INITIAL 16K NEXT 16K PCTINCREASE 0) ) TABLESPACE USERS STORAGE (INITIAL 16K NEXT 16K PCTINCREASE 0) ; CREATE TABLE DB_WATCH ( DB_ID VARCHAR2(12) NOT NULL, WATCH_ID VARCHAR2(12) NOT NULL, ACTIVE_YN VARCHAR2(1), CONSTRAINT DB_WATCH_PK PRIMARY KEY (DB_ID, WATCH_ID) USING INDEX TABLESPACE USERS_IDX STORAGE(INITIAL 16K NEXT 16K PCTINCREASE 0), CONSTRAINT DB_WATCH_FK1 FOREIGN KEY (DB_ID) REFERENCES DATABASE (DB_ID), CONSTRAINT DB_WATCH_FK2 FOREIGN KEY (WATCH_ID) REFERENCES WATCH (WATCH_ID) ) TABLESPACE USERS STORAGE ( INITIAL 16K NEXT 16K PCTINCREASE 0) ; CREATE TABLE DB_WATCH_RESULT( DB_ID VARCHAR2(12) NOT NULL, WATCH_ID VARCHAR2(12) NOT NULL, RUN_TIME DATE NOT NULL, PARAMETER VARCHAR2(256) NULL, VALUE NUMBER(12,2) NOT NULL, CONSTRAINT DB_WATCH_RESULT_FK FOREIGN KEY (DB_ID,WATCH_ID) REFERENCES DB_WATCH(DB_ID, WATCH_ID) ) TABLESPACE USERS STORAGE ( INITIAL 16K NEXT 16K PCTINCREASE 0) ; Mini-Lesson M6, Scripts & Source Code / Page 12

13 Note: The sizes of the prepare, insert, select, where, and close clause fields in the WATCH table have been increased from the original 256 characters to 512 characters to accommodate the various watches described below. You may need to increase them further to support your own custom watches. You may also need to alter storage parameters to fit your particular system. Original Eagle PL/SQL Engine (by Jay Mehta, IOUG-A Select Magazine, April, 1997): REM REM Name: eplsql.sql REM Description: Create PL/SQL procudure that executes active watched REM Usage: Run from SQL*Plus, Use Eagle account REM CREATE OR REPLACE PROCEDURE EXECUTE_DB_WATCH AS BEGIN CURSOR C_DB_WATCH IS SELECT DB_ID, WATCH_ID, ACTIVE_YN FROM DB_WATCH ; db_watch_rec DB_WATCH%ROWTYPE ; watch_rec WATCH%ROWTYPE ; database_rec DATABASE%ROWTYPE ; sql_stmt VARCHAR2(1000) ; ret_val INTEGER ; cursor_id INTEGER ; c_get_data INTEGER ; temp_clause VARCHAR2(256) ; OPEN C_DB_WATCH; LOOP FETCH C_DB_WATCH INTO db_watch_rec; EXIT WHEN C_DB_WATCH%NOTFOUND ; IF db_watch_rec.active_yn = 'Y' THEN SELECT * INTO watch_rec FROM WATCH WHERE WATCH_ID = db_watch_rec.watch_id ; /* fetch database record */ SELECT * INTO database_rec FROM DATABASE WHERE DB_ID = db_watch_rec.db_id ; watch_rec.select_clause := REPLACE(watch_rec.select_clause, '<DB_ID>',database_rec.db_id); Mini-Lesson M6, Scripts & Source Code/ Page 13

14 watch_rec.select_clause := REPLACE(watch_rec.select_clause, '<DB_LINK>',database_rec.db_link); sql_stmt := watch_rec.insert_clause watch_rec.select_clause watch_rec.where_clause; IF watch_rec.prepare1_clause IS NOT NULL THEN watch_rec.prepare1_clause := REPLACE(watch_rec.prepare1_clause, '<DB_LINK>',database_rec.db_link); cursor_id := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(cursor_id,watch_rec.prepare1_clause,DBMS_SQL.V7); ret_val := DBMS_SQL.EXECUTE(cursor_id) ; DBMS_SQL.CLOSE_CURSOR(cursor_id); END IF; IF watch_rec.prepare2_clause IS NOT NULL THEN watch_rec.prepare2_clause := REPLACE(watch_rec.prepare2_clause, '<DB_LINK>',database_rec.db_link); cursor_id := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(cursor_id,watch_rec.prepare2_clause,DBMS_SQL.V7); ret_val := DBMS_SQL.EXECUTE(cursor_id) ; DBMS_SQL.CLOSE_CURSOR(cursor_id); END IF; c_get_data := DBMS_SQL.OPEN_CURSOR ; DBMS_SQL.PARSE(c_get_data,sql_stmt,DBMS_SQL.V7) ; ret_val := DBMS_SQL.EXECUTE(c_get_data) ; DBMS_SQL.CLOSE_CURSOR(c_get_data) ; IF watch_rec.close1_clause IS NOT NULL THEN cursor_id := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(cursor_id,watch_rec.close1_clause,DBMS_SQL.V7); ret_val := DBMS_SQL.EXECUTE(cursor_id) ; DBMS_SQL.CLOSE_CURSOR(cursor_id); END IF; IF watch_rec.close2_clause IS NOT NULL THEN cursor_id := DBMS_SQL.OPEN_CURSOR; DBMS_SQL.PARSE(cursor_id,watch_rec.close2_clause,DBMS_SQL.V7); ret_val := DBMS_SQL.EXECUTE(cursor_id) ; DBMS_SQL.CLOSE_CURSOR(cursor_id); END IF; END IF; Mini-Lesson M6, Scripts & Source Code / Page 14

15 END LOOP; END ; / Eagle Enhanced Replacement PL/SQL Engine for Eagle: create or replace package eagle as /* procedure run is the top-level procedure that calls all others. A DBA can specify a specific database for monitoring, or let the procedure default to all databases. */ procedure run (dbid in varchar2 default '%'); /* procedure sqlexec opens a cursor for each SQL command and executes the command. */ procedure sqlexec (querystr in varchar2, dbid in varchar2, dblink in varchar2); /* function sqlinit replaces the <DB_ID> and <DB_LINK> keywords in each SQL command with the appropriate database name and database link name. */ function sqlinit (querystr in varchar2, dbid in varchar2, dblink in varchar2) return varchar2; end eagle; / create or replace package body eagle as no_connection EXCEPTION; PRAGMA EXCEPTION_INIT(no_connection, ); procedure run (dbid in varchar2 default '%') is cursor c_db_watch (db varchar2) is select db_id, watch_id, active_yn from db_watch where db_id like db order by db_id; db_watch_rec db_watch%rowtype; watch_rec watch%rowtype; database_rec database%rowtype; sqltext varchar2(2000); begin /* Open the list of database watches for the specified database */ open c_db_watch(dbid); loop /* Get the next database watch record, exit when no more records found */ fetch c_db_watch into db_watch_rec; exit when c_db_watch%notfound; Mini-Lesson M6, Scripts & Source Code/ Page 15

16 /* If the watch is active, then execute */ if db_watch_rec.active_yn = 'Y' then /* Get the details for the watch and database */ select * into watch_rec from watch where watch_id=db_watch_rec.watch_id; select * into database_rec from database where db_id=db_watch_rec.db_id; /* Execute the prepare clauses for the watch */ sqlexec (watch_rec.prepare1_clause,database_rec.db_id,database_rec.db_link); sqlexec (watch_rec.prepare2_clause,database_rec.db_id,database_rec.db_link); /* Execute the watch insert as select command */ sqltext := watch_rec.insert_clause watch_rec.select_clause watch_rec.where_clause; sqlexec (sqltext,database_rec.db_id,database_rec.db_link); /* Execute the close clauses for the watch */ sqlexec (watch_rec.close1_clause,database_rec.db_id,database_rec.db_link); sqlexec (watch_rec.close2_clause,database_rec.db_id,database_rec.db_link); end if; end loop; end run; procedure sqlexec (querystr in varchar2, dbid in varchar2, dblink in varchar2) is sqltext varchar2(2000); ret_val integer; cursor_id integer; begin /* Determine if this SQL command is null */ if querystr is not null then /* Initialize the SQL command by replacing keywords with values for db_id and db_link */ sqltext := sqlinit (querystr, dbid, dblink); /* Open and execute the cursor for the SQL command */ cursor_id := dbms_sql.open_cursor; dbms_sql.parse(cursor_id,sqltext,dbms_sql.v7); ret_val := dbms_sql.execute(cursor_id) ; /* Close the cursor and exit */ Mini-Lesson M6, Scripts & Source Code / Page 16

17 dbms_sql.close_cursor(cursor_id); end if; exception /* When a connection to target database is not found, proceed to next watch */ when no_connection then return; end sqlexec; function sqlinit (querystr in varchar2, dbid in varchar2, dblink in varchar2) return varchar2 is sqltext varchar2(2000); begin sqltext := querystr; sqltext := replace(sqltext,'<db_id>',dbid); sqltext := replace(sqltext,'<db_link>',dblink); return sqltext; end sqlinit; end eagle; / Eagle Extended The following scripts can be used to extend Eagle to collect audit trail information. AUDIT_TRAIL DDL for Eagle in Oracle7 CREATE TABLE AUDIT_TRAIL (DB_ID VARCHAR2(12) NOT NULL, SESSIONID NUMBER NOT NULL, ENTRYID NUMBER NOT NULL, STATEMENT NUMBER NOT NULL, TIMESTAMP# DATE NOT NULL, USERID VARCHAR2(30) NULL, USERHOST VARCHAR2(255) NULL, TERMINAL VARCHAR2(255) NULL, ACTION# NUMBER NOT NULL, RETURNCODE NUMBER NOT NULL, OBJ$CREATOR VARCHAR2(30) NULL, OBJ$NAME VARCHAR2(128) NULL, AUTH$PRIVILEGES VARCHAR2(16) NULL, AUTH$GRANTEE VARCHAR2(30) NULL, NEW$OWNER VARCHAR2(30) NULL, NEW$NAME VARCHAR2(128) NULL, SES$ACTIONS VARCHAR2(19) NULL, AUDIT_TRAIL DDL for Eagle in Oracle8 CREATE TABLE AUDIT_TRAIL (DB_ID VARCHAR2(12) NOT NULL, SESSIONID NUMBER NOT NULL, ENTRYID NUMBER NOT NULL, STATEMENT NUMBER NOT NULL, TIMESTAMP# DATE NOT NULL, USERID VARCHAR2(30) NULL, USERHOST VARCHAR2(255) NULL, TERMINAL VARCHAR2(255) NULL, ACTION# NUMBER NOT NULL, RETURNCODE NUMBER NOT NULL, OBJ$CREATOR VARCHAR2(30) NULL, OBJ$NAME VARCHAR2(128) NULL, AUTH$PRIVILEGES VARCHAR2(16) NULL, AUTH$GRANTEE VARCHAR2(30) NULL, NEW$OWNER VARCHAR2(30) NULL, NEW$NAME VARCHAR2(128) NULL, SES$ACTIONS VARCHAR2(19) NULL, Mini-Lesson M6, Scripts & Source Code/ Page 17

18 SES$TID NUMBER NULL, LOGOFF$LREAD NUMBER NULL, LOGOFF$PREAD NUMBER NULL, LOGOFF$LWRITE NUMBER NULL, LOGOFF$DEAD NUMBER NULL, LOGOFF$TIME DATE NULL, COMMENT$TEXT VARCHAR2(2000) NULL, SPARE1 VARCHAR2(255) NULL, SPARE2 NUMBER NULL, OBJ$LABEL RAW(255) NULL, SES$LABEL RAW(255) NULL, PRIV$USED NUMBER NULL SES$TID NUMBER NULL, LOGOFF$LREAD NUMBER NULL, LOGOFF$PREAD NUMBER NULL, LOGOFF$LWRITE NUMBER NULL, LOGOFF$DEAD NUMBER NULL, LOGOFF$TIME DATE NULL, COMMENT$TEXT VARCHAR2(4000) NULL, SPARE1 VARCHAR2(255) NULL, SPARE2 NUMBER NULL, OBJ$LABEL RAW(255) NULL, SES$LABEL RAW(255) NULL, PRIV$USED NUMBER NULL ) STORAGE ( INITIAL 1M NEXT 1M MINEXTENTS 1 PCTINCREASE 0) TABLESPACE "DBAUDIT"; Notes: ) STORAGE ( INITIAL 1M NEXT 1M MINEXTENTS 1 PCTINCREASE 0) TABLESPACE "DBAUDIT"; Notes: The COMMENT$TEXT field from an Oracle8 database must be trimmed from varchar2(4000) to varchar2(2000). All data from Oracle7 and Oracle8 audit trails can be stored in this table without being trimmed or altered. The SES$ACTIONS field was expanded from varchar2(16) to varchar2(19) to accommodate Oracle8 values. The USERHOST field was expanded from varchar2(128) to varchar2(255) to accommodate Oracle7 values. The TIMESTAMP and ACTION fields have been renamed, adding a '#' character to the end of each. Copy the AUDIT_ACTIONS table into the Eagle schema for use in reports and views: CREATE TABLE EAGLE.AUDIT_ACTIONS TABLESPACE USERS AS SELECT * FROM SYS.AUDIT_ACTIONS; There are three (3) different watches that can be used to collect audit trail data, depending on the version numbers of the Eagle database and the target database. Each watch will do the following: Copy all audit entries from AUD$ in the target database to AUDIT_TRAIL in the Eagle database, adding the DB_ID field as a source identifier. Only those entries made since the last time Eagle has run will be copied (no duplicates). Automatically delete any entries more than 365 days old. Use the following table to determine which audit watch to use for your systems. Mini-Lesson M6, Scripts & Source Code / Page 18

19 Target Database Eagle Database Database Version Oracle7 Oracle8 Oracle7 AUDIT_7_TO_8 AUDIT_8_TO_7 Oracle8 AUDIT_7_TO_8 AUDIT_TRAIL AUDIT_TRAIL Watch SQL: This watch can be used when both the Eagle and target databases are both Oracle8 insert into watch (watch_id, name, prepare1_clause, insert_clause, select_clause, where_clause, close1_clause) values ('AUDIT_TRAIL','Database Audit Trail', 'delete from audit_trail where db_id=''<db_id>'' and timestamp < (sysdate-365)', 'insert into audit_trail ', 'select ''<DB_ID>'', a.* from sys.aud$ a ', 'where a.timestamp > (select nvl(max(timestamp),sysdate-1) from audit_trail where db_id=''<db_id>'')', 'commit'); AUDIT_7_TO_8 Watch DDL: This watch is used when the target database is Oracle7 (the Eagle database can be either Oracle7 or Oracle8) insert into watch (watch_id, name, prepare1_clause, prepare2_clause, insert_clause, select_clause, where_clause, close1_clause, close2_clause) values ('AUDIT_7_TO_8','Database Audit Trail (Oracle7)', 'delete from audit_trail where db_id=''<db_id>'' and timestamp < (sysdate-365)', 'CREATE OR REPLACE VIEW AUD$_V8 AS SELECT SESSIONID, ENTRYID, STATEMENT, TIMESTAMP TIMESTAMP#, USERID, USERHOST, TERMINAL, ACTION ACTION#, RETURNCODE, OBJ$CREATOR, Mini-Lesson M6, Scripts & Source Code/ Page 19

20 OBJ$NAME, AUTH$PRIVILEGES, AUTH$GRANTEE, NEW$OWNER, NEW$NAME, SES$ACTIONS, SES$TID, LOGOFF$LREAD, LOGOFF$PREAD, LOGOFF$LWRITE, LOGOFF$DEAD, LOGOFF$TIME, COMMENT$TEXT, SPARE1, SPARE2, OBJ$LABEL, SES$LABEL, PRIV$USED FROM 'insert into audit_trail ', 'select ''<DB_ID>'', a.* from aud$_v8 a ', 'where a.timestamp > (select nvl(max(timestamp),sysdate-1) from audit_trail where db_id=''<db_id>'')', 'commit', 'drop view aud$_v8'); AUDIT_8_TO_7 Watch DDL: This watch is used when the Eagle database is in Oracle7 and the target database is Oracle8 insert into watch (watch_id, name, prepare1_clause, prepare2_clause, insert_clause, select_clause, where_clause, close1_clause, close2_clause) values ('AUDIT_8_TO_7','Database Audit Trail (Oracle8)', 'delete from audit_trail where db_id=''<db_id>'' and timestamp < (sysdate-365)', 'CREATE OR REPLACE VIEW AUD$_V7 AS SELECT SESSIONID, ENTRYID, STATEMENT, TIMESTAMP#, USERID, USERHOST, TERMINAL, ACTION#, RETURNCODE, OBJ$CREATOR, OBJ$NAME, AUTH$PRIVILEGES, AUTH$GRANTEE, NEW$OWNER, NEW$NAME, SES$ACTIONS, SES$TID, LOGOFF$LREAD, LOGOFF$PREAD, LOGOFF$LWRITE, LOGOFF$DEAD, LOGOFF$TIME, SUBSTR(COMMENT$TEXT,1,2000) COMMENT$TEXT, SPARE1, SPARE2, OBJ$LABEL, SES$LABEL, PRIV$USED FROM SYS.AUD$@<DB_LINK>', 'insert into audit_trail ', 'select ''<DB_ID>'', a.* from aud$_v7 a ', 'where a.timestamp > (select nvl(max(timestamp),sysdate-1) from audit_trail where db_id=''<db_id>'')', 'commit', 'drop view aud$_v7'); Mini-Lesson M6, Scripts & Source Code / Page 20

21 EAGLE_AUDIT_TRAIL VIEW DDL: create or replace view eagle_audit_trail as select db_id /* DB_ID */, spare1 /* OS_USERNAME */, userid /* USERNAME */, userhost /* USERHOST */, terminal /* TERMINAL */, timestamp# /* TIMESTAMP */, obj$creator /* OWNER */, obj$name /* OBJECT_NAME */, aud.action# /* ACTION */, act.name /* ACTION_NAME */, new$owner /* NEW_OWNER */, new$name /* NEW_NAME */, decode(aud.action#, 108 /* grant sys_priv */, null, 109 /* revoke sys_priv */, null, 114 /* grant role */, null, 115 /* revoke role */, null, auth$privileges) /* OBJ_PRIVILEGE */, decode(aud.action#, 108 /* grant sys_priv */, spm.name, 109 /* revoke sys_priv */, spm.name, null) /* SYS_PRIVILEGE */, decode(aud.action#, 108 /* grant sys_priv */, substr(auth$privileges,1,1), 109 /* revoke sys_priv */, substr(auth$privileges,1,1), 114 /* grant role */, substr(auth$privileges,1,1), 115 /* revoke role */, substr(auth$privileges,1,1), null) /* ADMIN_OPTION */, auth$grantee /* GRANTEE */, decode(aud.action#, 104 /* audit */, aom.name, 105 /* noaudit */, aom.name, null) /* AUDIT_OPTION */, ses$actions /* SES_ACTIONS */, Mini-Lesson M6, Scripts & Source Code/ Page 21

22 logoff$time /* LOGOFF_TIME */, logoff$lread /* LOGOFF_LREAD */, logoff$pread /* LOGOFF_PREAD */, logoff$lwrite /* LOGOFF_LWRITE */, decode(aud.action#, 104 /* audit */, null, 105 /* noaudit */, null, 108 /* grant sys_priv */, null, 109 /* revoke sys_priv */, null, 114 /* grant role */, null, 115 /* revoke role */, null, aud.logoff$dead) /* LOGOFF_DLOCK */, comment$text /* COMMENT_TEXT */, sessionid /* SESSIONID */, entryid /* ENTRYID */, statement /* STATEMENTID */, returncode /* RETURNCODE */, spx.name /* PRIVILEGE */, rawtolab(obj$label) /* OBJECT_LABEL */, rawtolab(ses$label) /* SESSION_LABEL */ from eagle.audit_trail aud, sys.system_privilege_map spm, sys.system_privilege_map spx, sys.stmt_audit_option_map aom, eagle.audit_actions act where aud.action# = act.action (+) and - aud.logoff$dead = spm.privilege (+) and aud.logoff$dead = aom.option# (+) and - aud.priv$used = spx.privilege (+); EAGLE_AUDIT_SESSION VIEW DDL: create or replace view eagle_audit_session as select db_id, os_username, username, userhost, terminal, timestamp, action_name, logoff_time, logoff_lread, logoff_pread, logoff_lwrite, logoff_dlock, sessionid, returncode, session_label from eagle_audit_trail where action between 100 and 102; EAGLE_AUDIT_OBJECT VIEW DDL: create or replace view eagle_audit_object as select DB_ID, OS_USERNAME, USERNAME, USERHOST, TERMINAL, TIMESTAMP, OWNER, OBJ_NAME, ACTION_NAME, NEW_OWNER, NEW_NAME, SES_ACTIONS, COMMENT_TEXT, SESSIONID, ENTRYID, STATEMENTID, RETURNCODE, PRIV_USED, OBJECT_LABEL, SESSION_LABEL Mini-Lesson M6, Scripts & Source Code / Page 22

23 from eagle_audit_trail where (action between 1 and 16) or (action between 19 and 29) or (action between 32 and 41) or (action = 43) or (action between 51 and 99) or (action = 103) or (action between 110 and 113) or (action between 116 and 121) or (action between 123 and 128); EAGLE_AUDIT_STATEMENT VIEW DDL: create or replace view eagle_audit_statement as select DB_ID, OS_USERNAME, USERNAME, USERHOST, TERMINAL, TIMESTAMP, OWNER, OBJ_NAME, ACTION_NAME, NEW_NAME, OBJ_PRIVILEGE, SYS_PRIVILEGE, ADMIN_OPTION, GRANTEE, AUDIT_OPTION, SES_ACTIONS, COMMENT_TEXT, SESSIONID, ENTRYID, STATEMENTID, RETURNCODE, PRIV_USED, SESSION_LABEL from eagle_audit_trail where action in ( 17 /* GRANT OBJECT */, 18 /* REVOKE OBJECT */, 30 /* AUDIT OBJECT */, 31 /* NOAUDIT OBJECT */, 49 /* ALTER SYSTEM */, 104 /* SYSTEM AUDIT */, 105 /* SYSTEM NOAUDIT */, 106 /* AUDIT DEFAULT */, 107 /* NOAUDIT DEFAULT */, 108 /* SYSTEM GRANT */, 109 /* SYSTEM REVOKE */, 114 /* GRANT ROLE */, 115 /* REVOKE ROLE */ ); EAGLE_AUDIT_CLIENT_SESSION VIEW DDL: create or replace view eagle_audit_client_session as select db_id, os_username, username, userhost, terminal, timestamp, action_name, logoff_time, logoff_lread, logoff_pread, logoff_lwrite, logoff_dlock, sessionid, returncode, comment_text, session_label, substr(substr(comment_text,instr(comment_text,'host=',1)+5, instr(comment_text,')',instr(comment_text,'host=',1)) - (instr(comment_text,'host=',1)+5)),1,15) ip_address Mini-Lesson M6, Scripts & Source Code/ Page 23

24 from eagle_audit_trail where action between 100 and 102; EAGLE_AUDIT_FAILED_SESSION VIEW DDL: create or replace view eagle_audit_failed_session as select db_id, os_username, username, userhost, terminal, timestamp, action_name, sessionid, returncode, comment_text, substr(substr(comment_text,instr(comment_text,'host=',1)+5, instr(comment_text,')',instr(comment_text,'host=',1)) - (instr(comment_text,'host=',1)+5)),1,15) ip_address from eagle_audit_trail where returncode in (1017,1005) and action between 100 and 102; Audit Trail Reports The following sample reports were designed using Oracle WebServer 2.0 and the PL/SQL Agent. The are included only as an example of the types of reports that can be generated with the centralized audit trail data collected by Eagle. DBAUDIT PACKAGE DDL: create or replace package dbaudit as end; procedure query; procedure report (rptcode in varchar2 default 'session', db_nm in varchar2 default 'ALL', user_nm in varchar2, object_nm in varchar2, action_nm in varchar2, code in varchar2, day in varchar2, month in varchar2, year in varchar2); procedure auditrpt (rptcode in varchar2, db_name in varchar2, user_name in varchar2, object_name in varchar2, action_name in varchar2, rt_code in varchar2, webday in varchar2, webmonth in varchar2, webyear in varchar2); procedure dataheader (rptcode in varchar2); procedure datafooter; procedure getdata (rptcode in varchar2, db_name in varchar2, user_name in varchar2, object_name in varchar2, action_name in varchar2, rtcode in varchar2, webday in varchar2, webmonth in varchar2, webyear in varchar2); create or replace package body dbaudit as Procedure query presents the initial report request form procedure query is cursor dblist is select distinct db_id from eagle.audit_trail order by db_id; cursor userlist is Mini-Lesson M6, Scripts & Source Code / Page 24

25 select distinct userid from eagle.audit_trail order by userid; cursor objlist is select distinct obj$name from eagle.audit_trail order by obj$name; cursor actionlist is select name, action from sys.audit_actions order by name; cursor codelist is begin select distinct returncode from eagle.audit_trail order by returncode; htp.htmlopen; htp.headopen; htp.title('stats Database Audit History'); htp.headclose; htp.bodyopen('','bgcolor="#000066" TEXT="#ffffe8" LINK="#ccffff" VLINK="#33ccff" BACKGROUND="/images/back10.jpg"'); htp.header(1,'stats Database Audit History'); htp.hr; htp.formopen('/webaudit/owa/dbaudit.report','post'); htp.print('<b>select Report Criteria:</B><P>'); htp.tableopen; htp.print('<tr><td WIDTH="150">Select Audit Report:</TD><TD>'); htp.formradio('rptcode','session','checked'); htp.print('session Audits '); htp.formradio('rptcode','object'); htp.print('object/statement Audits'); htp.print('</td></tr>'); htp.print('<tr><td WIDTH="150">Database Name:</TD><TD>'); htp.formselectopen('db_nm'); htp.formselectoption('all','selected','value="all"'); for dc in dblist loop htp.formselectoption(dc.db_id,'','value="' dc.db_id '"'); end loop; htp.formselectclose; htp.print('</td></tr>'); htp.print('<tr><td WIDTH="150">Database User Name:</TD><TD>'); htp.formselectopen('user_nm'); htp.formselectoption('all','selected','value="all"'); for uc in userlist loop htp.formselectoption(uc.userid,'','value="' uc.userid '"'); Mini-Lesson M6, Scripts & Source Code/ Page 25

26 end loop; htp.formselectclose; htp.print('</td></tr>'); htp.print('<tr><td WIDTH="150">Object Name:</TD><TD>'); htp.formselectopen('object_nm'); htp.formselectoption('all','selected','value="all"'); for oc in objlist loop htp.formselectoption(oc.obj$name,'','value="' oc.obj$name '"'); end loop; htp.formselectclose; htp.print(' (Object/Statement Audits only)</td></tr>'); htp.print('<tr><td WIDTH="150">Action Name:</TD><TD>'); htp.formselectopen('action_nm'); htp.formselectoption('all','selected','value="all"'); for ac in actionlist loop htp.formselectoption(ac.name,'','value="' ac.action '"'); end loop; htp.formselectclose; htp.print(' (Object/Statement Audits only)</td></tr>'); htp.print('<tr><td WIDTH="150">Return Code:</TD><TD>'); htp.formselectopen('code'); htp.formselectoption('all','selected','value="all"'); for rc in codelist loop htp.formselectoption(rc.returncode,'','value="' rc.returncode '"'); end loop; htp.formselectclose; htp.print('</td></tr>'); htp.print('<tr><td WIDTH="150">Day:</TD><TD>'); htp.formselectopen('day'); htp.formselectoption('all','selected','value="all"'); for ctr in loop htp.formselectoption(ctr,'','value="' ctr '"'); end loop; htp.formselectclose; htp.print('</td></tr>'); Mini-Lesson M6, Scripts & Source Code / Page 26

27 htp.print('<tr><td WIDTH="150">Month:</TD><TD>'); htp.formselectopen('month'); htp.formselectoption('all','selected','value="all"'); htp.formselectoption('january','','value="january "'); htp.formselectoption('february','','value="february "'); htp.formselectoption('march','','value="march htp.formselectoption('april','','value="april htp.formselectoption('may','','value="may htp.formselectoption('june','','value="june htp.formselectoption('july','','value="july htp.formselectoption('august','','value="august "'); "'); "'); "'); "'); "'); htp.formselectoption('september','','value="september"'); htp.formselectoption('october','','value="october "'); htp.formselectoption('november','','value="november "'); htp.formselectoption('december','','value="december "'); htp.formselectclose; htp.print('</td></tr>'); htp.print('<tr><td WIDTH="150">Year:</TD><TD>'); htp.formselectopen('year'); htp.formselectoption('all','','value="all"'); htp.formselectoption('1997','','value="1997"'); htp.formselectoption('1998','selected','value="1998"'); htp.formselectclose; htp.print('</td></tr>'); htp.tableclose; htp.para; htp.formsubmit('','submit'); htp.formreset('reset'); htp.formclose; htp.hr; htp.print('<p><font SIZE=2><CITE>'); htp.anchor('/','<img BORDER=0 SRC="/images/home-b.jpg">'); BORDER=0 SRC="/images/mail-b.jpg">'); htp.para; htp.img('/images/tag1.gif','bottom','generated by Oracle WebServer'); htp.bodyclose; Mini-Lesson M6, Scripts & Source Code/ Page 27

28 htp.htmlclose; end query; Procedure report parses the initial report request and calls the specified report procedure. procedure report (rptcode in varchar2 default 'session', db_nm in varchar2 default 'ALL', user_nm in varchar2, object_nm in varchar2, action_nm in varchar2, code in varchar2, day in varchar2, month in varchar2, year in varchar2) is header_text varchar2(50); db_name varchar2(10); user_name varchar2(32); object_name varchar2(32); action_name varchar2(64); rtcode varchar2(10); webday varchar2(3); webmnth varchar2(20); webyear varchar2(4); begin if db_nm = 'ALL' then db_name := '%'; else db_name := db_nm; end if; if user_nm = 'ALL' then user_name := '%'; else user_name := user_nm; end if; if object_nm = 'ALL' then object_name := '%'; else object_name := object_nm; end if; if action_nm = 'ALL' then action_name := '%'; else Mini-Lesson M6, Scripts & Source Code / Page 28

29 action_name := action_nm; end if; if code = 'ALL' then rtcode := '%'; else rtcode := code; end if; webday := day; if length(webday) < 2 then webday := '0' webday; end if; if webday = 'ALL' then webday := '%'; end if; if month = 'ALL' then webmnth := '%'; else webmnth := rtrim(month) '%'; end if; if year = 'ALL' then webyear := '%'; else webyear := year; end if; htp.htmlopen; htp.headopen; htp.title('stats Database Audit History'); htp.headclose; htp.bodyopen('','bgcolor="#ffffff" TEXT="#ffffe8" LINK="#ccffff" VLINK="#33ccff" BACKGROUND="/images/back10.jpg"'); htp.header(1,'stats Database Audit History'); htp.tableopen('border','','','','width="100%"'); htp.tablerowopen; Mini-Lesson M6, Scripts & Source Code/ Page 29

30 htp.tableheader('database'); htp.tableheader('user Name'); htp.tableheader('object Name'); htp.tableheader('action'); htp.tableheader('return Code'); htp.tableheader('day'); htp.tableheader('month'); htp.tableheader('year'); htp.tablerowclose; htp.tablerowopen; htp.tabledata(db_nm); htp.tabledata(user_nm); htp.tabledata(object_nm); htp.tabledata(action_nm); htp.tabledata(code); htp.tabledata(day); htp.tabledata(month); htp.tabledata(year); htp.tablerowclose; htp.tableclose; htp.hr; auditrpt (rptcode, db_name, user_name, object_name, action_name, rtcode, webday, webmnth, webyear); htp.hr; htp.print('<p><font SIZE=2><CITE>'); htp.anchor('/','<img BORDER=0 SRC="/images/home-b.jpg">'); htp.anchor('/webstats/owa/webstats.query','<img BORDER=0 SRC="/images/up-b.jpg">'); BORDER=0 SRC="/images/mail-b.jpg">'); htp.para; htp.img('/images/tag1.gif','bottom','generated by Oracle WebServer'); htp.bodyclose; htp.htmlclose; end report; Procedure auditrpt generates the Server Audit History Report procedure auditrpt (rptcode in varchar2, db_name in varchar2, user_name in varchar2, Mini-Lesson M6, Scripts & Source Code / Page 30

31 object_name in varchar2, action_name in varchar2, rt_code in varchar2, webday in varchar2, webmonth in varchar2, webyear in varchar2) is begin dataheader(rptcode); getdata (rptcode, db_name, user_name, object_name, action_name, rt_code, webday, webmonth, webyear); datafooter; htp.para; end auditrpt; Procedure dataheader creates the table header for report data procedure dataheader (rptcode in varchar2) is begin htp.tableopen('border','','','','width="100%"'); if rptcode = 'session' then else htp.tablecaption('<b>user Session History</B>'); htp.tablerowopen; htp.tableheader('database',cattributes=>'valign="bottom" width='); htp.tableheader('timestamp',cattributes=>'valign="bottom" width='); htp.tableheader('sid',cattributes=>'valign="bottom" width='); htp.tableheader('user Name',cattributes=>'valign="bottom" width='); htp.tableheader('os User Name',cattributes=>'valign="bottom" width='); htp.tableheader('action Name',cattributes=>'valign="bottom" width='); htp.tableheader('return Code',cattributes=>'valign="bottom" width='); htp.tableheader('ip Address',cattributes=>'valign="bottom" width='); htp.tablerowclose; htp.tablecaption('<b>object/statement History</B>'); htp.tablerowopen; htp.tableheader('database',cattributes=>'valign="bottom" width='); htp.tableheader('timestamp',cattributes=>'valign="bottom" width='); htp.tableheader('sid',cattributes=>'valign="bottom" width='); htp.tableheader('user Name',cattributes=>'valign="bottom" width='); htp.tableheader('action Name',cattributes=>'valign="bottom" width='); htp.tableheader('object Owner',cattributes=>'valign="bottom" width='); htp.tableheader('object Name',cattributes=>'valign="bottom" width='); htp.tableheader('return Code',cattributes=>'valign="bottom" width='); htp.tablerowclose; Mini-Lesson M6, Scripts & Source Code/ Page 31

32 end if; end dataheader; Procedure datafooter creates the table footer for report data procedure datafooter is begin htp.tableclose; end datafooter; Procedure getdata generates the data tables for the reports procedure getdata (rptcode in varchar2, db_name in varchar2, user_name in varchar2, object_name in varchar2, action_name in varchar2, rtcode in varchar2, webday in varchar2, webmonth in varchar2, webyear in varchar2) is querystr varchar2(2000); begin if rptcode = 'session' then querystr := 'select db_id, to_char(timestamp,''dd-mon-yy HH24:MI:SS''), sessionid, username, os_username, action_name, returncode, ip_address from eagle.audit_client_session where db_id like :db_nm and username like :user_nm and returncode like :code and to_char(timestamp,''dd'') like :webday and to_char(timestamp,''month'') like :webmnth and to_char(timestamp,''yyyy'') like :webyear order by timestamp'; owa_sql.cells_from_query( owa_sql.init(querystr, ':db_nm',db_name, ':user_nm',user_name, ':code',rtcode, ':webday',webday, ':webmnth',webmonth, ':webyear',webyear), Mini-Lesson M6, Scripts & Source Code / Page 32

33 10000,'Yes'); else querystr := 'select db_id, to_char(timestamp,''dd-mon-yy HH24:MI:SS''), sessionid, username, action_name, owner, object_name, returncode from eagle.audit_trail_view where action like :action_nm and db_id like :db_nm and username like :user_nm and object_name like :object_nm and returncode like :code and to_char(timestamp,''dd'') like :webday and to_char(timestamp,''month'') like :webmnth and to_char(timestamp,''yyyy'') like :webyear order by timestamp'; owa_sql.cells_from_query( owa_sql.init(querystr, ':action_nm',action_name, ':db_nm',db_name, ':user_nm',user_name, ':object_nm',object_name, ':code',rtcode, ':webday',webday, ':webmnth',webmonth, ':webyear',webyear), 10000,'Yes'); end if; end getdata; end ; Audit Trail Configuration Identify the tablespace in which the audit trail table is located. select table_name, tablespace_name from dba_tables where table_name='aud$' and owner like 'SYS%'; The following instructions are excerpts from Conference Paper 139: Enhancing Database Security: Monitoring Audit Trails Using Enterprise Manager. Mini-Lesson M6, Scripts & Source Code/ Page 33

34 Special Note Changing either the location or the ownership of AUD$ is a configuration change that is not supported by Oracle Technical Support. Take care when performing the following steps to ensure the procedures are followed exactly. While the authors have tested these scripts on a variety of Oracle versions and OS platforms, no warranty, expressed or implicit, is given that you will have the same results. Step 1 If auditing is already enabled in the database, it will need to temporarily be disabled while these changes are made. In the init.ora file, make sure that the audit trail parameter is turned off. Make sure that the value of this parameter is set to none. If the value of this parameter is changed, the database will need to be restarted for the change to take effect. Step 2 Check to see if there is already an auditing tablespace in the database. Connect internal using Server Manager and run the following command. select tablespace_name from dba_tablespaces; TABLESPACE_NAME - SYSTEM USER_DATA ROLLBACK_DATA TEMPORARY_DATA Step 3 If an auditing tablespace does not exist, execute the following commands as SYS (or internal). Substitute a file name appropriate to the local operating system, and enter storage parameters consistent with the rest of the database. create tablespace "DBAUDIT" datafile '<use appropriate file name>' size 1m default storage (initial 128k next 128k pctincrease 0); Repeat the query from Step 2 to verify that the auditing tablespace has been correctly created. Step 4 Create the new audit trail table by executing the following commands as SYS (or internal). Substitute storage parameters consistent with the rest of the database. rename aud$ to aud$_temp; create table system.aud$ tablespace "DBAUDIT" storage (initial 64k next 64k pctincrease 0) as select * from aud$_temp; Step 5 Connect as SYSTEM and execute the following commands to index and set permissions on the new audit trail (again substituting appropriate storage parameters): create index i_aud1 on aud$(sessionid,ses$tid) tablespace "DBAUDIT" storage (initial 64k next 64k pctincrease 0); Mini-Lesson M6, Scripts & Source Code / Page 34

35 grant all on aud$ to sys with grant option; Step 6 Connect internal from Server Manager and run these commands to reset and rebuild the auditing portions of Oracle s data dictionary: create view aud$ as select * from (if you are using Oracle for Windows95 or WindowsNT, then run %ORACLE_HOME%\rdbms73\admin\cataudit.sql or %ORACLE_HOME%\rdbms80\admin\cataudit.sql) WatchDog Installation The following instructions are excerpts from Conference Paper 139: Enhancing Database Security: Monitoring Audit Trails Using Enterprise Manager. Step 7 SYSTEM now owns the audit trail. Stop the database and set the following initialization parameters, then restart: audit_trail = db utl_file_dir = /your/alert/log/directory/path where the directory in utl_file_dir is the directory which contains the database alert log; this will allow the audit trail trigger to update the alert log when an audited event is detected. Any previously existing audits should be unaffected; all new entries will be written to the new table owned by SYSTEM. The WatchDog trigger can now be written against AUD$ to automate responses to various events that may show up, like failed logins or other unusual activities. Step 8 Make sure any audits that need to be monitored are in place. The following examples will use the session audit to determine when a login to the database has failed. The session audit is enabled by a DBA with the following command, issued from Server Manager. AUDIT SESSION; Securing the UTL_FILE Package Before the WatchDog trigger is created, there are some additional security enhancements that can be made to the database. The UTL_FILE package available in Oracle 7.3 and higher allows stored procedures to have access to operating system files and directories on the server machine. This package will allow the WatchDog audit trail trigger to access the database alert log. UTL_FILE access to operating system directories is controlled by the UTL_FILE_DIR parameter in the init.ora file for the database. Only files in designated directories can be accessed by UTL_FILE. By default, execute on UTL_FILE is granted to public, which means that any user in the database has potential read-write access as the Oracle software owner to the UTL_FILE directories (including the alert log, when the WatchDog configuration changes in Step 7 are made). This is true even if the user has no other privileges or no user account on the server operating system. Execute on UTL_FILE should only be granted on an individual basis to trusted and approved users (preferably only DBAs or trusted software administrators). Mini-Lesson M6, Scripts & Source Code/ Page 35

Monitoring Audit Trails Using Enterprise Manager

Monitoring Audit Trails Using Enterprise Manager Enhancing Database Security: Monitoring Audit Trails Using Enterprise Manager Peter J. Magee, CDA SQRIBE Technologies Gail VanderKolk Reynolds & Reynolds Abstract Maintaining the security and integrity

More information

Database Auditing - 1 - Report submitted by: D. Murali Krishna - 200505017 S.M Siva Rama Krishna - 200505015

Database Auditing - 1 - Report submitted by: D. Murali Krishna - 200505017 S.M Siva Rama Krishna - 200505015 - 1 - Database Auditing Report submitted by: D. Murali Krishna - 200505017 S.M Siva Rama Krishna - 200505015 Course : Information Security Audit and Assurance Faculty : Prof. Bruhadeshwar - 2 - Contents:

More information

Tivoli Security Compliance Manager. Version 5.1.1 rel. 2 July, 2008. Collector and Message Reference Windows Oracle Addendum

Tivoli Security Compliance Manager. Version 5.1.1 rel. 2 July, 2008. Collector and Message Reference Windows Oracle Addendum Tivoli Security Compliance Manager Version 5.1.1 rel. 2 July, 2008 Collector and Message Reference Windows Oracle Addendum Copyright International Business Machines Corporation 2006. All rights reserved.

More information

All About Oracle Auditing A White Paper February 2013

All About Oracle Auditing A White Paper February 2013 A White Paper February 2013 Sr Staff Consultant Database Specialists, Inc http:www.dbspecialists.com mdean@dbspecialists.com Many organizations keep their most sensitive and valuable information in an

More information

Database security tutorial. Part I

Database security tutorial. Part I Database security tutorial Part I Oracle Tutorials, June 4 th 2012 Daniel Gómez Blanco Agenda Authentication Roles and privileges Auditing 2 Authentication Basis of any security model Process of confirming

More information

All About Oracle Auditing Everything You Need to Know

All About Oracle Auditing Everything You Need to Know All About Oracle Auditing Everything You Need to Know Mike Dean Database Specialists, Inc. www.dbspecialists.com RMOUG February 12, 2013 Who Am I? Oracle 11g Certified Professional DBA More than 15 years

More information

Oracle. Brief Course Content This course can be done in modular form as per the detail below. ORA-1 Oracle Database 10g: SQL 4 Weeks 4000/-

Oracle. Brief Course Content This course can be done in modular form as per the detail below. ORA-1 Oracle Database 10g: SQL 4 Weeks 4000/- Oracle Objective: Oracle has many advantages and features that makes it popular and thereby makes it as the world's largest enterprise software company. Oracle is used for almost all large application

More information

Best Practices for Oracle Databases Hardening Oracle 10.2.0.3 / 10.2.0.4

Best Practices for Oracle Databases Hardening Oracle 10.2.0.3 / 10.2.0.4 Best Practices for Oracle Databases Hardening Oracle 10.2.0.3 / 10.2.0.4 Alexander Kornbrust Table of Content Passwords (Security) Patches Database Settings PUBLIC Privileges Database Trigger Compiling

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: 001-855-844-3881 & 001-800-514-06-97 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals

More information

White Paper. Auditing the DBA in Oracle Applications: A Guide for Compliance and Audit Managers. By Cameron Larner. Absolute Technologies, Inc.

White Paper. Auditing the DBA in Oracle Applications: A Guide for Compliance and Audit Managers. By Cameron Larner. Absolute Technologies, Inc. www.absolute-tech.com White Paper Auditing the DBA in Oracle Applications: A Guide for Compliance and Audit Managers By Cameron Larner Absolute Technologies, Inc. Copyright 2014 by Cameron Larner Page

More information

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added? DBMS Questions 1.) Which type of file is part of the Oracle database? A.) B.) C.) D.) Control file Password file Parameter files Archived log files 2.) Which statements are use to UNLOCK the user? A.)

More information

Setting Up Your Team-SQL Database for ORACLE 8.05

Setting Up Your Team-SQL Database for ORACLE 8.05 Setting Up Your Team-SQL Database for ORACLE 8.05 Once you have your Oracle Server in place, and have the SQL client software installed on all Team Client PCs, you are ready to set up your Team-SQL for

More information

Oracle Insurance Policy Administration

Oracle Insurance Policy Administration Oracle Insurance Policy Administration Databases Installation Instructions Step 1 Version 10.1.2.0 Document Part Number: E59346-01 December, 2014 Copyright 2009, 2014, Oracle and/or its affiliates. All

More information

Identity Management and Access Control

Identity Management and Access Control and Access Control Marek Rychly mrychly@strathmore.edu Strathmore University, @ilabafrica & Brno University of Technology, Faculty of Information Technology Enterprise Security 7 December 2015 Marek Rychly

More information

Oracle Database Security Features in the Banking Environment. Dr. Matthias Mann, DOAG

Oracle Database Security Features in the Banking Environment. Dr. Matthias Mann, DOAG Oracle Database Security Features in the Banking Environment Dr. Matthias Mann, DOAG University of Applied Sciences, Cologne Campus Gummersbach 20.06.2013 AGENDA Database User Authentication and Authorization

More information

RMAN BACKUP & RECOVERY. Recovery Manager. Veeratteshwaran Sridhar

RMAN BACKUP & RECOVERY. Recovery Manager. Veeratteshwaran Sridhar RMAN Recovery Manager BACKUP & RECOVERY Veeratteshwaran Sridhar Why Backup & Recovery? The purpose of a backup and recovery strategy is to protect the database against data loss and reconstruct the database

More information

Database Programming with PL/SQL: Learning Objectives

Database Programming with PL/SQL: Learning Objectives Database Programming with PL/SQL: Learning Objectives This course covers PL/SQL, a procedural language extension to SQL. Through an innovative project-based approach, students learn procedural logic constructs

More information

Banner overview. Authentication to Banner & 3 rd Party Apps. Authorization to Banner & 3 rd Party Apps

Banner overview. Authentication to Banner & 3 rd Party Apps. Authorization to Banner & 3 rd Party Apps Banner overview Authentication to Banner & 3 rd Party Apps Authorization to Banner & 3 rd Party Apps 1 Section 1 Higher Education Enterprise Resource Planning (ERP) system. Original vendor SunGard Higher

More information

<Insert Picture Here> Oracle Database Security Overview

<Insert Picture Here> Oracle Database Security Overview Oracle Database Security Overview Tammy Bednar Sr. Principal Product Manager tammy.bednar@oracle.com Data Security Challenges What to secure? Sensitive Data: Confidential, PII, regulatory

More information

ORACLE DATABASE 11G: COMPLETE

ORACLE DATABASE 11G: COMPLETE ORACLE DATABASE 11G: COMPLETE 1. ORACLE DATABASE 11G: SQL FUNDAMENTALS I - SELF-STUDY COURSE a) Using SQL to Query Your Database Using SQL in Oracle Database 11g Retrieving, Restricting and Sorting Data

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: 1.800.529.0165 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This course is designed to deliver the fundamentals of SQL and PL/SQL along

More information

Oracle 11g Security. Summary of new features (1) Agenda. Summary of new features (3) Summary of new features (2) Introduction - commercial slide.

Oracle 11g Security. Summary of new features (1) Agenda. Summary of new features (3) Summary of new features (2) Introduction - commercial slide. Introduction - commercial slide. UKOUG DBMS SIG, November 7 th 2007 Oracle 11g Security By Pete Finnigan Written Friday, 21st September 2007 Founded February 2003 CEO Pete Finnigan Clients UK, States,

More information

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW Oracle University Contact Us: + 38516306373 Oracle Database: SQL and PL/SQL Fundamentals NEW Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training delivers the

More information

DBA101: A Refresher Course

DBA101: A Refresher Course 1 DBA101: A Refresher Course Marlene Theriault and Rachel Carmichael Abstract There are many tasks that a database administrator (DBA) should perform on a routine basis. Often, ORACLE documentation is

More information

Oracle Database 10g: Introduction to SQL

Oracle Database 10g: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database 10g: Introduction to SQL Duration: 5 Days What you will learn This course offers students an introduction to Oracle Database 10g database technology.

More information

Security Analysis. Spoofing Oracle Session Information

Security Analysis. Spoofing Oracle Session Information November 12, 2006 Security Analysis Spoofing Oracle Session Information OVERVIEW INTRODUCTION Oracle Database session information includes database user name, operating system user name, host, terminal,

More information

Protecting Data Assets and Reducing Risk

Protecting Data Assets and Reducing Risk Protecting Data Assets and Reducing Risk Michelle Malcher Enterprise Database Security Oracle Open World 2014 2014 Wells Fargo Bank, N.A. All rights reserved. For public use. 1 Introduction Michelle Malcher

More information

Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia

Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia 1. SQL Review Single Row Functions Character Functions Date Functions Numeric Function Conversion Functions General Functions

More information

Virtual Private Database Features in Oracle 10g.

Virtual Private Database Features in Oracle 10g. Virtual Private Database Features in Oracle 10g. SAGE Computing Services Customised Oracle Training Workshops and Consulting. Christopher Muir Senior Systems Consultant Agenda Modern security requirements

More information

2. Oracle SQL*PLUS. 60-539 Winter 2015. Some SQL Commands. To connect to a CS server, do:

2. Oracle SQL*PLUS. 60-539 Winter 2015. Some SQL Commands. To connect to a CS server, do: 60-539 Winter 2015 Some SQL Commands 1 Using SSH Secure Shell 3.2.9 to login to CS Systems Note that if you do not have ssh secure shell on your PC, you can download it from www.uwindsor.ca/softwaredepot.

More information

Monitor Oracle Event Logs using EventTracker

Monitor Oracle Event Logs using EventTracker Monitor Oracle Event Logs using EventTracker Publication Date: Oct 23, 2013 EventTracker 8815 Centre Park Drive Columbia MD 21045 www.eventtracker.com Abstract The purpose of this paper is to highlight

More information

Handling Exceptions. Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1

Handling Exceptions. Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1 Handling Exceptions Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1 Objectives After completing this lesson, you should be able to do the following: Define PL/SQL

More information

Part 12. SQL for Oracle System Tables

Part 12. SQL for Oracle System Tables Part 12 SQL for Oracle System Tables System Tables All truly relational systems must have the system information stored in tables. These system tables are accessible in the same way as any other table.

More information

Oracle Database 10g Express

Oracle Database 10g Express Oracle Database 10g Express This tutorial prepares the Oracle Database 10g Express Edition Developer to perform common development and administrative tasks of Oracle Database 10g Express Edition. Objectives

More information

Fine Grained Auditing In Oracle 10G

Fine Grained Auditing In Oracle 10G Fine Grained Auditing In Oracle 10G Authored by: Meenakshi Srivastava (meenaxi.srivastava@gmail.com) 2 Abstract The purpose of this document is to develop an understanding of Fine Grained Auditing(FGA)

More information

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. est: Final Exam Semester 1 Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 6 1. How can you retrieve the error code and error message of any

More information

Oracle Database Links Part 2 - Distributed Transactions Written and presented by Joel Goodman October 15th 2009

Oracle Database Links Part 2 - Distributed Transactions Written and presented by Joel Goodman October 15th 2009 Oracle Database Links Part 2 - Distributed Transactions Written and presented by Joel Goodman October 15th 2009 About Me Email: Joel.Goodman@oracle.com Blog: dbatrain.wordpress.com Application Development

More information

CA DataMinder. Database Guide. Release 14.1. 4th Edition

CA DataMinder. Database Guide. Release 14.1. 4th Edition CA DataMinder Database Guide Release 14.1 4th Edition This Documentation, which includes embedded help systems and electronically distributed materials, (hereinafter referred to as the Documentation )

More information

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Oracle University Contact Us: +966 12 739 894 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This Oracle Database: SQL and PL/SQL Fundamentals training is designed to

More information

Introduction to Oracle PL/SQL Programming V2.1 - Lessons 11-End

Introduction to Oracle PL/SQL Programming V2.1 - Lessons 11-End Introduction to Oracle PL/SQL Programming V2.1 - Lessons 11-End Introduction to Oracle PL/SQLProgramming Page i Table of Contents 0. How to Use This Course...0.1 Lesson Objectives...0.2 Target Audience...0.3

More information

New SQL Features in Firebird 3

New SQL Features in Firebird 3 New SQL Features in Firebird 3 Sponsors! Whats new in Firebird 3 Common SQL Full syntax of MERGE statement (per SQL 2008) MERGE... RETURNING Window (analytical) functions SUBSTRING with regular expressions

More information

Oracle DBA Course Contents

Oracle DBA Course Contents Oracle DBA Course Contents Overview of Oracle DBA tasks: Oracle as a flexible, complex & robust RDBMS The evolution of hardware and the relation to Oracle Different DBA job roles(vp of DBA, developer DBA,production

More information

Database 10g Edition: All possible 10g features, either bundled or available at additional cost.

Database 10g Edition: All possible 10g features, either bundled or available at additional cost. Concepts Oracle Corporation offers a wide variety of products. The Oracle Database 10g, the product this exam focuses on, is the centerpiece of the Oracle product set. The "g" in "10g" stands for the Grid

More information

Oracle Database Security

Oracle Database Security breaking through barriers to progress By Raman Jathar an award winning '2004 Future 50 Company' 18650 W. Corporate Drive Suite 120 Brookfield, WI 53045 262.792.0200 Database Security Lately, database security

More information

The Ultimate Remote Database Administration Tool for Oracle, SQL Server and DB2 UDB

The Ultimate Remote Database Administration Tool for Oracle, SQL Server and DB2 UDB Proactive Technologies Inc. presents Version 4.0 The Ultimate Remote Database Administration Tool for Oracle, SQL Server and DB2 UDB The negative impact that downtime can have on a company has never been

More information

Oracle PL/SQL Injection

Oracle PL/SQL Injection Oracle PL/SQL Injection David Litchfield What is PL/SQL? Procedural Language / Structured Query Language Oracle s extension to standard SQL Programmable like T-SQL in the Microsoft world. Used to create

More information

Backing up and restoring HP Systems Insight Manager 6.0 or greater data files in a Windows environment

Backing up and restoring HP Systems Insight Manager 6.0 or greater data files in a Windows environment Technical white paper Backing up and restoring HP Systems Insight Manager 6.0 or greater data files in a Windows environment Table of contents Abstract 2 Introduction 2 Saving and restoring data files

More information

Advanced SQL Injection in Oracle databases. Esteban Martínez Fayó

Advanced SQL Injection in Oracle databases. Esteban Martínez Fayó Advanced SQL Injection in Oracle databases Esteban Martínez Fayó February 2005 Outline Introduction SQL Injection attacks How to exploit Exploit examples SQL Injection in functions defined with AUTHID

More information

Backup Types. Backup and Recovery. Categories of Failures. Issues. Logical. Cold. Hot. Physical With. Statement failure

Backup Types. Backup and Recovery. Categories of Failures. Issues. Logical. Cold. Hot. Physical With. Statement failure Backup Types Logical Backup and Recovery Cold Hot Physical With Without Issues Categories of Failures Protectthe database from numerous types of failures Increase Mean-Time-Between-Failures (MTBF) Decrease

More information

Migrate Topaz databases from One Server to Another

Migrate Topaz databases from One Server to Another Title Migrate Topaz databases from One Server to Another Author: Olivier Lauret Date: November 2004 Modified: Category: Topaz/BAC Version: Topaz 4.5.2, BAC 5.0 and BAC 5.1 Migrate Topaz databases from

More information

Lesson 5 Administrative Users

Lesson 5 Administrative Users Administrative Users 5.1 Lesson 5 Administrative Users A practical and hands-on lesson on creating and using Oracle administrative users. SKILLBUILDERS Administrative Users 5.2 Lesson Objectives Understand

More information

D12C-AIU Oracle Database 12c: Admin, Install and Upgrade Accelerated NEW

D12C-AIU Oracle Database 12c: Admin, Install and Upgrade Accelerated NEW D12C-AIU Oracle Database 12c: Admin, Install and Upgrade Accelerated NEW Duration: 5 Days What you will learn This Oracle Database 12c: Admin, Install and Upgrade Accelerated course will provide you with

More information

Database Extensions Visual Walkthrough. PowerSchool Student Information System

Database Extensions Visual Walkthrough. PowerSchool Student Information System PowerSchool Student Information System Released October 7, 2013 Document Owner: Documentation Services This edition applies to Release 7.9.x of the PowerSchool software and to all subsequent releases and

More information

Security Target for. Security Evaluations Oracle Corporation 500 Oracle Parkway Redwood Shores, CA 94065

Security Target for. Security Evaluations Oracle Corporation 500 Oracle Parkway Redwood Shores, CA 94065 Security Target for Oracle Database 11g Release 2 (11.2.0.2) Standard Edition and Standard Edition One October 2011 Version 1.3 Security Evaluations Oracle Corporation 500 Oracle Parkway Redwood Shores,

More information

How To Secure The Org Database

How To Secure The Org Database Oracle Database Security Checklist An Oracle White Paper June 2008 Oracle Database Security Checklist Protecting the database environment... 3 Install only what is required... 3 Lock and expire default

More information

Setting up the Oracle Warehouse Builder Project. Topics. Overview. Purpose

Setting up the Oracle Warehouse Builder Project. Topics. Overview. Purpose Setting up the Oracle Warehouse Builder Project Purpose In this tutorial, you setup and configure the project environment for Oracle Warehouse Builder 10g Release 2. You create a Warehouse Builder repository

More information

Guide to Auditing and Logging in the Oracle E-Business Suite

Guide to Auditing and Logging in the Oracle E-Business Suite Guide to Auditing and Logging in the Oracle E-Business Suite February 13, 2014 Stephen Kost Chief Technology Officer Integrigy Corporation Mike Miller Chief Security Officer Integrigy Corporation Phil

More information

How To Use A Computer System With A Powerpoint (Orchestra) On A Pc Or Macbook (Orroboro) On An Unix System (Ororrobero) For A Long Time (Ora) On Your

How To Use A Computer System With A Powerpoint (Orchestra) On A Pc Or Macbook (Orroboro) On An Unix System (Ororrobero) For A Long Time (Ora) On Your Oracle Database Security Benchmark v1.2 For Oracle Version 8i 1 and 2 Copyright 2003, The Center for Internet Security www.cisecurity.org Page 2 of 48 Agreed Terms of Use Background. CIS provides benchmarks,

More information

How To Secure Your Database On Oracle.Org

How To Secure Your Database On Oracle.Org Checklist Application Report for Oracle Database Administration Table of Contents 1. Lock and expire default user accounts 2. Document database incident response and escalation procedure 3. Review log

More information

A basic create statement for a simple student table would look like the following.

A basic create statement for a simple student table would look like the following. Creating Tables A basic create statement for a simple student table would look like the following. create table Student (SID varchar(10), FirstName varchar(30), LastName varchar(30), EmailAddress varchar(30));

More information

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC MyOra 3.0 SQL Tool for Oracle User Guide Jayam Systems, LLC Contents Features... 4 Connecting to the Database... 5 Login... 5 Login History... 6 Connection Indicator... 6 Closing the Connection... 7 SQL

More information

Delivery Method: Instructor-led, group-paced, classroom-delivery learning model with structured, hands-on activities.

Delivery Method: Instructor-led, group-paced, classroom-delivery learning model with structured, hands-on activities. Course Code: Title: Format: Duration: SSD024 Oracle 11g DBA I Instructor led 5 days Course Description Through hands-on experience administering an Oracle 11g database, you will gain an understanding of

More information

Cross Platform Transportable Tablespaces Migration in Oracle 11g

Cross Platform Transportable Tablespaces Migration in Oracle 11g Cross Platform Transportable Tablespaces Migration in Oracle 11g Prepared by ViSolve Migration Team June 2012 Contact ViSolve, Inc. 4010, Moorpark Avenue, #205 San Jose, California 95117 (602) 842 2738

More information

DB2 - DATABASE SECURITY

DB2 - DATABASE SECURITY DB2 - DATABASE SECURITY http://www.tutorialspoint.com/db2/db2_database_security.htm Copyright tutorialspoint.com This chapter describes database security. Introduction DB2 database and functions can be

More information

Oracle 10g PL/SQL Training

Oracle 10g PL/SQL Training Oracle 10g PL/SQL Training Course Number: ORCL PS01 Length: 3 Day(s) Certification Exam This course will help you prepare for the following exams: 1Z0 042 1Z0 043 Course Overview PL/SQL is Oracle's Procedural

More information

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP) Audience Data Warehouse Administrator Database Administrators Database Designers Support Engineer Technical Administrator Related Training Required Prerequisites Working knowledge of SQL and use of PL/SQL

More information

MyOra 3.5. User Guide. SQL Tool for Oracle. Kris Murthy

MyOra 3.5. User Guide. SQL Tool for Oracle. Kris Murthy MyOra 3.5 SQL Tool for Oracle User Guide Kris Murthy Contents Features... 4 Connecting to the Database... 5 Login... 5 Login History... 6 Connection Indicator... 6 Closing the Connection... 7 SQL Editor...

More information

Oracle Database 11g: Security Release 2. Course Topics. Introduction to Database Security. Choosing Security Solutions

Oracle Database 11g: Security Release 2. Course Topics. Introduction to Database Security. Choosing Security Solutions Oracle Database 11g: Security Release 2 In this course, students learn how they can use Oracle Database features to meet the security, privacy and compliance requirements of their organization. The current

More information

Developing Value from Oracle s Audit Vault For Auditors and IT Security Professionals

Developing Value from Oracle s Audit Vault For Auditors and IT Security Professionals Developing Value from Oracle s Audit Vault For Auditors and IT Security Professionals November 13, 2014 Michael Miller Chief Security Officer Integrigy Corporation Stephen Kost Chief Technology Officer

More information

WHITE PAPER. Guide to Auditing and Logging in the Oracle E-Business Suite

WHITE PAPER. Guide to Auditing and Logging in the Oracle E-Business Suite WHITE PAPER Guide to Auditing and Logging in the Oracle E-Business Suite APRIL 2016 GUIDE TO AUDITING AND LOGGING IN THE ORACLE E-BUSINESS SUITE Version 1.0 March 2003 Version 1.1 February 2004 Version

More information

CLC Server Command Line Tools USER MANUAL

CLC Server Command Line Tools USER MANUAL CLC Server Command Line Tools USER MANUAL Manual for CLC Server Command Line Tools 2.5 Windows, Mac OS X and Linux September 4, 2015 This software is for research purposes only. QIAGEN Aarhus A/S Silkeborgvej

More information

Oracle Database 10g: Program with PL/SQL

Oracle Database 10g: Program with PL/SQL Oracle University Contact Us: Local: 1800 425 8877 Intl: +91 80 4108 4700 Oracle Database 10g: Program with PL/SQL Duration: 5 Days What you will learn This course introduces students to PL/SQL and helps

More information

Database Security. Oracle Database 12c - New Features and Planning Now

Database Security. Oracle Database 12c - New Features and Planning Now Database Security Oracle Database 12c - New Features and Planning Now Michelle Malcher Oracle ACE Director Data Services Team Lead at DRW IOUG, Board of Directors Author, Oracle Database Administration

More information

SPI Backup via Remote Terminal

SPI Backup via Remote Terminal FLUOR SPI Backup via Remote Terminal SmartPlant Implementation Team By Mitch Fortey Copyright 2014 Fluor Corporation all rights reserved SPI Back Up via Remote Terminal Data Backup 101 Why do we backup

More information

Oracle Database. 2 Day + Security Guide 11g Release 1 (11.1) B28337-07

Oracle Database. 2 Day + Security Guide 11g Release 1 (11.1) B28337-07 Oracle Database 2 Day + Security Guide 11g Release 1 (11.1) B28337-07 June 2011 Oracle Database 2 Day + Security Guide, 11g Release 1 (11.1) B28337-07 Copyright 2006, 2011, Oracle and/or its affiliates.

More information

ORACLE DATABASE SECURITY. Keywords: data security, password administration, Oracle HTTP Server, OracleAS, access control.

ORACLE DATABASE SECURITY. Keywords: data security, password administration, Oracle HTTP Server, OracleAS, access control. ORACLE DATABASE SECURITY Cristina-Maria Titrade 1 Abstract This paper presents some security issues, namely security database system level, data level security, user-level security, user management, resource

More information

Setting up SQL Translation Framework OBE for Database 12cR1

Setting up SQL Translation Framework OBE for Database 12cR1 Setting up SQL Translation Framework OBE for Database 12cR1 Overview Purpose This tutorial shows you how to use have an environment ready to demo the new Oracle Database 12c feature, SQL Translation Framework,

More information

Managing a Distributed Database

Managing a Distributed Database Unit 7 Managing a Distributed Database Structure: 7.1 Introduction 7.2 Managing Global Names in a Distributed System 7.2.1 Understanding How Global Database Names Are Formed 7.2.2 Determining Whether Global

More information

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL Oracle University Contact Us: +381 11 2016811 Oracle Database: Introduction to SQL Duration: 5 Days What you will learn Understanding the basic concepts of relational databases ensure refined code by developers.

More information

news from Tom Bacon about Monday's lecture

news from Tom Bacon about Monday's lecture ECRIC news from Tom Bacon about Monday's lecture I won't be at the lecture on Monday due to the work swamp. The plan is still to try and get into the data centre in two weeks time and do the next migration,

More information

March 9 th, 2010. Oracle Total Recall

March 9 th, 2010. Oracle Total Recall March 9 th, 2010 Oracle Total Recall Agenda Flashback Data Archive Why we need Historical Data Pre-11g methods for Historical data Oracle Total Recall overview FDA Architecture Creating and Enabling FDA

More information

WHITE PAPER. Guide to Auditing and Logging in the Oracle E-Business Suite

WHITE PAPER. Guide to Auditing and Logging in the Oracle E-Business Suite WHITE PAPER Guide to Auditing and Logging in the Oracle E-Business Suite FEBRUARY 2014 GUIDE TO AUDITING AND LOGGING IN THE ORACLE E-BUSINESS SUITE Version 1.0 March 2003 Version 1.1 February 2004 Version

More information

Oracle Database Security Solutions

Oracle Database Security Solutions Oracle Database Security Solutions Eric Cheung Senior Manager, Technology Sales Consulting Eric.cheung@oracle.com May 2008 Key Drivers for Data Security Privacy and Compliance Sarbanes-Oxley

More information

Oracle E-Business Suite APPS, SYSADMIN, and oracle Securing Generic Privileged Accounts. Stephen Kost Chief Technology Officer Integrigy Corporation

Oracle E-Business Suite APPS, SYSADMIN, and oracle Securing Generic Privileged Accounts. Stephen Kost Chief Technology Officer Integrigy Corporation Oracle E-Business Suite APPS, SYSADMIN, and oracle Securing Generic Privileged Accounts May 15, 2014 Mike Miller Chief Security Officer Integrigy Corporation Stephen Kost Chief Technology Officer Integrigy

More information

Oracle Database Security Myths

Oracle Database Security Myths Oracle Database Security Myths December 13, 2012 Stephen Kost Chief Technology Officer Integrigy Corporation Phil Reimann Director of Business Development Integrigy Corporation About Integrigy ERP Applications

More information

How To Use The Correlog With The Cpl Powerpoint Powerpoint Cpl.Org Powerpoint.Org (Powerpoint) Powerpoint (Powerplst) And Powerpoint 2 (Powerstation) (Powerpoints) (Operations

How To Use The Correlog With The Cpl Powerpoint Powerpoint Cpl.Org Powerpoint.Org (Powerpoint) Powerpoint (Powerplst) And Powerpoint 2 (Powerstation) (Powerpoints) (Operations orrelog SQL Table Monitor Adapter Users Manual http://www.correlog.com mailto:info@correlog.com CorreLog, SQL Table Monitor Users Manual Copyright 2008-2015, CorreLog, Inc. All rights reserved. No part

More information

Safeguard Sensitive Data in EBS: A Look at Oracle Database Vault, Transparent Data Encryption, and Data Masking. Lucy Feng

Safeguard Sensitive Data in EBS: A Look at Oracle Database Vault, Transparent Data Encryption, and Data Masking. Lucy Feng Delivering Oracle Success Safeguard Sensitive Data in EBS: A Look at Oracle Database Vault, Transparent Data Encryption, and Data Masking Lucy Feng RMOUG Training Days February 2012 About DBAK Oracle Solution

More information

Database Extension 1.5 ez Publish Extension Manual

Database Extension 1.5 ez Publish Extension Manual Database Extension 1.5 ez Publish Extension Manual 1999 2012 ez Systems AS Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License,Version

More information

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL Oracle University Contact Us: 1.800.529.0165 Oracle Database: Introduction to SQL Duration: 5 Days What you will learn View a newer version of this course This Oracle Database: Introduction to SQL training

More information

Database Assessment. Vulnerability Assessment Course

Database Assessment. Vulnerability Assessment Course Database Assessment Vulnerability Assessment Course All materials are licensed under a Creative Commons Share Alike license. http://creativecommons.org/licenses/by-sa/3.0/ 2 Agenda Introduction Configuration

More information

Oracle Database Development Standards For DNR Staff and Contractors. Table of Contents

Oracle Database Development Standards For DNR Staff and Contractors. Table of Contents Oracle Database Development Standards For DNR Staff and Contractors Table of Contents INTRODUCTION...2 DATABASE ORGANIZATION...2 DATABASE PROCEDURES...3 Development...3 Testing...3 Production Release...4

More information

StreamServe Persuasion SP5 Oracle Database

StreamServe Persuasion SP5 Oracle Database StreamServe Persuasion SP5 Oracle Database Database Guidelines Rev A StreamServe Persuasion SP5 Oracle Database Database Guidelines Rev A 2001-2011 STREAMSERVE, INC. ALL RIGHTS RESERVED United States patent

More information

Workflow Templates Library

Workflow Templates Library Workflow s Library Table of Contents Intro... 2 Active Directory... 3 Application... 5 Cisco... 7 Database... 8 Excel Automation... 9 Files and Folders... 10 FTP Tasks... 13 Incident Management... 14 Security

More information

Oracle Database 11g: Security

Oracle Database 11g: Security Oracle Database 11g: Security Student Guide D52365GC10 Edition 1.0 October 2007 PRODUCTION This documentation contains proprietary information of Oracle Corporation. It is provided under a license agreement

More information

Embarcadero Performance Center 2.7 Installation Guide

Embarcadero Performance Center 2.7 Installation Guide Embarcadero Performance Center 2.7 Installation Guide Copyright 1994-2009 Embarcadero Technologies, Inc. Embarcadero Technologies, Inc. 100 California Street, 12th Floor San Francisco, CA 94111 U.S.A.

More information

Division of IT Security Best Practices for Database Management Systems

Division of IT Security Best Practices for Database Management Systems Division of IT Security Best Practices for Database Management Systems 1. Protect Sensitive Data 1.1. Label objects containing or having dedicated access to sensitive data. 1.1.1. All new SCHEMA/DATABASES

More information

Microsoft SQL Server Security Best Practices

Microsoft SQL Server Security Best Practices Microsoft SQL Server Security Best Practices This white paper contains administrative and operational best practices that should be performed from a security perspective when using Microsoft SQL Server.

More information

An Introduction to SQL Injection Attacks for Oracle Developers. January 2004 INTEGRIGY. Mission Critical Applications Mission Critical Security

An Introduction to SQL Injection Attacks for Oracle Developers. January 2004 INTEGRIGY. Mission Critical Applications Mission Critical Security An Introduction to SQL Injection Attacks for Oracle Developers January 2004 INTEGRIGY Mission Critical Applications Mission Critical Security An Introduction to SQL Injection Attacks for Oracle Developers

More information

Have your objects been tampered with? The Problem. By Pete Finnigan

Have your objects been tampered with? The Problem. By Pete Finnigan Have your objects been tampered with? By Pete Finnigan The Problem How would you know if an attacker had been into your production database and altered any of your database objects or altered some of your

More information

Handling Exceptions. Schedule: Timing Topic 45 minutes Lecture 20 minutes Practice 65 minutes Total

Handling Exceptions. Schedule: Timing Topic 45 minutes Lecture 20 minutes Practice 65 minutes Total Handling Exceptions Schedule: Timing Topic 45 minutes Lecture 20 minutes Practice 65 minutes Total Objectives After completing this lesson, you should be able to do the following: Define PL/SQL exceptions

More information