Re: login script
Date: 1995/03/31
Message-ID: <3lh1i6$6l9_at_tbsnames.turner.com>#1/1
In article <3lfbot$nve_at_lucy.infi.net>, gtravis_at_richmond.infi.net (Glenn Travis) writes:
> I'm always asking questions, so I thought I'd post a helpful script I use
> to set my sqlprompt var to tell me the time, server, and dbname. It's
> really useful if you have multiple instances and servers and are
> continually connecting all over the place across SQL*Net.
>
>
> login.sql
>
> set term off
> set trim off
> set feedback off
> set echo off
> set output off
> column name1 new_value prompt1
> column name2 new_value prompt2
> select name name1 from v$database;
> select substr(program,instr(program,'_at_')+1,instr(program,'
> ')-1-instr(program,'_at_')) name2 from v$process where program like
> '%SMON%';
> set sqlprompt "(&&prompt2)-&&prompt1 SQL> "
> set time on
> set pause "PRESS RETURN TO CONTINUE > "
> set feedback on
> set term on
>
>
> criticism welcome.
>
This works fine, but only when you first login to sqlplus. If you login to a different database using the 'connect username_at_database' command from sqlplus, the login.sql script won't be executed again so your sql prompt will show the wrong information.
Does anyone know of a way to circumvent that problem?
-- ------------------------------------------------------------------------------ Pierre Hollard Oracle Database Administrator Phone: (404) 827-0656 Turner Broadcasting System, Inc. E-Mail: phollard_at_dev1.turner.com ------------------------------------------------------------------------------Received on Fri Mar 31 1995 - 00:00:00 CEST