修改sqlplus提示符
如图所示 :
修改 提示符为 username(sid_serial#)@instance_name ,这样其实很方便的
以下是步骤
在11g中glogin.sql 文件是不存在的,取而代之的是 login.sql 直接编辑该文件就可
vi $ORACLE_HOME/sqlplus/bin/login.sql
set termout off define loginname=idle column global_name new_value loginname #select 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); select distinct sess.username||'('||sess.sid||'_'||sess.SERIAL#||')@'||inst.instance_name global_name from v$session sess,v$mystat stat ,v$instance inst where stat.sid=sess.sid; set sqlprompt '&loginname> ' set termout on define_editor=vi set linesize 200 set pagesize 100 #set time on #set timing on |
然后使用命令登录就能看见效果了
[oracle@Oracle11g bin]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 20 09:12:03 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
09:12:03 SYS(1_15)@prod>
是不是很简单