Return apex application schema

Hi
Let's say I have an apex application named "ABC" based in the schema "ABC".
I also have a schema "XYZ" that hold procedure used by every other schema.
For logging purpose, at some point I want to find which application is calling "XYZ".
I would normally use SELECT USER FROM DUAL to return "ABC" which works fine when called from toad, but in this case, because of Apex, the result is "ANONYMOUS".
Also, SELECT SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA') FROM DUAL ; will return "XYZ".
I am out of ideas to find the original apex schema.
Thanks.
Sebastian

To get the app schema, try the <tt>apex_util.get_default_schema</tt> API method.
However its more usual to use the built-in <tt>APP_USER</tt> substitution string to get the identity of the currently authenticated user.
(Please update your forum profile with a better handle than "user13342055".)

Similar Messages

  • Executing queries in another schema in an APEX application

    Hello all,
    I'm using Application Express 2.1.0.00.39 with Oracle Database Express.
    Following this post (Re: Including a SQL GUI in APEX applications I made a page that executes users' queries. The user inputs his SQL statement in a textarea and submits the page, then a new region returning the query results is displayed. Actually I did hardly the same as Vikas did here: http://htmldb.oracle.com/pls/otn/f?p=24317:228:4426360772935581::NO:::
    However my needs are very specific: as there will be a lot of users and all users will have their own schema, I need to execute the queries a user inputs in his own schema and not the default parsing schema.
    I looked around and found a few solutions.
    First, GRANT. But I can't grant the default schema priviledges on all users' schema. It will permit everyone to work on all schemas and I don't want that. I want to force the parsing schema to be the same as the user authentified.
    Next, I found that post: Re: how to connect to another user from a named pl/sql block. I tried the EXECUTE IMMEDIATE but it won't work with the CONNECT statement.
    Finally I found that post: Change Parsing Schema dynamically? I tried to put the ALTER SESSION in a process. The success message appears, meaning the statement was executed successfully. But the query in input is still executed in the APEX default parsing schema. Then I tried to put the ALTER SESSION statement in the Report (which is a PL/SQL function body returning a SQL query), like that:
    BEGIN
    EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA=:APP_USER';
    RETURN v('P2_QRY_TEXT');
    END;
    It didn't work either.
    What should be the best practice for my problem? Is there anyway to do what I want?
    Thanks,

    Re-thinking my solution:
    Instead of having the package for each user, make 1 schema hold the package (whichever represents your system and not a user). Then declare the package to run as AUTHID CURRENT USER, which should make the calling schema's privileges be active. That way you avoid the hassle of having the manage 1 package for each user.
    User Shema ===(SQL QUERY)==> Your System's Schema ==(QUERY) ===> Your Package w/ Authid Current User ==(Dynamic SQL Execution) ==> END
    For your package, you might want to consider implementing/simulating variable argument lists, so that you can provide binds if necessary. You would just match up the binds within the query (using dbms_sql would be the only way, execute immediate does not give supporting query information) to the corresponding arguments.
    I'm not sure what your goal is, but at least you have a direction to run in/at.

  • Can multiple APEX application use the same parsing schema?

    Hi,
    I have 4.2 APEX thru pl/sql Gatewat, 11gr2 DB and using theme 24.
    Due to the APEX limitation for version control I would be splitting 1 big ERP applications into 24 different APEX applications and each application would be considered as 1 unit for version control.
    I have about 800 tables and I would assume that all of these would need to be stored in 1 schema since a lot of these table are linked thru FK.
    Can I have multiple APEX APPS using the same parsing schema? or is there a better way to do this?
    Thanks in advance!

    Hi,
    Multiple applications can have same (one) parsing schema.
    You can test that on e.g. apex.oracle.com, where normally you have only one schema and you create multiple applications and all use that same schema.
    Regards,
    Jari
    My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
    Twitter: http://www.twitter.com/jariolai
    Edited by: jarola on Jan 28, 2013 7:15 PM

  • Bugreport: Apex 4.2.1 Button 'Return to application' doesn't return to app

    Hi there,
    I think there is a bug, when searching for a page number that doesn't exist in the application (e.g. typing error).
    When you edit a page and enter a page number where the page doesn't exist (that means in Field "go_to_page"), the error "Error processing condition. ORA-01403: no data found" appears correctly, but with button 'Return to application' you don't come back to the application.
    The same behavior is when you enter a non-existing page number in "Search Application" (P0_SEARCH) on the overview page of an application
    e.g. http://apex.oracle.com/pls/otn/
    WS: uBrennerDemo
    demo/demo
    Application: 61765 (Demo01)
    go to page: 5
    Regards Uli

    I get this a lot - it's frustrating!

  • Apex on one database, application schema on another database

    Hi Forum
    I need your help to let me whether following scenario is possible in Apex or not.
    Currently we have a database that has application schema running on server A
    We want to install another Database on another server ( server B) and install and configure apex on that.
    Can we configure Apex that we installed on B access to database on server A?
    if yes, can you please provide some hints how to do that or you can provide a link to web page.
    Sincerely

    Hello,
    Yes you can achieve that by using database links, take a look at this link for the syntax -
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_56a.htm#2061507
    you can then query etc over the link -
    SELECT * FROM employees@remotedb;Note that there will be a performance overhead in operating on the remote data rather than having it 'local', so for certain data (like lookups etc) you might want to consider the use of materialized views to store a local copy of the data.
    Hope this helps,
    John.
    http://jes.blogs.shellprompt.net
    http://www.apex-evangelists.com

  • APEX application deployment

    Hi All,
    I will soon be exporting my first APEX application from a development database to a test database. I do not want to export the data which the application is built on as the development database contains sample data instead of the "real" data. Before exporting my application, I will of course install APEX 3.2.1 in the test environment and then import the "real" data into the test database so that once the application has been exported and installed in the new environment, the APEX application will already have its data in place.
    On page 14-12 in Chapter 14 of the Oracle Application Express Application Builder User's Guide, I saw the following section:
    Exporting an Application
    When you export an application, Oracle Application Express generates a text file containing PL/SQL API calls.
    To export an application:
    1. Navigate to the Export page:
    a. On the Workspace home page, click the Application Builder icon.
    b. Select an application.
    c. On the Application home page, click Export/Import.
    d. On the Export/Import page, click Export and then click Next.
    2. From Application, select the application to be exported.
    3. From File Format, select how rows in the export file will be formatted:
    ■ Choose UNIX to have the resulting file contain rows delimited by line feeds.
    ■ Choose DOS to have the resulting file contain rows delimited by carriage
    returns and line feeds.
    4. From Owner Override, optionally select another owner. By default, the application is owned by the owner identified in the application attribute owner.
    5. From Build Status Override, select one of the following:
    ■ Run Application Only - Developers can only run an application
    ■ Run and Build Application - Developers can both run and edit an application
    Selecting Run Application Only is an effective way to protect an application from modifications from other developers.
    6. From Debugging, select one of the following:
    ■ Yes exports the application with debugging enabled.
    ■ No exports the application with debugging disabled.
    7. From Exporting Supporting Object Definitions, specify whether to export
    supporting object definitions with your application.
    8. From Export Comments, specify whether to export comments for this application.
    See "Adding Developer Comments" on page 6-22.
    9. Use the As of field to export your application as it was previously defined. Specify the number of minutes in the field provided.
    10. Click Export Application
    Since I do not have any images, themes, static files, workspace users, cascading style sheets, etc, to export, it makes no sense to use the “Packaged Application” method to perform the export. All I need is the application definition that contains all my interactive reports, forms, etc.
    The next step would then be to Import the application into the target Oracle Application Express instance and install the application.
    This method should be OK for my needs, right?
    Thanks

    By simply doing an application export, all you will export is the metadata associated with your application (page definitions, items, processes, validations etc).
    No "Customer Data" will be exported neither will any tables or PL/SQL packages that are owned by your parsing schema.
    If you aim is simply to export the APEX application and no tables, pl/sql units, data etc, then doing a simple application export should be good enough. Thats all we ever do and then add the PL/SQL units / table data on top as additional scripts.
    Hope that helps
    Duncs
    http://djmein.blogspot.com
    As a courtesy, please remember to mark helpful or correct responses accordingly :)

  • Unit testing PL/SQL used in APEX application

    question from my customer :
    I am developing an application in Oracle Application Express and am working on unit tests for the PL/SQL stored procedures and packages that are stored in the underlying database and that are used by the APEX application. These unit tests should run within the SQL Developer Unit Test framework.
    The problem is that some of the PL/SQL code stored in the database uses functions like NV('APPLICATION_ITEM') to access items in the apex application. These do not return any values when I try to execute the PL/SQL within the unit test framework, ie through the backend. While it is good that the NV function does not error, NULL do not really work well in my scenario either (for example when the result of this functions is inserted into a NOT NULL column of a table). I can think of a few workarounds, such as creating my own NV function inside the test schema to return desirable values, but nothing seems a really satisfactory solution. I just wonder if there is any best practice recommendation from Oracle for this scenario - how can I run code that uses APEX-specific functions through the back end. I could not find anything in the APEX documentation for this but I'd be interesting to know if there is any recommendation how to best deal with this case.
    I am using SQL Developer version 4.0.0.13.80

    User[[:digit:]*
    Your PL/SQL Package APIs are poorly designed.
    You need to take Tom Kyte's quote to heart:
    "Application come and application go, but data remains forever"
    In short, you need to separate your database processing code (the stuff you need to unit test) from front-end/middle tier code.
    (repetitiveness is for effect.. not rudeness.)
    As such, The PL/SQL code that you need to 'UNIT TEST' must work without needing to run in APEX.
    The PL/SQL code that you need to 'UNIT TEST' must work without needing to run in .NET.
    The PL/SQL code that you need to 'UNIT TEST' must work without needing to run in JSP.
    The PL/SQL code that you need to 'UNIT TEST' must work without needing to run in Jive.
    The PL/SQL code that you need to 'UNIT TEST' must work without needing to run in Ruby.
    The PL/SQL code that you need to 'UNIT TEST' must work without needing to run in Perl::CGI.
    The PL/SQL code that you need to 'UNIT TEST' must work without needing to run in P9.
    The PL/SQL code that you need to 'UNIT TEST' must work without needing to run in <place latest and greatest thing here>.
    Again, I don't mean to sound rude.  I'm just trying to reinforce the idea that you need to separate database code from middle-tier/front-end stuff.
    Basically, you will need to separate all of your packages into multiple parts.
    a _CORE package (that will be unit tested) that does all the hard work
    an _APEX package for APEX infrastructure (this works with NV()/V(), etc.)
    a _NET package for .NET infrastructure when you need it
    a _JSP package for the JSP infrastructure when you need it
    a _JIVE package for the JIVE infrastructure when you need it
    a _<place latest and greatest thing here> for the <place latest and greatest thing here> when you need it.
    MK

  • APEX Application behaviour in a RAC setup

    Hi
    Caveat first: I'm pretty new to Oracle RAC and just looking into it as an option. We have an APEX application currently running in Oracle 11gR2 single node currently and are considering HA for this.
    My question is: What would be the expected behaviour seen by a User of an APEX application, in the event of a node failure, when running with an OHS / RAC configuration? Will they get "transparent fail-over" and see nothing or will they see an error?
    I appreciate I could post in the APEX forum, but feel that is probably more of a development forum and possibly someone here has had to look at things at this level.
    I have read what I think may be the definitive reference for this:
    http://www.oracle.com/technetwork/developer-tools/apex/learnmore/apex-rac-wp-133532.pdf
    but while it covers most of what I want I don't believe I have found an answer to my question
    This states:
    "The Transparent Application Failover (TAF) feature of Oracle Net Services is a runtime failover for high-availability environments. It enables client applications to automatically reconnect to the database if the connection fails and, optionally, resume a SELECT statement that was in progress. The reconnection happens automatically from within the Oracle Call Interface (OCI) library. For applications that do insert, update or delete transactions, the application must trap the error when the failure occurs, rollback the transaction, and then resubmit. If the application is not written to be TAF aware, the session will get disconnected."
    However (as I understand it) APEX runs in the database and would fail with the database, it isn't a typical "client application" connecting to Oracle via a TAF aware connection pool - it is essentially a large pl/sql package and TAF only covers SELECT statements not packages.
    May be I'm over-reading this and it's simpler than that: APEX/Mod_plsql might just handle it?
    - APEX User/HTTP session state is stored in database APEX: Understanding session state which is available on other nodes
    - Mod_plsql in OHS can detect the error returning and reissues the request to good server and APEX on that instance can retrieve Users/HTTP state and process the request (APEX/RAC doc states mod_plsql can see an error from database and cleanup connection up and form a new connection, but not that it will retry the request for the client into other APEX/DB node).
    I'm really just after a (transparent/non-transparent) statement based on experience, but an outline of how the components behave would be useful.
    Thanks in advance
    Dave

    Hi
    Any chance of getting that link outside of Metalink? - I'm trying to get our customer support id, but no luck at present.
    I'm aware that APEX can run with RAC (as per the link I posted) - I'm really after next level info around behaviour in that environment.
    Thanks
    Dave

  • APEX Application accessing data from two different databases

    Hi All,
    Currently as we all know that APEX Application resides in database and is connected to the schema of that database.
    I want APEX Application to be running and accessing data from two different databases. Elaborating my question,
    Currently, my APEX Production Application is connected with XXXX Schema of DB1 Database(Where APEX Resides). Now I want to add some pages into this APEX Application for REPORT Purpose, But I want to connect this REPORT APEX Pages to get data from Different Schema YYYY for Database DB2.
    Is it possible to configure this scenario?
    The reason for doing this is to avoid the REPORT related (adhoc queries) resource utilization effect on Production DB1 Database.
    Thanks
    Nil

    1. If you do the joining of two or more tables in DB1 then all data is pulled over to DB1 and then the join is executed: so more data over the databaselink and more work for DB1. Better keep the joining stuff where the data resides and just pull exactly that data over that you need.
    2. Don't know about your different block sizes. Seems a nice question for one of the other forums (DBA or SQL).
    3. I mean create synonyms on DB1 for reports VIEWS in DB2.
    Hope all is clear!

  • SSO for Oracle Apex application

    Hi All,
    I am working on the requirement where the client want to implement the SSO for the apex application which are in different workspaces.
    But not using oracle SSO server :(
    The Microsoft active directory is used for authentication.
    Please give me some idea how to implement SSO for these apex applications.
    Thanks & Regards,
    Prutha

    Hi,
    I am trying to implement Single-Sign On for my Apex applications. Below are the requirement steps:
    This is working fine within same WORKSPACE and on single DB, but I need to implement SSO across DB with different workspaces.
    1. I have *2 Databases* DB-1 and DB-2. Both are different and running on different machines.
    2. On Both DB's Apex is configured.
    3. I have to deploy an app which uses internal Application Express account credentials for Login on DB-1
    4. From DB-1, after login, I have to provide a link to open another Apex App deployed on DB-2
    5. All Apex Apps on both DB's are using same Authentication Schemes.
    6. In both DB's I have PAGE SENTRY function for session validation.
    Can we configure Apex only once on both DB servers like RAC. Do we have any admin setting in Apex by which we can achieve th motive.
    Please help me to implement such functionality using only Apex across different DB's and different Workspaces.
    Thanks,
    Ismail
    Edited by: user9536278 on Mar 27, 2012 4:18 AM

  • Oracle dbms.set_role does not work in APEX application

    Hi, in our j2ee applications, we use secure application role. Basically, the data source use the app user schema to connect to the database. the app user only has create session privileges. the database logon trigger will copy a set of attribute to the local secure context. (ip address, session user, client id, application name). The applications explicitly invoke the stored procedure sec_mgr.set_role before any DMLs are executed.
    the sec_mgr.set_role will check the local context attribute , authorize the ip, application name, and set an appreciated role to this session based on session user.
    we want to apply the same framework to the APEX application. First, we change the paring schema to the app schema which only has create session privilege. then we put the plsql code in which sec_mgr.set_role is called in the application builder --> shared components ---> edit security attribute ---> Virtual Private Database (VPD).
    however, we got the error ORA-06565: cannot execute SET ROLE from within stored procedure
    the sec_mgr.set_role is defined as invoker's right(AUTHID CURRENT_USER)
    do i missing something in APEX to get it work?
    Thanks

    Please explain it does not work in APEX? Is the application updating tables that have a trigger? APEX does NOT override trigger actions. Is it possible the values your trigger is looking for are NOT available in your APEX application? Can you post the trigger code here for review?
    Thank you,
    Tony Miller
    Webster, TX
    What if you really were stalking a paranoid schizophrenic... Would they know?
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Integrate an Apex Application with the E-Business Suite 11i

    Hi !
    I'm currently working to get connected to APEX (Application Express 3.2.1.00.11) using an E-Business Suite 11i form function then using the ICX cookie.
    I'm using a document created by Rod West(consultant at Cabot Consulting) to help me doing this connection.
    The document is : http://www.oracle.com/technology/products/database/application_express/pdf/apex_ebs_wp_cabot_consulting.pdf
    I always have errors when I try to get connected using the method suggested in the document.
    The error I have received is :
    ORA-00942: table or view does not exist ORA-00942: table or view does not exist ORA-06512: at "APPS.ICX_SEC", line 2388 ORA-06510: PL/SQL: unhandled user-defined exception
    This error seems to come from wfa_sec.getsession(:P101_USERNAME) used in the Before Header process of the login page(Page101).
    See code here (Figure 10 in the document) :
    BEGIN
    wfa_sec.getsession(:P101_USERNAME);
    :P101_PASSWORD :=
    XXAPX_SECURITY_PKG.generate_hash
    (FND_GLOBAL.user_name);
    IF :P101_PASSWORD IS NOT NULL THEN
    APEX_CUSTOM_AUTH.login(
    P_UNAME => :P101_USERNAME,
    P_PASSWORD => :P101_PASSWORD,
    P_SESSION_ID => v('APP_SESSION'),
    P_APP_PAGE => :APP_ID||':1'
    END IF;
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    I have done a "GRANT EXECUTE ON apps.WFA_SEC" to my APEX Schema, so the APEX Schema should have access to everything used by the package... I have tried to "GRANT EXECUTE ON" ICX_SESSIONS but I still have the same error...
    Do I need to do other "GRANT" ? Have you experienced the same problem ?
    Thanks for your help !

    Hi !
    Yes, I have already created synonyms but I still got the same errors...the error seems to be related to a table used in the package icx_sec...I have tried to grant and create synonym for tables icx_transactions and icx_sessions but I still got the error. Any ideas ?
    I have also tried to use the method (OWA_COOKIE.send) suggested in the 2007 version of the Rod West's document (the method you mentionned in the thread) and I'm able to get connected to my APEX application using the E-Business Menu but I have an intermittent problem with this method.. In fact, some days I'm able to get connected to APEX at the first try but some days I received "Invalid Login Credentials" at the first try and at the second try I get connected...And we haven't found any reasons yet for the intermittent "Invalid Login Credentials" ?
    Have you experienced the same intermittent problem on your side ?
    Thanks !

  • Error when calling a procedure from my apex application

    Hello.
    I want to create a small APEX application that can configure asynchronous change data capture (distributed hotlog) on certain tables.
    Basically, what the application should do is to simply create change tables. Everything else is set up as prerequisite.
    My problem is that when I run the following script from schema apex_cdd (using sqldeveloper) , it works; but if I run it from my apex application by calling it when pressing a button as a pl/sql process, it doen't work.
    BEGIN
    apex_cdc.enable_table_capture
         (     i_owner => 'staging_cdcpub',
              i_change_table_name     => 'g_changeTable',
              i_change_set_name     => 'Source_changeSet',
              i_change_source          => 'orcl01_cs',
              i_source_schema          => 'My_src',
              i_source_table          => 'G',
              i_column_type_list     => 'STARTDATE DATE,STATUS CHAR(1),NAME VARCHAR2(10),ENDDATE DATE,DESCRIPTION VARCHAR2(255),ID NUMBER(8,0),VALUE NUMBER(10,2)'
    END;
    If I look in the trace file, i see that the error is:
    CDCdebug:in ChangeTable.java enableDisabledTriggers: ORA-06550: line 1, column 8:
    PLS-00201: identifier 'SYS.DBMS_CDC_SYS_IPUBLISH' must be declared
    ORA-06550: line 1, column 8:
    PL/SQL: Statement ignored
    oracle.jdbc.driver.OracleSQLException: ORA-06550: line 1, column 8:
    PLS-00201: identifier 'SYS.DBMS_CDC_SYS_IPUBLISH' must be declared
    ORA-06550: line 1, column 8:
    PL/SQL: Statement ignored
    Other remarks:
    - My procedure calls: sys.DBMS_CDC_PUBLISH.CREATE_CHANGE_TABLE.
    - I gave the same rights that I gave for apex_cdc schema to flows_030200 and APEX_PUBLIC_USER schemas (just to see if it works), but it doens't.
    Is APEX calling the procedure from another schema ?
    Does anyone has an idea why this procedure crashes if called from APEX application, but works ok if called from the same schema APEX application runs on, but using SQLDeveloper ?
    Any thoughts are appreciated.
    Radian

    The procedure apex_cdc.enable_table_capture i created myself with no authid mentioned explicitly, so it uses definer rights, by default.
    BUt this procedure is simply a wrapper for sys.dbms_cdc_publish.create_change_table.
    When I look on the security model for this sys.dbms_cdc_publish, i see it runs under invoker rights. (http://www.psoug.org/reference/dbms_cdc_publish.html).
    The code is like this:
    CREATE OR REPLACE PROCEDURE enable_table_capture
              i_owner               IN VARCHAR2,
              i_change_table_name     IN VARCHAR2,
              i_change_set_name     IN VARCHAR2,
              i_change_source          IN VARCHAR2,
              i_source_schema          IN VARCHAR2,
              i_source_table          IN VARCHAR2,
              i_column_type_list     IN VARCHAR2
         IS
         BEGIN
              EXECUTE IMMEDIATE 'alter session set REMOTE_DEPENDENCIES_MODE=SIGNATURE';
              EXECUTE IMMEDIATE 'begin add_log@orcl01(i_tableName => ''G''); end;';
    sys.DBMS_CDC_PUBLISH.CREATE_CHANGE_TABLE(
    owner => i_owner,
    change_table_name => i_change_table_name,
    change_set_name => i_change_set_name,
    source_schema => i_source_schema,
    source_table => i_source_table,
    column_type_list => i_column_type_list,
    capture_values => 'both',
    rs_id => 'y',
    row_id => 'n',
    user_id => 'n',
    timestamp => 'y',
    object_id => 'n',
    source_colmap => 'n',
    target_colmap => 'y',
    options_string => NULL);
    END enable_table_capture;

  • Export APEX application will not import to another APEX instance

    Oracle XE 11gR2
    APEX 4.1.1
    Windows 7
    ===============
    Get the following error when trying to import (via SQL*Plus) an APEX application:
    ORA-02291: integrity constraint (APEX_040100.WWV_FLOWS_FK) violated - parent key not found
    ORA-06512: at "APEX_040100.WWW_FLOW_API", line 679
    ORA-06512: at line 3
    Used the following PL/SQL block to import APEX application:
    declare
    -- the name of the workspace in which to import -- actually your parsing schema
    t_workspace varchar2(30):= 'APEXAPP';
    -- an application number of an existing application in the workspace.
    t_existing_app number := 103;
    -- the "new" application number, an existing number will be dropped first.
    t_new_app number := 103;
    -- security group id, you don't have to set this variable
    t_secgrp_id number;
    begin
    -- get the Security Group ID
    select workspace_id
    into t_secgrp_id
    from apex_applications
    where application_id = t_existing_app;
    wwv_flow_api.set_security_group_id(p_security_group_id => t_secgrp_id);
    apex_application_install.set_application_id(t_new_app);
    apex_application_install.generate_offset;
    apex_application_install.set_schema(t_workspace);
    apex_application_install.set_application_alias('APEXAPP' );
    end;
    @C:\DEPLOY\APEX_APP.sql;
    commit;
    =====================
    I recently did an upgrade from APEX 4.0.2 to 4.1.1 but there were no apps in this particular APEX instance. Just needed an upgrade because the APEX that
    comes with Oracle XE database is 4.0.2 and we are developing with APEX 4.1.1
    Please advise. This block has been used before to deploy APEX exports.

    I'm front of the same issue.
    Did you find a solution ?
    Thanks for help.
    Fanny

  • How to restore or backup Apex application from Command line ? URGENT

    We have Oracle apex 4.1 installed in Oracle 11g R2 database (windows 64-bit) 2008 R2
    For some reason our database dictionary objects are corrupted.
    We wanted to backup our Apex applications in some workspaces ASAP.
    We are not able to access apex from http://localhost:7777/pls/apex/htmldb_login
    We have an underlying database schema export (expdp).
    1) Is there a way to export or backup the apex application without logging into the apex URL ? if yes how ?
    2) Does Oracle has any of its own native tool to backup and restore from command line ?
    Thanks in advance

    My (MS Windows) experience, if I may; perhaps you'll find something useful.
    You'll find the README.TXT file in /apex/utilities directory. Read it.
    In order to use APEXExport, you need JDK version 1.5 or higher. Check your version by typing (and viewing the result):
    C:\>java –version
    java version "1.6.0_06"
    Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
    Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)Its directory should be part of the PATH environment variable: on my computer, directory name isC:\Program Files\Java\jre1.6.0_06\binFurthermore, Oracle JDBC class libraries must be part of the CLASSPATH environment variable. Check whether it exists (in Control Panel - System - Advanced - Environment Variables). For my 10gXE, it is here:C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jarI couldn't make it work; didn't know that ".\" directory must be entered into CLASSPATH as well (found that information in Arie Geller's book). Therefore, my final CLASSPATH version is:.\;C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jarOK, setup is done. Now, go to your /apex/utilities directory and, from the command prompt, run (mind the upper case!)java oracle.apex.APEXExportwhich will show a short help.
    I chose to export the whole workspace. In order to do that, I need the workspace ID (got it from Apex's SQL Workshop; that might be a problem as you can't get there, can you? I can't tell how to find that information apart from SQL Workshop, but I'm pretty sure someone, who is much more experienced than me, will know it). OK, here's how you find it:select v('WORKSPACE_ID') from dual;Finally, here's the final step - export:C:\apex\utilities>java oracle.apex.APEXExport -db localhost:1521:xe -user scott -password tiger -workspaceid 1038408092496568The result are fxxx.sql files (where "xxx" represents application number).
    I hope you'll manage to export your applications; basically, nothing special here (except that ".\" directory in the CLASSPATH variable).
    Best of luck!

Maybe you are looking for