Setting Sql Prompt to that of the connected Host

Hi all,
I work in a multiple Database environment. At times I've various
sessions open in SqlPlus. My problem is its really tedious to
keep track of which host my active window is connected to.
All I want to do is set my sql prompt to that of the Database
alias or my remote host ... (Automatically on Login)
Any suggestions ????

Here's a suggestion from another forum that should help you.
FYI, the next version of iSQL*Plus will have this feature by
default, so you'll always know the user and database to which
you're connected.
Here is how Tom Kyte does it. The following is an excerpt from
a response he gave to a similar question:
I use a login.sql with SQLPlus. I also make sure each and every
database has a unique global name (alter database rename
global_name to <some name>) or unique SID (i like the global
name myself).
In my login.sql i have:
column global_name new_value gname
set termout off
select lower(user) || '@' ||
decode(global_name, 'ORACLE8.WORLD', '8.0', 'ORA8I.WORLD',
'8i', 'ORA8IDEV.WORLD', 'dev8i', global_name ) global_name from
global_name;
set termout on
set sqlprompt '&gname> '
That makes my sqlprompt look like:
ops$[email protected]>
So, now I have my username and database in the prompt. I just
have to remember to use an @connect -- NOT connect when
connecting since the login.sql is run ONCE, not after every
connect. My @connect is simply:
connect &1
@login
If you want to use the ORACLE_SID instead of the global database
name, just "select instance global_name from v$thread" in the
above.

Similar Messages

  • Is it possible to set up a computer that uses the Sprint...

    Is it possible to set up a computer that uses the Sprint Pantech PX-500 (Mobile Broadband Card) to share its connection via Wi-fi? How would I set this up on a WRT54G?
    Thanks so much!
    -B

    If you haven't got the router then get WRT54G3G. If you already have a router then use it as a switch/access point, and use windows internet connection sharing or proxy server to share internet.

  • UAC Behaviour when set to "Prompt for Consent on the Secure Desktop"

    We are in the process of testing UAC on Windows 8.1. UAC is enabled for admins and the setting for "Behavior of the elevation prompt for administrators in Admin Approval mode" is set to "Prompt for consent on the secure desktop".
    This results in the administrator having to go through three separate prompts in order to execute the function which required elevation.
    First there is a dialog which gives the options "I want to complete this action by entering my credentials on the authentic Windows sign-in screen" or "I don't want to complete this action"
    Second there is a prompt to press CTRL-ALT-DEL to enter your credentials
    Third there is the prompt for consent on the secure desktop.
    Is there a way I can configure UAC to not have the first two prompts?

    Hi Fangzhou and thanks for the reply. The action is just to "Run as Administrator" on anything. Perhaps I should share the full set of settings I have in group policy:
    User Account Control: Admin Approval Mode for the Built-in Administrator account
    Enabled
    User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop
    Disabled
    User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode
    Prompt for consent on the secure desktop
    User Account Control: Behavior of the elevation prompt for standard users
    Prompt for credentials on the secure desktop
    User Account Control: Detect application installations and prompt for elevation
    Enabled
    User Account Control: Only elevate executables that are signed and validated
    Disabled
    User Account Control: Only elevate UIAccess applications that are installed in secure locations
    Enabled
    User Account Control: Run all administrators in Admin Approval Mode
    Enabled
    User Account Control: Switch to the secure desktop when prompting for elevation
    Enabled
    User Account Control: Virtualize file and registry write failures to per-user locations
    Enabled

  • HT4235 my iphone 4 wont connect to my laptop (windows 8) via usb but it will however register that it is there via 'photos' im not using the cable that came with my phone, does that affect the connection? i just want it to connect to my itunes again!!!

    my iphone 4 wont connect to my laptop (windows 8) via usb but it will however register that it is there via 'photos' im not using the cable that came with my phone, does that affect the connection?
    i just want it to connect to my itunes again!!!
    Thank you to anyone and everyone that manages to help!

    Hello webster995,
    Thank you for the details of the issue you are experiencing with your iPhone not appearing in iTunes.  I recommend following the steps in the article below to troubleshoot the issue you described:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • HT1338 I want to plug my Air into my TV. I have the latest HDMI adapter with sound. My TV has a HDMI port. Is there a setting in my Air that tells the computer to interface with my TV? I can't find it.

    I want to plug my Air into my TV. I have the latest HDMI adapter with sound. My TV has a HDMI port. Is there a setting in my Air that tells the computer to interface with my TV? I can't find it.

    Apple menu>System Preferences>Sound>Output, make sure the TV is selected as the device

  • Surfing the web I constantly get a dialog box popping up that says "The connection was rest" or " Server not found" or "The connection has timed out"

    Surfing the web I constantly get a dialog box popping up that says "The connection was rest" or " Server not found" or "The connection has timed out". The panel gives me three possible causes, none of which are correct and tells me to "Try again". Sometimes when I try again the site appears, sometimes it does after several tries and sometimes it never does. I called my IP, Cox and they told me it is a result of something Microsoft put out in their updates to IE (presumably to discourage people from using Firefox). Can you help me get rid of this problem?

    Surfing the web I constantly get a dialog box popping up that says "The connection was rest" or " Server not found" or "The connection has timed out". The panel gives me three possible causes, none of which are correct and tells me to "Try again". Sometimes when I try again the site appears, sometimes it does after several tries and sometimes it never does. I called my IP, Cox and they told me it is a result of something Microsoft put out in their updates to IE (presumably to discourage people from using Firefox). Can you help me get rid of this problem?

  • Urgent OmniPortlet JDBC SQL Server - Unable to establish the connection

    Not sure if this is the correct forum but as there is another JDBC question regarding portlets in this forum I have to give this a try as it is URGENT I get this solved.
    Please see my post in the Portal General Forum
    OmniPortlet DataDirect JDBC SQL Server - Unable to establish the connection
    Thanks!

    Not sure if this is the correct forum but as there is another JDBC question regarding portlets in this forum I have to give this a try as it is URGENT I get this solved.
    Please see my post in the Portal General Forum
    OmniPortlet DataDirect JDBC SQL Server - Unable to establish the connection
    Thanks!

  • Its just on the screen that shows the connect to itunes thing, someone pleaseee help ?

    Okay my ipod needs to be restored, but I have a passcode on it, and it wont let me do anything because i have a passcode.its just on the screen that shows the connect to itunes thing, someone please help? i would greatly appreciate it (:

    Connect in recovery mode and restore.
    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Refer to Updating and restoring iPhone and iPod touch software.
    If the issue continues after updating and restoring your device, refer to this document
    iPhone and iPod touch: Wrong passcode results in red disabled screen

  • How do I set up a template that opens the mix and arrange windows in multiple screens? I am using Mac OSX 10.6.4 and Logic 9. Thanks in advance for your time and advice.

    I want to be able to set up a template that opens my mix window on my laptop, and my arrange page on my bigger HP monitor.
    It seems that saving the template while this configuration is set doesn't save it.
    Bum.

    Hi microjac,
    You should be able to open the desired windows and lock the Screenset using the Screenset menu in the global menu bar. Then save as a template. This works using an Apple monitor with a MBP so hopefully will work with any display.
    mrjferrell

  • Workflows: How to set a workflow variable that is the difference in hours between now and a created date

    I'm trying to create a variable that contains the number of hours between the item created date and Now.  When i use TODAY, it seems to set the time at 12:00 rather than the time now - so that throws the hours off.  Any ideas?
    ajw

    Hi ajw,
    According to your description, my understanding is that you want to calculate the hours between the item created date and now.
    It seems to be not an OOB way to implement your requirement, to get the current time, you need to create a custom workflow activity for SharePoint 2010 workflow. About creating custom workflow activity, you can refer to the links below:
    http://msdn.microsoft.com/en-us/library/hh872790(v=office.14).aspx
    http://blogs-sharepoint-ashutoshmisra.blogspot.in/2013/02/create-custom-workflow-action-for.html
    Or, you can use a third party solution to achieve your requriement.
    Here are some similar posts for you to take a look at:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/e93ea37a-df09-4cbf-a58d-5d4def3d3d42/how-to-compare-time-in-sharepoint-designer-2010sp-2010-workflow?forum=sharepointgeneralprevious
    http://blog-sharepoint.blogspot.in/2009/03/get-current-time-in-sharepoint-designer.html
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • I have just downloaded firefox onto my laptop but it wont open. I keep getting a message that says: 'The connection has timed out' Can you help

    This is the message i get after a few seconds of trying to connect:
    The connection has timed out.
    The server at search.bearshare.com is taking too long to respond.
    The site could be temporarily unavailable or too busy. Try again in a few moments.
    If you are unable to load any pages, check your computer's network connection.
    If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

    Is this when you install the EXE, or when you are running Firefox, or some other time?

  • How do I get back the firefox page that has the connection to gmail, not just the search engine?

    When I open fire fox I get a page that says it is 'my web search'. There is no way to connect to g mail on that page. Previously, the page did searching and had a connection to g mail. I miss it. How do I get it back?

    Do you have the Test Pilot Addon? Test pilot was expirimenting with new tab pages recently, to determine which new tab page should make it into a later version of firefox (probably 9 or 10). I believe the study is over now, so they have removed the new tab page.
    To get a similar feature search http://addons.mozilla.org for '''new tab page''' or '''Speed dial''' extensions.

  • My ipod had a little rain damage and screwed up but later on fixed it and was fine. Later on that day the connect to itunes screen popped up and when i connected it it said "your ipod has a passcode" and then says try again. can anyone fix this?

    Yeah everything is in the question so plz hep me....

    Quinten,
    It will erase all of the information on your ipod. When was the last time you synced your ipod? If recently you should be able to recover most of your files. If not you will only be able to have the files since you last synced it to your computer. Can it sync it ignoring the passcode? If so try that. If none of these work you may just have to plainly restore it or put it in recovery mode.
                                                                          Thank you for choosing Apple!
                                                                               MH, an Apple expert

  • Telnet: Sending an output to the connected host.

    Hi all, I have written a GUI to connect to a host using a socket. This is going to be a MUD client (for all who know what a MUD is) and I can't seem to send anything to the host. Any suggestions? Also, the code returned by the host is in some computer language at some areas. Like when there is supposed to be colour it shows a squarebox then [32mL.
    This is the complete working code.
    Thanks.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.IOException;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.JTextArea;
    public class UMC extends JFrame implements Runnable {
         boolean connected = false;     
         BufferedReader br;
         BufferedWriter bw;
         Container c;
         Socket socket;
         JScrollPane jsp;
         JTextArea ta;
         JTextField tf;
         Thread thread;
         UMC() {
              super("Uknight Mud Client v0.1 - Unknown Knight 2004");
              c = getContentPane();
              c.setLayout(new BorderLayout());
              ta = new JTextArea();
              tf = new JTextField();
              thread = new Thread(this);
              jsp = new JScrollPane(ta, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
              ta.setEditable(false);
              ta.setBackground(Color.black);
              ta.setForeground(Color.white);
              tf.addActionListener(new TextInputHandler());
              c.add(jsp, BorderLayout.CENTER);
              c.add(tf, BorderLayout.SOUTH);
              setSize(800,600);
              show();
              tf.requestFocus();
              connect("tharsis.dyndns.org", 8765);
         public static void main(String args[]) {
              JFrame.setDefaultLookAndFeelDecorated(true);
              new UMC();
         public void connect(String host, int port) {
              try {
                   output("Attempting to connect to " + host + ": " + port);
                   socket = new Socket(host, port);
                   br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                   bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
                   connected = true;
                   thread.start();
              } catch (IOException e) {
                   JOptionPane.showMessageDialog(null, "Cannot connect to " + host + ": " + port, "Cannot connect", JOptionPane.ERROR_MESSAGE);
         public void run() {
              while(connected) {
                   try {
                        if(br.ready())
                        output(br.readLine());
                   } catch (IOException e) {}
                   try {
                        thread.sleep(5);
                   } catch (InterruptedException e) {}
         public void output(String text) {
              ta.append(text + "\n");
              jsp.getVerticalScrollBar().setValue(jsp.getVerticalScrollBar().getMaximum());
         class TextInputHandler implements ActionListener {
              public void actionPerformed(ActionEvent e) {
                   if(connected)
                   write();
                   else
                   output("You are not connected yet!");
                   tf.setText("");
         public void write() {
              try {
                   bw.write(tf.getText(),0,tf.getText().length());
                   bw.flush();
              } catch(IOException e) {}          
    }

    Erm I got it to work using PrintWriter already thanks..... Though I need help about how to import the colours and such, and I do get some weird characters like Ys with some dots above them. Any suggestions?

  • How to set SQL trace in OCI session ?

    Hello,
    In a SQL*Plus session, I can use the SQL statement "alter session set sql_trace=true;" to set SQL trace in that session only. I assume I could execute the same SQL statement from C code in an OCI client and achieve the same goal.
    However, if I cannot change the code of this OCI client, is there a way to set SQL trace for that single session alone, without changing the C code? Say, through an environment variable, configuration file, etc.?
    Thanks.

    I am not aware of a way to selectively enable the server-side tracing without modifying the client code.
    There is client tracing available by setting the environment variable EVENT_10842 as follows:
    "server=<>;user=<>;stmt=<>;level=<>;interval=<>"
    e.g.
    setenv EVENT_10842 "server=inst1,inst2;user=scott,system;stmt=all;level=15"
    Where:
    "server" is a comma separated list or "all"
    "user" is a comma separated list or "all"
    "stmt" can be INSERT,UPDATE,DELETE,SELECT or "all"
    The following levels are supported:
    1 - Trace all server attach and server detach calls for servers listed in "server" attribute of the environment variable.
    2 - Trace all session begin, logon, session end, logoff calls for the users listed in "user" attribute of the environment variable.
    3 - Trace all prepare, execute, fetch calls for the specified statement types listed in "stmt" attribute of environment variable.
    4 - Trace all Bind, Define, Describe calls.
    5 - Trace all OCI LOB calls
    7 - Get statistical info on all connection pooling /connection related calls
    8 - Get statistical info on all session info
    9 - Get statistical info on all handle info
    10 - Get statistical info on time taken in execute and fetch calls
    11 - Get statistical info on transaction related calls
    15 - Trace all calls with statistical info.

Maybe you are looking for

  • DMS Document Name

    Hi guys.. How can i create an DVS Document (CV01N) and keep the Filename after checking the document in alive? The Doc Name is only visible before Chekcing in!

  • Sold to party adress copy to ship to party

    HI, when customers place an order on the internet they get a choice to deliver to a different delivery address. When customers choose this option and type in a different address it does not ask them to enter in a tel number. Would it be possible in s

  • Organizational Chart with specific colors in OBIEE 11g

    Hi Gurus, How to create organizational chart in OBIEE? I tried to follow this link Oracle Business Intelligence by Sandeep Venu: Google Organization Chart in OBIEE 11G but can't find out how to make specific chart (example chart of manager position)

  • Odd mailbox behaviour

    Hello I use gmail. On my iphone and ipad it could not be simpler - everything goes straight into my inbox ... I always know it's there, and can decide where to move it. On my macbook air the mailbox behaves differently. Most (but not all) of my mail

  • Resource Adapter Design

    I am fairly new to IdM and have had little training on it. I need assistance with a Resource Adapter design question. I need to create an adapter that will read a database table of application accounts and associated attributes, and then link those a