Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
STEPHEN SCOTT — — source: IIUG Forums & Mailing Lists
HP-UX
11i (pa-risc)(64 bit)
9.40.FC4
Is there a way to tell who is accessing a table.
We drop/recreate a table each night during our normal processing.
Last night we received a message {-106 (non-exclusive access)}
Is there any way to track down who is accessing that table (so I can
disconnect them)?
↪ replying to STEPHEN SCOTT
Andrew Ford — — source: IIUG Forums & Mailing Lists
Try the
following script:
DATABASE="$1"
TABLE="$2"
PIDS=""
echo "session id username hostname pid"
PARTNUM=`echo "select hex(partnum) || \\\\"|output\\\\" from systables where
tabname = \\\\"${TABLE}\\\\"" | dbaccess ${DATABASE} 2>/dev/null | grep output |
cut -d '|' -f1 | sed "s/0x//"`
for RSTCB in `onstat -g opn | grep -i ${PARTNUM} | awk '{print $2}' | sed
"s/0x//"`
do
SESSID=`onstat -u | grep -i ${RSTCB} | awk '{print $3}'`
OUTPUT=`echo "select \\\\"output|\\\\" || sid || \\\\" \\\\" || trim(username) || \\\\"
\\\\" || trim(hostname) || \\\\" \\\\" || pid from syssessions where sid = ${SESSID}"
| dbaccess sysmaster 2>/dev/null | grep output | cut -d '|' -f2`
echo ${OUTPUT}
done | sort -u
----- Original Message -----
From: "STEPHEN SCOTT" <dba.lumber@gmail.com>
To: <ids@iiug.org>
Sent: Monday, August 01, 2005 3:11 AM
Subject: Non-Exclusive Table Usage [5525]
> HP-UX 11i (pa-risc)(64 bit)
> 9.40.FC4
>
> Is there a way to tell who is accessing a table.
>
> We drop/recreate a table each night during our normal processing.
>
> Last night we received a message {-106 (non-exclusive access)}
>
> Is there any way to track down who is accessing that table (so I can
disconnect them)?
>
>
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.