8 * Table structure for table 'totacct'
10 CREATE TABLE totacct (
11 totacctid INT PRIMARY KEY,
12 username varchar(64) DEFAULT '' NOT NULL,
13 acctdate DATE DEFAULT sysdate NOT NULL,
15 conntotduration NUMERIC(12),
16 connmaxduration NUMERIC(12),
17 connminduration NUMERIC(12),
18 inputoctets NUMERIC(12),
19 outputoctets NUMERIC(12),
20 nasipaddress varchar(15) default NULL
22 CREATE INDEX totacct_acctdate_idx ON totacct (acctdate);
23 CREATE INDEX totacct_nasipaddress_idx ON totacct (nasipaddress);
24 CREATE INDEX totacct_nasondate_idx ON totacct (acctdate, nasipaddress);
25 CREATE INDEX totacct_username_idx ON totacct (username);
26 CREATE INDEX totacct_userondate_idx ON totacct (username, acctdate);
28 CREATE SEQUENCE totacct_seq START WITH 1 INCREMENT BY 1;
30 /* Trigger to emulate a serial # on the primary key */
31 CREATE OR REPLACE TRIGGER totacct_serialnumber
32 BEFORE INSERT OR UPDATE OF totacctid ON totacct
35 if ( :new.totacctid = 0 or :new.totacctid is null ) then
36 SELECT totacct_seq.nextval into :new.totacctid from dual;