Check out this valuable book by Jon Emmons on
Linux for the Oracle DBA for more tips and tricks.
Suppose there exists a need to find a UNIX script that searches
every file on the UNIX server for a file that queries the
dba_2pc_pending view.
Assume the name and location of the file have been completely
forgotten, and we need a script to quickly locate our SQL statement.
- The first step is to write a command that will display all
file names on the server. This is quite simple in UNIX, and it
returns a list of every file on the server:
find
. -print
/home/oracle/sqlnet.log
/home/oracle/export.sh
/home/oracle/mon
/home/oracle/mon/a.ksh
/home/oracle/mon/alert.ksh
/home/oracle/mon/count.ksh
/home/oracle/mon/create_mon1_tables.ksh
/home/oracle/mon/fix_db.ksh
/home/oracle/mon/get_vmstat.ksh
/home/oracle/mon/oracheck.lst
/home/oracle/mon/alerts_PROD.lst
/home/oracle/mon/mail_reports.ksh
- We now have a complete list of all of the
UNIX files. Because we know that the grep commands accepts file
names as an argument, we can use xargs to search each file for
our Oracle table name:
>find
. -print|xargs grep -i dba_2pc_pending
home/oracle/sql/pending.sql: dba_2pc_pending
find / -print
"add listing"
This ability to take a basic UNIX command and chain it with
other commands is a fundamental principal in UNIX shell programming
for Oracle.
|
|
|
Get the Complete Details on
Linux System Management for Oracle DBAs
The landmark book
"Linux for the Oracle DBA: The
Definitive Reference"
provides comprehensive yet specific
knowledge on administering Oracle on Linux. A
must-have reference for every DBA running or planning to run
Oracle on a Linux platform.
Buy it
for 30% off directly from the publisher.
|
|
|
|
Burleson is the American Team

Note:
This Oracle
documentation was created as a support and Oracle training reference for use by our
DBA performance tuning consulting professionals.
Feel free to ask questions on our
Oracle forum.
Verify
experience!
Anyone
considering using the services of an Oracle support expert should
independently investigate their credentials and experience, and not rely on
advertisements and self-proclaimed expertise. All legitimate Oracle experts
publish
their Oracle
qualifications.
Errata?
Oracle technology is changing and we
strive to update our BC Oracle support information. If you find an error
or have a suggestion for improving our content, we would appreciate your
feedback. Just
e-mail:
and include the URL for the page.
Copyright © 1996 - 2020
All rights reserved by
Burleson
Oracle ®
is the registered trademark of Oracle Corporation.
|
|