3.8K Java and JavaScript in the Database.Tried use TRIM (L and R) did not make any difference.Īny idea what function would help to either undercover the the garage/space or spacial character and formatted with correct light? Thanks in advance for any insight. But, for a reason I can’t yet, the sqlp complains it too long the max is 50.ġ) The actual numbers of characters for user-SID-Version-host is 39Ģ) the number the select returns is 68, there seems to be lost of added un-seem characters. The below custom prompt is to help regular users (no sys/system) I’ve shaped this to the point which shows me enough enough information. I'm thinking I could utilize your command and tweak it to show the cdb:pdb each time. New 1: alter session set container = pdb1īecause I'm using _CONNECT_IDENTIFIER each time I switch PDBs my SQLPROMPT stays the same. New 1: alter session set container = pdb2 Old 1: alter session set container = &PDB_NAME Prompt Choose which PDB/CDB you would like to switch to.ĬONTAINER: which PDB/CDB you would like to switch to. SELECT 'USER: '||SYS_CONTEXT('USERENV','CURRENT_USER') I'm probably querying the wrong view but I haven't had a chance to delve into it further yet. The switch.sql is still a work in progress because I can't see any other PDBS/CDBS from v$pdbs if I'm in a PDB (i.e. What I do now is I wrote a couple short scripts to give me information on "where" I am and to "switch" between environments. I see us using something like "alter session switch container" quite frequently as DBAs - maybe there is a more effective way to work on this but as I'm testing this is what I'm leaning on right now. In a 12c environment, where we have multiple PDBs for developers I see myself switching between them often to execute scripts, check jobs, create/unlock users, etc. With the Partitioning, OLAP and Data Mining help me to correct this.įor better or worse, I use system or / as sysdba for almost every connection I make to any DB I maintain. Below is my environment variable setting.Ĭ:\Program Files\Business Objects\common\3.5\bin\NOTES\ Ĭ:\Program Files\Business Objects\common\3.5\bin\NOTES\DATA\ ĭ:\oracle\product\10.2.0\BIN>dir login.sqlĭirectory of D:\oracle\product\10.2.0\BINīut, If i navigate to BIN folder and connect through sqlplus the login.sql script executes sucessfully.ĭ:\oracle\product\10.2.0\BIN>sqlplus Release 11.1.0.6.0 - Production on Sun Jun 27 16:09:27 2010 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Productionĭisconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production Please help me to setup this login.sql correctly.ĭ:\>sqlplus Release 11.1.0.6.0 - Production on Sun Jun 27 16:06:59 2010Ĭopyright (c) 1982, 2007, Oracle. I created a login.sql file and placed that in BIN folder and it seems not working properly.
On limited-authority accounts, it defaults to the connect identifier, otherwise I get the server:database name, as below.
My glogin.sql includes:Ĭolumn COUNT(*) format 999,999,999,999,999 Īs sqlprompt - default to TNS connectString+userĪlter session set nls_date_format='yyyy-mm-dd HH24:MI:SS' Now I can default to the _CONNECT_IDENTIFIER. However, some accounts don't have access to V$INSTANCE SQL*PLUS used to prompt me for the SQLPrompt when V$INSTANCE wasn't accessible. Sweet! I like showing server:database\user in my SQLprompt. I also tried it while adding a "set define off" command to the glogin.sql script, which gave me this: With the Partitioning, OLAP and Data Mining options Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production Select lower(user) || || global_name into gname from global_name I added this to glogin.sql on my Oracle 10gR2 client: Ok, I give my colorfull login.sql for unix terminals in 10g, largely inspired from this thread ! Please note that _USER is not equivalent to &_USER because &_USER is executed only during the "set sqlp" and _USER is executed for each prompt. However, the prompt buffer is limited to 50 characters, so if you have _PRIVILEGE" in your prompt, you have only 12 character left. SQL> set sqlp _PRIVILEGE> AS SYSDBA> conn > quit