Document Type | Technical Information
Category | Monitoring/Inspection
Applicable Product Versions | 6FS05, 6FS06, 6FS07, 6FS07PS, 7FS01, 7FS02, 7FS02PS
Document Number | TMOTI034
Issue
When booting the DB, the error
A shared memory segment with the same key already exists occurs and the startup fails.ASCMD> cd archive current path = +DS/archive ASCMD> ls <File_name> log-t0-r0-s5.arc - Number of files found: 1 ASCMD> rm log-t0-r0-s5.arc rm complete: +DS/archive/log-t0-r0-s5.arc --> archive deleted ASCMD> ls ERROR: no such path '+DS/archive/' (rc=-19)
Cause
When Tibero boots the DB, the shm key value is created by hashing
$TB_HOME and $TB_SID to generate a unique shm key, then shared memory is created using that key.If shared memory already exists with the same key and another process is attached to it, the
A shared memory segment with the same key already exists error occurs and the DB startup fails.Note that since the shm key is hashed from
$TB_HOME and $TB_SID values, a simple restart does not resolve the issue.Solutions
Check the
SHM_KEY value recorded in the log, identify the corresponding shared memory shmid, then remove that shared memory segment and restart the DB to boot normally.$ tbboot
**************************************************************
* A shared memory segment with the same key already exists.
* SHM_KEY = 0x1438469a
* Trying to reuse the shared memory segment....
**************************************************************
$ ipcs -m | awk '$1=="0x1438469a" {print $2}' | xargs ipcrm -m
--- '$1=="[Modify to match SHM_KEY value]"
$ tbboot
Listener port = 9292
Tibero 6
TmaxData Corporation Copyright (c) 2008-. All rights reserved.
Tibero instance started up (NORMAL mode).Note
$ ipcs -m | awk '$1=="0x1438469a" {print $2}' | xargs ipcrm -mExplanation of command
ipcs -m: Lists shared memory resources
awk '$1=="0x1438469a" {print $2}': Prints the second field of rows where the first field is 0x1438469a
xargs ipcrm -m: Removes shared memory using the passed argumentIn summary, this command queries shared memory resources, selects the shared memory whose first field (key) matches 0x1438469a, obtains its second field (shmid), and removes it using ipcrm -m.ipcs -mAdditional explanation related to commands
ipcs -s: Lists semaphore resources
ipcrm -s: Removes semaphores