{"id":80,"date":"2014-02-09T13:57:00","date_gmt":"2014-02-09T15:57:00","guid":{"rendered":"http:\/\/maxoracle.com\/2014\/02\/09\/change-the-face-for-sqlplus-automatically-display-sid-and-connected-user-in-sqlplus\/"},"modified":"2014-02-09T13:57:00","modified_gmt":"2014-02-09T15:57:00","slug":"change-the-face-for-sqlplus-automatically-display-sid-and-connected-user-in-sqlplus","status":"publish","type":"post","link":"https:\/\/www.soudba.com.br\/?p=80","title":{"rendered":"Change the face for SQLPLUS  &#8211;  Automatically display SID and connected User in Sql*Plus"},"content":{"rendered":"<p><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">Show the name of instance on startup of sqlplus<\/span><br \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\"><br \/><\/span><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">set termout off<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">define gname=idle<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">column global_name new_value gname<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">select lower(user)||\u2019@\u2019 ||substr(global_name,1,decode(dot,0,length(global_name),dot-1)) global_name from (select global_name, instr(global_name,\u2019.&#8217;) dot from global_name);<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">set sqlprompt \u2018&amp;gname&gt;\u2019<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">set termout on<\/span><br \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\"><br \/><\/span><span style=\"color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;\"><span style=\"background-color:#fafcff;font-size:10.944000244141px;line-height:16.416000366211px;\">Put this code on file<\/span><\/span><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">&nbsp;\u201cglogin.sql\u201d in your $ORACLE_HOME\/sqlplus\/admin&nbsp;<\/span><br \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\"><br \/><\/span><span style=\"color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;\"><span style=\"background-color:#fafcff;font-size:10.944000244141px;line-height:16.416000366211px;\">before<\/span><\/span><br \/><span style=\"background-color:#fafcff;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\"><span style=\"color:red;\">SQL<\/span><\/span><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">&gt;show user<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">USER is \u201cSYS\u201d<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:red;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">SQL<\/span><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">&gt;<\/span><br \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\"><br \/><\/span><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">After<\/span><br \/><span style=\"background-color:#fafcff;color:red;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">sys@ORCL<\/span><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">&gt;show user<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">USER is \u201cSYS\u201d<\/span><br style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\" \/><span style=\"background-color:#fafcff;color:red;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">sys@ORCL<\/span><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\">&gt;<\/span><br \/><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\"><br \/><\/span><span style=\"background-color:#fafcff;color:#2a2a2a;font-family:Verdana, Tahoma, Arial, sans-serif;font-size:10.944000244141px;line-height:16.416000366211px;\"><br \/><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Show the name of instance on startup of sqlplusset termout offdefine gname=idlecolumn global_name new_value gnameselect lower(user)||\u2019@\u2019 ||substr(global_name,1,decode(dot,0,length(global_name),dot-1)) global_name from (select global_name, instr(global_name,\u2019.&#8217;) dot from global_name);set sqlprompt \u2018&amp;gname&gt;\u2019set termout onPut this code on file&nbsp;\u201cglogin.sql\u201d in your $ORACLE_HOME\/sqlplus\/admin&nbsp;beforeSQL&gt;show userUSER is \u201cSYS\u201dSQL&gt;Aftersys@ORCL&gt;show userUSER &hellip; <a href=\"https:\/\/www.soudba.com.br\/?p=80\">Continue lendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-sem-categoria"],"_links":{"self":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":0,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}