|
Home > Archive > Sybase Database > January 2006 > Exiting ISQL with / w/o exit & quit
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Exiting ISQL with / w/o exit & quit
|
|
| deepak.rathore@gmail.com 2005-12-20, 3:23 am |
| Which is Suitable 1) or 2):
1)
isql -Usa -Ppassword -Sserver_name << EOF
go
select * from table
go
EOF
2)
isql -Usa -Ppassword -Sserver_name << EOF
go
select * from table
go
quit
EOF
Here in case 1) ,we r not exiting ISQL using exit or quit command.
In this case , will the session be remained open/ resource might not be
free properly.
Or it is perfectly fine i.e. 2) does not give any advantage.
| |
| michael.peppler@gmail.com 2005-12-20, 7:23 am |
| There is no difference - in both cases the connection will get closed
correctly.
Michael
| |
| pokerdragon 2005-12-20, 11:23 am |
|
michael.peppler@gmail.com wrote:
> There is no difference - in both cases the connection will get closed
> correctly.
>
> Michael
I'll add one thing, sort of unrelated, but since I work closely with
database security, I always cringe when I see people putting the -P
option on the isql command line, especially when it's the sa password.
A better option is to put the password as the very first line of your
input, i.e.:
isql -Sserver -Usa << EOF
password
select column from table
go
EOF
This prevents the sa password from showing up clear-text when someone
does a 'ps' on your box while the script is running. For tiny,
millisecond-duration sql statements, is there a high risk? No. Is
this anal retentive? Maybe. Is it easy to implement? Yes. Does it
provide better security? Yes. It's all the admin's choice in the end
I suppose.. but being in a government shop, I have no choice but to be
anal about this stuff.
-Mike
| |
| Michael Peppler 2005-12-20, 11:23 am |
| On Tue, 20 Dec 2005 07:57:29 -0800, pokerdragon wrote:
>
> michael.peppler@gmail.com wrote:
>
> I'll add one thing, sort of unrelated, but since I work closely with
> database security, I always cringe when I see people putting the -P option
> on the isql command line, especially when it's the sa password.
>
>
> A better option is to put the password as the very first line of your
> input, i.e.:
>
> isql -Sserver -Usa << EOF
> password
> select column from table
> go
> EOF
>
> This prevents the sa password from showing up clear-text when someone does
> a 'ps' on your box while the script is running. For tiny,
> millisecond-duration sql statements, is there a high risk? No. Is this
> anal retentive? Maybe. Is it easy to implement? Yes. Does it provide
> better security? Yes.
On most recent versions of isql the -P option gets hidden automatically.
But I agree in general.
Michael
--
Michael Peppler [TeamSybase] mpeppler@peppler.org - http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
| |
| pokerdragon 2005-12-30, 8:23 pm |
| Hi Michael,
When you say recent versions of isql... are you referring to the
sybase-released versions of ISQL? We are using ASE 12.5.3 ESD1, and
the isql binary we are using is $SYBASE/OCS-12_5/bin/isql, dated Mar 9
2004.
Where does this updated isql come from, and what are some of the
additional features it provides?
Thanks,
-Mike
| |
| Michael Peppler 2006-01-01, 7:23 am |
| On Fri, 30 Dec 2005 12:41:40 -0800, pokerdragon wrote:
> Hi Michael,
>
> When you say recent versions of isql... are you referring to the
> sybase-released versions of ISQL? We are using ASE 12.5.3 ESD1, and the
> isql binary we are using is $SYBASE/OCS-12_5/bin/isql, dated Mar 9 2004.
>
> Where does this updated isql come from, and what are some of the
> additional features it provides?
I forget exactly which EBF includes this change - but you can get it if
you install a recent EBF for the SDK (this can be installed on top of your
ASE installation with no problem).
In that release an explicit -P... parameter gets converted to something
else via a fairly simple technique (essentially changing the command line
and re-executing isql).
I'm currently implementing a similar technique for sqsh, btw.
Michael
--
Michael Peppler [TeamSybase] mpeppler@peppler.org - http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
|
|
|
|
|