glogin.sql supress error when Instance Idle I have a pl/sql block in my glogin.sql file to show information from v$instance when I connect on the database server.  Is there a way to suppress the ORA-01034 we would naturally get when the instance is idle?  An idle instance reports that it is idle when you connect, so anything additional is not necessary and could be confusing.
This is what I use in my login.sql. Tom Kytes book Expert One on One has this script. No sign of ORA-01034 when instance is down. My prompt only shows idle&gt;

set term off    

-- a lot of stuff

REM here is how I set my signature prompt in sqlplus to 
REM username@database&gt; I use the NEW_VALUE concept to format 
REM a nice prompt string that defaults to IDLE (useful for those
REM of you that use sqlplus to start up their databases - the
REM prompt will default to idle&gt; if your database isn't started)
define gname=idle
column global_name new_value gname
select lower(user) || '@' ||
substr(global_name, 1, decode(dot, 0, length(global_name), dot-1)) global_name
from (select global_name, instr(global_name, '.') dot
from global_name);
set sqlprompt '&amp;gname&gt; '

-- a lot of more stuff    

set term on