create_db.Oracle 4.15 KB
Newer Older
root's avatar
root committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
## Oracle Database creation script
## Fabien Marquois <fmarquoi@univ-lr.fr>

/Bases/oracle/product/7.3.4.1/bin/sqlplus loginsystem/passwdoracle <<-!
 create user SYMPA identified by SYMPA default tablespace TABLESP
temporary tablespace TEMP;
 grant create session to SYMPA;
 grant create table to SYMPA;
 grant create synonym to SYMPA;
 grant create view to SYMPA;
 grant execute any procedure to SYMPA;
 grant select any table to SYMPA;
 grant select any sequence to SYMPA;
 grant resource to SYMPA;
!

/Bases/oracle/product/7.3.4.1/bin/sqlplus SYMPA/SYMPA <<-!
CREATE TABLE user_table (
        email_user              varchar2(100) NOT NULL,
        gecos_user              varchar2(150),
21
        password_user           varchar2(40),
root's avatar
root committed
22
23
        cookie_delay_user       number,
        lang_user               varchar2(10),
24
	attributes_user		varchar2(500),
25
	data_user	        varchar2(500),	
root's avatar
root committed
26
27
28
29
30
        CONSTRAINT ind_user PRIMARY KEY (email_user)
);
CREATE TABLE subscriber_table (
        list_subscriber         varchar2(50) NOT NULL,
        user_subscriber         varchar2(100) NOT NULL,
31
       	custom_attribute_subscriber varchar2(500),
32
	robot_subscriber        varchar2(80) NOT NULL,
root's avatar
root committed
33
34
35
36
        date_subscriber         date NOT NULL,
	update_subscriber	date,
        visibility_subscriber   varchar2(20),
        reception_subscriber    varchar2(20),
37
	topics_subscriber	varchar2(200),
38
 	bounce_subscriber       varchar2 (35),
salaun's avatar
salaun committed
39
	bounce_score_subscriber number,
40
	bounce_address_subscriber       varchar2 (100),
41
 	comment_subscriber      varchar2 (150),
42
43
	subscribed_subscriber 	number NULL    constraint  cons_subscribed_subscriber CHECK (subscribed_subscriber in (0,1)),
	included_subscriber 	number NULL    constraint  cons_included_subscriber CHECK (included_subscriber in (0,1)),
44
	include_sources_subscriber varchar2(50),
45
        CONSTRAINT ind_subscriber PRIMARY KEY (list_subscriber,user_subscriber,robot_subscriber)
root's avatar
root committed
46
);
47
48
49
CREATE TABLE admin_table (
	list_admin 		varchar2(50) NOT NULL,
 	user_admin 		varchar2(100) NOT NULL,
50
 	robot_admin 		varchar2(80) NOT NULL,
51
	role_admin 		varchar2(20) NOT NULL,
52
53
54
	date_admin 		date NOT NULL,
	update_admin 		date,
	reception_admin 	varchar2(20),
55
	visibility_admin 	varchar2(20),
56
	comment_admin 		varchar2(150),
57
58
	subscribed_admin  	number NULL    constraint  cons_subscribed_admin CHECK (subscribed_admin in (0,1)),
	included_admin  	number NULL    constraint  cons_included_admin CHECK (included_admin in (0,1)),
59
60
	include_sources_admin  	varchar2(50),
	info_admin   		varchar2(150),
61
	profile_admin  		varchar2(20),
62
63
64
65
       CONSTRAINT ind_admin PRIMARY KEY (list_admin,user_admin,robot_admin,role_admin)
);

CREATE TABLE netidmap_table (
66
        netid_netidmap              varchar2 (100) NOT NULL,
67
	serviceid_netidmap	    varchar2 (100) NOT NULL,
68
69
	robot_netidmap	            varchar2 (80) NOT NULL,
        email_netidmap              varchar2 (100),
70
        CONSTRAINT ind_netidmap PRIMARY KEY (netid_netidmap, serviceid_netidmap, robot_netidmap)
71
);
72

73
74
75
76
77
78
79
80
81
82
83
84
85
86
CREATE TABLE logs_table (
	id_logs			number NOT NULL,
	date_logs		number NOT NULL,
	robot_logs		varchar2 (80),
	list_logs		varchar2 (50),
	action_logs		varchar2 (50) NOT NULL,
	parameters_logs		varchar2 (100),
	target_email_logs	varchar2 (100),
	user_email_logs		varchar2 (100),
	msg_id_logs		varchar2 (255),
	status_logs		varchar2 (10) NOT NULL,
	error_type_logs		varchar2 (150),
	client_logs		varchar2 (100),
	daemon_logs		varchar2 (10) NOT NULL,
87
	CONSTRAINT ind_logs PRIMARY KEY (id_logs)
88
89
);

90
91
92
93
94
95
96
97
98

CREATE TABLE session_table (
	id_session			number NOT NULL,
	start_date_session		number NOT NULL,
	date_session		        number NOT NULL,
	remote_addr_session		varchar2(60),
	robot_session		        varchar2(80),
	email_session		        varchar2(100),
	hit_session     	        number,
99
	data_session		        varchar2(500),
100
101
	CONSTRAINT ind_session PRIMARY KEY (id_session)
);
102
103
104
105
106
107
108
109
110
111
112
113
114

CREATE TABLE one_time_ticket_table (
	ticket_one_time_ticket		varchar2(30),
	robot_one_time_ticket		varchar2(80),
	email_one_time_ticket		varchar2(100),
	dat_one_time_ticket		number,
	data_one_time_ticket		varchar2(200),
	remote_addr_one_time_ticket	varchar2(60),
	status_addr_one_time_ticket	varchar2(60),
	CONSTRAINT ind_one_time_ticket PRIMARY KEY (ticket_one_time_ticket)
);


root's avatar
root committed
115
!