Commit c76122c4 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Script de migration : nouvelle génération

parent d1d7f498
Loading
Loading
Loading
Loading
+26 −26
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@
	QUESTION : VARCHAR2(2000) => varchar(2000)
	REPONSE : VARCHAR2(2000) => varchar(2000)
	ORDRE : NUMBER(22) => bigint
[13] TABLE FICHIER (owner: SYGAL, 5124 rows)
[13] TABLE FICHIER (owner: SYGAL, 5197 rows)
	ID : NUMBER(22) => bigint
	UUID : VARCHAR2(60) => varchar(60)
	NATURE_ID : NUMBER(22) => bigint
@@ -174,7 +174,7 @@
	HISTO_DESTRUCTEUR_ID : NUMBER(22) => bigint
	CODE_TYPE_FINANCEMENT : VARCHAR2(8) => varchar(8)
	LIBELLE_TYPE_FINANCEMENT : VARCHAR2(100) => varchar(100)
[16] TABLE IMPORT_LOG (owner: SYGAL, 114672 rows)
[16] TABLE IMPORT_LOG (owner: SYGAL, 126227 rows)
	TYPE : VARCHAR2(128) => varchar(128)
	NAME : VARCHAR2(128) => varchar(128)
	SUCCESS : NUMBER(1) => boolean
@@ -292,7 +292,7 @@
	EMAIL : VARCHAR2(256) => varchar(256)
	ETAT : VARCHAR2(1) => varchar(1)
	CODE : VARCHAR2(19) => varchar(19)
[31] TABLE METADONNEE_THESE (owner: SYGAL, 590 rows)
[31] TABLE METADONNEE_THESE (owner: SYGAL, 640 rows)
	ID : NUMBER(22) => bigint
	THESE_ID : NUMBER(22) => bigint
	TITRE : VARCHAR2(2048) => varchar(2048)
@@ -365,7 +365,7 @@
[41] TABLE PROFIL_TO_ROLE (owner: SYGAL, 149 rows)
	PROFIL_ID : NUMBER(38) => bigint
	ROLE_ID : NUMBER(38) => bigint
[42] TABLE RAPPORT (owner: SYGAL, 1081 rows)
[42] TABLE RAPPORT (owner: SYGAL, 1151 rows)
	ID : NUMBER(22) => bigint
	THESE_ID : NUMBER(22) => bigint
	FICHIER_ID : NUMBER(22) => bigint
@@ -378,7 +378,7 @@
	HISTO_MODIFICATION : DATE(7) => timestamp
	HISTO_DESTRUCTION : DATE(7) => timestamp
	TYPE_RAPPORT_ID : NUMBER(22) => bigint
[43] TABLE RAPPORT_VALIDATION (owner: SYGAL, 59 rows)
[43] TABLE RAPPORT_VALIDATION (owner: SYGAL, 81 rows)
	ID : NUMBER(22) => bigint
	TYPE_VALIDATION_ID : NUMBER(22) => bigint
	RAPPORT_ID : NUMBER(22) => bigint
@@ -484,7 +484,7 @@
	HISTO_MODIFICATEUR_ID : NUMBER(22) => bigint
	HISTO_DESTRUCTION : DATE(7) => timestamp
	HISTO_DESTRUCTEUR_ID : NUMBER(22) => bigint
[53] TABLE SOUTENANCE_MEMBRE (owner: SYGAL, 904 rows)
[53] TABLE SOUTENANCE_MEMBRE (owner: SYGAL, 979 rows)
	ID : NUMBER(22) => bigint
	PROPOSITION_ID : NUMBER(22) => bigint
	GENRE : VARCHAR2(1) => varchar(1)
@@ -671,7 +671,7 @@
	HISTO_MODIFICATION : DATE(7) => timestamp
	HISTO_DESTRUCTEUR_ID : NUMBER(22) => bigint
	HISTO_DESTRUCTION : DATE(7) => timestamp
[65] TABLE TMP_ACTEUR (owner: SYGAL, 72139 rows)
[65] TABLE TMP_ACTEUR (owner: SYGAL, 72174 rows)
	INSERT_DATE : DATE(7) => timestamp
	ID : VARCHAR2(64) => varchar(64)
	ETABLISSEMENT_ID : VARCHAR2(64) => varchar(64)
@@ -705,7 +705,7 @@
	SOURCE_ID : VARCHAR2(64) => varchar(64)
	SOURCE_CODE : VARCHAR2(64) => varchar(64)
	SOURCE_INSERT_DATE : DATE(7) => timestamp
[68] TABLE TMP_ETABLISSEMENT (owner: SYGAL, 2454 rows)
[68] TABLE TMP_ETABLISSEMENT (owner: SYGAL, 2460 rows)
	INSERT_DATE : DATE(7) => timestamp
	ID : VARCHAR2(64) => varchar(64)
	ETABLISSEMENT_ID : VARCHAR2(64) => varchar(64)
@@ -729,7 +729,7 @@
	SOURCE_INSERT_DATE : DATE(7) => timestamp
	CODE_TYPE_FINANCEMENT : VARCHAR2(8) => varchar(8)
	LIBELLE_TYPE_FINANCEMENT : VARCHAR2(100) => varchar(100)
[70] TABLE TMP_INDIVIDU (owner: SYGAL, 34098 rows)
[70] TABLE TMP_INDIVIDU (owner: SYGAL, 34110 rows)
	INSERT_DATE : DATE(7) => timestamp
	ID : VARCHAR2(64) => varchar(64)
	ETABLISSEMENT_ID : VARCHAR2(64) => varchar(64)
@@ -766,7 +766,7 @@
	LIB_ROJ : VARCHAR2(200) => varchar(200)
	LIC_ROJ : VARCHAR2(50) => varchar(50)
	SOURCE_INSERT_DATE : DATE(7) => timestamp
[73] TABLE TMP_STRUCTURE (owner: SYGAL, 2909 rows)
[73] TABLE TMP_STRUCTURE (owner: SYGAL, 2915 rows)
	INSERT_DATE : DATE(7) => timestamp
	ID : VARCHAR2(64) => varchar(64)
	ETABLISSEMENT_ID : VARCHAR2(64) => varchar(64)
@@ -807,7 +807,7 @@
	DAT_TRANSFERT_DEP : DATE(7) => timestamp
	SOURCE_INSERT_DATE : DATE(7) => timestamp
	CORRECTION_EFFECTUEE : VARCHAR2(30) => varchar(30)
[75] TABLE TMP_THESE_ANNEE_UNIV (owner: SYGAL, 46208 rows)
[75] TABLE TMP_THESE_ANNEE_UNIV (owner: SYGAL, 46210 rows)
	INSERT_DATE : DATE(7) => timestamp
	ID : VARCHAR2(64) => varchar(64)
	ETABLISSEMENT_ID : VARCHAR2(64) => varchar(64)
@@ -880,7 +880,7 @@
	HISTO_DESTRUCTEUR_ID : NUMBER(22) => bigint
	STRUCTURE_ID : NUMBER(22) => bigint
	RNSR_ID : VARCHAR2(128) => varchar(128)
[84] TABLE USER_TOKEN (owner: SYGAL, 6 rows)
[84] TABLE USER_TOKEN (owner: SYGAL, 9 rows)
	ID : NUMBER(22) => bigint
	USER_ID : NUMBER(22) => bigint
	TOKEN : VARCHAR2(256) => varchar(256)
@@ -957,27 +957,27 @@
	DESC_NON_FRANCHIE : VARCHAR2(250) => varchar(250)
	DESC_SANS_OBJECTIF : VARCHAR2(250) => varchar(250)
----------------------------------------------------------
Total number of rows: 696538
Total number of rows: 708447

Top 10 of tables sorted by number of rows:
	[1] TABLE API_LOG has 137285 rows
	[2] TABLE IMPORT_LOG has 114672 rows
	[3] TABLE TMP_ACTEUR has 72139 rows
	[2] TABLE IMPORT_LOG has 126227 rows
	[3] TABLE TMP_ACTEUR has 72174 rows
	[4] TABLE ACTEUR has 64302 rows
	[5] TABLE TMP_THESE_ANNEE_UNIV has 46208 rows
	[5] TABLE TMP_THESE_ANNEE_UNIV has 46210 rows
	[6] TABLE THESE_ANNEE_UNIV has 44322 rows
	[7] TABLE INDIVIDU has 36507 rows
	[8] TABLE INDIVIDU_RECH has 36507 rows
	[9] TABLE TMP_INDIVIDU has 34098 rows
	[9] TABLE TMP_INDIVIDU has 34110 rows
	[10] TABLE DOCTORANT has 12754 rows
Top 10 of largest tables:
	[1] TABLE TYPE_RAPPORT: 0 MB (3 rows)
	[2] TABLE TYPE_VALIDATION: 0 MB (15 rows)
	[3] TABLE WF_ETAPE: 0 MB (22 rows)
	[4] TABLE UNITE_RECH: 0 MB (512 rows)
	[5] TABLE USER_TOKEN: 0 MB (6 rows)
	[6] TABLE VARIABLE: 0 MB (31 rows)
	[7] TABLE VERSION_FICHIER: 0 MB (6 rows)
	[1] TABLE UNITE_DOMAINE_LINKER: 0 MB (102 rows)
	[2] TABLE USER_TOKEN: 0 MB (9 rows)
	[3] TABLE TMP_VARIABLE: 0 MB (28 rows)
	[4] TABLE VARIABLE: 0 MB (31 rows)
	[5] TABLE VERSION_FICHIER: 0 MB (6 rows)
	[6] TABLE UNITE_RECH: 0 MB (512 rows)
	[7] TABLE TYPE_RAPPORT: 0 MB (3 rows)
	[8] TABLE TYPE_STRUCTURE: 0 MB (3 rows)
	[9] TABLE TMP_VARIABLE: 0 MB (28 rows)
	[10] TABLE UNITE_DOMAINE_LINKER: 0 MB (102 rows)
	[9] TABLE WF_ETAPE: 0 MB (22 rows)
	[10] TABLE TYPE_VALIDATION: 0 MB (15 rows)
+31 −31
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
  <head>
  <title>Ora2Pg - Database Migration Report</title>
  <meta HTTP-EQUIV="Generator" CONTENT="Ora2Pg v20.0">
  <meta HTTP-EQUIV="Date" CONTENT="Thu Jul  1 14:10:18 2021">
  <meta HTTP-EQUIV="Date" CONTENT="Tue Jul  6 14:57:54 2021">
  <style>
body {
	margin: 30px 0;
@@ -100,7 +100,7 @@ h2 {
<table>
<tr><th>Version</th><td>Oracle Database 11g Enterprise Edition Release 11.2.0.3.0</td></tr>
<tr><th>Schema</th><td>SYGAL</td></tr>
<tr><th>Size</th><td>1055.50 MB</td></tr>
<tr><th>Size</th><td>1057.56 MB</td></tr>
</table>
</div>
<div id="content">
@@ -115,7 +115,7 @@ h2 {
<tr><td class="object_name">PACKAGE BODY</td><td style="text-align: center;">2</td><td style="text-align: center;">0</td><td style="text-align: center;">294.1</td><td>Total size of package code: 31229 bytes. Number of procedures and functions found inside those packages: 27.</td><td class="detail">ucbn_ldap.alias2mail: 3.2<br>ucbn_ldap.etu2eppn: 3.1<br>ucbn_ldap.etu2mail: 3.1<br>ucbn_ldap.free: 9<br>ucbn_ldap.get: 84.4<br>ucbn_ldap.getinvites: 88.3<br>ucbn_ldap.hid2alias: 3.1<br>ucbn_ldap.hid2eppn: 3.1<br>ucbn_ldap.hid2mail: 3.1<br>ucbn_ldap.hidisprimaryteacher: 3.1<br>ucbn_ldap.hidisteacher: 3.1<br>ucbn_ldap.ldap_connect: 24<br>ucbn_ldap.oid2alias: 3.5<br>ucbn_ldap.oid2eppn: 3.5<br>ucbn_ldap.oid2mail: 3.5<br>ucbn_ldap.uid2alias: 3.1<br>ucbn_ldap.uid2cn: 3.1<br>ucbn_ldap.uid2givenname: 3.1<br>ucbn_ldap.uid2gn: 3.4<br>ucbn_ldap.uid2mail: 3.2<br>ucbn_ldap.uid2sn: 3.1<br>ucbn_ldap.version: 3<br>unicaen_oracle.comprise_entre: 3.6<br>unicaen_oracle.liked: 3<br>unicaen_oracle.str_find: 3.2<br>unicaen_oracle.str_reduce: 6<br>unicaen_oracle.implode: 3.2<br></td></tr>
<tr><td class="object_name">SEQUENCE</td><td style="text-align: center;">63</td><td style="text-align: center;">0</td><td style="text-align: center;">6.3</td><td>Sequences are fully supported, but all call to sequence_name.NEXTVAL or sequence_name.CURRVAL will be transformed into NEXTVAL('sequence_name') or CURRVAL('sequence_name').</td><td class="detail"></td></tr>
<tr><td class="object_name">SYNONYM</td><td style="text-align: center;">0</td><td style="text-align: center;">0</td><td style="text-align: center;">0</td><td>SYNONYMs will be exported as views. SYNONYMs do not exists with PostgreSQL but a common workaround is to use views or set the PostgreSQL search_path in your session to access object outside the current schema.</td><td class="detail"></td></tr>
<tr><td class="object_name">TABLE</td><td style="text-align: center;">94</td><td style="text-align: center;">0</td><td style="text-align: center;">9.4</td><td></td><td class="detail">Total number of rows: 748056<br>Top 10 of tables sorted by number of rows:<br>api_log has 137285 rows<br>import_log has 114672 rows<br>tmp_acteur has 72139 rows<br>acteur has 64302 rows<br>z_import_observ_etab_result has 49958 rows<br>tmp_these_annee_univ has 46208 rows<br>these_annee_univ has 44322 rows<br>individu_rech has 36507 rows<br>individu has 36507 rows<br>tmp_individu has 34098 rows<br>Top 10 of largest tables:<br></td></tr>
<tr><td class="object_name">TABLE</td><td style="text-align: center;">94</td><td style="text-align: center;">0</td><td style="text-align: center;">9.4</td><td></td><td class="detail">Total number of rows: 759965<br>Top 10 of tables sorted by number of rows:<br>api_log has 137285 rows<br>import_log has 126227 rows<br>tmp_acteur has 72174 rows<br>acteur has 64302 rows<br>z_import_observ_etab_result has 49958 rows<br>tmp_these_annee_univ has 46210 rows<br>these_annee_univ has 44322 rows<br>individu has 36507 rows<br>individu_rech has 36507 rows<br>tmp_individu has 34110 rows<br>Top 10 of largest tables:<br></td></tr>
<tr><td class="object_name">TRIGGER</td><td style="text-align: center;">1</td><td style="text-align: center;">0</td><td style="text-align: center;">4</td><td>Total size of trigger code: 448 bytes.</td><td class="detail">individu_rech_update: 3<br></td></tr>
<tr><td class="object_name">VIEW</td><td style="text-align: center;">60</td><td style="text-align: center;">2</td><td style="text-align: center;">61.9</td><td>Views are fully supported but can use specific functions.</td><td class="detail">src_acteur: 1.1<br>src_role: 1.2<br>v_import_tab_cols: 1.1<br>v_situ_depot_vc_valid_pres: 1.2<br>v_situ_depot_vc_valid_pres_new: 1.2<br>v_tmp_anomalie: 4.1<br></td></tr>
<tr><th style="text-align: center; border-bottom: 0px; vertical-align: bottom;">Total</th><td style="text-align: center; border-bottom: 0px; vertical-align: bottom;">499</td><td style="text-align: center; border-bottom: 0px; vertical-align: bottom;">17</td><td style="text-align: center; border-bottom: 0px; vertical-align: bottom;">464.60</td><td colspan="2" style="border-bottom: 0px; vertical-align: bottom;">464.60 cost migration units means approximatively 6 man-day(s). The migration unit was set to 5 minute(s)
@@ -166,8 +166,8 @@ h2 {
</ul>
<li>Function ucbn_ldap.free total estimated cost: 9</li>
<ul>
<li>DBMS_ => 2 (cost: 3)</li>
<li>TEST => 2</li>
<li>DBMS_ => 2 (cost: 3)</li>
<li>SIZE => 1</li>
</ul>
<li>Function str_reduce total estimated cost: 6</li>
@@ -200,13 +200,13 @@ h2 {
<li>TEST => 2</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.oid2mail total estimated cost: 3.5</li>
<li>Function ucbn_ldap.oid2eppn total estimated cost: 3.5</li>
<ul>
<li>CONCAT => 5 (cost: 0.1)</li>
<li>TEST => 2</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.oid2eppn total estimated cost: 3.5</li>
<li>Function ucbn_ldap.oid2mail total estimated cost: 3.5</li>
<ul>
<li>CONCAT => 5 (cost: 0.1)</li>
<li>TEST => 2</li>
@@ -226,101 +226,101 @@ h2 {
</ul>
<li>Function unicaen_oracle.implode total estimated cost: 3.2</li>
<ul>
<li>CONCAT => 2 (cost: 0.1)</li>
<li>TEST => 2</li>
<li>CONCAT => 2 (cost: 0.1)</li>
<li>SIZE => 1</li>
<li>NOTFOUND => 1</li>
</ul>
<li>Function ucbn_ldap.uid2mail total estimated cost: 3.2</li>
<li>Function unicaen_oracle.str_find total estimated cost: 3.2</li>
<ul>
<li>CONCAT => 2 (cost: 0.1)</li>
<li>TEST => 2</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.alias2mail total estimated cost: 3.2</li>
<li>Function ucbn_ldap.uid2mail total estimated cost: 3.2</li>
<ul>
<li>CONCAT => 2 (cost: 0.1)</li>
<li>TEST => 2</li>
<li>CONCAT => 2 (cost: 0.1)</li>
<li>SIZE => 1</li>
</ul>
<li>Function unicaen_oracle.str_find total estimated cost: 3.2</li>
<li>Function ucbn_ldap.alias2mail total estimated cost: 3.2</li>
<ul>
<li>CONCAT => 2 (cost: 0.1)</li>
<li>TEST => 2</li>
<li>CONCAT => 2 (cost: 0.1)</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.uid2sn total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>CONCAT => 1 (cost: 0.1)</li>
<li>SIZE => 1</li>
<li>CONCAT => 1 (cost: 0.1)</li>
</ul>
<li>Function ucbn_ldap.uid2alias total estimated cost: 3.1</li>
<li>Function ucbn_ldap.hidisteacher total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>CONCAT => 1 (cost: 0.1)</li>
<li>SIZE => 1</li>
<li>CONCAT => 1 (cost: 0.1)</li>
</ul>
<li>Function ucbn_ldap.hid2mail total estimated cost: 3.1</li>
<li>Function ucbn_ldap.uid2alias total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>SIZE => 1</li>
<li>CONCAT => 1 (cost: 0.1)</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.hid2eppn total estimated cost: 3.1</li>
<li>Function ucbn_ldap.hid2alias total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>CONCAT => 1 (cost: 0.1)</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.uid2cn total estimated cost: 3.1</li>
<li>Function ucbn_ldap.uid2givenname total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>CONCAT => 1 (cost: 0.1)</li>
<li>SIZE => 1</li>
<li>CONCAT => 1 (cost: 0.1)</li>
</ul>
<li>Function ucbn_ldap.hidisprimaryteacher total estimated cost: 3.1</li>
<li>Function ucbn_ldap.etu2mail total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>SIZE => 1</li>
<li>CONCAT => 1 (cost: 0.1)</li>
</ul>
<li>Function ucbn_ldap.hidisteacher total estimated cost: 3.1</li>
<li>Function ucbn_ldap.hidisprimaryteacher total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>CONCAT => 1 (cost: 0.1)</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.etu2mail total estimated cost: 3.1</li>
<li>Function ucbn_ldap.hid2mail total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>SIZE => 1</li>
<li>CONCAT => 1 (cost: 0.1)</li>
</ul>
<li>Function ucbn_ldap.etu2eppn total estimated cost: 3.1</li>
<li>Function ucbn_ldap.hid2eppn total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>CONCAT => 1 (cost: 0.1)</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.uid2givenname total estimated cost: 3.1</li>
<li>Function ucbn_ldap.etu2eppn total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>SIZE => 1</li>
<li>CONCAT => 1 (cost: 0.1)</li>
</ul>
<li>Function ucbn_ldap.hid2alias total estimated cost: 3.1</li>
<li>Function ucbn_ldap.uid2cn total estimated cost: 3.1</li>
<ul>
<li>TEST => 2</li>
<li>SIZE => 1</li>
<li>CONCAT => 1 (cost: 0.1)</li>
<li>SIZE => 1</li>
</ul>
<li>Function ucbn_ldap.version total estimated cost: 3</li>
<li>Function unicaen_oracle.liked total estimated cost: 3</li>
<ul>
<li>TEST => 2</li>
<li>SIZE => 1</li>
</ul>
<li>Function unicaen_oracle.liked total estimated cost: 3</li>
<li>Function ucbn_ldap.version total estimated cost: 3</li>
<ul>
<li>TEST => 2</li>
<li>SIZE => 1</li>
@@ -353,11 +353,11 @@ h2 {
<ul>
<li>CONCAT => 2 (cost: 0.1)</li>
</ul>
<li>View v_import_tab_cols total estimated cost: 1.1</li>
<li>View src_acteur total estimated cost: 1.1</li>
<ul>
<li>CONCAT => 1 (cost: 0.1)</li>
</ul>
<li>View src_acteur total estimated cost: 1.1</li>
<li>View v_import_tab_cols total estimated cost: 1.1</li>
<ul>
<li>CONCAT => 1 (cost: 0.1)</li>
</ul>
+25 −25
Original line number Diff line number Diff line
@@ -10,10 +10,10 @@
[10] TABLE ETABLISSEMENT (owner: SYGAL, 2427 rows)
[11] TABLE ETABLISSEMENT_RATTACH (owner: SYGAL, 180 rows)
[12] TABLE FAQ (owner: SYGAL, 13 rows)
[13] TABLE FICHIER (owner: SYGAL, 5124 rows)
[13] TABLE FICHIER (owner: SYGAL, 5197 rows)
[14] TABLE FICHIER_THESE (owner: SYGAL, 3570 rows)
[15] TABLE FINANCEMENT (owner: SYGAL, 4274 rows)
[16] TABLE IMPORT_LOG (owner: SYGAL, 114672 rows)
[16] TABLE IMPORT_LOG (owner: SYGAL, 126227 rows)
[17] TABLE IMPORT_NOTIF (owner: SYGAL, 1 rows)
[18] TABLE IMPORT_OBSERV (owner: SYGAL, 3 rows)
[19] TABLE IMPORT_OBSERV_RESULT (owner: SYGAL, 62 rows)
@@ -28,7 +28,7 @@
[28] TABLE INFORMATION_LANGUE (owner: SYGAL, 2 rows)
[29] TABLE LISTE_DIFF (owner: SYGAL, 80 rows)
[30] TABLE MAIL_CONFIRMATION (owner: SYGAL, 1437 rows)
[31] TABLE METADONNEE_THESE (owner: SYGAL, 590 rows)
[31] TABLE METADONNEE_THESE (owner: SYGAL, 640 rows)
[32] TABLE NATURE_FICHIER (owner: SYGAL, 20 rows)
[33] TABLE NOTIF (owner: SYGAL, 1 rows)
[34] TABLE NOTIF_MAIL (owner: SYGAL, 2270 rows)
@@ -39,8 +39,8 @@
[39] TABLE PROFIL (owner: SYGAL, 16 rows)
[40] TABLE PROFIL_PRIVILEGE (owner: SYGAL, 542 rows)
[41] TABLE PROFIL_TO_ROLE (owner: SYGAL, 149 rows)
[42] TABLE RAPPORT (owner: SYGAL, 1081 rows)
[43] TABLE RAPPORT_VALIDATION (owner: SYGAL, 59 rows)
[42] TABLE RAPPORT (owner: SYGAL, 1151 rows)
[43] TABLE RAPPORT_VALIDATION (owner: SYGAL, 81 rows)
[44] TABLE RDV_BU (owner: SYGAL, 628 rows)
[45] TABLE ROLE (owner: SYGAL, 174 rows)
[46] TABLE ROLE_PRIVILEGE (owner: SYGAL, 4550 rows)
@@ -50,7 +50,7 @@
[50] TABLE SOUTENANCE_ETAT (owner: SYGAL, 3 rows)
[51] TABLE SOUTENANCE_INTERVENTION (owner: SYGAL, 1 rows)
[52] TABLE SOUTENANCE_JUSTIFICATIF (owner: SYGAL, 284 rows)
[53] TABLE SOUTENANCE_MEMBRE (owner: SYGAL, 904 rows)
[53] TABLE SOUTENANCE_MEMBRE (owner: SYGAL, 979 rows)
[54] TABLE SOUTENANCE_PROPOSITION (owner: SYGAL, 342 rows)
[55] TABLE SOUTENANCE_QUALITE (owner: SYGAL, 15 rows)
[56] TABLE SOUTENANCE_QUALITE_SUP (owner: SYGAL, 4 rows)
@@ -62,17 +62,17 @@
[62] TABLE THESE (owner: SYGAL, 12507 rows)
[63] TABLE THESE_ANNEE_UNIV (owner: SYGAL, 44322 rows)
[64] TABLE TITRE_ACCES (owner: SYGAL, 3673 rows)
[65] TABLE TMP_ACTEUR (owner: SYGAL, 72139 rows)
[65] TABLE TMP_ACTEUR (owner: SYGAL, 72174 rows)
[66] TABLE TMP_DOCTORANT (owner: SYGAL, 12305 rows)
[67] TABLE TMP_ECOLE_DOCT (owner: SYGAL, 40 rows)
[68] TABLE TMP_ETABLISSEMENT (owner: SYGAL, 2454 rows)
[68] TABLE TMP_ETABLISSEMENT (owner: SYGAL, 2460 rows)
[69] TABLE TMP_FINANCEMENT (owner: SYGAL, 3887 rows)
[70] TABLE TMP_INDIVIDU (owner: SYGAL, 34098 rows)
[70] TABLE TMP_INDIVIDU (owner: SYGAL, 34110 rows)
[71] TABLE TMP_ORIGINE_FINANCEMENT (owner: SYGAL, 132 rows)
[72] TABLE TMP_ROLE (owner: SYGAL, 29 rows)
[73] TABLE TMP_STRUCTURE (owner: SYGAL, 2909 rows)
[73] TABLE TMP_STRUCTURE (owner: SYGAL, 2915 rows)
[74] TABLE TMP_THESE (owner: SYGAL, 12431 rows)
[75] TABLE TMP_THESE_ANNEE_UNIV (owner: SYGAL, 46208 rows)
[75] TABLE TMP_THESE_ANNEE_UNIV (owner: SYGAL, 46210 rows)
[76] TABLE TMP_TITRE_ACCES (owner: SYGAL, 3743 rows)
[77] TABLE TMP_UNITE_RECH (owner: SYGAL, 417 rows)
[78] TABLE TMP_VARIABLE (owner: SYGAL, 28 rows)
@@ -81,7 +81,7 @@
[81] TABLE TYPE_VALIDATION (owner: SYGAL, 15 rows)
[82] TABLE UNITE_DOMAINE_LINKER (owner: SYGAL, 102 rows)
[83] TABLE UNITE_RECH (owner: SYGAL, 512 rows)
[84] TABLE USER_TOKEN (owner: SYGAL, 6 rows)
[84] TABLE USER_TOKEN (owner: SYGAL, 9 rows)
[85] TABLE UTILISATEUR (owner: SYGAL, 3875 rows)
[86] TABLE VALIDATION (owner: SYGAL, 2427 rows)
[87] TABLE VALIDITE_FICHIER (owner: SYGAL, 1108 rows)
@@ -89,27 +89,27 @@
[89] TABLE VERSION_FICHIER (owner: SYGAL, 6 rows)
[90] TABLE WF_ETAPE (owner: SYGAL, 22 rows)
----------------------------------------------------------
Total number of rows: 696538
Total number of rows: 708447

Top 10 of tables sorted by number of rows:
	[1] TABLE API_LOG has 137285 rows
	[2] TABLE IMPORT_LOG has 114672 rows
	[3] TABLE TMP_ACTEUR has 72139 rows
	[2] TABLE IMPORT_LOG has 126227 rows
	[3] TABLE TMP_ACTEUR has 72174 rows
	[4] TABLE ACTEUR has 64302 rows
	[5] TABLE TMP_THESE_ANNEE_UNIV has 46208 rows
	[5] TABLE TMP_THESE_ANNEE_UNIV has 46210 rows
	[6] TABLE THESE_ANNEE_UNIV has 44322 rows
	[7] TABLE INDIVIDU_RECH has 36507 rows
	[8] TABLE INDIVIDU has 36507 rows
	[9] TABLE TMP_INDIVIDU has 34098 rows
	[9] TABLE TMP_INDIVIDU has 34110 rows
	[10] TABLE DOCTORANT has 12754 rows
Top 10 of largest tables:
	[1] TABLE TMP_VARIABLE: 0 MB (28 rows)
	[2] TABLE TYPE_RAPPORT: 0 MB (3 rows)
	[3] TABLE UNITE_DOMAINE_LINKER: 0 MB (102 rows)
	[4] TABLE USER_TOKEN: 0 MB (6 rows)
	[1] TABLE USER_TOKEN: 0 MB (9 rows)
	[2] TABLE VARIABLE: 0 MB (31 rows)
	[3] TABLE TYPE_VALIDATION: 0 MB (15 rows)
	[4] TABLE TYPE_RAPPORT: 0 MB (3 rows)
	[5] TABLE UNITE_RECH: 0 MB (512 rows)
	[6] TABLE WF_ETAPE: 0 MB (22 rows)
	[7] TABLE TYPE_STRUCTURE: 0 MB (3 rows)
	[8] TABLE VERSION_FICHIER: 0 MB (6 rows)
	[9] TABLE TYPE_VALIDATION: 0 MB (15 rows)
	[10] TABLE VARIABLE: 0 MB (31 rows)
	[7] TABLE UNITE_DOMAINE_LINKER: 0 MB (102 rows)
	[8] TABLE TMP_VARIABLE: 0 MB (28 rows)
	[9] TABLE TYPE_STRUCTURE: 0 MB (3 rows)
	[10] TABLE VERSION_FICHIER: 0 MB (6 rows)
+3 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ SET client_encoding TO 'UTF8';

\set ON_ERROR_STOP ON

CREATE MATERIALIZED VIEW mv_recherche_these AS
CREATE VIEW mv_recherche_these_mview AS
with acteurs as (
    select a.these_id, i.nom_usuel, INDIVIDU_ID
    FROM individu i
@@ -39,4 +39,6 @@ from these t
         left join acteurs a on a.these_id = t.id
         left join individu ia on ia.id = a.INDIVIDU_ID;

--SELECT create_materialized_view('mv_recherche_these','mv_recherche_these_mview', change with the name of the colum to used for the index);

+106 −0
Original line number Diff line number Diff line
@@ -6,4 +6,110 @@ SET client_encoding TO 'UTF8';

\set ON_ERROR_STOP ON


-- Generated by Ora2Pg, the Oracle database Schema converter, version 20.0
-- Copyright 2000-2019 Gilles DAROLD. All rights reserved.
-- DATASOURCE: dbi:Oracle:host=sygaldb.unicaen.fr;sid=SYGLPROD;port=1523

SET client_encoding TO 'UTF8';

\set ON_ERROR_STOP ON



CREATE TABLE materialized_views (
mview_name text NOT NULL PRIMARY KEY,
view_name text NOT NULL,
iname text,
last_refresh TIMESTAMP WITH TIME ZONE
);

CREATE OR REPLACE FUNCTION create_materialized_view(text, text, text)
RETURNS VOID
AS $$
DECLARE
mview ALIAS FOR $1; -- name of the materialized view to create
vname ALIAS FOR $2; -- name of the related view
iname ALIAS FOR $3; -- name of the colum of mview to used as unique key
entry materialized_views%ROWTYPE;
BEGIN
EXECUTE 'SELECT * FROM materialized_views WHERE mview_name = ' || quote_literal(mview) || '' INTO entry;
IF entry.iname IS NOT NULL THEN
RAISE EXCEPTION 'Materialized view % already exist.', mview;
END IF;

EXECUTE 'REVOKE ALL ON ' || quote_ident(vname) || ' FROM PUBLIC';
EXECUTE 'GRANT SELECT ON ' || quote_ident(vname) || ' TO PUBLIC';
EXECUTE 'CREATE TABLE ' || quote_ident(mview) || ' AS SELECT * FROM ' || quote_ident(vname);
EXECUTE 'REVOKE ALL ON ' || quote_ident(mview) || ' FROM PUBLIC';
EXECUTE 'GRANT SELECT ON ' || quote_ident(mview) || ' TO PUBLIC';
INSERT INTO materialized_views (mview_name, view_name, iname, last_refresh)
VALUES (
quote_literal(mview), 
quote_literal(vname),
quote_literal(iname),
CURRENT_TIMESTAMP
);
IF iname IS NOT NULL THEN
EXECUTE 'CREATE INDEX ' || quote_ident(mview) || '_' || quote_ident(iname)  || '_idx ON ' || quote_ident(mview) || '(' || quote_ident(iname) || ')';
END IF;

RETURN;
END
$$
SECURITY DEFINER
LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION drop_materialized_view(text) RETURNS VOID
AS
$$
DECLARE
mview ALIAS FOR $1;
entry materialized_views%ROWTYPE;
BEGIN
EXECUTE 'SELECT * FROM materialized_views WHERE mview_name = ''' || quote_literal(mview) || '''' INTO entry;
IF entry.iname IS NULL THEN
RAISE EXCEPTION 'Materialized view % does not exist.', mview;
END IF;

IF entry.iname IS NOT NULL THEN
EXECUTE 'DROP INDEX ' || quote_ident(mview) || '_' || entry.iname  || '_idx';
END IF;
EXECUTE 'DROP TABLE ' || quote_ident(mview);
EXECUTE 'DELETE FROM materialized_views WHERE mview_name=''' || quote_literal(mview) || '''';

RETURN;
END
$$
SECURITY DEFINER
LANGUAGE plpgsql ;

CREATE OR REPLACE FUNCTION refresh_full_materialized_view(text) RETURNS VOID
AS $$
DECLARE
mview ALIAS FOR $1;
entry materialized_views%ROWTYPE;
BEGIN
EXECUTE 'SELECT * FROM materialized_views WHERE mview_name = ''' || quote_literal(mview) || '''' INTO entry;
IF entry.iname IS NULL THEN
RAISE EXCEPTION 'Materialized view % does not exist.', mview;
END IF;

IF entry.iname IS NOT NULL THEN
EXECUTE 'DROP INDEX ' || quote_ident(mview) || '_' || entry.iname  || '_idx';
END IF;
EXECUTE 'TRUNCATE ' || quote_ident(mview);
EXECUTE 'INSERT INTO ' || quote_ident(mview) || ' SELECT * FROM ' || entry.view_name;
EXECUTE 'UPDATE materialized_views SET last_refresh=CURRENT_TIMESTAMP WHERE mview_name=''' || quote_literal(mview) || '''';

IF entry.iname IS NOT NULL THEN
EXECUTE 'CREATE INDEX ' || quote_ident(mview) || '_' || entry.iname  || '_idx ON ' || quote_ident(mview) || '(' || entry.iname || ')';
END IF;

RETURN;
END
$$
SECURITY DEFINER
LANGUAGE plpgsql ;

\i ./schema/mviews/MV_RECHERCHE_THESE_mview.sql
Loading