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.
Rudy Fernandes — — source: Informix-list mailing list archive (1991-1998)
Chris Pope wrote:
> Hi, I'm a neophyte Informix DBA. I'm trying to figure out how to automate
> the dropping of a database. I need to kill all the sessions and drop the
> database. How can I automate dbaccess to do this?
>
> Thanks.
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 80,000 Newsgroups - 16 Different Servers! =----
Here's a simple Unix script
#!/bin/ksh
# Kills all sessions connected to a specific Database
if [ $# != 1 ]; then
echo Usage $0 database
exit 1
fi
DB=$1
for SESSION in $(onstat -g sql | grep " $DB " | awk '{print $1}')
do
echo Killing Session $SESSION ...
onmode -z $SESSIONdone
### End of Shell Script ###
Presumably, while you are a neophyte *Informix* DBA, you know what you're
doing in the larger scheme of things. Wanting to kill users and drop
databases indicates a certain bent of mind.
Rudy
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.