Thursday, August 22, 2013

APEX installation on Linux - Step by Step

Hi All,

Here the step by step for APEX installation on Linux.

You can download the latest Apex version from:
http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

1. Copy the apex_4.2.2_en.zip to $ORACLE_HOME: 
cp apex_4.2.2_en.zip $ORACLE_HOME

2. Extract apex_4.2.2_en.zip : 
cd $ORACLE_HOME; unzip apex_4.2.2_en.zip;cd $ORACLE_HOME/apex

3. Create a new tablespace for Apex objects:

create TABLESPACE APEX 
    DATAFILE '/full_path_for_data_directory/apex01.dbf'
    SIZE 1000M
    AUTOEXTEND ON
    NEXT 100M
    MAXSIZE 8000M;

4. Start APEX installation:
sqlplus "/as sysdba" @apexins.sql APEX APEX TEMP /i/

Arguments:
   Position 1: Name of tablespace for Application Express application user
   Position 2: Name of tablespace for Application Express files user
   Position 3: Name of temporary tablespace or tablespace group
   Position 4: Virtual directory for APEX images

Example:
1)Local
sqlplus "sys/syspass as sysdba" @apexins SYSAUX SYSAUX TEMP /i/
2)With connect string
sqlplus "sys/syspass@10g as sysdba" @apexins SYSAUX SYSAUX TEMP /i/

5. Change ADMIN account password:
sqlplus "/as sysdba" @apxchpwd.sql

*** The password must contain at least one punctuation character: (!”#$%&()“*+,-/:;?_).

6. Run the Embedded PL/SQL Gateway configuration (EPG):
sqlplus "/as sysdba" @apex_epg_config.sql $ORACLE_HOME (full path)

7. Update the APEX images with those from the new release:
sqlplus "/as sysdba" @apxldimg.sql $ORACLE_HOME (full path)

8. Make sure that the following accounts are unlocked and not expired:
If EXPIRED - Change password for following users : ANONYMOUS,XDB,APEX_PUBLIC_USER,FLOWS_FILES,APEX_040200.
IF LOCKED - Unlock:
ALTER USER ANONYMOUS ACCOUNT UNLOCK;
ALTER USER XDB ACCOUNT UNLOCK;
ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK;
ALTER USER FLOWS_FILES ACCOUNT UNLOCK;
ALTER USER APEX_040200 ACCOUNT UNLOCK;

9. Enable network services (ACL) and XML DB HTTP server:
sqlplus "/as sysdba"
exec dbms_xdb.sethttpport(8080);

Verify the port:
SELECT DBMS_XDB.GETHTTPPORT FROM DUAL;

10. Enable remote HTTP connections:
sqlplus "/as sysdba"
exec dbms_xdb.setlistenerlocalaccess(l_access => false);

11. Grant connect privileges to any host for the APEX_040200 database user:
sqlplus "/as sysdba"
DECLARE
ACL_PATH VARCHAR2(4000);
BEGIN
-- Look for the ACL currently assigned to '*' and give APEX_040200
-- the "connect" privilege if APEX_040200
-- does not have the privilege yet.
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200',
'connect') IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
'APEX_040200', TRUE, 'connect');
END IF;
EXCEPTION
-- When no ACL has been assigned to '*'.
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
'ACL that lets power users to connect to everywhere',
'APEX_040200', TRUE, 'connect');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/
COMMIT;

run also the following command:
Alter system set shared_servers=10;
*add hared_servers=10 to your spfile/pfile.

12. Check that Apex was installed:
SELECT comp_name, version, status FROM dba_registry WHERE comp_id='APEX';

COMP_NAME                      VERSION                        STATUS
------------------------------            ------------------------------   -----------

Oracle Application Express     4.2.2.00.11                    VALID

13. Login first time. You will be asked to change ADMIN password:
http://localhost:8080/apex/apex_admin

14. Workspace login page: 
http://localhost:8080/apex

Workspace: INTERNAL
Username: ADMIN
Password: Your new admin password



Good Luck ...

35 comments:

  1. Very nice article. Still helpful. Thank you.

    ReplyDelete
    Replies
    1. sqlplus "/as sysdba"
      DECLARE
      ACL_PATH VARCHAR2(4000);
      BEGIN
      -- Look for the ACL currently assigned to '*' and give APEX_040200
      -- the "connect" privilege if APEX_040200
      -- does not have the privilege yet.
      SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
      WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
      IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040200',
      'connect') IS NULL THEN
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
      'APEX_040200', TRUE, 'connect');
      END IF;
      EXCEPTION
      -- When no ACL has been assigned to '*'.
      WHEN NO_DATA_FOUND THEN
      DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml',
      'ACL that lets power users to connect to everywhere',
      'APEX_040200', TRUE, 'connect');
      DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
      END;
      /
      COMMIT;

      this is not working we are getting below error

      *
      ERROR at line 1:
      ORA-44416: Invalid ACL: Unresolved principal 'APEX_040200'
      ORA-06512: at "SYS.DBMS_NETWORK_ACL_ADMIN", line 252
      ORA-06512: at line 17
      ORA-01403: no data found

      Delete
    2. Hi ,
      What Apex version you installing?

      Delete
    3. Oracle Application Express 5.0.3

      Delete


    4. Nice information thanks for share. you should read this about this famous story

      Delete
  2. Oracle Application Express 5.0.3

    ReplyDelete
    Replies
    1. This is your issue.
      Please do the following:
      select * from dba_users where username like 'APEX%'
      I think you will get the following: APEX_050000 in your update

      if yes, change the APEX_040200 to APEX_050000

      Delete
    2. hey thanks,

      But when i am going to login with http://localhost:8080/apex/apex_admin link getting unable to connect

      Delete
  3. there is any setting to do this

    ReplyDelete
    Replies
    1. Please check that APEX_050000 user unlocked and open

      Delete
    2. required all user reset and unlock it
      USERNAME ACCOUNT_STATUS
      ------------------------------ -----------------
      FLOWS_FILES OPEN
      APEX_PUBLIC_USER OPEN
      ANONYMOUS OPEN
      XDB OPEN

      Delete
    3. Where is the APEX_050000 user. what is the user status?

      Delete
    4. Firefox can't establish a connection to the server at localhost:8080.

      Delete
    5. USERNAME ACCOUNT_STATUS
      ------------------------------ -----------------
      APEX_050000 OPEN

      Delete
    6. change the localhost to you database server hostname

      Delete
    7. which hostname i have to set

      Delete
    8. change the word localhost in http://localhost:8080/apex/apex_admin url to your database server hostname.

      example:

      http://mydbserver:8080/apex/apex_admin

      Delete
    9. my database hostname is localhost so it sholud be require to change my server hostname
      is their any issue of my listener

      Delete
  4. there is an issue of my default listner there are no any service register with database so i have to plan create new listner

    ReplyDelete
    Replies
    1. Hi

      Good morning

      i got connectivity from browser to apex bt they r asking username name which username i have to put

      Delete
    2. hi,
      R u there i am putting user as APEX_050000

      plz tell me which one is correct admin name

      Delete
    3. Please see step 14. This is the credentials. If not,run step 5 again.

      Delete
  5. i got connectivity

    i am dba not from apps team.

    could u give me one example how to create page.

    ReplyDelete
    Replies
    1. Sorry. Im an oracle dba too. So you can ask our best friend "google". ☺☺

      Delete
  6. Thanks a lot. This is the only working guide for me.

    ReplyDelete
  7. Thank you for this helpful article. Will this work with APEX 19.2? Alot has changed since you posted this article.

    ReplyDelete
  8. Very good article, but I'm confused on two things:
    1.- my $ORACLE_HOME is /u01/app/oracle/product/11.2.0/xe
    and already have an apex subdirectory.
    Should I replace its content with the new version?

    2.- On steps 6 and 7, I should put $ORACLE_HOME or my (full path)
    example
    @apex_epg_config.sql $ORACLE_HOME
    or
    @apex_epg_config.sql /u01/app/oracle/product/11.2.0/xe

    thanks

    ReplyDelete
    Replies
    1. Hi,
      1. Just rename the folder apex to apex_orig and extract the zip file. It will create the new apex folder.
      2. You need to use : /u01/app/oracle/product/11.2.0/xe

      Delete
    2. thanks for your answer, it worked.
      Only something left, when i execute

      SELECT comp_name, version, status FROM dba_registry WHERE comp_id='APEX';

      the APEX status is INVALID, but I have worked with it without any difficulty.

      What can I do?

      Delete