Oracle Scripts and Tips

Robert Hanrahan

No_Copyright

This page was created to give some usefull scripts + more to people who are involved in Oracle 
Databases in a Unix server. In my case I work with Oracle 8.1.7 and Tru64 Unix 5.1a in cluster.
I have been working with Oracle for few years and mainly I've been more a "Physical DBA" than the 
usual pl/sql gurus who work close with the development team and create all these nice materialized 
views, procedures, triggers, sequences and various exotic kind of indexes .) 
What I like is the planning of creating a DB and see the best way to distribute the data/work load, 
 where to physically place the datafiles. Having in the first place the good idea to separate the 
datafiles (tables away from indexes) and finally to monitor the overall DB and check that there 
are no violent queries that will slow down the whole thing.
When the speed slows down in the DB, people will blame you for it, and they will try to stress you out.
maybe you didn't check the many things a DBA must be looking at. 
You should create a directory,  and later back it up, where you put all the scripts used for the
creation of the database and the creation of some new tablespaces and a file where you write 
down all the changes from the start. When you change some parameter (especcially in the init file)
make sure you have the old value stored somewhere:

you can comment an old value of it: shared_pool = 160000 #12000 old
Here you can get the scripts, I have taken some scripts around too. It is a good thing to search
aroung the web, you'll find more than what you wanted to search! Though sometimes it leads you 
nowhere and you'll get caught in a never ending trip... Anyway, I like looking in forums and if
I can be of any help I write the guy who had that particular question or problem and give him 
the solution, that is not just verbally but I enclose the full script! How can he do anything if he
has no SQL reference? It is funny that all these people who get the "verbal" reply write back
asking "how do I make that? Does anyone know how?" :| 

 I've read a nice but too "slave-like-devoted-to-client DBA" whitepaper in which he said that it
is difficult to get scripts from people, why? Because they do not want to share their scripts! 
I do the opposite. When I finish one script I send it to my DBA friends and to ORACLE_DBA_TIPS.
I like the idea that people will benefit from it.
alter_table_initial_next.sql alter_table_mod_column.sql an.sql cpu_consumed.sql
create_tbs_view.sql db_profi.sql db_stA.sql db_stS.sql
dba_free_space.sql enable_disable_constraints.sql file_stA.sql file_stS.sql
j2.sql julian_to_date.sql last_analyzed.sql locks_hold_req_report.sql
ltch_stA.sql ltch_stS.sql mon_latch.sql part.sql
process.sql rbs_stS.sql rbs_user.sql redolatch.sql
segs.sql serv_stA.sql serv_stS.sql sesswait.sql
sga.sql shrink_rbs.sql sp_stA.sql sp_stS.sql
space_used.sql spazio.sql sql_in_exec_all.sql sqltext.sql
stat_ctl.sql tablespace.sql top_phys.sql wait_stA.sql
wait_stS.sql wait_until_old_transacion_finish.sql whos_wai.sql apt_format.sql.txt
database_roles.txt db_link_commands.txt dba_ind_partitions.txt enable_sql_trace_with_oradebug.txt
explanation.txt korn_commands.txt oracle_env.txt raid_various.txt
save_sqlplus_settings.sql.txt scripts_unix.txt sed.txt select2.txt
sqlploader.txt system_busy.txt view.txt Full_BKP.sh
_exp_to_sql.sh alerts.sh analyze_compute.sh analyze_proc.sh
are_u_oracle.sh backup.sh cache_hit_ratio.sh chech_number_rollbk_segs.sh
check_number_of_rollback_segs.sh collect.sh constraint.sh crea_xt013_cud.sh
create_user.sh exp.sh imp.sh killall.sh
ora.sh ora2txt.sh oracle.sh recreate_triggers.sh
rman_archive.sh rollbackStat.sh search_databases_rsh.sh sequence.sh
space_tablespaces.sh start_shutdown.sh stoproc.sh sysStat.sh
tabelle.sh tablespace.sh tar.sh tbs_status.sh
tbs_test.sh traceSession.sh user_segments.sh view.sh

 


A good place to find Oracle , NT and Linux reference commands: www.ss64.com 


Oracle

 


 

come and listen to some music!