通过glogin.sql文件设置sqlplus登录的环境设置

编辑$ORACLE_HOME/sqlplus/admin下的glogin文件

详细内容如下所示:

define_editor=visetserveroutputonsize1000000settrimspoolonsetlong5000setlinesize100setpagesize9999columnplan_plus_expformata80columnglobal_namenew_valuegnamesettermoutoffdefinegname=idlecolumnglobal_namenew_valuegnameselectlower(user)||'@'||substr(global_name,1,decode(dot,0,length(global_name),dot-1))global_namefrom(selectglobal_name,instr(global_name,'.')dotfromglobal_name);setsqlprompt'&gname>'settermouton

保存之后使用sqlplus登录查看设置后的效果

[oracle@rac1~]$sqlplussystem/oracleSQL*Plus:Release11.2.0.3.0ProductiononMonDec715:11:452015Copyright(c)1982,2011,Oracle.Allrightsreserved.Connectedto:OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bitProductionWiththePartitioning,RealApplicationClusters,AutomaticStorageManagement,OLAP,DataMiningandRealApplicationTestingoptionssystem@RACDB>

使用sys登录

[oracle@rac1~]$sqlplus/assysdbaSQL*Plus:Release11.2.0.3.0ProductiononMonDec715:12:272015Copyright(c)1982,2011,Oracle.Allrightsreserved.Connectedto:OracleDatabase11gEnterpriseEditionRelease11.2.0.3.0-64bitProductionWiththePartitioning,RealApplicationClusters,AutomaticStorageManagement,OLAP,DataMiningandRealApplicationTestingoptionssys@RACDB>