Smaller Footprint Oracle Client Software

Do you need to bundle Oracle Client Software with your application and want something leaner than the Oracle Instant Client? Do you need a quick and simple way to make a native Oracle 10 connection from your Windows PC?

Here’s an option that will provide Oracle 10 native connectivity (not ODBC) under Windows 32-bit using as few Oracle files as possible. Compressed size is 10 Megs compared to 17 Megs for the Oracle Client Basic Lite package.

Oracle10Client.zip

To install, you simply unzip the contents. The oracle key file contains a registry path that must correspond to the folder in which you have installed the client software. In the zip file, bin / oracle.key has

SOFTWARE\ORACLE\myOracle10Client

and the oracle10.reg file has

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\myOracle10Client]
“Oracle_Home”=”C:\\Program Files\\Oracle\\myOracle10Client”

You can use the oracle10.reg file to create the required registry entry.

You should update these files to point to the location in which you install the client software.

You can assemble this distribution yourself by paring down an Oracle 10 Client install to just:

BIN/
NETWORK/
RDBMS/
nls/
oracle10.reg
oracore/

./BIN:
ORASLAX10.DLL
TNSPING.EXE
oci.dll
oracle.key
oraclient10.dll
oracommon10.dll
oracore10.dll
orageneric10.dll
orahasgen10.dll
oraldapclnt10.dll
oran10.dll
orancds10.dll
orancrypt10.dll
oranhost10.dll
oranl10.dll
oranldap10.dll
oranls10.dll
orannzsbb10.dll
oranro10.dll
orantcp10.dll
orantns10.dll
oraocr10.dll
oraocrb10.dll
oraplp10.dll
orapls10.dll
orasnls10.dll
orasql10.dll
oraunls10.dll
orauts.dll
oravsn10.dll
oraxml10.dll

./NETWORK:
ADMIN/
mesg/

./NETWORK/ADMIN:
SAMPLE/
sqlnet.ora
tnsnames.ora

./NETWORK/ADMIN/SAMPLE:
SQLNET.ORA
TNSNAMES.ORA

./NETWORK/mesg:
tnsus.msb

./RDBMS:
mesg/

./RDBMS/mesg:
ocius.msb
oraus.msb

./nls:
data/

./nls/data:
lx00001.nlb
lx10001.nlb
lx1boot.nlb
lx20001.nlb
lx200b2.nlb
lx20367.nlb
lx207d0.nlb

./oracore:
zoneinfo/

./oracore/zoneinfo:
readme.txt
timezlrg.dat
timezone.dat

I should mention how this list was assembled. Initially, I used a very expensive product called AppSight (now BMC AppSight). Once I discovered by Mark Russinovich’s sysinternals, that worked just as well.

Advertisements
Published in: on April 23, 2008 at 6:27 pm  Comments (8)  
Tags: , ,

Passing Parameters to Oracle Report Builder Runtime

It’s a little tricky passing parameters to the Oracle Report Builder Runtime when they contain single-quotes. Here’s a way that works:


/oracle/product/8.0.6/bin/rwrun60 module=myReport.rdf batch=yes userid=scott/tiger@demodb.world mode=bitmap destype=file desformat=pdf desname=/report/output/myReport.pdf adt_begin=01-Feb-2007 adt_end=01-Feb-2008 as_lastname="O''Brien"

You wrap the value for non-dates with double-quotes. Change all single-quotes to TWO single-quotes.

as_lastname=
[doubleQuote]O[singleQutoe][singleQuote]Brien[doubleQuote]

Published in: on February 7, 2008 at 9:12 pm  Comments (12)  

A List Function for Oracle

SQL Anywhere has a very convenient LIST function for combining rows of data into a single column.

Ex.

SELECT LIST( emp_id, ';' ORDER BY emp_lname ) AS "Sorted IDs"
FROM EMPLOYEE
GROUP BY dept_id

Sorted IDs
160;105;1250;247;266;249;445;…
1039;129;1142;195;667;1162;902;…
1336;879;586;390;757;148;1483;…
1751;591;1062;1191;992;888;318;…
1013;191;750;921;868;1658;703;…

Since I have to move between SQL Anywhere and Oracle quite often, I needed a way to duplicate, as much as possible, this function in Oracle.

Tom’s stringAgg routine is a great start. It is a good example of building a custom aggregate function in Oracle. However, it doesn’t lend itself to specifying the delimiter. Certainly you can use REPLACE, but if your strings contain commas, you’re out of luck.

Here is a solution, built on Tom’s StringAggType, that uses an object to pass in a delimiter. It’s a little clumsy to call, and doesn’t support DISTINCT, but it does work. Suggestions for improvement are welcome.

SQL> select deptid, list(listparm(lname, '|')) 
from emp 
group by deptid;

DEPTID       LIST(LISTPARM(LNAME,'|'))
----------   --------------------------------------------------------------------------------
10           Jones|Johnson|Hendricks
20           Sewell|Rogers|Yancy
30           Yost|Smith|Carter|Smith
40           Michaels

The Code:

drop type ListType
/

create or replace type ListParm as object
(
   theString varchar2(4000),
   is_Delimiter varchar2(100)
);
/

create or replace type ListType as object
(
   is_Delimiter varchar2(100),
   theString varchar2(4000),

   static function
        ODCIAggregateInitialize(sctx IN OUT ListType )
        return number,

   member function
        ODCIAggregateIterate(self IN OUT ListType ,
                             value IN ListParm )
        return number,

   member function
        ODCIAggregateTerminate(self IN ListType,
                               returnValue OUT  varchar2,
                               flags IN number)
        return number,

   member function
        ODCIAggregateMerge(self IN OUT ListType,
                           ctx2 IN ListType)
        return number
);
/

show errors

create or replace type body ListType
is

    static function ODCIAggregateInitialize(sctx IN OUT ListType)
    return number
    is
    begin
        sctx := ListType( ',', null );
        return ODCIConst.Success;
    end;

    member function ODCIAggregateIterate(self IN OUT ListType,
                                         value IN ListParm )
    return number
    is
    begin
        self.is_Delimiter := value.is_Delimiter;

        self.theString := self.theString || self.is_Delimiter || value.theString;
        return ODCIConst.Success;
    end;

    member function ODCIAggregateTerminate(self IN ListType,
                                           returnValue OUT varchar2,
                                           flags IN number)
    return number
    is
    begin
        returnValue := rtrim( ltrim( self.theString, self.is_Delimiter ), self.is_Delimiter );
        return ODCIConst.Success;
    end;

    member function ODCIAggregateMerge(self IN OUT ListType,
                                       ctx2 IN ListType)
    return number
    is
    begin
        self.theString := self.theString || self.is_Delimiter || ctx2.theString;
        return ODCIConst.Success;
    end;

end;
/

CREATE OR REPLACE FUNCTION List(input ListParm)
RETURN varchar2
PARALLEL_ENABLE AGGREGATE USING ListType;
/

Published in: on January 17, 2008 at 5:22 pm  Comments (11)