ITPub博客

首页 > Linux操作系统 > Linux操作系统 > sqlplus显示登录用户名和实例名

sqlplus显示登录用户名和实例名

原创 Linux操作系统 作者:yhj20041128001 时间:2013-08-29 09:46:31 0 删除 编辑
1.Entry $ORACLE_HOME/sqlplus/admin,edit glogin.sql,add as follow SQL statement behind.

[hrmsoraclone@hrmodbt01 admin]$cp  glogin.sql  glogin.sql.bak
[hrmsoraclone@hrmodbt01 admin]$vi glogin.sql
define_editor=vi
set timing on
set serveroutput on size 100000
set linesize 100
set trimspool on
set long 5000
set termout off
default gname=idle
column global_name new_value gname
SELECT lower(USER) || '@' ||upper(instance_name)||'('||nvl(UTL_INADDR.GET_HOST_ADDRESS, SYS_CONTEXT('userenv', 'ip_address'))||')' GLOBAL_NAME FROM v$instance;
set sqlprompt '&gname> '
set termout on
2.when entry sqlplus,it show as follow
 
[hrmsoraclone@hrmodbt01 admin]$ sql
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Aug 29 09:50:56 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
sys@HRMCLONE(10.70.38.162)>

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23757700/viewspace-769474/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 绑定2网卡为bond0
请登录后发表评论 登录
全部评论

注册时间:2010-09-17

  • 博文量
    162
  • 访问量
    354679