cancel
Showing results for 
Search instead for 
Did you mean: 

Shared memory

SOLVED
Go to solution
Gerry Tully
Frequent Advisor

Shared memory

I have installed memory windows which seems to work for our 4 instances of Oracle. However, we have another application that now does not run. The log file says " Trying to use shared file instead of shared memory" Anyone have any insight into my next step? Thanks.
Any Ideas?
6 REPLIES
James Murtagh
Honored Contributor

Re: Shared memory

Hi Gerry,

First of all you need to identify if this application is stand-alone (creates and uses its own resources) or if it shares resources with another application.

If the first is true you will need to identify which system call failed and the exit code.

If the second is true and it is trying to share information with one of the windowed applications it will need to join that window to access the information.

For memory windows remember the global window (3rd quadrant) is still the default window for all applications that do not specify which window id to use. So if you are trying to attach to a shared memory segment that is in a unique window and don't specify a window id, this will try to attach to an address in the global window and will fail.

Regards,

James.
Gerry Tully
Frequent Advisor

Re: Shared memory

Thanks for the reply James. I guess at this point what I have is, the owner of the application can get in to it with out a problem. When anyone else tries to get in they can't. It seems it won't attach to the correct memory window. The memory window set for that application is set globally, so I would expect that anyone could get into it but apparently I'm wrong. Do you know any way around this? Thanks
Any Ideas?
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Shared memory

If indeed your memory window identifiers are assigned globally and your application has been altered to enable memory windows, I would next simply do an ipcs -ma and look to see if anyone other than the owner has access to the shared memory segment.

If it's actually a permission problem and you don't have access to the source then you could write a small c program making a shmctl() call to open the permissions on the shmid.
If it ain't broke, I can fix that.
Gerry Tully
Frequent Advisor

Re: Shared memory

Clay, after doing ipcs -am, that looks like the problem. The rights are 640. Being very unfamiliar in this area, how would I change them? Thanks
Any Ideas?
A. Clay Stephenson
Acclaimed Contributor

Re: Shared memory

Okay Gerry,

Here's my 3-minute C program.

1) cc shm.c -o shm

If you don't have a development C compiler, you can use the bundled compiler but you will need to convert the ANSI functions to K&R.

int main(int argc, char *argv[])
becomes
int main(argc, argv)
int argc;
char *argv[];

problem(char *msg, int err)
becomes
problem(msg,err)
char *msg;
int err;

As is, it will set permissions to 666 but you can change the NEW_PERMS define to anything you like.

2) Run ipcs -ma and determine the shared memory identifier. (The decimal identifier in the 2nd column of ipcs -ma output).

3) shm shmid

ipcs -ma should now display 666 permissions on this shmid.

It took me longer to type this stuff than to do the C.

Regards, Clay
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Shared memory

One more thing, Gerry:

The C program will need to be run by either the owner of the shmid or root; noone else will have sufficient permissions to do an IPC_SET.

You should man shmctl to see how this works.
If it ain't broke, I can fix that.