Tampilkan postingan dengan label 10g. Tampilkan semua postingan
Tampilkan postingan dengan label 10g. Tampilkan semua postingan

How do I activate the OCI8/Oracle extension for PHP?




    To activate the OCI8/Oracle extension for PHP please execute the following command:

    sudo /opt/lampp/lampp oci8

    The following dialog will start:

    Please enter the path to your Oracle or Instant Client installation:

              [/opt/lampp/lib/instantclient-11.2.0.3.0]

              installing symlinks...

              patching php.ini...

              OCI8 add-on activation likely successful.

              LAMPP: Stopping Apache with SSL...

              LAMPP: Starting Apache with SSL...

    The extension should now be active.
Done!!!




source : #https://www.apachefriends.org/faq_linux.html




ORACLE TERBILANG Function

FUNCTION ZMID(CStr IN VARCHAR2, STR IN INTEGER, LEN IN NUMBER DEFAULT 32767) RETURN VARCHAR2 IS
     iMID VARCHAR2(32767);
BEGIN
     If ( STR > Length(CStr) ) Then
         RETURN( NULL );
     END IF;
     iMID := SUBSTR( CStr, STR, len );
     RETURN ( iMID );
END;
/


FUNCTION zright(iChar VARCHAR2,jumlah NUMBER) RETURN VARCHAR IS
 Vpanjang  NUMBER;
 Vchar_Kanan VARCHAR2(100);
BEGIN
  Vpanjang:=Length(iChar)+1-jumlah;
  Vchar_Kanan:=SUBSTR(iChar,Vpanjang,jumlah);
  RETURN Vchar_Kanan;
END;
/


function ORACLE_TERBILANG(angka number) return varchar2 is

  strJmlHuruf     number;
  terbilang       varchar2(32767);
  intPecahan      varchar2(32767);
  strPecahan      varchar2(32767);
  urai            varchar2(32767);
  sMinus          varchar2(32767);
  strTot          varchar2(32767);
  x               varchar2(32767);
  y               integer;
  z               integer;
  Bil1            varchar2(32767);
  Bil2            varchar2(32767);
  pNumber         varchar2(32767);

 begin

   /*Cek Panjang input Angka*/
    pNumber :=length(angka);

    if substr(angka,1,1) <> '-' then
       if 16 <= pNumber then terbilang := ''; return(terbilang); end if;
    Else
       if 17 <= pNumber then terbilang := ''; return(terbilang); end if;
    End If;

   /*Cek Awal NOL*/
   If angka is Null or angka =0 Then terbilang := 'NOL';
      return(terbilang);
   End If;

       strJmlHuruf := LTrim((angka)); intPecahan  := 0;

  /*Cek Awal Minus*/
    If InStr(strJmlHuruf, '-') > 0 Then
            sMinus := 'MINUS ';
            terbilang := ZRight(strJmlHuruf, length(strJmlHuruf) - 1);
            strTot := terbilang; strJmlHuruf := terbilang;
    End If;

    /*Sementara Tdak ada pecahan :D*/
    If (intPecahan = 0) Then strPecahan := ''; End If;

    X := 0;
    Y := 0;
    Urai := '';

    /*::::::::::::LOOP::::::::::::*/
    While (X < length(strJmlHuruf)) Loop
                    X := X + 1;
                    strTot := ZMID(strJmlHuruf, X, 1);
                    Y := Y + (strTot);
                    z := length(strJmlHuruf) - X + 1;

    /*::::::::::::::::::::::::::Select Case Val(strTot)::::::::::::::::::::::::::*/
            if (strTot) = 1 then

                /*:::::::::::::::::::::::::::*/
                If (z = 1 Or z = 7 Or z = 10 Or z = 13) Then Bil1 := 'SATU ';

                ElsIf (z = 4) Then
                     If (X = 1) Then Bil1 := 'SE';
                        Else Bil1 := 'SATU ';
                    End If;

                ElsIf (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 14 ) Then
                    X := X + 1;
                    strTot := ZMid(strJmlHuruf, X, 1);
                    z := length(strJmlHuruf) - X + 1;
                    Bil2 := '';

                       if  strTot = 0 then Bil1 := 'SEPULUH ';
                             ElsIf strTot = 1 then Bil1 := 'SEBELAS ';
                             ElsIf strTot = 2 then Bil1 := 'DUA BELAS ';
                             ElsIf strTot = 3 then Bil1 := 'TIGA BELAS ';
                             ElsIf strTot = 4 then Bil1 := 'EMPAT BELAS ';
                             ElsIf strTot = 5 then Bil1 := 'LIMA BELAS ';
                             ElsIf strTot = 6 then Bil1 := 'ENAM BELAS ';
                             ElsIf strTot = 7 then Bil1 := 'TUJUH BELAS ';
                             ElsIf strTot = 8 then Bil1 := 'DELAPAN BELAS ';
                             else Bil1 := 'SEMBILAN BELAS ';
                       end if;
                 else
                  Bil1 := 'SE';
              end if;
              /*:::::::::::::::::::::::::::*/

              elsif strTot = 2 then Bil1 := 'DUA ';
              elsif strTot = 3 then Bil1 := 'TIGA ';
              elsif strTot = 4 then Bil1 := 'EMPAT ';
              elsif strTot = 5 then Bil1 := 'LIMA ';
              elsif strTot = 6 then Bil1 := 'ENAM ';
              elsif strTot = 7 then Bil1 := 'TUJUH ';
              elsif strTot = 8 then Bil1 := 'DELAPAN ';
              elsif strTot = 9 then Bil1 := 'SEMBILAN ';
              else Bil1 := '';
            end if;
    /*::::::::::::::::::::::::::END Select Case Val(strTot)::::::::::::::::::::::::::*/

                If ((strTot) > 0) Then
                    If (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 14) Then      Bil2 := 'PULUH ';
                      ElsIf (z = 3 Or z = 6 Or z = 9 Or z = 12 Or z = 15) Then Bil2 := 'RATUS ';
                      Else Bil2 := '';
                    End If;
                Else       Bil2 := '';
                End If;

                If (Y > 0) Then
                  /*::::::Select Case z:::::::*/
                   if z = 4 then        Bil2 := Bil2||'RIBU ';   Y := 0;
                      elsif z = 7  then Bil2 := Bil2||'JUTA ';   Y := 0;
                      elsif z = 10 then Bil2 := Bil2||'MILYAR '; Y := 0;
                      elsif z = 13 then Bil2 := Bil2||'TRILYUN ';Y := 0;
                   end if;
                End If;

     Urai := Urai||Bil1||Bil2;
    end loop;
    /*::::::::::::END LOOP::::::::::::*/

       Urai := sMinus||Urai||strPecahan;
        If (intPecahan = 0) Then
           Terbilang := Urai||'RUPIAH ';
        End If;
  return(terbilang);

end ORACLE_TERBILANG;
/

dbms_scheduler Ruunning OS Command or Shell Script from PL/SQL, EXPORT oracle database to .dmp file


Hi there i will share a little bit trick, that allow you to export oracle database using pl/sql.

I have Windows client and my oracle 10g DB base on Ubuntu(LInux),
i want create some procedure that will execute linux command to export oracle database.

ok here there are :
i will divide the method base on 2 model.

1. U will execute by calling .sh file

#Create exp.sh file

#!/bin/sh
ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME PATH
exp user/pass@orcl file=/U_re_directory/exp.dmp

#Run this script on pl/SQL

 BEGIN
 DBMS_SCHEDULER.CREATE_JOB(
 job_name=>'testjob',
 job_type=>'EXECUTABLE',
 job_action=>'U_re_directory/exp.sh',
 enabled=>true,
 auto_drop=>true);
 end;
 /

2. U will execute by typing the script directly 


begin
   dbms_scheduler.create_job (job_name    => 'myjob',
                              job_type    => 'executable',
                              job_action  => '/bin/sh',
                              number_of_arguments => 2,
                              auto_drop   => true);
   dbms_scheduler.set_job_argument_value ('myjob', 1,'-c');
   dbms_scheduler.set_job_argument_value ('myjob', 2,'ORACLE_HOME=/opt/oracle/product/10.2.0/db

PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME PATH
exp assyifa/assyifa@orcl file=/U_re_directory/exp.dmp');
   dbms_scheduler.run_job ('myjob');
end;
/




:) Done!

Note :

How to see scheduled job status

select status,additional_info from DBA_SCHEDULER_JOB_RUN_DETAILS where job_name='Scheduled_NAME';

How to drop a scheduled job in oracle

BEGIN
  dbms_scheduler.drop_job(job_name => 'Scheduled_NAME');
END;

Grant privilege tu user


SQL> conn system
SQL> grant create job to your_user;
SQL> grant create EXTERNAL job to your_user;
sources :

https://oracle-base.com/articles/misc/oracle-shell-scripting
http://rohmad.net/2008/07/24/menjalankan-os-command-atau-shell-script-dari-plsql/
https://askubuntu.com/questions/38661/how-do-i-run-sh-files
https://stackoverflow.com/questions/37458051/how-to-drop-a-scheduled-job-in-oracle
http://www.dba-oracle.com/t_execute_operating_system_os_command_oracle.htm

How to remove extra space in between a string? oracle 10g


SQL> select replace('AAA BBB CCC', chr(32), '') from dual;

REPLACE('
---------
AAABBBCCC

Oracle Form 6i dynamic query and execute in oracle

  dynamic query

 1.

set_block_property('DIVIEW_SALESES', default_where, 'query statement');

 example :

set_block_property('DIVIEW_SALESES', default_where, 'sls_status='||''''||'A'||''''||' and to_char(sls_date,'||''''||'mm/yyyy'||''''||')='||''''||:tool.REF_DATE||'''');

Done!

Transpose rows to columns in Oracle 10g Generating matrix using SQL queries using PIVOT instead


In 10g you can use DECODE function instead of PIVOT:

 CREATE TABLE po_table (
  po_num NUMBER,
  terms_type NUMBER,
  terms_description VARCHAR2(20)
);

INSERT INTO po_table VALUES(10, 1, 'Desc-10-1');
INSERT INTO po_table VALUES(10, 2, 'Desc-10-2');
INSERT INTO po_table VALUES(10, 3, 'Desc-10-3');
INSERT INTO po_table VALUES(20, 1, 'Desc-20-1');
INSERT INTO po_table VALUES(20, 3, 'Desc-20-3');
INSERT INTO po_table VALUES(30, NULL, NULL);

COMMIT;

SELECT
    po_num,
    MAX(DECODE(terms_type, 1, terms_type)) AS terms1,
    MAX(DECODE(terms_type, 1, terms_description)) AS terms1Desc,
    MAX(DECODE(terms_type, 2, terms_type)) AS terms2,
    MAX(DECODE(terms_type, 2, terms_description)) AS terms2Desc,
    MAX(DECODE(terms_type, 3, terms_type)) AS terms3,
    MAX(DECODE(terms_type, 3, terms_description)) AS terms3Desc
  FROM
    po_table
GROUP BY po_num
ORDER BY po_num;

Output:

    PO_NUM  TERMS1 TERMS1DESC    TERMS2 TERMS2DESC    TERMS3 TERMS3DESC
---------- ------- ------------ ------- ------------ ------- ----------
        10       1 Desc-10-1          2 Desc-10-2          3 Desc-10-3
        20       1 Desc-20-1                               3 Desc-20-3
        30                                                            
https://stackoverflow.com/questions/19812930/transpose-rows-to-columns-in-oracle-10g

Printing with Foxit Reader using command line command

Hi there i wanna share how to printting via Foxit REader using command line.
In my case i use it on my oracle developer 6i
then here it's!!!

host('"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe" /t "pdf file" "printer name"');
 then
host('"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe" /t c:\file.pdf printname'); 


Internet explorer stopped working when opening oracle forms 10g windows7

Basically , When U run oracle forms 10g and it shows blank or Stop working on your browser, because Jinit on oracle 10g is not support on that browser. . .

I googled a little and found those problems. . .
Now i will share U how to work  your oracle form 10g on your PC
Basic OS
*Win7
*Oracle Developer 10g
*Java Runtime 6u27

The Idea is finding How to Run oracle form 10g in Mozilla or Any browser

1.

Install Java Environment 
2.
Change The Formsweb.cfg
3.
Add the plugin in browser



source : https://www.youtube.com/watch?v=lzyHQ2PcWHI

How to install oracle developer suite 10g on windows 7

How to install oracle developer suite 10g on windows 7

Actually, I have a little bit problem when i try to install oracle developer suite 10g.
I found error that my system does not support, but now i found the solutions.
It needs a little tricks that will decoy Oracle Standard system required.

Come Let 's Start



1.

Go to "oracle developer suite 10g  Installer Folder"\Install\oraparam.ini


 2.

Find :
[Certified Versions]
Windows=5.0,5.1,5.2
Solaris=5.8,5.9
Linux=redhat-2.1AS
HPUX=B.11.11
 Add this script :
[Certified Versions]
Windows=5.0,5.1,5.2,4.1
Solaris=5.8,5.9
Linux=redhat-2.1AS
HPUX=B.11.11


Find :
[Windows-5.1-required]
#Minimum display colours for OUI to run
MIN_DISPLAY_COLORS=256
SWAP_SPACE=1535
TEMP_SPACE=150
Edit :
[Windows-6.1-required]
#Minimum display colours for OUI to run
MIN_DISPLAY_COLORS=256
SWAP_SPACE=1535
TEMP_SPACE=150
 Save and exit file.

 3.

Add Virtual memory size
Go To Advanced system settings >>Tab " Advanced ">>Button Performance's "Setting">>Tab " Advanced ">>Button "Change"
Initial size = 4000
Max size = 4000

Ok and restart your PC.

 4.

 Go to "oracle developer suite 10g  Installer Folder
Set Property file Compatibility as "Windows XP Console Pack 2" 

 5.

 Run Setup


6.

Done!

#Source : https://www.youtube.com/watch?v=qYeic14YK-Y

DBlink from oracle 10g/XE to sql server

How to create database Link Oracle 10g / XE to MYSQL Server

:) Hi there, a few days ago, i had a problem that makes me to use oracle 10g dblink to sql server.
This is my first time to do this and i do not sleep around 4 days for finding how to do this properly.
When i tried the procedures that i searched on google. . .there are so many errors i faced. at last fortunately i managed connecting oracle to MYSQL server. . . :)

I,m Using
OS: WIN7
ODBC DSN : hsodbc
DB1 : oracle XE
DB2 :MYSQL Server
DB2 : user "a" pass "a"
Database link from oracle 10g to sql server :
1.Setting up a system DSN(Data Source Name)
2.Setting hsodbc(oracle XE/10g)/dg4odbc(oracle11g-12c)
3.Setting tnsname.ora / listener.ora
4.Create db link to MYSQL
done!

1.

Configure ODBC by setting up a system DSN(Data Source Name)
Typically you can find this at
Start->Settings->Control Panel->Administrative Tools->Data Sources(ODBC)

2.

Look for inithsodbc.ora in $ORACLE_HOME/hs/admin/
Make a copy of it and rename it to init<your odbc Data Source Name>.ora
Remember we had chosen "hsodbc" as our DSN.
Open the file and enter the DSN that you just created recently i.e "hsodbc".
This is how $ORACLE_HOME/hs/admin/inithsodbc.ora should look like:

# This is a sample agent init file that contains the HS parameters that are
# needed for an ODBC Agent. 

#
# HS init parameters
#
HS_FDS_CONNECT_INFO = hsodbc
HS_FDS_TRACE_LEVEL = 0


#
# Environment variables required for the non-Oracle system
#
#set <envvar>=<value>

 3.

Configure listener.ora
$ORACLE_HOME/network/admin/listener.ora
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = hsodbc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
      (PROGRAM = hsodbc)

    )
  )
Note: SID_NAME should be your DSN name. PROGRAM=hsodbc or dg4odbc tells Oracle to use heterogenous services.

4.

Configure tnsnames.ora
$ORACLE_HOME/network/admin/tnsnames.ora
HSODBC =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = Lab)(PORT = 1521))
    (CONNECT_DATA = (SID = hsodbc))
      (HS = OK)
    )
HOST = Oracle Host
PORT = Oracle PORT
SID = your  DSN name

Restart your listener to make sure the settings are in effect.
lsnrctl stop
lsnrctl start
You can now validate the connection to your SQL Server database by the normal Oracle tnsping utility.
tnsping hsodbc
TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 01-DEC-2004 13:19:54

Copyright (c) 1997, 2003, Oracle.  All rights reserved.

Used TNSNAMES adapter to resolve the alias
Attempting to contact
 
OK (30 msec)


5.

Make sure that global_names parameter is set to false
SQL> sho parameter global_names

NAME               TYPE             VALUE
------------------ ---------------- -------
global_names       boolean          FALSE

Create a database link:

CREATE DATABASE LINK <<dblinkname>> CONNECT TO <<user MYSQLServer>> IDENTIFIED BY <<password MYSQLServer>> USING '<<connection string>>';

Example:
SQL> CREATE DATABASE LINK hsodbc CONNECT TO a IDENTIFIED BY a USING 'hsodbc';
Database link created.

We have completed our configuration.

Example:
SQL> desc emp@hsodbc
 Name          Null?      Type
 ------------- --------   --------------
 EMPID         NOT NULL   NUMBER(1)
 EMPNAME                  VARCHAR2(60)
 CREATED                  DATE
Note :

Check Whether HSODBC is Installed

The first common error is people do not check the OracleDB has installed hsodbc/dg4odbc on the DB or not.

The full text of the error reported to us was:

ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535

You may get this error if:

Oracle fails to connect to DG4ODBC/HSODBC. DG4ODBC/HSODBC cannot retrieve the underlying error from the ODBC driver.
open command prompt / terminal go to $ORALCE_HOME/bin
cd $ORALCE_HOME/bin
hsodbc
 you will see something similar to the following if HSODBC is installed:
hsoodbc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV)
If you get HSODBC: empty, your version of Oracle does not include HSODBC.


if you find this error

ORA-00942 table of view does not exist

MYSQLServer is not case sensitive as long as you omit the quotes. The following names are all identical:
TEST2, test2, Test2, TeSt2

The following tables are different:
"TEST2", "test2", "Test2"

So, use double quote (") between your table name, because oracle will send upper case command by default.

:) i hope it will help your problem.



Oracle DataBase Cold Backup scritp


Oracle DataBase Cold Backup scritp

Oracle DataBase Cold Backup scritp. . . 
It will help your work and easy to use.
Please drop a comment to tell me, if U find the wrong script or this script is not working.

1.

file name : cold_backup.sh

#!/bin/sh
date
echo " Performing Cold backup . . . "
echo " --------------------------------"
echo " Shuting down the databse . . ."
echo " --------------------------------"
./shutdb.sh
echo " Copy data file  . . . "
echo " --------------------------------"
cp -R -p /media/data1/oracle/oradata/ /media/data1/backup/oradata/
echo " --------------------------------"
echo " Restarting the database . . . "
echo " --------------------------------"
./startdb.sh

2.

file name : shutdb.sh


sqlplus / as sysdba << EOF
set feedback on
set echo on
shutdown immediate;

exit
EOF

3.

file name : startdb.sh


lsnrctl start
sqlplus / as sysdba << EOF
set feedback on
set echo on
startup;

exit
EOF


note :
i'm working under  *Ubuntu 10.10 and using *Oracle 10g.


Sequence current value and next value

Sequence current value and next value



SQL>
SQL> -- It is important to note that the value of CURRVAL is not populated until
after NEXTVAL has been used.
SQL>
SQL>

SQL> CREATE SEQUENCE StudentNumSeq
  2    INCREMENT BY 1
  3    START WITH 1100
  4    MAXVALUE 99999
  5    NOCACHE
  6    NOCYCLE;

Sequence created.

SQL>
SQL>
SQL> select StudentNumSeq.NEXTVAL from DUAL;

                 NEXTVAL
------------------------
                 1100.00

SQL>
SQL>
SQL> SELECT StudentNumSeq.CURRVAL FROM DUAL;

                 CURRVAL
------------------------
                 1100.00

SQL>
SQL>
SQL> drop sequence StudentNumSeq;

Sequence dropped.

SQL>
SQL>

Oracle Function PLSQL: Conversion date to number (hour,min)

Oracle Function : Conversion date to number (hour,min)

Use this function to get conversion date variable to number(hour,min) :

The function would generate date variable, (date1-date2) becomes number (hour,min)

FUNCTION GET_DURATION(d1 number) RETURN VARCHAR2 IS
--# d1 = tanggal awal
--# d2 = tanggal akhir
tmpvar VARCHAR2(100);
durdays NUMBER(20, 10); -- days between two dates
durhrs BINARY_INTEGER; -- completed hours
durmin BINARY_INTEGER; -- completed minutes
dursec BINARY_INTEGER; -- completed second
durhari PLS_INTEGER;
jhrs number;
jmin number;
thrs number;
BEGIN
durdays := d1;

durhari := TRUNC(d1);

durhrs := MOD(TRUNC(24 * durdays), 24);
durmin := MOD(TRUNC(durdays * 1440), 60);
dursec := MOD(TRUNC(durdays * 86400), 60);

jhrs :=(to_number(durhari)*24)+to_number(durhrs||'.'||lpad(durmin,2,'0'));
thrs :=jhrs;
RETURN(thrs);
END get_duration;


How to use :

select GET_DURATION(date_variable) from dual;

example :
select GET_DURATION(date1-date2) from dual;
or
select GET_DURATION((date1-date2)-(date3-date4)) from dual; 

Oracle Designer 6i: How install SQLLDR on win xp


Oracle Designer 6i: How install SQLLDR on win xp

A few weeks ago, i was looking for some articles that discuss "How to install SQLLDR on windows xp?" but i did not get satisfactory results.

After studying some of the structures that exist within the application Designer 6i, I did a little improvisation.

Oracle Designer 6i: How install SQLLDR on win xp?


1.

Download SQLLDR package by this link below.
http://www.4shared.com/zip/YEkcRoB3/sqlldr.html?

2.

Exact the file and it contains 2 files "des_817" and "des_817.reg"

3.

Copy folder  des_817 onto "C:\des_817"

4.

Run des_817.reg

5.

Set up the network connection by "regedit"
HKEY_LOCAL_MACHINE >> SOFTWARE >> ORACLE >> HOME2


TNS_ADMIN = "your networking path"

mine
TNS_ADMIN = C:\orades\net80\admin

How to use :

1.

Open command prompt (Run >> cmd)

2.


Type this script :
C:\des_817\bin\sqlldr userid=usr/pass@sid control=ctlfile
:)

Oracle Form 6i: How to put database data into List Item(Combo Box)?

Oracle Form 6i: How to put database data into List Item(Combo Box)?

Last days around, i just tried to make some List Item(ComboBox) that filed from database selected. . .
It's pretty good and easy enough.

1.

Create Program Unit :


PROCEDURE CREATE_Filenames_RG  IS
-- Andrew Fraser v2.2 27th May 2010
-- Populate dynamic lookup

    it_id1   Item := Find_Item('block.my_list_item');

    group1_id    RecordGroup;

    GRP_status       NUMBER;

    V_Space varchar2(10) := ''''||'0'||'''';

BEGIN

  group1_id := Find_Group('FILENAMES_RG');

  IF NOT Id_Null(group1_id) THEN
   delete_group(group1_id);
  END IF;
  group1_id := Create_Group_From_Query('FILENAMES_RG',
        'SELECT field FROM table ORDER BY field') ;

    Grp_status := Populate_Group('FILENAMES_RG');
   IF Grp_status = 0 THEN
If Not Id_Null(it_id1) THEN
  If Get_Item_Property(it_id1,Item_Type) = 'LIST' Then
   Clear_List(it_id1);
   Populate_List(it_id1,'FILENAMES_RG');
    END IF;
END IF;
END IF;

End;


2.

Create/edit triggers to call this:

On form startup:
When-New-Form-Instance on the form as a whole:

CREATE_Filenames_RG;

3.


And/or on mouse click if you want the database table requeried every single time the user clicks on the dropdown:

When-Mouse-Click on the new item itself:

Clear_List('CAS_UPLOAD');
Clear_Item;
CREATE_Filenames_RG;

easy right??


How to set Oracle Database in Arcivelog Mode ::Oracle10g

How to set Oracle Database in Arcivelog Mode ::Oracle10g

Here;s  How to set Oracle Database in Arcivelog Mode ::Oracle10g :

1.

SHUTDOWN immediate;

2.

STARTUP mount;

3.

ALTER DATABASE FLASHBACK ON;

4.

ALTER DATABASE ARCHIVELOG;

5.

ALTER DATABASE OPEN;


The startup command will use a temporary file as pfile with the following init.ora parameters:

6.


ALTER SYSTEM SET log_archive_dest_10 = "LOCATION=/media/data2/oracle_kjks_backup/archivelogs
OPTIONAL REOPEN=300" SCOPE=SPFILE;
spfile='/media/data1/oracle/product/10.2.0/dboracle/dbs/spfileorcl.ora'

crossword (ORACLE_TERBILANG)


Now, i ll share ORACLE_TERBILANG function.
ORACLE_TERBILANG function is describing number (IDR currency) to letters  in the word.

How to applicate function ORACLE_TERBILANG

1. 

Copy and run these scripts bellow on PLSQL :

-->
FUNCTION zright(iChar VARCHAR2,jumlah NUMBER) RETURN VARCHAR IS
Vpanjang NUMBER;
Vchar_Kanan VARCHAR2(100);
BEGIN
Vpanjang:=Length(iChar)+1-jumlah;
Vchar_Kanan:=SUBSTR(iChar,Vpanjang,jumlah);
RETURN Vchar_Kanan;
END;

FUNCTION ZMID(CStr IN VARCHAR2, STR IN INTEGER, LEN IN NUMBER DEFAULT 32767) RETURN VARCHAR2 IS
iMID VARCHAR2(32767);
BEGIN
If ( STR > Length(CStr) ) Then
RETURN( NULL );
END IF;
iMID := SUBSTR( CStr, STR, len );
RETURN ( iMID );
END;


function ORACLE_TERBILANG(angka number) return varchar2 is

strJmlHuruf number;
terbilang varchar2(32767);
intPecahan varchar2(32767);
strPecahan varchar2(32767);
urai varchar2(32767);
sMinus varchar2(32767);
strTot varchar2(32767);
x varchar2(32767);
y integer;
z integer;
Bil1 varchar2(32767);
Bil2 varchar2(32767);
pNumber varchar2(32767);

begin

/*Cek Panjang input Angka*/
pNumber :=length(angka);

if substr(angka,1,1) <> '-' then
if 16 <= pNumber then terbilang := ''; return(terbilang); end if;
Else
if 17 <= pNumber then terbilang := ''; return(terbilang); end if;
End If;

/*Cek Awal NOL*/
If angka is Null or angka =0 Then terbilang := 'NOL';
return(terbilang);
End If;

strJmlHuruf := LTrim((angka)); intPecahan := 0;

/*Cek Awal Minus*/
If InStr(strJmlHuruf, '-') > 0 Then
sMinus := 'MINUS ';
terbilang := ZRight(strJmlHuruf, length(strJmlHuruf) - 1);
strTot := terbilang; strJmlHuruf := terbilang;
End If;

/*Sementara Tdak ada pecahan :D*/
If (intPecahan = 0) Then strPecahan := ''; End If;

X := 0;
Y := 0;
Urai := '';

/*::::::::::::LOOP::::::::::::*/
While (X < length(strJmlHuruf)) Loop
X := X + 1;
strTot := ZMID(strJmlHuruf, X, 1);
Y := Y + (strTot);
z := length(strJmlHuruf) - X + 1;

/*::::::::::::::::::::::::::Select Case Val(strTot)::::::::::::::::::::::::::*/
if (strTot) = 1 then

/*:::::::::::::::::::::::::::*/
If (z = 1 Or z = 7 Or z = 10 Or z = 13) Then Bil1 := 'SATU ';

ElsIf (z = 4) Then
If (X = 1) Then Bil1 := 'SE';
Else Bil1 := 'SATU ';
End If;

ElsIf (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 14 ) Then
X := X + 1;
strTot := ZMid(strJmlHuruf, X, 1);
z := length(strJmlHuruf) - X + 1;
Bil2 := '';

if strTot = 0 then Bil1 := 'SEPULUH ';
ElsIf strTot = 1 then Bil1 := 'SEBELAS ';
ElsIf strTot = 2 then Bil1 := 'DUA BELAS ';
ElsIf strTot = 3 then Bil1 := 'TIGA BELAS ';
ElsIf strTot = 4 then Bil1 := 'EMPAT BELAS ';
ElsIf strTot = 5 then Bil1 := 'LIMA BELAS ';
ElsIf strTot = 6 then Bil1 := 'ENAM BELAS ';
ElsIf strTot = 7 then Bil1 := 'TUJUH BELAS ';
ElsIf strTot = 8 then Bil1 := 'DELAPAN BELAS ';
else Bil1 := 'SEMBILAN BELAS ';
end if;
else
Bil1 := 'SE';
end if;
/*:::::::::::::::::::::::::::*/

elsif strTot = 2 then Bil1 := 'DUA ';
elsif strTot = 3 then Bil1 := 'TIGA ';
elsif strTot = 4 then Bil1 := 'EMPAT ';
elsif strTot = 5 then Bil1 := 'LIMA ';
elsif strTot = 6 then Bil1 := 'ENAM ';
elsif strTot = 7 then Bil1 := 'TUJUH ';
elsif strTot = 8 then Bil1 := 'DELAPAN ';
elsif strTot = 9 then Bil1 := 'SEMBILAN ';
else Bil1 := '';
end if;
/*::::::::::::::::::::::::::END Select Case Val(strTot)::::::::::::::::::::::::::*/

If ((strTot) > 0) Then
If (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 14) Then Bil2 := 'PULUH ';
ElsIf (z = 3 Or z = 6 Or z = 9 Or z = 12 Or z = 15) Then Bil2 := 'RATUS ';
Else Bil2 := '';
End If;
Else Bil2 := '';
End If;

If (Y > 0) Then
/*::::::Select Case z:::::::*/
if z = 4 then Bil2 := Bil2||'RIBU '; Y := 0;
elsif z = 7 then Bil2 := Bil2||'JUTA '; Y := 0;
elsif z = 10 then Bil2 := Bil2||'MILYAR '; Y := 0;
elsif z = 13 then Bil2 := Bil2||'TRILYUN ';Y := 0;
end if;
End If;

Urai := Urai||Bil1||Bil2;
end loop;
/*::::::::::::END LOOP::::::::::::*/

Urai := sMinus||Urai||strPecahan;
If (intPecahan = 0) Then
Terbilang := Urai||'RUPIAH ';
End If;
return(terbilang);

end ORACLE_TERBILANG;

How to use ORACLE_TERBILANG

select oracle_terbilang(number) from dual;


Automatic Oracle 10g Startup and Shutdown at Ubuntu Linux system boot

Automatic Oracle 10g Startup and Shutdown at Ubuntu Linux system boot
Set the restart flag to “Y” in /etc/oratab, from something like this
dbname:/u01/app/oracle/product/10.2.0/db_1:N
to something like
dbname:/u01/app/oracle/product/10.2.0/db_1:Y
Copy&paste the boot script code that follows into /etc/init.d/dbora (the file dbora doesn’t exists, so create it) and modify the bold values to reflect your installation:


#!/bin/sh
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME PATH

ORA_HOME=/u01/app/oracle/product/10.2.0/db_1
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi

case "$1" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
        ;;
esac
 
 
Create the symbolic links related to boot runlevels [since I'm a long-time-Slackware-user and pretty new to Ubuntu, I'm not well versed about Ubuntu boot system so feel free to correct me (the comments are at the end of the post)]:

ln -s /etc/init.d/dbora /etc/rc0.d/k01dbora
ln -s /etc/init.d/dbora /etc/rc1.d/k01dbora
ln -s /etc/init.d/dbora /etc/rc2.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc4.d/S99dbora
 Release 2 bug: inside /u01/app/oracle/product/10.2.0/db_1/bin/dbstart there is a bug that will prevent the listener to start (Failed to auto-start Oracle Net Listener using /ade/vikrkuma_new/oracle/bin/tnslsnr); to solve change line 78 from

ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle/bin/tnslsnr

to

ORACLE_HOME_LISTNER=$ORACLE_HOME


Installing Oracle 10g on Ubuntu 9.10 (Karmic Koala)

Installing Oracle 10g on Ubuntu 9.10 (Karmic Koala)


Apparently, I need to install Oracle 10g on my Ubuntu, and there is no obstacle that's true. . .  of course if find the exactly guide.
And i think, it's so easy to Installing Oracle 10g on Ubuntu 9.10 (Karmic Koala).

If you encountered some trouble, you can leave the comment or just e-mail me, and i ll try to help you to fix it.

How to Install Oracle 10g on Ubuntu 9.10 (Karmic Koala)?


1. Install the dependency required
sudo apt-get install build-essential libaio1 rpm lesstif2-dev alien
2. Create User and group "Oracle"
sudo groupadd oinstall
sudo groupadd dba
sudo groupadd nobody
sudo useradd -g oinstall -G dba,nobody -m oracle -s /bin/bash
3. Set the User's password
sudo passwd oracle
4. Create the directory to install oracle 10g and set the owner to the "oracle:oinstall"
sudo mkdir -p /u01/app/oracle
sudo chown -R oracle:oinstall /u01/app/oracle
sudo chmod -R 775 /u01/app/oracle
5. Edit the parameter kernel on the file "/etc/sysctl.conf"
sudo gedit /etc/sysctl.conf
and add the parameters bellow :
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
6. Reboot your Computer or You can active it with run this script :
sudo /sbin/sysctl -p
7. Edit this file too  /etc/security/limits.conf
sudo gedit /etc/security/limits.conf
add the last part of file with this scripts
soft nproc 2047
hard nproc 16384
soft nofile 1024
hard nofile 65536
8. Create the symbolic links to cheating the Oracle 10g that your Ubuntu like  rpm and suitable with requirement, there are red hat enterprise linux (redhat-3 and redhat-4), sles, asianux.
sudo ln -s /usr/bin/awk /bin/awk
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /lib/libgcc_s.so.1 /lib/libgcc_s.so
sudo ln -s /usr/bin/basename /bin/basename
sudo touch /etc/redhat-release
sudo chmod 666 /etc/redhat-release
sudo echo redhat-4 > /etc/redhat-release
9. Reboot Your Computer and Logging in as Oracle's user
10. And then create file on the "/home/oracle/.bashrc"
gedit .bashrc
Add the scripts bellow, exit and save the file
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
11. Copy the Master Oracle 10g on the some directory, and extract it. And Run this script bellow on the terminal to install Oracle 10g. and follow the steps till Finish
./runInstaller -ignoresysprereqs
12. During the installation is running, Run this file as root
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh
Oracle is not automatically starting when you re restarting the computer. You need to follow those steps bellow to start the Oracle10g manually.
Log in as oracles user

##Starting Database

- Go into sqlplus as DBA with type this script
sql>sqlplus sys as sysdba
sql>startup
sql>exit

##Starting Listener

- Run the listener
$ lsnrctl start
$ emctl start dbconsole

How to Install Oracle Application Server 10g Release 2 on Ubuntu

How to Install Oracle Application Server 10g Release 2 on Ubuntu
Oracle Application Server 10g is a comprehensive solution for developing, integrating, and deploying your enterprise’s applications, portals, and Web services. Oracle Application Server 10g Based on a powerful and scalable J2EE server, Oracle Application Server 10g provides complete business integration and business intelligence suites, and best-of-breed portal software.

As the only platform designed for grid computing as well as full lifecycle support for Service-Oriented Architecture (SOA), Oracle Application Server 10g gives you unmatched scalability, availability, manageability, and security.

and now i ll show you,

How to Install Oracle Application Server 10g Release 2 on Ubuntu?

1. 

Create ‘oracle’ user and ‘oracle’ group
sudo adduser oracle
sudo addgroup oracle

2.

Now you need to add user ‘oracle’ add ‘root’ to secondary list of groups
You need to change the permissions of opt directory using the following command :
sudo chmod 775 /opt

3.

Log out and log in as oracle user
To fix a missing ‘ntcontab.o’ error, install the following packages
sudo apt-get install gcc make manpages-dev autoconf automake libtool flex bison gdb gcc-2.95-doc binutils
sudo apt-get install libdb1-compat

4.

Download the Oracle Application file ‘as_linux_x86_core_101202.cpio’ from here

5.

Extract in local user directory and run the installer using the following command

./runInstaller -ignoreSysPrereqs
At the end of the install near 95% if is says that it cannot verify that the instance is running(message:
/opmn/bin/opmnctl start), hit continue.

Waiting the installation process, when done then exit.
That’s all.

Go to :
http://localhost:1156
 for the admin console.

Thanks for visiting and consider to share this article if you find it useful.

#source : http://www.ubuntugeek.com/install-oracle-application-server-10g-release-2-in-ubuntu.html