VMS Link problem and Oracle OCI

From: Ray Steel <103125.3226_at_CompuServe.COM>
Date: 1995/12/07
Message-ID: <4a7svo$k8p$1_at_mhafn.production.compuserve.com>


Here is my problem:

I am attempting to create a shareable image on VAX/VMS using the Oracle OCI routines. This shareable image (call it RAYIMAGE) contains all the database access calls for a number of different databases (Oracle, Sybase, RDB etc). It is usually activated by a find_image_symbol() call. For a number of reasons, it MUST be a shareable image.

My problem is that when I link it with the following (required) line in the options file:

        CLUSTER=SGAPAD,512,,ORA_OLB:SGAPAD my linker goes crazy paging away, and eventually (1/2 hour later), creates a 10,565 block image file (after bringing the system to its knees). Linking a non shareable image creates a 400 block file in 30 seconds.

The Linker Map for RAYIMAGE shows the following:

Module Name  Ident              Bytes      File 
-----------  -----              -----      -----
SGAPAD       RDBMS 7.1.X        5242880    [ORACLE7.RDBMS]SGAPAD.OBJ;1
                    
	...
   Cluster      Type Pages   Base Addr  Disk VBN PFC Protection and Paging
   -------      ---- -----   ---------  -------- --- ---------------------
   SGAPAD          4     1    00000200         3   0 READ ONLY    
                   4 10239    00000400         4   0 READ WRITE   COPY ON REF


The Linker Map for a simple executable shows:

   Cluster      Type Pages   Base Addr  Disk VBN PFC Protection and Paging
   -------      ---- -----   ---------  -------- --- ---------------------
   SGAPAD          0     1    00000200         3   0 READ ONLY    
                   0 10239    00000400         0   0 READ WRITE DEMAND ZERO  


Note the difference 'COPY ON REF' verses 'DEMAND ZERO'. I suspect that the linker is creating 10240 blocks of empty space in my shareable image.

I guess my first question would be.

        How do I make that PSECT demand zero?

If I can't do that, could I globaldef two symbols and allocate the right amount of memory at run time? I actually tried this, but the pager went crazy again at allocation time and I had to kill the process.

I don't understand why a simple executable with a large demand zero psect like this works fine compared to the other options.

I tried changing the attributes of the psects to PIC also - no difference.

Is it even possible to create a shareable image with this sort of code?

If you would prefer to email me, my address is:

103125.3226_at_compuserve.com

Thanks for any light you can shine on this problem.

Ray Steel


Here are the relevant details, including the offending sgapad routine:

Link statement:


	$LINK/DEBUG/map/full/NOEXE QOPN, STUBS, -

,[]QRTL/OPT/SHARE=QRTL -
,[]ORADB_OPTIONS/OPT

ORADB_OPTIONS.OPT:


		ORA_UTIL:OCI/LIB/INCLUDE=OCICEE,-
		ORA_UTIL:KLIB/LIB/INCLUDE=(SL),-
		ORA_RDBMSV71/SHAREABLE,-
		ORA_COREV71/SHAREABLE,-
		ORA_UPISHRV71/SHAREABLE
	CLUSTER=SGAPAD,512,,ORA_OLB:SGAPAD
	SYMBOL=OSNSOI,0
	SYMBOL=OSNCOI,0
	SYS$SYSTEM:SYS.STB/SELECTIVE
	PSECT_ATTR = $CHAR_STRING_CONSTANTS,SHR,NOWRT,EXE
	PSECT_ATTR = ___ORACLE_SYSTEM_DESC___,NOWRT

SGAPAD.MAC+SGAPAD.MAR


	; Created by ORA_RDBMS_FCR.COM on  4-DEC-1995 18:33:23.22
	_sgalength  = 1024*5120
	_sgabase    = 512
	_sgapadding = 512
	_sgachksize = 8

;
;  Copyr (c) 1994 Oracle
;
; copyright (c) 1992 by the Oracle Corporation
;
; NAME
;   sgapad
; FUNCTION
;   Pad for the maximum SGA
; NOTES
;   The VMS linker must know the size and location of the address space to
;   reserve for the ORACLE SGA, an area called the SGA pad.  The purpose
;   of the SGA pad is to prevent user routines and memory returned by
;   the VMS memory allocation routines (especially LIB$_GETVM) from
;   being mapped into the virtual addresses where we will expect to
;   find the SGA.  Since the SGA will only be mapped by ORACLE long
;   after most images have been mapped and memory allocation is done,
; we reserve the addresses at link time in the form of demand-zero ; pages.
; MODIFIED
;   RJaganna  09/14/94 - make ___ORACLE_SYSTEM_DESC nowrt; page align psects  
;   TSepez    03/08/94 - Store size of pad in pad for runtime checks.  
;   TSepez    05/12/92 - Created from base file  
  
        .title   sgapad  
        .ident   " RDBMS 7.1.x  09/15/94"  
        .psect  ___ORACLE_SYSTEM_DESC___,-  
                page,nopic,ovr,rel,lcl,noshr,noexe,rd,nowrt,novec  
        .asciz  /SGA/                   ; Tag  
        .long   _sgalength              ; Store size  
        .blkb   _sgapadding-_sgachksize ; Pad to page boundary. no gaps.  
  
        .psect  ___ORACLE_SYSTEM_GLOBAL_AREA___,-  
                page,nopic,ovr,rel,lcl,noshr,noexe,rd,wrt,novec  
                ; keep the psect wrt so that it can be demand zero filled  
        .blkb   _sgalength-_sgapadding  ; allocate maximum sga length  
        .end  
Received on Thu Dec 07 1995 - 00:00:00 CET

Original text of this message