-
Notifications
You must be signed in to change notification settings - Fork 0
/
25-ords-tuning.sh
68 lines (42 loc) · 1.52 KB
/
25-ords-tuning.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# set -eux
export APEX_ORDS_DIR="$( cd "$(dirname "$0")" ; pwd -P )"
cd "$APEX_ORDS_DIR"
. ./00-set-apex-ords-env.sh
echo "Fazendo os ajustes dos parametros do pool de conexoes do ORDS ..."
sed -i "s# *<\\/properties> *#<entry key=\"jdbc.InitialLimit\">5</entry>\n</properties>#" "${ORDS_CONFIG}/databases/default/pool.xml"
sed -i "s# *<\\/properties> *#<entry key=\"jdbc.MaxLimit\">25</entry>\n</properties>#" "${ORDS_CONFIG}/databases/default/pool.xml"
echo "Desabilitando a nova landing page do ORDS v23+ devido a um bug conhecido que impede a execucao do APEX ..."
sed -i "s# *<\\/properties> *#<entry key=\"misc.defaultPage\">apex</entry>\n</properties>#" "${ORDS_CONFIG}/global/settings.xml"
echo "Ajustes no ORDS concluidos com sucesso!"
cat << EOF > "ords-fix-gateway-user.sql"
set define off
connect sys/${DB_SERVER_PWD}@//${DB_SERVER_IP}:${DB_SERVER_PORT}/${DB_SERVER_SERVICE_NAME} as sysdba
BEGIN
ORDS_ADMIN.CONFIG_PLSQL_GATEWAY(
p_runtime_user => 'ORDS_PUBLIC_USER',
p_plsql_gateway_user => 'APEX_PUBLIC_USER'
);
commit;
END;
/
set define on
QUIT
EOF
cat << EOF > "ords-fix-gateway-user.bat"
@ECHO OFF
SET "CURDIR=%~dp0"
set "JAVA_HOME=%CURDIR%${JAVA_BASE_NAME}"
set "PATH=%JAVA_HOME%\bin;%CURDIR%\sqlcl\bin;%PATH%"
cd "%CURDIR%"
echo.
echo POR FAVOR, NAO FECHE ESTA JANELA. AGUARDE A CONCLUSAO DO PROCESSAMENTO ...
sql -S /nolog @"%CURDIR%ords-fix-gateway-user.sql"
echo.
echo Ajustes no ORDS realizados com sucesso!
echo.
pause
exit
EOF
start "" "ords-fix-gateway-user.bat"
exit