Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Database Scripts

4 posts in General Discussion Last posting was on 2009-04-13 17:48:10.0Z
Herman Miller Posted on 2009-04-13 15:14:57.0Z
Sender: 220.49e35687.1804289383@sybase.com
From: Herman Miller
Newsgroups: ianywhere.public.general
Subject: Database Scripts
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49e356f1.234.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 13 Apr 2009 08:14:57 -0700
X-Trace: forums-1-dub 1239635697 10.22.241.41 (13 Apr 2009 08:14:57 -0700)
X-Original-Trace: 13 Apr 2009 08:14:57 -0700, 10.22.241.41
Lines: 8
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7514
Article PK: 5923

Sybase 9.0.2.3534

2 questions. How can I close a database connection from a
sql script?

Also, how can I script a change of password for user dba?

Thanks


"Nick Elson [Sybase iAnywhere]" < Posted on 2009-04-13 16:12:34.0Z
From: "Nick Elson [Sybase iAnywhere]" <@nick@.@elson@@sybase@.@com@>
Newsgroups: ianywhere.public.general
References: <49e356f1.234.1681692777@sybase.com>
Subject: Re: Database Scripts
Lines: 30
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49e36472$1@forums-1-dub>
Date: 13 Apr 2009 09:12:34 -0700
X-Trace: forums-1-dub 1239639154 10.22.241.152 (13 Apr 2009 09:12:34 -0700)
X-Original-Trace: 13 Apr 2009 09:12:34 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7515
Article PK: 5924

> How can I close a database connection from a sql script?

If it is the current connection a disconnect; or exit;
may suffice. Depending upon what client and API
is being used.

"Which connection do you need to ***DROP***?"
and
"Why you need to do so?"
are two very important details you have left out. Knowing
that may be relevant to the answer.

> Also, how can I script a change of password for user dba?

GRANT CONNECT TO dba IDENTIFIED BY '##########';

Of course you need to be DBA or have that role granted
to you before you change this.

<Herman Miller> wrote in message news:49e356f1.234.1681692777@sybase.com...
> Sybase 9.0.2.3534
>
> 2 questions. How can I close a database connection from a
> sql script?
>
> Also, how can I script a change of password for user dba?
>
> Thanks


Herman Miller Posted on 2009-04-13 16:45:00.0Z
Sender: 220.49e35687.1804289383@sybase.com
From: Herman Miller
Newsgroups: ianywhere.public.general
Subject: Re: Database Scripts
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49e36c0c.4d4.1681692777@sybase.com>
References: <49e36472$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 13 Apr 2009 09:45:00 -0700
X-Trace: forums-1-dub 1239641100 10.22.241.41 (13 Apr 2009 09:45:00 -0700)
X-Original-Trace: 13 Apr 2009 09:45:00 -0700, 10.22.241.41
Lines: 35
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7516
Article PK: 5925

Not the current db. We need to refresh a training db from
production and need to close the training db before we can
overwrite it.

> > How can I close a database connection from a sql script?
>
> If it is the current connection a disconnect; or exit;
> may suffice. Depending upon what client and API
> is being used.
>
> "Which connection do you need to ***DROP***?"
> and
> "Why you need to do so?"
> are two very important details you have left out. Knowing
> that may be relevant to the answer.
>
> > Also, how can I script a change of password for user
> dba?
>
> GRANT CONNECT TO dba IDENTIFIED BY '##########';
>
> Of course you need to be DBA or have that role granted
> to you before you change this.
>
> <Herman Miller> wrote in message
> > news:49e356f1.234.1681692777@sybase.com... Sybase
> 9.0.2.3534 >
> > 2 questions. How can I close a database connection from
> > a sql script?
> >
> > Also, how can I script a change of password for user
> dba? >
> > Thanks
>
>


"Nick Elson [Sybase iAnywhere]" < Posted on 2009-04-13 17:48:10.0Z
From: "Nick Elson [Sybase iAnywhere]" <@nick@.@elson@@sybase@.@com@>
Newsgroups: ianywhere.public.general
References: <49e36472$1@forums-1-dub> <49e36c0c.4d4.1681692777@sybase.com>
Subject: Re: Database Scripts
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49e37ada$1@forums-1-dub>
Date: 13 Apr 2009 10:48:10 -0700
X-Trace: forums-1-dub 1239644890 10.22.241.152 (13 Apr 2009 10:48:10 -0700)
X-Original-Trace: 13 Apr 2009 10:48:10 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7517
Article PK: 5928

Given that you can go the simple way with either of
these:

DISCONNECT ALL;
or
STOP DATABASE . . . . . UNCONDITIONALLY;

or the hard way of determining all existing connections
[see sa_conn_info for example code for this part] using
a cursor on that use

DROP CONNECTION <connection_id>;

Either way you may want to also learn about the
use of our utility_db as well as our sa_server_option( )
procedure to disable new connections.

<Herman Miller> wrote in message news:49e36c0c.4d4.1681692777@sybase.com...
> Not the current db. We need to refresh a training db from
> production and need to close the training db before we can
> overwrite it.
>
>> > How can I close a database connection from a sql script?
>>
>> If it is the current connection a disconnect; or exit;
>> may suffice. Depending upon what client and API
>> is being used.
>>
>> "Which connection do you need to ***DROP***?"
>> and
>> "Why you need to do so?"
>> are two very important details you have left out. Knowing
>> that may be relevant to the answer.
>>
>> > Also, how can I script a change of password for user
>> dba?
>>
>> GRANT CONNECT TO dba IDENTIFIED BY '##########';
>>
>> Of course you need to be DBA or have that role granted
>> to you before you change this.
>>
>> <Herman Miller> wrote in message
>> > news:49e356f1.234.1681692777@sybase.com... Sybase
>> 9.0.2.3534 >
>> > 2 questions. How can I close a database connection from
>> > a sql script?
>> >
>> > Also, how can I script a change of password for user
>> dba? >
>> > Thanks
>>
>>