U of A University of Arkansas Division of Agriculture

Pictures of chickens, flowers, wheat, a boy looking through a magnifying glass, irrigation pipe, soybean pods, and fruits and vegetables.

Cooperative Extension Service

Cooperative Extension Service

Agricultural Experiment Station

Steve Rea's
Oracle Tips, Tricks, and Scripts

Link to Steve Rea's Oracle Certification graphic


Search | Publications | Jobs | Personnel Directory | Links

User ID, Oracle SID, and Directory at UNIX Prompt

Instead of checking your environment variables or running whoami and pwd to make sure your unix session is set to the correct database and directory to run a program or script or upgrade, you can add the following line to the end of your .profile file in your unix home directory to show your unix user ID and the Oracle SID and current working directory at the unix prompt (instead of just showing a dollar sign).  For example, if I'm in my home directory and production database, this shows "srea:PROD:/home/srea$ " for my unix prompt.

PS1='$USER:$ORACLE_SID:$PWD\$ '

If you want all database users to see this session information whenever they log into unix, you could put it at the end of the oraenv script (such as /usr/lbin/oraenv).  This line works for AIX unix korn shell.  For other unix versions, you can look through the comp.unix.aix archives in usenet, searching for the word "prompt", for the appropriate prompt command (http://www.unixguide.net/ibm/faq/faq6.10.shtml has a search you can use).

This Page was Last Updated on 06/04/07

You Are Visitor Number

Hit Counter

Link to CES Home PageBack To CES Home Page

Link to Steve Rea's Oracle PageBack To Steve Rea's Oracle Page

Back to top of this pageBack To Top


© 2006
University of Arkansas
Division of Agriculture
All rights reserved.
Last Date Modified 02/09/2008
Webmaster

University of Arkansas • Division of Agriculture
Cooperative Extension Service
2301 South University Avenue
Little Rock, Arkansas 72204 • USA
Phone (501) 671-2000 • Fax (501) 671-2209
 

MissionDisclaimerEEO
PrivacyFOI