Upon logging onto a UNIX computer, a special login file
is executed to establish the UNIX environment.
Typically, these login commands perform the following
functions:
sample bash
.profile for Oracle
sample ksh
.profile for Oracle
- Basic UNIX environment commands
- Set the UNIX
command line editor
- Set Oracle aliases
- Set a
standard UNIX command prompt
- Changing the Oracle UNIX
environment
- Basic UNIX environment commands
There are several settings that should be configured when
logged onto UNIX. These login commands define the user
environment and are critical to success in UNIX. Start
with the basic environment command.
Set the Oracle shell environment
The first choice is which shell is needed as the default.
The choices are c-Shell (csh), Bourne shell (sh), Korn shell
(ksh), or the Bourne Again shell (bsh). In the example
below, the default shell is set to the Korn shell.
#***********************************************************
# Set environment to Korn shell.
#***********************************************************
ENV=.kshrc; export
ENV
Set the
umask parameter
The umask parameter is used to set the
default file protections for a user. As shown in the
following example, set the umask to 022.
#***************************************************************
# Set the umask to have 755 for
executables and 644 for text
#***************************************************************
umask 022
Set the UNIX terminal type
The following command sets the terminal
type for the session.
#***************************************************************
# Set the terminal to vt100
#***************************************************************
DBABRV=ora; export DBABRV
ORACLE_TERM=vt100; export ORACLE_TERM
TERM=vt100; export TERM
The UNIX command line editor
The next command is the setting for the command line
editor. This is the set –o command. Observe how the
command line editor makes the DBA's life in UNIX easier.
UNIX allows setting the type of command editor.
Once set, a variety of shortcuts can be used to quickly
redisplay previous UNIX commands. These shortcut commands
will greatly reduce the amount of typing at the UNIX prompt,
and a UNIX guru can always be recognized because of
their use of these command shortcuts. There are two
common settings for the command line editor, emacs and vi.
set –o emacs - This command sets the emacs editor for
editing online UNIX commands.
Command completion with emacs - the emacs setting allows
completing of long file names by pressing the escape key
twice (). For example, to vi the file
oracle_script_for_checking_permissions.ksh, enter vi oracle
, and the command line will display:
root> vi oracle_script_for_checking_permissions.ksh
Display previous commands - the emacs editor allow viewing
of the prior command by pressing the p keys.
set –o vi - This command sets the vi editor for online UNIX
commands. Once a command is displayed at the UNIX
prompt, use standard vi commands to edit the command.
In addition, the set –o vi command allows for easy searches
of the UNIX command history.
Command completion with
vi - the vi setting allows long file names to be completed
by pressing the escape backslash ( \). For
example, to vi the file
oracle_script_for_checking_permissions.ksh, enter vi oracle
\, and the command line will display:
root> vi oracle_script_for_checking_permissions.ksh
Display previous commands - the vi editor allows viewing of
prior commands by pressing the k key.
Search
the command history –search for a specific command in the
command history and display it on the command line by
pressing the escape key and the forward slash ( / ).
For example, to redisplay a command that contains ksh, enter
/, followed by ksh. The matching command will then be
displayed on the command line.
To automatically set this value, place the following code
in the login file (.profile, .kshrc
Backspace and
Keyboard editor setting - this setting allows the following
shortcuts:
# k -
to display command history
#
\ - for command completion
#
/ searchstring - to find a command in the
history file
stty erase ^? #Maps Backspace
character to backspace instead of ctl-h
set -o vi
export EDITOR=vi
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|