|
73 | 73 | - name: Install JDBC Driver |
74 | 74 | run: | |
75 | 75 | wget -q https://download.oracle.com/otn-pub/otn_software/jdbc/233/ojdbc11.jar -O ./lib/ojdbc11.jar |
| 76 | + - name: Upgrade Oracle 11g timezone file to match Instant Client |
| 77 | + run: | |
| 78 | + # Oracle 11g XE ships with DSTv14; Instant Client 21.15 uses v35. |
| 79 | + # Copy newer timezone files into the 11g container and run DBMS_DST |
| 80 | + # to upgrade the server so it matches the client. |
| 81 | + ORACLE_CONTAINER=$(docker ps --filter "ancestor=gvenzl/oracle-xe:11" -q) |
| 82 | + CLIENT_ZONEINFO=/opt/oracle/instantclient_21_15/oracore/zoneinfo |
| 83 | + ls -la "$CLIENT_ZONEINFO" || ls -la /opt/oracle/instantclient_21_15/ |
| 84 | + # Copy newer timezone files from the Instant Client into the 11g container |
| 85 | + for f in "$CLIENT_ZONEINFO"/timezlrg_*.dat "$CLIENT_ZONEINFO"/timezone_*.dat; do |
| 86 | + [ -f "$f" ] || continue |
| 87 | + docker cp "$f" "$ORACLE_CONTAINER":/u01/app/oracle/product/11.2.0/xe/oracore/zoneinfo/ |
| 88 | + done |
| 89 | + docker exec "$ORACLE_CONTAINER" ls -la /u01/app/oracle/product/11.2.0/xe/oracore/zoneinfo/ |
| 90 | + # Run DBMS_DST to upgrade the database timezone version |
| 91 | + sqlplus -S sys/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME} as sysdba <<'SQL' |
| 92 | + SET SERVEROUTPUT ON |
| 93 | + SELECT version FROM v$timezone_file; |
| 94 | + DECLARE |
| 95 | + l_tz_version PLS_INTEGER; |
| 96 | + BEGIN |
| 97 | + l_tz_version := DBMS_DST.get_latest_timezone_version; |
| 98 | + DBMS_OUTPUT.PUT_LINE('Latest timezone version available: ' || l_tz_version); |
| 99 | + DBMS_DST.begin_prepare(l_tz_version); |
| 100 | + DBMS_DST.end_prepare; |
| 101 | + DBMS_DST.begin_upgrade(l_tz_version); |
| 102 | + END; |
| 103 | + / |
| 104 | + SQL |
| 105 | + # Restart the database to complete begin_upgrade |
| 106 | + docker exec "$ORACLE_CONTAINER" bash -c 'echo "shutdown immediate; |
| 107 | + startup; |
| 108 | + exit" | sqlplus -S / as sysdba' |
| 109 | + sqlplus -S sys/${DATABASE_SYS_PASSWORD}@${DATABASE_NAME} as sysdba <<'SQL' |
| 110 | + SET SERVEROUTPUT ON |
| 111 | + DECLARE |
| 112 | + l_failures PLS_INTEGER; |
| 113 | + BEGIN |
| 114 | + DBMS_DST.upgrade_database(l_failures); |
| 115 | + DBMS_DST.end_upgrade(l_failures); |
| 116 | + DBMS_OUTPUT.PUT_LINE('Upgrade failures: ' || l_failures); |
| 117 | + END; |
| 118 | + / |
| 119 | + SELECT version FROM v$timezone_file; |
| 120 | + SQL |
76 | 121 | - name: Create database user |
77 | 122 | run: | |
78 | 123 | ./ci/setup_accounts.sh |
|
0 commit comments