If u want, than each sqlplus user have anything special in command promt u should:
-- use glogin.sql file for setup prompt line
-- use query that can get machine name and OS user name from session
for example:
select SID,OSUSER,MACHINE from v$session where sid = ( select distinct sid from v$mystat );
...
and then:
col v_r new_value prt noprint;
select '['||rtrim(OSUSER)||'@'||rtrim(MACHINE)||']SQL>' v_r from v$session where sid = ( select distinct sid from v$mystat );
set sqlprompt &prt
Two things though:
1. I'm just trying to learn how to run an OS command and use the output in a variable & or &&. I thought it was possible to do this in a select from dual; is this incorrect?
2. In the case of getting the host_name, we do not have select grants on v$session or v$instance, so these solutions don't work.
Bookmarks