DBA Hub

📋Steps in this guide1/2

APEX Tips : Remove EPG Configuration

This post describes how to remove the APEX EPG configuration.

oracle miscconfigurationintermediate
by OracleDba
13 views
1

Find the Code

When you open the "apxremov2.sql" script you will find a section that looks like this.

Code/Command (click line numbers to comment):

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
-- XDB Cleanup
declare
    cfg XMLType;
    l_dad_list dbms_epg.varchar2_table;
begin

    if '^UPGRADE' = '1' then

        if dbms_xdb.existsresource('/i/') then
          dbms_xdb.deleteresource('/i/', dbms_xdb.delete_recursive_force);
        end if;

        if dbms_xdb.existsresource('/images/') then
          dbms_xdb.deleteresource('/images/',dbms_xdb.delete_recursive_force);
        end if;

        dbms_epg.get_dad_list( l_dad_list );
        for i in 1..l_dad_list.count loop
            if upper(l_dad_list(i)) = 'APEX' then
                dbms_epg.drop_dad('APEX');
            end if;
        end loop;

        cfg := dbms_xdb.cfg_get();

        if cfg.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings/servlet-mapping/servlet-name[text()="PublishedContentServlet"]') = 1 then
            cfg := cfg.deleteXML('/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings/servlet-mapping/servlet-name[text()="PublishedContentServlet"]/..');
        end if;

        if cfg.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list/servlet/servlet-name[text()="PublishedContentServlet"]') = 1 then
            cfg := cfg.deleteXML('/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list/servlet/servlet-name[text()="PublishedContentServlet"]/..');
        end if;

        dbms_xdb.cfg_update(cfg);
        commit;
        dbms_xdb.cfg_refresh;

    end if;

end;
/
2

Run the Edited Code

Either remove the statement surrounding the code, or edit it to make the test positive, so the code actually runs. Here is an example of what I run. Notice the modified statement. Once that is complete, it's worth running the procedure to check everything is OK. That's it! For more information see: - APEX Articles Hope this helps. Regards Tim...

Code/Command (click line numbers to comment):

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
CONN / AS SYSDBA
ALTER SESSION SET CONTAINER = pdb1;

-- XDB Cleanup
declare
    cfg XMLType;
    l_dad_list dbms_epg.varchar2_table;
begin
if '1' = '1' then
if dbms_xdb.existsresource('/i/') then
          dbms_xdb.deleteresource('/i/', dbms_xdb.delete_recursive_force);
        end if;

        if dbms_xdb.existsresource('/images/') then
          dbms_xdb.deleteresource('/images/',dbms_xdb.delete_recursive_force);
        end if;

        dbms_epg.get_dad_list( l_dad_list );
        for i in 1..l_dad_list.count loop
            if upper(l_dad_list(i)) = 'APEX' then
                dbms_epg.drop_dad('APEX');
            end if;
        end loop;

        cfg := dbms_xdb.cfg_get();

        if cfg.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings/servlet-mapping/servlet-name[text()="PublishedContentServlet"]') = 1 then
            cfg := cfg.deleteXML('/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings/servlet-mapping/servlet-name[text()="PublishedContentServlet"]/..');
        end if;

        if cfg.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list/servlet/servlet-name[text()="PublishedContentServlet"]') = 1 then
            cfg := cfg.deleteXML('/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list/servlet/servlet-name[text()="PublishedContentServlet"]/..');
        end if;

        dbms_xdb.cfg_update(cfg);
        commit;
        dbms_xdb.cfg_refresh;

    end if;

end;
/

CONN / AS SYSDBA
ALTER SESSION SET CONTAINER = pdb1;

SET SERVEROUTPUT ON
EXEC SYS.validate_apex;

Comments (0)

Please to add comments

No comments yet. Be the first to comment!