Re: Modifying SQL*Plus Command Prompt on UNIX
Date: 1995/07/24
Message-ID: <3v0vj1$gri_at_madison.tdsnet.com>#1/1
moricet_at_ix.netcom.com (Tom Morice) wrote:
>Does anyone have a method to modify the UNIX SQL*Plus command prompt
>which includes elements such as UNIX hostname and Oracle userid. For
>example, I would like to set the prompt to look like the following:
>
> userid_at_hostname:SQL>
>
>where userid is the account the user is logged in to Oracle with
>and hostname is dynamically set based on the host the user is
>running SQL*Plus on.
>
>What would the glogin.sql or login.sql statements be to accomplish
>this?
>
>Would appreciate any help. Thanks.
>
Here's what we do:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[pythia:oracle]: cat glogin.sql
rem glogin.sql
rem
rem SQL*Plus global login startup file.
rem
rem This is the global login file for SQL*Plus.
rem Add any sqlplus commands here that are to be
rem executed when a user invokes sqlplus
rem
set termout off
column glogin_prompt noprint new_value _glogin_prompt
select substr(program,instr(program,'_at_')+1,instr(program,'
')-instr(program,'_at_')
-1)||':'||value glogin_prompt
from v$parameter,v$process where program like '%SMON%' and
name='db_name';
set sqlprompt 'SQL_at_&_glogin_prompt> '
set termout on
[pythia:oracle]: sqlplus /
SQL*Plus: Release 3.1.3.2.1 - Production on Mon Jul 24 15:20:51 1995
Copyright (c) Oracle Corporation 1979, 1992. All rights reserved.
Connected to:
ORACLE7 Server Release 7.0.16.6.0 - Production
With the procedural and distributed options
PL/SQL Release 2.0.18.1.0 - Production
SQL_at_pythia:fido>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Be sure to GRANT SELECT on the underlying V_$ views to PUBLIC as SYS.
-- ******************************************************* Mike Morgan Technology Integration Services - Unix DBA Mike.Morgan_at_teldta.com TDS Computing Services 301 S. Westfield Road Madison, WI 53705 USA (608)845-4661 "The DBA is always right ... even when he's wrong." *******************************************************Received on Mon Jul 24 1995 - 00:00:00 CEST