1
|
/**
|
2
|
* '$RCSfile$'
|
3
|
* Copyright: 2004 Regents of the University of California and the
|
4
|
* National Center for Ecological Analysis and Synthesis
|
5
|
*
|
6
|
* '$Author: jones $'
|
7
|
* '$Date: 2004-04-02 11:43:13 -0800 (Fri, 02 Apr 2004) $'
|
8
|
* '$Revision: 2101 $'
|
9
|
*
|
10
|
* This program is free software; you can redistribute it and/or modify
|
11
|
* it under the terms of the GNU General Public License as published by
|
12
|
* the Free Software Foundation; either version 2 of the License, or
|
13
|
* (at your option) any later version.
|
14
|
*
|
15
|
* This program is distributed in the hope that it will be useful,
|
16
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18
|
* GNU General Public License for more details.
|
19
|
*
|
20
|
* You should have received a copy of the GNU General Public License
|
21
|
* along with this program; if not, write to the Free Software
|
22
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23
|
*/
|
24
|
|
25
|
/*
|
26
|
* Logging -- table to store metadata and data access log
|
27
|
*/
|
28
|
CREATE TABLE access_log (
|
29
|
entryid NUMBER(20), -- the identifier for the log event
|
30
|
ip_address VARCHAR2(512), -- the ip address inititiating the event
|
31
|
principal VARCHAR2(512), -- the user initiiating the event
|
32
|
docid VARCHAR2(250), -- the document id #
|
33
|
event VARCHAR2(512), -- the code symbolizing the event type
|
34
|
date_logged DATE, -- the datetime on which the event occurred
|
35
|
CONSTRAINT access_log_pk PRIMARY KEY (entryid)
|
36
|
);
|
37
|
|
38
|
CREATE SEQUENCE access_log_id_seq;
|
39
|
CREATE TRIGGER access_log_before_insert
|
40
|
BEFORE INSERT ON access_log FOR EACH ROW
|
41
|
BEGIN
|
42
|
SELECT access_log_id_seq.nextval
|
43
|
INTO :new.entryid
|
44
|
FROM dual;
|
45
|
END;
|
46
|
/
|