Friday, July 02, 2010

Apex 4 Installation on 11gR2

A URL da doc : http://download.oracle.com/docs/cd/E17556_01/doc/install.40/e15513/otn_install.htm#insertedID6

Baseada na documentação coloquei os seguintes passos:


--1º install Oracle Text if you got  :
/*Elapsed: 00:00:00.01
Application Express installation requires the Oracle Text database component.
begin
*
ERROR at line 1:
ORA-00900: invalid SQL statement
ORA-06512: at line 4
Disconnected from Oracle Database 11g Release 11.2.0.1.0 - Production
*/
@?/ctx/admin/catctx.sql ctxsys DRSYS TEMP(your temporary tablespace) NOLOCK


--all ok
-- 2ºinstall apex

@apexins SYSAUX SYSAUX TEMP /i/

--all ok
--3º change ADMIN password

@apxchpwd
--Brasil#2010

--all ok
-- 4º unlock APEX_PUBLIC_USER
ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK ;

--all ok
-- 5º change the passwaord for ALTER USER APEX_PUBLIC_USER IDENTIFIED BY

ALTER USER APEX_PUBLIC_USER IDENTIFIED BY senha

--all ok
-- 6º  grant connect privileges to any host for the APEX_040000 database user

DECLARE
  ACL_PATH  VARCHAR2(4000);
  ACL_ID    RAW(16);
BEGIN
  -- Look for the ACL currently assigned to '*' and give APEX_040000
  -- the "connect" privilege if APEX_040000 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;

  -- Before checking the privilege, ensure that the ACL is valid
  -- (for example, does not contain stale references to dropped users).
  -- If it does, the following exception will be raised:
  --
  -- ORA-44416: Invalid ACL: Unresolved principal 'APEX_040000'
  -- ORA-06512: at "XDB.DBMS_XDBZ", line ...
  --
  SELECT SYS_OP_R2O(extractValue(P.RES, '/Resource/XMLRef')) INTO ACL_ID
    FROM XDB.XDB$ACL A, PATH_VIEW P
   WHERE extractValue(P.RES, '/Resource/XMLRef') = REF(A) AND
         EQUALS_PATH(P.RES, ACL_PATH) = 1;

  DBMS_XDBZ.ValidateACL(ACL_ID);
   IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_040000',
     'connect') IS NULL THEN
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
     'APEX_040000', 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_040000', TRUE, 'connect');
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*');
END;
/

commit ;

--all ok
-- 7º Enable Indexing of Online Help in Oracle Database 11gR2 and Higher

--a)
SELECT par_value FROM ctxsys.ctx_parameters WHERE par_name = 'FILE_ACCESS_ROLE';

--if return null then

--b) create a role

SQL> CREATE ROLE APEX_URL_DATASTORE_ROLE;

Role created.

--c)grant the user APEX_040000

SQL> GRANT APEX_URL_DATASTORE_ROLE to APEX_040000;

Grant succeeded.

--d)grant permission

EXEC ctxsys.ctx_adm.set_parameter('file_access_role', 'APEX_URL_DATASTORE_ROLE');

-- e) if a) return a value grant the user  APEX_040000 with the role wich showed at step a) and continue ons tep c)

--all Ok
--8º Embedded gateway + configuração do local das imagens(the base directory location where the APEX was unzipped)

@apex_epg_config /home/oracle

--all ok
--9º unlock anonymous

ALTER USER ANONYMOUS ACCOUNT UNLOCK;

--all ok
-- 10º change the image directory.the base directory location where the APEX was unzipped

@apxldimg.sql /home/oracle


--10º drop the old apex users

--a)
SELECT username
   FROM dba_users
 WHERE (username LIKE 'FLOWS_%' OR USERNAME LIKE 'APEX_%')
   AND USERNAME NOT IN (
        SELECT 'FLOWS_FILES'
          FROM DUAL
         UNION
        SELECT 'APEX_PUBLIC_USER' FROM DUAL
         UNION
        SELECT SCHEMA s
           FROM dba_registry
         WHERE comp_id = 'APEX');

--b) drop all user that appear on the select above

drop user "usuario" cascade ;

Depois :

http://hostname ou IP:8080/apex/apex_admin
http://hostname ou IP:8080/apex

--Any problem wth ADMIN password,reset with @apxchpwd


Troque a senha e enjoy it!

No comments: