How to recognize USB devices in Virtualbox running on a Linux host


sudo adduser $USER vboxusers
sudo addgroup usbfs
sudo adduser $USER usbfs
cat /etc/group | grep usbfs
echo "none /proc/bus/usb usbfs devgid=1004,devmode=664 0 0" | sudo tee -a /etc/fstab

Reboot mesin yang kita gunakan agar group baru & user permission dapat di update.


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

Compile .fmb in folder

one file

ifcmp60 Module=c:\workspaces\project\forms\section\form.fmb Userid=scott/tiger@db batch=yes module_type=form



in folder


FOR %i IN (.fmb) DO ifcmp60 Userid=scott/tiger@db batch=yes module_type=form module=%i batch=yes module_type=form compile_all=yes window_state=minimize


source :






https://dukez.wordpress.com/2010/11/15/compile-oracle-forms-6i-from-command-line-with-olb/

https://www.scribd.com/document/63561272/Batch-Compile-Script-for-Forms-Reports-Libraries-Menus-and-Also-Converting-Binary-to-Text-and-Back-ID-191529-1

How to sort the result from string_agg() / order by string_agg on oracle 10g

 Hi there now day i will share how to order by string_agg() result
and here it's the simple code :

select string_agg(prod,' | ') FROM
  (SELECT product as prod FROM tblproducts ORDER BY product )MAIN;


How to Copy a List of Files in a Windows Folder Into an Excel List

https://smallbusiness.chron.com/copy-list-files-windows-folder-excel-list-40032.html