Posts Tagged oracle

Installing Application Express with Oracle 10g Express Edition on Ubuntu is as easy as installing on Windows.

I have comprehended the steps to install Oracle Express Edition along with APEX 3.2 in Ubuntu.

UPDATE: The same procedure works for upgrading to APEX 4.0 from APEX 3.2 or directly installing 4.0 over Oracle XE as well. :)

1) Download Oracle XE universal .deb file from oracle.com

Download apex_3.2.zip from oracle.com

2)  Double click the .deb file and install the package.

then in Terminal window type:
Type:

 sudo /etc/init.d/oracle-xe configure 

Follow the instructions given there to complete the installation of Oracle 10g.

3) Setting the Oracle Path:
Edit your .bashrc file to include the lines:

ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME
export ORACLE_SID=XE

export PATH

4) UPGRADING TO APEX 3.2
Place apex_3.2.zip in folder /tmp.
In terminal:

cd /tmp
unzip apex_3.2.zip
cd /tmp/apex
sqlplus /nolog 

Type:

connect sys as sysdba

Note: Prompt for password of database admin login
Type:

 @apexins SYSAUX SYSAUX TEMP /i/ 

This will take several minutes for installation.

5) Setting the Images folder
In terminal Type inside /tmp/apex directory:

sqlplus /nolog

In sqlplus:

connect sys as sysdba
@apxldimg.sql /tmp

6) Enable remote http connections:

SQL>

 exec dbms_xdb.setListenerLocalAccess (l_access => FALSE);

Login

URL: http://127.0.0.1:8080/apex

Workspace: Internal

Username: Admin

Password: password

Source:

http://ubuntuforums.org/showthread.php?t=899926

https://help.ubuntu.com/community/Oracle10g

and Apex Documentation

    Here is a simple code for reading the entire contents of a file into a string in PL/SQL using utl_file package.
It iterates through the file, concatenating each line at a time using get_line function.
declare
  f_in utl_file.file_type;
  s_in varchar2(10000);
  string varchar2(32000);

begin
 f_in := utl_file.fopen('SAMPLEDIR','input.txt','R');

   loop
      begin
        utl_file.get_line(f_in,s_in);
        EXCEPTION
          WHEN NO_DATA_FOUND THEN
        EXIT;

        string:= string || s_in;

      end;
   end loop;
 utl_file.fclose(f_in);
end;

In the above code SAMPLEDIR is a logical entry in the database pointing to a directory which needs to be created before performing any file handling procedures. The following link lets you get started with file handling in PL/SQL in case if you are new to it. http://www.devshed.com/c/a/Oracle/Reading-Text-Files-using-Oracle-PLSQL-and-UTLFILE/1/