 |
|
Oracle Tips by Burleson |
OCP Instructors Guide for
Oracle DBA Certification
Chapter 8 -
Miscellaneous Oracle Information
Don’t Write Scripts
Don't write tuning, administration or
monitoring scripts if you don't have to. The Internet has an
abundance of web sites containing hundreds of scripts. Web sites to
try first are www.orafans.com, www.tusc.com, or search the web using
"oracle scripts" as the key word. Don't reinvent the wheel. Find a
reputable site and save time.
Don’t
Write Iterative SQL Statements – Generate SQL with SQL
If you need to perform the same alteration
repeatedly, you may not need to code a specific statement to perform
every change. You can use SQL to generate the statements for you.
The statement below combines hard coded values with values returned
from the database to generate an SQL statement that alters every
user’s default tablespace. The contents of that file can be used as
input to SQL*PLUS.
spool ‘c:\sql\output\alteruser.sql’
set verify off
set heading off
set echo off
set feedback off
set show off
set pagesize 0
set linesize 80
select 'alter user '||username||' default tablespace userwork;' from
dba_users;
spool off;
The above text is
an excerpt from:
OCP Instructors Guide for Oracle DBA Certification
A Study Guide to Advanced Oracle Certified Professional Database
Administration Techniques
ISBN 0-9744355-3-8
by Christopher T. Foot
http://www.rampant-books.com/book_2003_2_OCP_print.htm
 |
For more details and scripts, see my new book "
Oracle
Tuning: The Definitive Reference", over 900 pages
of BC's favorite tuning tips & scripts.
You can buy it direct from the publisher for 30%-off and get
instant access to the code depot. |
|