Oracle Apex: Two Ways to Export an Application from Itself

declare
l_files apex_t_export_files;
l_blob blob := empty_blob();
begin
l_files := apex_export.get_application(p_application_id => :app_id);
l_blob := wwv_flow_utilities.clob_to_blob(p_clob => l_files(1).contents);
sys.htp.init;
wwv_flow_utilities.print_download_header(
p_mime_type => ‘appllication/x-sql’,
p_file_name => ‘apex_exp_demo_m1.sql’,
p_is_attachment => true
);
sys.wpg_docload.download_file(l_blob);
end;

declare
l_files apex_t_export_files;
l_export apex_data_export.t_export;
begin
l_files := apex_export.get_application(p_application_id => :app_id);
l_export.content_clob := l_files(1).contents;
l_export.mime_type := ‘application/x-sql’;
l_export.file_name := ‘apex_exp_demo_m2’;
l_export.format := ‘sql’;
l_export.as_clob := true;
apex_data_export.download(l_export);
end;

How to obtain the certificates from HTTPS websites

In order to get websites’ certificates and then add those certificates to an Oracle Wallet you can use a free tool called OpenSSL. Usually it comes installed with Linux and Mac OS X. For windows it is possible to google it and download the installer.

Here are some samples on how to execute OpenSSL and obtains certificates.

  1. Gmail’s SMTP – openssl s_client -starttls smtp -connect smtp.gmail.com:587 -showcerts
  2. For other sites – openssl s_client -connect google.com:443 -showcerts

Get all certificates starting from the second to put into Oracle’s wallet. The first certificate should not be in there.

Now, lets create the Oracle’s wallet.
orapki wallet create -wallet /path -pwd pwd

Then, lets add a certificate to this wallet.
orapki wallet add -wallet /path -trusted_cert -cert /path/cert1.pem

You can see what’s in your certificate.
orapki wallet display -wallet /path

Thanks to this post: https://fuzziebrain.com/content/id/1720/

 

Keeping Javascript in modules inside Oracle Apex

Step 1: create a file using the naming convention myModule.page#.js (i.e. myModule.page110.js)

var myModule = myModule || {};
myModule.page110 = {
pageLoad: function () {
jQuery(‘#P110_ITEM’).focus().select();
},
myOtherFunction: function () {
console.log(‘…’);
}
}

Step 2: after uploading the file to “shared components -> static files”, refer to it in “Apex page -> File URLs” section

#APP_IMAGES#myModule.page110.js

Step 3: any calls to javascript code should now be something like “myModule.page110.pageLoad();”

 

*** Note ***
doesn’t matter if your code is one line only; keep it in a separate file.
https://vmorneau.me/avoid-javascript-mess/

How to manually change Oracle Apex internal Admin’s password

Hi. Here it follows the necessary code to be used as SYSDBA in order to change the internal Admin password of your Oracle Apex installation.

— 1st step
alter session set current_schema = APEX_050100;

— 2nd step
select rtrim(min(user_id)) user_id,
nvl(rtrim(min(email_address)), ‘ADMIN’) email_address
from wwv_flow_fnd_user
where security_group_id = 10
and user_name = upper(‘ADMIN’);

— 3rd step
declare
l_g_security_group_id number := wwv_flow_security.g_security_group_id;
l_g_user varchar2(255) := wwv_flow_security.g_user;
begin
wwv_flow_security.g_security_group_id := 10;
wwv_flow_security.g_user := ‘ADMIN’;

wwv_flow_fnd_user_int.create_or_update_user( p_user_id => 1940108883932253,
p_username => ‘ADMIN’,
p_email => ’email@mail.com’,
p_password => ‘password’ );

commit;
wwv_flow_security.g_security_group_id := l_g_security_group_id;
wwv_flow_security.g_user := l_g_user;
end;
/

Tested on Oracle Apex 5.1. Good luck!

Instalando o APEX 3.2 no Oracle XE

Passo 1: download da versão 3.2.

    http://apex.oracle.com
Passo 2: descompactar em uma pasta temporária qualquer.
    c:\oraclexe\apex
Passo 3: conectar ao Oracle XE, no SCHEMA SYS, apartir do prompt do DOS e da pasta onde foi descompactado o APEX.
    > sqlplus sys/senha as sysdba
Passo 4: executar o primeiro comando da instalação:
    > @apexins SYSAUX SYSAUX TEMP /i/
Passo 5: conectar no SCHEMA SYS novamente e executar o segundo comando:
    > @apxchpwd
    Esse comando irá alterar a senha do usuário ADMIN do APEX.
Passo 6: executar o terceiro e último comando:
    > @apxldimg c:/oraclexe
    Esse comando irá copiar as imagens para o banco de dados. Note que o diretório usado é o diretório logo acima da pasta onde o APEX se encontra. Note também a barra invertida.
Após os passos acima, você pode excluir a pasta onde o APEX foi descompactado. E, claro, acessar http://localhost:8080/apex para acessar o Oracle APEX 3.2.
Teste feito no Windows XP SP3 com o Oracle XE e Oracle APEX 3.2.