Jumat, 29 Mei 2009

Problem solving dbconsole oracle 10g

Anda cek direktori /OH/oc4j/j2ee instead of OC4J_DBConsole_yy.co.id_xxxx ?

Try renaming that directory to OC4J_DBConsole_yy.co.id_xxxx anda coba untuk stop dan start dbconsole.

Berikut cara simple untuk drop and recreate repository.

#drop (menghapus dbconsole yang sudah ada)
emca -deconfig dbcontrol db -repos drop

#create (membuat baru dbconsole)
emca -config dbcontrol db -repos create

#recreate (configurasi ulang dbconsole)
emca -config dbcontrol db -repos recreate

Semoga bermanfaat & selamat mencoba

Selasa, 12 Mei 2009

Skrip untuk membuat synonym dari object

Ketik skrip berikut untuk membuat perintah synonym:

Select 'Create Public synonym ' || object_name || ' for ' || object_name || '; '
From user_objects
Where object_type IN ('TABLE','VIEW','FUNCTION','PROCEDURE')

Hasil dari query copy aja lansung pada query editor, kemudian jalankan.

Selamat mencoba...

Selasa, 13 Januari 2009

PHP and oci8 on Ubuntu

OCI8 is an extension for providing APIs to Oracle database management system. However, installing OCI8 is not just easy like apt-get since it requires SDK offered by Oracle and its distribution license prohibits the inclusion to linux distribution. That means we have to download and compile it by ourselves. Fortunately, it is a little bit easy for Ubuntu.
  1. Install PEAR and PECL

    sudo apt-get install php-pear
  2. Download Oracle Instant Client. You need at least Basic and SDK.

  3. Extract the archives.

    sudo mkdir -p /opt/oracle
    cd /opt/oracle
    sudo unzip instantclient-basic-linux-x86-64-10.2.0.3-20070103.zip
    sudo unzip instantclient-sdk-linux-x86-64-10.2.0.3-20070103.zip
    sudo mv /opt/oracle/instantclient_10_2 /opt/oracle/instantclient

  4. Create symbolic links.

    cd /opt/oracle/instantclient
    sudo ln -s libclntsh.so.10.1 libclntsh.so
    sudo ln -s libocci.so.10.1 libocci.so

  5. Add instant client to system ld.

    sudo su -
    echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient

  6. Compile oci8.

    sudo pecl install oci8
  7. Enter instantclient,/opt/oracle/instantclient when you are prompted.

  8. Enable the extension.

    sudo su -
    echo extension=oci8.so >> /etc/php5/apache2/php.ini

  9. Restart apache2.

    sudo /etc/init.d/apache2 restart