O'Reilly logo

Unix for Oracle DBAs Pocket Reference by Donald K. Burleson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unix Server Environment

This section presents handy Unix commands that will make it easier for you to navigate in your Unix environment. The first part of this section looks at commands that can be automatically executed when you sign on to Unix as the Oracle user. There is a special file in your home directory in which you can place Unix commands that you want automatically executed when you sign on to the system. If you use the Korn shell, this file is named .profile. If you use the C shell, it will be called .cshrc. If there's any doubt, your Unix system administrator will be able to tell you the name of the file in your particular environment.

Also in this section, you will see how to create a standard Unix prompt, wrap SQL in a Unix script, and write a utility to quickly change all files in a directory. In addition, you will explore submitting background jobs and sending mail from Unix, and you'll use the powerful rsh command to make a script that visits multiple databases on multiple servers.

Set a Standard Unix Prompt

Placing the following code snippet in your .profile file will give you a Unix prompt that identifies your current server name, database name, and working directory. Knowing this information can help prevent you from accidentally running a command against the wrong database. Note that I have my prompt go to a new line after displaying the information, so that I have a full 79 characters in which to type my Unix commands.

#*********************************************** ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required