=====Oracle Apex 5.0.4 ( 19.2) mit der Oracle Datenbank 12c (18c/19c) - Installation===== **Seit 12.July.2016 ist die Version 5.0.4 verfügbar, ab April 2019 die 19.1 , seit November 2019 die 19.2** Oracle Apex - Oracle Application Express ermöglicht es in der Datenbank deklarativ und auf Basis von SQL und PL/SQL komplexe Webanwendungen zu erstellen. Der gesamte Apex Code liegt dabei in der Datenbank und ist damit voll in die Oracle Welt integriert. Um die Webseite aufrufen zu können, ist allerdings ein Webserver notwendig. Folgende Optionen sind hier möglich: * [[prog:first_steps_oracle_rest_data_service|Oracle REST Data Services]] - früher auch Oracle Application Express Listener - Java Implementierung, kann in einem J2EE compliant Web Server ausgeführt werden * Oracle HTTP Server with mod_plsql - Modul für den Apache Webserver für den Aufruf von PL/SQL Packages - gilt inzwischen unter 12c als veraltet * Embedded PL/SQL Gateway in der Datenbank, damit kein externe Websever notwendig - der Oracle XML DB Protocol Server wird hier in der Datenbank aktiviert und verwendet - die einfachste Lösung Bei der Installation kann unter der reinen notwendigen Apex Laufzeitumgebung (zum Beispiel für die produktive Umgebung) und der Apex Entwicklungsumgebung gewählt werden. Ist die 12c DBConsole im Einsatz, sind auch schon wichtige Einstellungen für die Verwendung des PL/SQL Gateway [[dba:oracle_12c_database_express|Die Oracle 12c Datenbank mit Oracle Database Express administrieren]] vorbereitet. Vor der Installation darauf achten, ob nicht bereits Apex 4.x installiert ist! Wird das nicht benötigt und soll neu mit Apex 5 angefangen werden, zuvor die Version 4 einfach komplett deinstallieren! ---- ==== Installation der Apex Development Umgebung mit dem Embedded PL/SQL Gateway in der Datenbank==== Download Oracle Application Express 5.0.4 von http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html * Oracle Application Express 5.0.4 - All languages - http://download.oracle.com/otn/java/appexpress/apex_5.0.4.zip Ablauf: Software bereitstellen: * Zip apex_5.0.4.zip auspacken, zum Beispiel nach **d:\oracle\** Version 4 entfernen: * Prüfen ob die Version 4 oder gar noch 3 in der DB installiert ist! * Falls noch ein Apex 3 User wie APEX_030000 / FLOWS_030000 aus einer alten Umgebung existiert diesen mit drop user * cascade; löschen * falls ja , d.h. der User APEX_040200 existiert, diesen zuerst entfernen! * Dazu in das APEX 4 Home unter **$ORACLE_HOME\apex** wechseln * Datenbank Umgebung setzen und mit SQL*Plus als User mit sysdba Rechten an der Zieldatenbank anmeldensqlplus / as sysdba -- remove apex @apxremov -- Flow User löschen falls noch exisiert, ansonsten Fehler ignorieren drop user FLOWS_FILES cascade; -- APEX Public user löschen falls noch exisiert, ansonsten Fehler ignorieren drop user APEX_PUBLIC_USER cascade; -- check if some synonyms are there -- create DDL to drop old synonyms select 'drop ' || decode(s.owner, 'PUBLIC', 'PUBLIC SYNONYM ', 'SYNONYM ' || s.owner || '.') || s.synonym_name || ';' as DELETE_ME from dba_synonyms s where table_owner like ('APEX_%') or table_owner like ('FLOW_%') / Wird eine Container Database Umgebung verwandt, Apex aus der CDB löschen und pro PDP installieren, siehe dazu => https://blogs.oracle.com/UPGRADE/entry/apex_in_pdb_does_not Bei Bedarf eigenen Tablespace für APEX anlegen, daran denken das mehr als 400 Tabellen angelegt werden, bei Uniform Tablespaces auf entsprechendes initial achten, wie z.b. 1MB. Apex 5 neu installieren: * Powershell Prompt öffnen und nach **d:\oracle\apex** wechseln * Datenbank Umgebung setzen und mit SQL*Plus als User mit sysdba Rechten an der Zieldatenbank anmelden sqlplus / as sysdba * Aufruf des SQL Scripts für die Installation "@apexins.sql tablespace_apex tablespace_files tablespace_temp images" wie:spool d:\temp\install_apex.log @apexins.sql SYSAUX SYSAUX TEMP /i/ Timing für: Complete Installation Abgelaufen: 00:21:19.59 PL/SQL-Prozedur erfolgreich abgeschlossen. Thank you for installing Oracle Application Express 5.0.4.00.12 Oracle Application Express is installed in the APEX_050000 schema. The structure of the link to the Application Express administration services is as follows: http://host:port/pls/apex/apex_admin (Oracle HTTP Server with mod_plsql) http://host:port/apex/apex_admin (Oracle XML DB HTTP listener with the embedded PL/SQL gateway) http://host:port/apex/apex_admin (Oracle REST Data Services) The structure of the link to the Application Express development interface is as follows: http://host:port/pls/apex (Oracle HTTP Server with mod_plsql) http://host:port/apex (Oracle XML DB HTTP listener with the embedded PL/SQL gateway) http://host:port/apex (Oracle REST Data Services) PL/SQL-Prozedur erfolgreich abgeschlossen. spool off Laufzeit in meiner Testumgebung 21min (i7 Cpu SSD, 1,5 GB memory_target) * Erzeugtes Logfile auf Fehler prüfen * Bei der Installation werden drei neue Schemas angelegt: * **APEX_050000** - The account that owns the Oracle Application Express schema and metadata. * **FLOWS_FILES** - The account that owns the Oracle Application Express uploaded files. * **APEX_PUBLIC_USER** - The minimally privileged account is used for Oracle Application Express configuration with Oracle REST Data Services or Oracle HTTP Server and mod_plsql. Apex User konfigurieren: * Den Instance Administrator - Master User für die Apex Verwaltung konfigurieren/Password setzen mit dem Script "apxchpwd.sql", das Password muss komplex sein! @apxchpwd.sql Anleitung beachten und Password auch gut merken .-)! [[prog:first_steps_oracle_rest_data_service|ORDS]] vorbereiten: * **APEX_LISTENER** und **APEX_PUBLIC_USER** User anlegen mit:@apex_rest_config.sql * **APEX_PUBLIC_USER** User entsperrenalter user APEX_PUBLIC_USER identified by APEX_PUBLIC_USER account unlock; In der Produktion ein besseres Password wählen!! => Nach diesem Schritten kann nun der ORDS installiert werden um auf Apex zuzugreifen => [[prog:first_steps_oracle_rest_data_service|Oracle ORDS 3.0 (Oracle REST Data Services) mit APEX 5.0 und als REST Interface verwenden]] Nur falls wirklich das Embedded PL/SQL Gateway verwandt werden soll: * Embedded PL/SQL Gateway für den Aufruf der Webseiten mit den Script "apex_epg_config.sql " konfigurieren, dazu muss der Pfad in der das Apex Source Verzeichnis liegt angegeben werden:@apex_epg_config.sql d:\oracle Das Script lädt die Bilder von Apex in die Datenbank, das dauert etwas. * Embedded PL/SQL Gateway aktivieren ALTER USER ANONYMOUS ACCOUNT UNLOCK; -- http SELECT DBMS_XDB.GETHTTPPORT FROM DUAL; exec DBMS_XDB.SETHTTPPORT(8080); --https select dbms_xdb_config.gethttpsport () from dual; exec dbms_xdb_config.sethttpsport (5500); * Netzwerk Rechte vergeben : BEGIN DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE( host => '*', ace => xs$ace_type(privilege_list => xs$name_list('connect'), principal_name => 'apex_050000', principal_type => xs_acl.ptype_db)); END; / Nur in Testumgebungen! In Produktion feiner einstellen! * An der Admin Oberfläche ( https://host:port/apex/apex_admin ) als Admin mit dem zuvor vergebenen Passwort anmelden. Quellen => Installation : https://docs.oracle.com/cd/E59726_01/install.50/e39144/epg.htm#HTMIG29350 ===Probleme=== **Login nicht möglich ("The server xxx requires a username and password. The server says: XDB".)** * https://community.oracle.com/thread/643846 * https://community.oracle.com/message/13055698 * https://community.oracle.com/message/11155775#11155775 In meinen Fall => darauf achten das nicht zuvor doch noch eine alte APEX Version in der DB installiert war! Löschen: DROP USER APEX_040200 CASCADE; -- fehler??? --EXEC DBMS_NETWORK_ACL_ADMIN.DELETE_PRIVILEGE('power_users.xml', 'FLOWS_030000'); -- startup force Nächste Problem beim Einsatz mit dem ORDS: "There are issues with the configuration of the Static Files in your environment. Please consult the "Configuring Static File Support" section in the Application Express Installation Guide." see => https://community.oracle.com/message/13014173#13014173 APEX_LISTENER und APEX_PUBLIC_USER User angelegt mit: @apex_rest_config.sql User Passwörter in der ORDS Propertie Datei gepfegt und ORDS neu initialisert mit(im ORDS HOME): java -jar ords.war install Anweisungen befolgen! Danach ist der Fehler verschwunden! ---- ==== Anmerkungen zu Installation auf einer neuen Oracle XE 11g Installation==== Leider steht die 12c noch nicht als XE Edition zur Verfügung. Nach der XE Installation wird sofort die bestehende Apex (APEX_040000) Umgebung auf die 5.03 Apex Umgebung gehoben. Da es sich um eine neuen Umgebung handelt wird Apex gelöscht und neu installiert Apex Download apex_5.0.3.zip nach C:\oracle\apex (=APEX_HOME) entpackt. APEX User und alle alten Synonyme zuvor unbedingt löschen: -- sauber entfernen: cd C:\oracle\apex sqlplus / as sysdba @apxremov.sql --pürfen und dann bei Bedarf "Reste" löschen --drop the user -- nur bei Bedarf den User DROP USER APEX_040200 CASCADE; --create DDL to drop old synonyms select 'drop ' || decode(s.owner, 'PUBLIC', 'PUBLIC SYNONYM ', 'SYNONYM ' || s.owner || '.') || s.synonym_name || ';' as DELETE_ME from dba_synonyms s where table_owner in ('APEX_040200') / -- execute the DDL Im ersten Versuch nur den alten Apex User gelöscht, allerdings gabe es dann erhebliche Probleme mit der Neuinstallation mit ungültigen Synoymen. Neu installieren: cd C:\oracle\apex sqlplus / as sysdba -- Install @apexins.sql SYSAUX SYSAUX TEMP /i/ ... Thank you for installing Oracle Application Express 5.0.3.00.03 Oracle Application Express is installed in the APEX_050000 schema. The structure of the link to the Application Express administration services is as follows: http://host:port/pls/apex/apex_admin (Oracle HTTP Server with mod_plsql) http://host:port/apex/apex_admin (Oracle XML DB HTTP listener with the embedded PL/SQL gateway) http://host:port/apex/apex_admin (Oracle REST Data Services) The structure of the link to the Application Express development interface is as follows: http://host:port/pls/apex (Oracle HTTP Server with mod_plsql) http://host:port/apex (Oracle XML DB HTTP listener with the embedded PL/SQL gateway) http://host:port/apex (Oracle REST Data Services) .... -- Images - -- nur C:\oracle vom APEX_HOME angeben !!!, Rest wird ergänzt @apex_epg_config.sql d:\oracle\ .. . Loading images directory: d:\oracle\apex5/images .. -- Password setzen @apxchpwd.sql --Rest Service api vorbereiten @apex_rest_config.sql --Port pürfen SELECT DBMS_XDB.GETHTTPPORT FROM DUAL; -- bei Bedarf setzen EXEC DBMS_XDB.SETHTTPPORT(8080); -- Prüfen ob ein Dispatcher für die XDB zur Verfügung steht und der Local Listener Parameter eingerichtet ist: show parameter dispatchers NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dispatchers string -- falls nicht konfiguriert, XDB einstellen alter system set dispatchers='(PROTOCOL=TCP) (SERVICE=XEXDB)' scope=both sid='*'; -- Den Local Listner Parameter einstellen falls nicht gesetzt alter system set local_listener='10.10.10.110:1521' scope=both sid='*'; -- neustarten, falls es immer noch nicht funktioniert startup force Nach der Installation ist wieder der Standard HTTP Port 8080 gesetzt, theoretisch sollte dann ein Aufruf über https://host:port/apex/apex_admin möglich sein. Alternativ ORDS [[prog:first_steps_oracle_rest_data_service|Oracle ORDS 3.0 (Oracle REST Data Services) mit APEX 5.0 und als REST Interface verwenden]] einsetzen. Sollte sich nun in der Datenbank ein ungültiges Objekt sys.htmldb_system befinden => siehe Metalink Node: HTMLDB_SYSTEM Package is Invalid After Removing APEX (Doc ID 1231863.1), hier wird das Package einfach gelöscht. ---- ==== Quellen ==== * http://www.oracle.com/technetwork/developer-tools/apex/documentation/index.html APEX: * http://docs.oracle.com/cd/E59726_01/doc.50/e39147/toc.htm