Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: how to LOCK_SGA on Solaris

Re: how to LOCK_SGA on Solaris

From: Frank Langelage <frank_at_lafr.de>
Date: Wed, 31 Dec 2003 16:10:27 +0100
Message-ID: <bsuot9$1hqrf$1@ID-48907.news.uni-berlin.de>


Pete Finnigan wrote:
> Hi Frank,
>
> you cannot lock shared memory segments as oracle as only root can lock
> shared memory on solaris. If you must use this parameter then you need
> to simulate the parameter in C so you can still start the database as
> oracle:
>
> do the following in shell to get the shared segment id or use oradebug
> instead of ipcs
>
> ipcs -m | grep oracle | awk '{print $2'} | while read segment
> do
> fix_in_core $segment
> done
>
> compile the following C program as fix_in_core.c
>
> gcc -o fix_in_core fix_in_core.c
>
> #include <sys/types.h>
> #include <sys/ipc.h>
> #include <sys/shm.h>
> #include <errno.h>
>
> int main(int argc,char **argv)
> {
> int retval;
> int segment;
>
> segment=atol(argv[1]);
> retval=shmctl(segment, SHM_LOCK, (struct shmid_ds *)0);
> (retval==0)?printf("locked Segment %d\n",segment):perror("error
> locking segment %d\n",segment);
> exit(retval);
> }
>
> I did this from memory as i don't have a solaris box here today to test
> with but it should work for you.
>
> kind regards
>
> Pete

The script and the progam work. Thanks.
I made some changes in the C-Code:
- include stdio.h and stdlib.h for prototypes of atol, printf, perror, exit - perror only expects one string argument and doesn't need "\n" at the end. Received on Wed Dec 31 2003 - 09:10:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US