Hi all , i'm trying to configure a Data Source for TimesTen in Weblogic server version 10.3
Seem that i had some problem about PLSQL_MEMORY_ADDRESS, this is the error message: TT8517: Cannot attach PL/SQL shared memory; PLSQL_MEMORY_ADDRESS not valid or already in use
I followed the guide here : http://download.oracle.com/otn_hosted_doc/timesten/1121/quickstart/html/admin/j2ee_weblogic.html
The first time i got this error i tried settings the PLSQL_MEMORY_ADDRESS in the sys.odbc.ini.
the machine is a 64 bit-linux and i found in this link a table about wich address memory to use:
http://otndnld.oracle.co.jp/document/products/V16967_01/doc/timesten.1121/e13069/attribute.htm#BABGCGEE +64-bit Linux 0000007fa0000000+
but the problem is still there.
Any suggestion or advice about what i can check about this error will be appreciated :).
Thanks in advance.
Try using the OS command "ipcs -m" to figure out the addresses at which shared-memory segments on this box start from and extend to. This should allow you to determine which shared memory segment is occupying the address at which TT wants to place its PLSQL memory segment. ipcs -ma will give you extra details such as PIDs, and this might allow you to identify who is using the already existing memory segment.
You need to identify a 'free' region within the process address space where the segment can be attached. The address space map for a process can be displayed using an O/S tool such as 'pmap'. In your case as this is Weblogic you need to use pmap on the JVM process ('java'). Find a suitable 'gap' of a size at least large enough for the size of the PLSQL shared memory segment and set PLSQL_MEMORY_ADDRESS to the start of that gap.
Every process is assigned a virtual address space by the O/S. For 32-bit O/S this space is typically 4 GB in size and for a 64-bit O/S the space is typically 17,179,869,184 GB in size (pretty large!). Of course, this is virtual space and most of it does not corrspond to real mmory and indeed, especially on 64-bit, most of the address space is 'empty' (i.e. not mapped to anything at all). When a process uses memory for something, some part of the address range becomes mapped to actual virtual memory of which some fraction is, at any one time, mapped to real, physical memory.
Addresses within the address space are a contiguous ascending sequence starting at 0 and incrwasing to the maximum size of the address space. Addresses are usually expressed as 32 or 64 bit hexadecimal values. So, for a 32-bit process the address range is 0x00000000 through to 0xffffffff while for a 64-bit process it is 0x0000000000000000 through to 0xffffffffffffffff. In general, the O/S will 'reserve' some parts of the address range for things like shared library/DLL loading and so on but this varies from O/S to O/S.
When a process attaches to a shared memory segment the segment has to be mapped into the process' address space. It can onloy be mapped into an area of the address space that is currently unused (i.e. it cannot 'overlap' anything already mapped in the address space. The key things are the start address at which the segment will be mapped and the size of the segment. By default, the TimesTen PLSQL shared memory segment is 32 MB in size (unless you have changed this by specifying a different value for PLSQL_MEMORY_SIZE). That is 0x00200000 in hex. So, we need to find an 'empty' space in the process address map that something of this size can fit into...
Tyhe 'pmap' command displays an address space map of a process. Each line represents a 'used' address range and is expressed in terms of the start address (in hex) the size of the area (usually in KB but see 'man pmap' for specifics) the memory protection attributes for that range and some info on what is mapped at that location (shared librray, data, stack etc.). What you need to do is to look at the (whole) output of pmap and find an address range that is at least 32 MB in size that is not usedfor anything. Note that pmap does not display unused ranges so you need to infer the presence of an unused area by looking at what is actually used. For example, consider the following pmap for the Linux shell, bash on 64-bit Linux:
Here we can see that there is lots of usage of the address space at low values up to the address 0x000000000b8a5000 (0x000000000b846000 + 380 Kb) but then there is a huge gap of unused space up to the next used address at 0x0000003329e00000 (/lib64/ld-2.5.so). That's a very large gap (much, much larger than 32 MB_ so this might be a good candidate to map the PLSQL segment in this process. We could chose an address of say, 0x0000000010000000 so we would set PLSQL_MEMORY_ADDRESS to 10000000 and we would be fine.
For another beer in Serbia, can you explane how to do this on Windows7 64bit? :) How to determine free memory "gap"? BTW, this error occurs ocasionaly, from time to time, so I'm not sure what causing it.