Commit bd8069be6d4ef6c89e68a29272995d71774c0bec

Authored by Guilherme Andrade Del Cantoni
1 parent 1fd67075

Ajustes da imagem dos containers Jod, Oracle e MySQL

.gitmodules
... ... @@ -2,3 +2,8 @@
2 2 path = mysql/sei-db-ref-executivo
3 3 url = http://softwarepublico.gov.br/gitlab/mp/sei-db-ref-executivo.git
4 4 branch = sei-v3.0.0-db
  5 +
  6 +[submodule "oracle/sei-db-ref-executivo"]
  7 + path = oracle/sei-db-ref-executivo
  8 + url = http://softwarepublico.gov.br/gitlab/mp/sei-db-ref-executivo.git
  9 + branch = sei-v3.0.0-db
... ...
oracle/Dockerfile
... ... @@ -4,24 +4,23 @@
4 4 # Container preparado e configurado para uso em desenvolvimento e testes
5 5 ################################################################################
6 6  
7   -MAINTAINER PEN - Processo Eletrônico Nacional
8 7 FROM wnameless/oracle-xe-11g
  8 +MAINTAINER Guilherme Andrade Del Cantoni <guilherme.cantoni@planejamento.gov.br>
9 9  
10 10 ############################# INÍCIO DA INSTALACAO #############################
11   -
  11 +ENV TERM xterm
12 12 ENV ORACLE_ALLOW_REMOTE=true
13 13 ENV NLS_LANG=PORTUGUESE_BRAZIL.WE8ISO8859P1
14 14  
15   -COPY pre-install.sql /tmp/pre-install.sql
16   -#todo: Necessário migrar dumps para git submodule
17   -COPY SEI_3.0.0.dmp /tmp/sei.dmp
18   -COPY SIP_3.0.0.dmp /tmp/sip.dmp
19   -COPY sei-config.sql /tmp/sei-config.sql
20   -COPY sip-config.sql /tmp/sip-config.sql
  15 +COPY sei-db-ref-executivo/oracle/sei_2_6_0_BD_Ref_Exec.dmp /tmp/sei_oracle.dmp
  16 +COPY sei-db-ref-executivo/oracle/sip_2_6_0_BD_Ref_Exec.dmp /tmp/sip_oracle.dmp
  17 +
  18 +COPY assets/pre-install.sql /tmp/pre-install.sql
  19 +COPY assets/sei-config.sql /tmp/sei-config.sql
  20 +COPY assets/sip-config.sql /tmp/sip-config.sql
21 21 COPY install.sh /install.sh
22 22  
23 23 RUN bash /install.sh
24   -
25 24 ############################## FIM DA INSTALACAO ###############################
26 25  
27 26 # Imagem de base já configura a exposição das portas 1521 e inicialização do
... ...
oracle/assets/pre-install.sql 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +SHUTDOWN;
  2 +STARTUP MOUNT;
  3 +ALTER SYSTEM ENABLE RESTRICTED SESSION;
  4 +ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
  5 +ALTER DATABASE OPEN;
  6 +ALTER DATABASE CHARACTER SET INTERNAL_USE WE8ISO8859P1;
  7 +ALTER DATABASE NATIONAL CHARACTER SET INTERNAL_USE AL16UTF16;
  8 +SHUTDOWN IMMEDIATE;
  9 +STARTUP;
  10 +
  11 +CREATE TABLESPACE SEI DATAFILE '/u01/app/oracle/oradata/XE/sei.dbf' SIZE 20M AUTOEXTEND ON;
  12 +CREATE TABLESPACE SIP DATAFILE '/u01/app/oracle/oradata/XE/sip.dbf' SIZE 20M AUTOEXTEND ON;
  13 +
  14 +CREATE USER sei_user IDENTIFIED BY sei_user;
  15 +CREATE USER sip_user IDENTIFIED BY sip_user;
  16 +
  17 +GRANT ALL PRIVILEGES TO sei_user;
  18 +GRANT ALL PRIVILEGES TO sip_user;
  19 +
  20 +EXIT;
... ...
oracle/assets/sei-config.sql 0 → 100644
... ... @@ -0,0 +1,4 @@
  1 +update orgao set sigla='ABC', descricao='ORGAO ABC' where id_orgao=0;
  2 +delete from auditoria_protocolo;
  3 +
  4 +EXIT;
... ...
oracle/assets/sip-config.sql 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +update orgao set sigla='ABC', descricao='ORGAO ABC' where id_orgao=0;
  2 +update sistema set pagina_inicial='http://localhost/sip' where sigla='SIP';
  3 +update sistema set pagina_inicial='http://localhost/sei/inicializar.php', web_service='http://localhost/sei/controlador_ws.php?servico=sip' where sigla='SEI';
  4 +update orgao set sin_autenticar='N' where id_orgao=0;
  5 +
  6 +EXIT;
... ...
oracle/install.sh
... ... @@ -5,7 +5,8 @@ set -e
5 5 export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
6 6 export PATH=$ORACLE_HOME/bin:$PATH
7 7 export ORACLE_SID=XE
8   -export NLS_LANG=PORTUGUESE_BRAZIL.WE8MSWIN1252
  8 +#export NLS_LANG=PORTUGUESE_BRAZIL.WE8MSWIN1252
  9 +export NLS_LANG=PORTUGUESE_BRAZIL.WE8ISO8859P1
9 10  
10 11 # Inicialização do servidor
11 12 bash /usr/sbin/startup.sh
... ... @@ -14,11 +15,14 @@ bash /usr/sbin/startup.sh
14 15 sqlplus sys/oracle as sysdba @"/tmp/pre-install.sql"
15 16  
16 17 # Restauração das bases de dados do SEI e SIP
17   -imp system/oracle file=/tmp/sei.dmp full=y
18   -imp system/oracle file=/tmp/sip.dmp full=y
  18 +impdp system/oracle file=/tmp/sei_oracle.dmp full=y
  19 +impdp system/oracle file=/tmp/sip_oracle.dmp full=y
19 20  
20 21 # Configuração das bases de dados do sistema
21 22 sqlplus sei_user/sei_user @"/tmp/sei-config.sql"
22 23 sqlplus sip_user/sip_user @"/tmp/sip-config.sql"
23 24  
  25 +# Remover arquivos temporários
  26 +rm -rf /tmp/*
  27 +
24 28 exit 0
... ...
oracle/pre-install.sql
... ... @@ -1,20 +0,0 @@
1   -SHUTDOWN;
2   -STARTUP MOUNT;
3   -ALTER SYSTEM ENABLE RESTRICTED SESSION;
4   -ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
5   -ALTER DATABASE OPEN;
6   -ALTER DATABASE CHARACTER SET INTERNAL_USE WE8MSWIN1252;
7   -ALTER DATABASE NATIONAL CHARACTER SET INTERNAL_USE AL16UTF16;
8   -SHUTDOWN IMMEDIATE;
9   -STARTUP;
10   -
11   -CREATE TABLESPACE SEI DATAFILE '/u01/app/oracle/oradata/XE/sei.dbf' SIZE 20M AUTOEXTEND ON;
12   -CREATE TABLESPACE SIP DATAFILE '/u01/app/oracle/oradata/XE/sip.dbf' SIZE 20M AUTOEXTEND ON;
13   -
14   -CREATE USER sei_user IDENTIFIED BY sei_user;
15   -CREATE USER sip_ser IDENTIFIED BY sip_user;
16   -
17   -GRANT ALL PRIVILEGES TO sei_user;
18   -GRANT ALL PRIVILEGES TO sip_user;
19   -
20   -EXIT;
oracle/sei-config.sql
... ... @@ -1,4 +0,0 @@
1   -update orgao set sigla='ABC', descricao='ORGAO ABC' where id_orgao=0;
2   -delete from auditoria_protocolo;
3   -
4   -EXIT;
oracle/sei-db-ref-executivo 0 → 160000
... ... @@ -0,0 +1 @@
  1 +Subproject commit 3949e4b5abbc4060ffb9d78441289e4f43eaeac9
... ...
oracle/sip-config.sql
... ... @@ -1,6 +0,0 @@
1   -update orgao set sigla='ABC', descricao='ORGAO ABC' where id_orgao=0;
2   -update sistema set pagina_inicial='http://localhost/sip' where sigla='SIP';
3   -update sistema set pagina_inicial='http://localhost/sei/inicializar.php', web_service='http://localhost/sei/controlador_ws.php?servico=sip' where sigla='SEI';
4   -update orgao set sin_autenticar='N' where id_orgao=0;
5   -
6   -EXIT;