dq.in
上传用户:dgyhgb
上传日期:2007-01-07
资源大小:676k
文件大小:1k
- #! /bin/sh
- #
- # dq : delete shared resources - all shared memory and queues owned
- # by effective user id
- #
- # !!! Dangerous. Usefull in case of debugging SQL server crash only
- #
- # This file is a part of GNU SQL Server
- #
- # Copyright (c) 1997 Free Software Foundation, Inc.
- # This file is written by Michael Kimelman.
- #
- # Contacts: gss@ispras.ru
- #
- host_os=@host_os@
- ME=`who am i | awk '{ print $1}'`
- if [ "$ME" = "root" ]; then
- echo "$0 : too dangerous to use with root privilegs"
- exit 0
- fi
- A=`ipcs -q | grep "$ME" | sed -e "s/^[^0-9]*([0-9]{1,}).*/1/g"`
- for qid in $A; do
- echo -n "removing query $qid... "
- if [ "$host_os" = "linux" ]; then
- ipcrm msg $qid
- else
- ipcrm -q $qid
- echo "done"
- fi
- done
- A=`ipcs -m | grep "$ME" | sed -e "s/^[^0-9]*([0-9]{1,}).*/1/g;"`
- for mid in $A ; do
- echo -n "removing memory segment $mid... "
- if [ "$host_os" = "linux" ] ; then
- ipcrm shm $mid
- else
- ipcrm -m $mid
- echo "done"
- fi
- done
- echo -----------------------------
- ipcs