Tales From A Lazy Fat DBA

Den of an Oracle DB Performance freak & a fan of PostgreSQL & Cassandra …. \,,/

  • Likes

    • 148,965
  • Archives

  • ॐ

  • Categories

  • Subscribe

  • Advertisements

SQLPLUS: Command Prompt customizied.

Posted by FatDBA on November 15, 2012

Some tips and tricks for SQLPLUS terminal:

———————————————————-
SQL Prompt With Time
———————————————————-
SQL> set time on
09:50:16 SQL>
09:50:19 SQL> select sysdate from dual;

SYSDATE
———
20-APR-11

09:50:34 SQL>

———————————————————-
SQL Prompt With USER
———————————————————-
SQL> set sqlprompt “_USER> ”
SCOTT>
SCOTT>
SCOTT> select sysdate from dual;

SYSDATE
———
20-APR-11

SCOTT>

———————————————————-
SQL Prompt With SID
———————————————————-
SQL> set sqlprompt “_CONNECT_IDENTIFIER> ”
mydb>
mydb>
mydb> select sysdate from dual;

SYSDATE
———
20-APR-11

mydb>

———————————————————-
SQL Prompt With USER@SID
———————————————————-
SQL> set sqlprompt “_USER’@’_CONNECT_IDENTIFIER SQL> ”
SCOTT@mydb SQL>
SCOTT@mydb SQL>
SCOTT@mydb SQL> select sysdate from dual;

SYSDATE
———
20-APR-11

SCOTT@mydb SQL>

———————————————————-
SQL Prompt With DATE
———————————————————-
SQL> set sqlprompt “_DATE SQL> ”
20-APR-11 SQL>
20-APR-11 SQL>
20-APR-11 SQL> select sysdate from dual;

SYSDATE
———
20-APR-11

20-APR-11 SQL>

 
Many More Soon!!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: