How to identify the environment (database) Apex is running on?

Hi
We are going to have 3 environments here: Development, Test and Production (separate databases/servers for each one). As usual, the development process will move applications from Dev -> Test -> Prod.
On my Apex 3 applications, I would like to visually identify, in some way, to which environment I am currently connected. For instance, displaying the name of the environment on the page header.
My problem is how to identify what environment Apex is running on. Is there any Apex instance-level property where I can set a string and display it in my applications? Or something like that?
What is the best way to achieve this? Any suggestions welcome.
Thanks,
Luis

Luis,
another option is to check the http environment to get this information.
This is what we use in one of our applications:
   FUNCTION get_environment
      RETURN VARCHAR2
   IS
   BEGIN
      IF LOWER (OWA_UTIL.get_cgi_env ('SERVER_NAME')) IN
                      ('development.opal-consulting.de')
      THEN
         RETURN c_development;
      ELSIF LOWER (OWA_UTIL.get_cgi_env ('SERVER_NAME')) =
                                                   'test.opal-consulting.de'
      THEN
         RETURN c_test;
      ELSE
         RETURN c_production;
      END IF;
   END;Unfortunately, this doesn't work with Oracle XE, thus you might be better off checking the value of: OWA_UTIL.get_cgi_env ('HTTP_HOST')
Anyway, I would also rather suggest using the table based approach, I use it in most applications now. This way you are more flexible. You can simulate all different settings in the same schema. Also, you can install development and test in the same database.
Regards,
~Dietmar.

Similar Messages

  • How to identify the alternative payee in payment run

    Hi All
    How to identify the alternative payee details in payment run by using transaction code F110 or which table or fields contain the alternative payee details for example REGHU & REGUP.
    How to identify the alternative payee details from system level. Any Update.
    Regards
    K.Gunasekar.

    Hi,
    EMPFG (Payment Recipient ) field in REGUH will give you the alternate Payee name of the Payment run executed in F110.
    Regards,
    SAPFICO

  • How can i identify the environment name or database name in the PL/SQL code

    Hi,
    I am using UTL_FILE to genearate the files.,
    My problem is, I have to design the common sql file , which can be executed in 2 diffrent environments ( Say QA & DEV ) , with no parameters. It has to identify the environment and based on the environment , it has to generate the concern files.,
    The only change needs to be incorporated is , file names , which will change based on the environment.,
    can nay one tell me , how can i identify the environment name or database name in the PL/SQL code ??
    Raja

    In this case, USEC_GI_DEV.NA.XXXNET.NET is a TNS alias. That alias exists only on the client machine. There is no way to access that information on the database server.
    You would have to find something in the v$database or v$instance table that uniquely identifies the database (and you may need some help from the DBAs to do this because you need to ensure that the data element you choose is compatible with whatever refresh process(es) are used in your environment).
    Now, if you are writing a stand-alone SQL*Plus script, SQL*Plus, as a client tool, does have access to the TNS alias in later versions. But that is a client-side determination, not a server-side determination.
    Justin

  • How to use the default database service name on creating procedure for data

    how to use the default database service name on creating procedure for datagaurd client failover ??? all oracle doc says create a new service as below and enable at DB startup. but our client is using/wanted database default service to connect from application on the datagaurd environment (rac to non rac setup).please help.
    Db name is = prod.
    exec DBMS_SERVICE.CREATE_SERVICE (service_name => 'prod',network_name =>'prod',failover_method => 'BASIC',failover_type => 'SELECT',failover_retries => 180,failover_delay => 1);
    says already the service available.
    CREATE OR REPLACE TRIGGER manage_dgservice after startup on database DECLARE role
    VARCHAR(30);BEGIN SELECT DATABASE_ROLE INTO role FROM V$DATABASE;
    IF role = 'NO' THEN DBMS_SERVICE.START_SERVICE('prod');
    END IF;
    END;
    says trigger created, but during a swithover still the service is listeneing on listener.
    tns entry.
    prod =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (LOAD_BALANCE = YES)
    (ADDRESS = (PROTOCOL = TCP)(HOST = prod1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = prod2)(PORT = 1521)) ---> primary db entry
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = proddr)(PORT = 1521)) --> DR DB entry
    (CONNECT_DATA =
    (SERVICE_NAME = prod)
    thanks in advance.
    Edited by: 854393 on Dec 29, 2012 11:52 AM

    Hello;
    So in the example below replace "ernie" with the alias you want the client to use.
    I can show you how I do it :
    First an entry need to be added to the client tnsnames.ora that uses a SERVICE_NAME instead of a SID.
    ernie =
    (DESCRIPTION =
        (ADDRESS_LIST =
           (ADDRESS = (PROTOCOL = TCP)(HOST = Primary.host)(PORT = 1521))
           (ADDRESS = (PROTOCOL = TCP)(HOST = Standby.host)(PORT = 1521))
           (CONNECT_DATA =
           (SERVICE_NAME = ernie)
    )Next the service 'ernie' needs to be created manually on the primary database.
    BEGIN
       DBMS_SERVICE.CREATE_SERVICE('ernie','ernie');
    END;
    /After creating the service needs to be manually started.
    BEGIN
       DBMS_SERVICE.START_SERVICE('ernie');
    END;
    /Several of the default parameters can now be set for 'ernie'.
    BEGIN
       DBMS_SERVICE.MODIFY_SERVICE
       ('ernie',
       FAILOVER_METHOD => 'BASIC',
       FAILOVER_TYPE => 'SELECT',
       FAILOVER_RETRIES => 200,
       FAILOVER_DELAY => 1);
    END;
    /Finally a database STARTUP trigger should be created to ensures that this service is only offered if the database is primary.
    CREATE TRIGGER CHECK_ERNIE_START AFTER STARTUP ON DATABASE
    DECLARE
    V_ROLE VARCHAR(30);
    BEGIN
    SELECT DATABASE_ROLE INTO V_ROLE FROM V$DATABASE;
    IF V_ROLE = 'PRIMARY' THEN
    DBMS_SERVICE.START_SERVICE('ernie');
    ELSE
    DBMS_SERVICE.STOP_SERVICE('ernie');
    END IF;
    END;
    /lsnrctl status - should show the new service.
    When I do this the Database will still register with the listener. I don't give that to the clients. That one will still be available but nobody knows about it. Meanwhile "ernie" moves with the database role.
    So in my example the default just hangs out in the background.
    Best Regards
    mseberg
    Edited by: mseberg on Dec 29, 2012 3:51 PM

  • How to identify the installed Weblogic Server and JDK are 32bit or 64bit?

    Hi everyone,
    I have a question ~
    Both Weblogic Server and JAVA JDK are installed on the server already, but I only know the Weblogic Server is 10.3.4.0 and JAVA JDK version is 1.6.0_25.
    I know the 64bit Weblogic Server installation file is a wlsXXXX_generic.jar package and 64bit JAVA JDK needed also.
    But, since the Weblogic installed already, there are no such installation files on the Linux Server now.
    I have tried the "java -version" for java version and check the Weblogic version from Weblogic console.
    How to identify the installed Weblogic Server and JDK are 32bit or 64bit with Linux command? Or is there any way to check it?

    What you can try to do is use WLST (or an MBean browser, such as JConsole or JRockit Mission Control) and connect to the adminserver.
    For example when using WLST:
    # set the environment by using setWLSEnv.sh (located in the ${WL_HOME}/server/bin directory).
    # start WLST by using: java weblogic.WLST
    # connect to the adminserver
    connect('adminusername','adminpassword');
    # change to the serverruntime environment
    serverRuntime();
    # show the attributes
    ls();
    # Here an attribute is shown called WebLogicVersion that shows the version of WebLogic
    -r--   WeblogicVersion                              WebLogic Server 10.3.5.0  Fri Apr 1 20:20:06 PDT 2011 1398638
    # Note that this does not show if is 32 bits or 64 bits to retrieve this information you have obtain the JVM version
    # change the directory
    cd('JVMRuntime/AdminServer');
    # show the attributes
    ls();
    -r--   Version                                      R28.0.1-21-133393-1.6.0_20-20100512-2126-linux-x86_64
    # when you have something like x86 at the you are running a 32 bit version, if you have something like x86_64 you are running a 64 bits versionAs mentioned above you can also retrieve this information by using a MBean browser.

  • How to config the oracle database connection pool in IAS

    Hi,
    Does anyone who hows to config the oracle database connection pool in IAS?
    Thanks so much!!!
    [email protected]
    Jacky

    Jacky,
    You need do the following for oracle type4 driver:
    1) register the driver:
    $IAS_HOME/bin/jdbcsetup
    Driver Identifier: Oracle_Type4_816 (whatever name you like)
    Driver Classname: oracle.jdbc.driver.OracleDriver
    Driver Classpath: .../classes12.zip (install this this zip file somewhere
    and add this zip into the Classpath later).
    2) DataSource Setup:
    start iAS Administration Tool (iASAT)
    Choose Database, unfold iAS1 (your app server instance),
    choose External JDBC Datasource -> add: DataSource Registration
    JNDI Name: yourPoolName
    Driver Type: Oracle_Type4_816 (select what you just register)
    DataSource Url: jdbc:oracle:thin:@hostName:portName:dbName
    Username: your_user_name
    Password: your_passwd
    (Datasource Pool: using defaults for now): you can also customrize the
    parameters for the pool.
    3. Add classes12.zip into CLASSPATH.
    In your application, you can use JNDI lookup to get the DataSource from
    which you get the connection from the pool.
    Hope this helps.
    Good luck.
    Xuran
    "Jacky Yan" <[email protected]> wrote in message
    news:9m0tmp$[email protected]..
    Hi,
    Does anyone who hows to config the oracle database connection pool in IAS?
    Thanks so much!!!
    [email protected]
    Jacky

  • How to identify the DDL changes ?

    Hi all,
    How to identify the DDL changes done to the database ?
    By triggers only Or we can use Logminer also OR
    SELECT * FROM USER_OBJECTS where object_type = 'TABLE' order by LAST_DDL_TIME desc;
    OR
    is there any other options are available ?
    Thanks in advance,
    Pal

    Something from asktom might help
    tkyte@TKYTE816> create or replace trigger ddl_trigger
    2 after create or alter or drop on SCHEMA
    3 declare
    4 l_sysevent varchar2(25);
    5 l_extra varchar2(4000);
    6 begin
    7 select ora_sysevent into l_sysevent from dual;
    8
    9 if ( l_sysevent in ('DROP','CREATE') )
    10 then
    11 if l_sysevent = 'CREATE'
    12 then
    13 begin
    14 select 'storage ( initial ' || initial_extent ||
    15 ' next ' || next_extent || ' .... )'
    into l_extra
    16 from all_tables
    where table_name = ora_dict_obj_name
    17 and owner = user;
    18 exception
    19 when no_data_found then null;
    20 end;
    21 end if;
    22
    23 insert into log
    24 select ora_sysevent, ora_dict_obj_owner,
    25 ora_dict_obj_name, l_extra
    26 from dual;
    27 elsif ( l_sysevent = 'ALTER' )
    28 then
    29 insert into log
    30 select ora_sysevent, ora_dict_obj_owner,
    31 ora_dict_obj_name, sql_text
    32 from v$open_cursor
    33 where upper(sql_text) like 'ALTER%' ||
    34 ora_dict_obj_name || '%'
    35 and sid = ( select sid
    36 from v$session
    37 where audsid=userenv('sessionid') );
    38 end if;
    39 end;
    40 /

  • How to identify the Oracle Edition ?

    Hai All,
    How to identify the oracle edition ( standard, enterprise etc...) running in a machine?
    Please help
    Shiju.

    Even if you have explicitly deselected the additional feature of the Enterprise Edition, If you have installed Oracle Enterprise Edition, then you have an Oracel Enterprise Edition Installed, and you must have a license to support your installation. There are several kinds of Edition, you may choose the one that best fits your needs.
    Oracle Enterprise Edition:
    Enterprise Edition is the full (top of the range) version or the Oracle Database Server. Options like RAC, Partitioning, Spatial, etc. can be purchased separately to enhance the functionality of the database.
    Oracle Standard Edition:
    Standard Edition is designed for smaller businesses and enterprises. It offers a subset of the features/ functionality implemented in Enterprise Edition. Database options like Data Guard, Partitioning, Spatial, etc. is not available with Standard Edition (from 10g one can use RAC with Standard Edition). Standard Edition can only be licensed on servers with a maximum capacity of four processors.
    Oracle Standard Edition One:
    Standard Edition One is a low cost, entry-level version of the Oracle Standard Edition database server. Standard Edition One can only be licensed on small servers with a maximum capacity of two processors.
    Oracle Personal Edition:
    Personal Oracle is a single user version of the database server. It is mostly the same as Enterprise Edition, but doesn't support advanced options like RAC, Streams, XMLDB, etc.
    Oracle Lite:
    Oracle Light is a database engine that can be used on mobile platforms like cell phones and PDA's.
    Oracle XE:
    Express Edition (XE) is a free, downloadable version of the Oracle database server. Oracle XE can only be used on single processor machines. It can only manage up to 4 GB of data and 1 GB of memory. ISVs can embed XE in 3rd party products and redistribute it freely.

  • How to identify the bind variable peeking problem?

    How to identify the bind variable peeking problem whether my db hitting or not and how to resolve it?
    currently we are doing the dbms_stat of application schema's with gather auto option and i hope this option we take the histogram stats also. Is there any option to improve it and its highly transactions oltp env of 11g.

    What is your exact 4 digits Oracle version ?
    Bind peeking issues are supposed to be solved with adaptative cursor sharing in 11.1 and 11.2:
    11.1 http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/optimops.htm#sthref919.
    11.2 http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/optimops.htm#PFGRF94588
    which says also:
    >
    Adaptive cursor sharing is enabled for the database by default and cannot be disabled. Note that adaptive cursor sharing does not apply to SQL statements containing more than 14 bind variables.
    >
    Edited by: P. Forstmann on 10 nov. 2011 13:50

  • How to share the same Database Connection when using several Task Flows ?

    Hi All,
    I’m using JDev 11.1.1.3.0.
    I’m developing ADF Fusion Applications (ABC BC, ADF Faces…)
    These applications are deployed on a Weblogic server.
    Each application has only one Application Module.
    All Application Modules have the same connection type defined: JDBC DataSource : jdbc/GCCDS
    It is working fine.
    I’ve also developed Task Flow Applications for small thinks that are reused in multiple main applications.
    Each Task Flow Application has also one Application Module with the same connections type as main applications.
    All these task flows are deployed to JAR file (ADF Library JAR File) and are reused on my main applications. (drag and drop from the Resource Palette to ADF Regions….).
    There are some parameters passed to Task Flows, so that they can filter data depending on which main applications they are called from.
    Everything is working perfectly.
    All my main applications are using more and more task flows. Which is nice for the reusability etc…?
    Only ONE PROBLEM: DATABASE CONNECTIONS.
    Every Task Flows service made a database connection. So one user may have 10 database connections for the same adf page. And when there are 100 users that are working at the same time, it becomes a problem.
    How to share the same database connections for the main applications and all task flows which are used in the main application?
    Best Regards
    Nicolas

    Hi John,
    When I open a ADF Library JAR file of one of my task flow. (gcc_tf_recentSites.jar)
    I can see TF_RecentSitesService.xml and TF_RecentSitesServiceImpl.class in gcc_tf_recentSites.jar\mu\gcc\tf\recentSites\model\service folder
    + bc4j.xcfg in gcc_tf_recentSites.jar\mu\gcc\tf\recentSites\model\service\common folder.
    bc4j.xcfg details are
    +<?xml version = '1.0' encoding = 'UTF-8'?>+
    +<BC4JConfig version="11.1" xmlns="http://xmlns.oracle.com/bc4j/configuration">+
    +<AppModuleConfigBag ApplicationName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService">+
    +<AppModuleConfig DeployPlatform="LOCAL" jbo.project="mu.gcc.tf.recentSites.model.TF_RecentSites_Model" name="TF_RecentSitesServiceLocal" ApplicationName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService">+
    +<Security AppModuleJndiName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService"/>+
    +<Custom JDBCDataSource="jdbc/GCCDS"/>+
    +</AppModuleConfig>+
    +<AppModuleConfig name="TF_RecentSitesServiceShared" ApplicationName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService" DeployPlatform="LOCAL" JDBCName="gccdev" jbo.project="mu.gcc.tf.recentSites.model.TF_RecentSites_Model">+
    +<AM-Pooling jbo.ampool.maxpoolsize="1" jbo.ampool.isuseexclusive="false"/>+
    +<Security AppModuleJndiName="mu.gcc.tf.recentSites.model.service.TF_RecentSitesService"/>+
    +</AppModuleConfig>+
    +</AppModuleConfigBag>+
    +</BC4JConfig>+
    So, it seems that the Application Module is packaged with the task flow....
    Is it normal ?
    Regards
    Nicolas

  • How to identify the user who created the variant

    Hi All,
    Can anyone tell me how to identify the user who created the variant ?

    Hi Dear,
    For the same go to SE11 and view the table "VARID". This table give the details of the program,user,variant etc.
    From this table u can know which user created the variant. Hope this solve your purpose.
    Regards

  • How can identify the default currency for a customer?

    How can identify the default currency for a customer?
    I know that this is being determined when you create a sales order for a particular customer, for example, so I could break this process open and find out what it uses. But I thought it worth asking in this forum first.
    Blue

    Hi Gary,
    As per my understanding of your question I am replying , If you are looking some thing else then I request you to please elaborate your query.
    If you see the BP sales area data in transaction BP, In billing tab you maintain the currency for a customer which is default currency when you create a sales order.
    <b>Reward points if it helps!!</b>
    Best regards,
    Vikash

  • How to identify the type of pocketpc barcode scanner?

    How to identify the type of pocketpc barcode scanner whteher it is intermec or symbol?
    GS

    Hi,
    well, this is the brand of the PDA - the Scanner itself is build into the device. So if you have an intermec device - you have an intermec scanner and vice versa. It is not recommended to use a HP device for example with an external scanner. This scenario is not really supported by the MI setup guides.
    Hope that helps!
    Regards,
    Oliver

  • How to Identify the Type of Font Names in Illustrator

    How to identify the type of font names like "True Type font" (or) "open Type font" for illustrator file using Scripts or any language. Could you please advice me.
    Thanks,
    Prabudass

    If there is an Illustrator SDKor Illustrator Scripting forum, try
    that. ATM won't really help - it is obsolete and should not be
    installed (breaks things).
    Aandi Inston

  • How to identify the type of Fonts

    How to identify the type of font names like "True Type font" (or) "open Type font" for illustrator file using Scripts. Could you please advice me.
    Thanks,
    Prabudass

    The code below will prompt the user with the type face of a single text-frame.
    shastafir
    // 5/4/2009
    // Open a new document and create a single text box
    // with some type in it.
    // Get access to the active layer
    var aiDocument = app.activeDocument;
    var aiLayer = aiDocument.activeLayer;
    // Get access to the type-frame's font
    var textBox = aiLayer.textFrames[0];
    var theFont =
    textBox.textRange.characterAttributes.textFont;
    // Alert user with the name of the font
    alert(theFont.name);

Maybe you are looking for

  • Internal Table in Table View

    Hi, I want to use an internal table in the Table View tag. Can any one please let me know how to use that. Thanks in advance. Regards, Ravi G

  • How can I know the output Image Size of any image with a variable

    I'm having problems with a filter I am writing because I can't enter the output image size(x and y) in a filter without doing it manually with a parameter

  • Cannot connect to imaging server after ZDML SP1 IR3 install

    OK, here's a bit of an odd problem... well, actually, I hope it's an insanely easy problem that I just have overlooked a simple solution for. I guess that's for you guys to help figure out. ;) We had been running Zenworks 7.0.1.0 on an OES1 Linux ser

  • Order number range - Group

    Hi, Client requirement is to maintain different number ranges for each order type. Whenever I try to create a Group(Menu-Group-Insert). Then Text. Then number range. I created new group, text,assigned number range but the new group is not coming. (sy

  • Can we use aggregates with Virtual Characteristics?

    Hi,   My question is "Can we use aggregates with Virtual Characteristics?" Is yes then how and if no then why not. Thanks for your contribution I have been researching the topic myself and I dont think its possible and even using OLAP cache is not po