Any Idea's ?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Any Idea's ?

  1. #1
    Join Date
    Nov 1999
    Location
    Kuwait
    Posts
    122

    Any Idea's ?

    I could make my SQL prompt like this USERNAME@DB1>, Where username is the DB username and DB1 is the global name of the DB. By editing the glogin file and adding the folowing enteries
    define X=NotConnected
    define Y=DBNAME

    Column Usr New_Value X
    Column DBName New_Value Y


    Select SYS_CONTEXT('USERENV','SESSION_USER' ) Usr From Dual;

    Select SYS_CONTEXT('USERENV','DB_NAME') DBNAME From Dual;

    set sqlprompt '&X@&Y> '

    But I want to get the alias from the tnsnames.ora file, if my tnsnames.ora file would have an entry like following then i would like to see my sql prompt like this SCOTT@DBTEST

    DBTEST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 111.1.1.1)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = ora9i)
    )
    )
    Any ideas out there?
    NK
    ====================================================
    Stand up for your principles even if you stand alone!
    ====================================================

  2. #2
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796

    Thumbs down

    No ideas
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  3. #3
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727

    idea!

    If you are using Oracle 9i, use the "external tables" with tnsnames.ora as the data source and get the string from the tnsnames.ora. Then set the sqlprompt. I havn't tried, just a clue for you!

    Thomas
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width