Wednesday, December 29, 2010

Installing Oracle application express 4.2 in MS-Windows 7 Oracle Database server 10.2 (Fresh Install)

You must have installed Oracle Database server 10.2.0.3 or greater.

My ORACLE_HOME is c:\oracle\product\102r2

My ORACLE_SID= presales 

My Oracle Database version is 10.2.0.3

Let's start downloading the Oracle express software



- Download Oracle application express 4.2 from OTN



then click on Downloads menu




go to Application express under Databases Option

click on there and you will see the following screen. Then choose the Accept License agreement option


Then click on Download link whether you want all languages or English only.



Note: This is not a complete software distribution.




the system will ask you your otn user`s name and password












After this download finishes we can start the installation procedure as shown below.

Extract the apex_4.0.2.zip into ORACLE_HOME directory in my case c:\oracle\product\102r2







press   continue button



After  this extract we need to go to ORACLE_HOME directory using CMD window and run it as administrator user


go to Accesories and choose Command prompt, press right click and select Run as administrator

Then click on this option . You will see a black window



go to $ORACLE_HOME directory, in my computer is
cd      c:\oracle\product\102r2\apex



---------------------------------------
Define the environment variables

TNS_ADMIN, ORACLE_HOME and ORACLE_SID



Now load sqlplus as system administrator

sqlplus / as sysdba

if you get to log in to the database, the environment variables were well defined;

otherwise repeat their definition and try again.



 Drop apex_030200 user if exists.

SQL> drop  user apex_030200 cascade;











Then  install Oracle apex entering ..



SQL>@apexins SYSAUX SYSAUX TEMP /i/







Updating the Images Directory When Running the Embedded PL/SQL Gateway

The images in an Oracle XML DB HTTP Server with the embedded PL/SQL gateway installation are in the XML DB repository. Updating the images is accomplished by running the SQL Script apxldimg.sql located in the top level directory where the patch was unzipped.

Load sqlplus as system administrator again

sqlplus / as sysdba


SQL>@apxldimg.sql c:\oracle\product\102r2\apex 





Now run this script with one parameter the oracle home directory, in this
example is

c:\oracle\product\102r2



@apex_epg_config.sql c:\oracle\product\102r2







change the password

@apxchpwd.sql




@apxconf.sql

Enter the password you entered before

define the port you will use for working with apex



execute this script from


Pravednik


SET SERVEROUTPUT ON

DECLARE

l_configxml XMLTYPE;

l_value VARCHAR2(5) := 'true'; -- (true/false)

BEGIN

l_configxml := DBMS_XDB.cfg_get();



IF
l_configxml.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access')
= 0 THEN

-- Add missing element.

SELECT insertChildXML

(

l_configxml,

'/xdbconfig/sysconfig/protocolconfig/httpconfig',

'allow-repository-anonymous-access',

XMLType('<allow-repository-anonymous-access
xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">' ||

l_value ||

'</allow-repository-anonymous-access>'),

'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'

)

INTO l_configxml

FROM dual;



DBMS_OUTPUT.put_line('Element inserted.');

ELSE

-- Update existing element.

SELECT updateXML

(

DBMS_XDB.cfg_get(),

'/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access/text()',

l_value,

'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'

)

INTO l_configxml

FROM dual;



DBMS_OUTPUT.put_line('Element updated.');

END IF;



DBMS_XDB.cfg_update(l_configxml);

DBMS_XDB.cfg_refresh;

END;
/

Now Unlock the anonymous account.









You are ready to use Oracle Apex