Search
Navigation
Recent blog posts
- Oracle IN Condition and Multi Column Subqueries
- SQL For Dinosaurs
- Quickie script to run dbv on your database...
- Permissions for Autotrace
- Accuracy of PROFILER.SQL from Metalink Doc: 243755.1
- Recording Oracle System Stats for historical analysis...
- Shell Script to Run a SQLPLUS against all databases running on a server...
- Viewing command line args with Solaris ps utility...
- Orion IO Test Tool
- Documented Hints available in 11.2...
Books
User login
oracle
Oracle IN Condition and Multi Column Subqueries
dmann — Fri, 02/19/2010 - 15:02
I keep coming across a construct in some legacy SQL that has been causing all kinds of performance issues for us. I guess you could call it using the IN condition with multi-column subqueries. I located the syntax for the IN condition here but it doesn't really get into much detail about using this construct.
Here is an example of the subquery (it returns the lowest salary and department_id for each department):
Read more »
Quickie script to run dbv on your database...
dmann — Fri, 01/22/2010 - 11:49
This script will generate dbv commands into a shell script and then execute the shell script.
run-dbv.sql:
set head off
set lines 200
set feedback off
set define off
spool dbv.sh
select 'dbv file='||name||' blocksize = '||block_size||
' LOGFILE=FILE-'||FILE#||'.LOG' from v$datafile;
spool off
host chmod 755 dbv.sh
spool dbv_results.log
host ./dbv.sh
spool off
Output will be created as separate log files. You can run it and review results like this:
$ sqlplus "/ as sysdba" @run-dbv.sql
Read more » Recording Oracle System Stats for historical analysis...
dmann — Thu, 12/31/2009 - 14:27
If you are experimenting with gathering system statistics it might be helpful to archive your current settings and any intermediate settings you come up with along the way.
There is a way to save stats to a table using DBMS_STATS.CREATE_STAT_TABLE and gathering with DBMS_STATS.GATHER into that table, but the format is cryptic and it is nice to have the descriptive parameter names tagging along with the data. (In a future post I will cover format of the CREATE_STAT_TABLE format).
The current system stats info is held in the sys.aux_stats$ table. Since the format is a little wacky, I came up with the following table to hold stats and the following insert statement to populate it after every gathering of system stats.
Now you can easily query the values of old stats in the SYSTEM_STATS_HISTORY table: Read more »
Orion IO Test Tool
dmann — Tue, 12/01/2009 - 22:54
I ran across Orion in a Kevin Closson blog post. From the OTN site:
"ORION (Oracle I/O Calibration Tool) is a standalone tool for calibrating the I/O performance for storage systems that are intended to be used for Oracle databases. The calibration results are useful for understanding the performance capabilities of a storage system, either to uncover issues that would impact the performance of an Oracle database or to size a new database installation. Since ORION is a standalone tool, the user is not required to create and run an Oracle database. " Read more »
Taking TKProf to the next level ... TVD$XTAT...
dmann — Wed, 11/18/2009 - 11:52
For the past few weeks I have been using the TriVaDis eXtended Tracefile Analysis Tool as a replacement for TKPROF.
TKPROF is available with all Oracle installations but is has some drawbacks. Early versions of TKPROF do not provide any information about bind variables. It also tends to lose detail because it aggregates data. When performing analysis it is unwise to make inferences about detailed execution based on aggregates. TVD$XTAT provides aggregates but also provides detail on each SQL Statement so you can zero in on the statement of interest. Read more »
Old versions of Oracle... don't forget about Oracle EDelivery
dmann — Tue, 10/13/2009 - 09:09
I was recently looking for old (not ancient, just old) install media to support a database migration. The usual collection of download links on OTN usually just has the last 2 releases. If you need older versions (in this case 9i) then hit up the EDelivery site and you should be able to find them.
If you need a much older version (like 8i or gasp! 7) I have heard you may be able to obtain it through an SR if you have a current support contract but luckily I have not had to test that route. Read more »
Copying Oracle JVM Permissions
dmann — Tue, 03/31/2009 - 10:49
Now that I am working in an environment where I am responsible for more database instances it seems like data is always moving around. Machines are being retired, platforms are changing, all kinds of fun stuff.
I often have to move using regular old Oracle import/export utilities. These utilities aren't the best at some of the more esoteric Oracle features so some 'backfilling' of objects or permissions may be required.
Here are some queries that are helpful when moving a schema that has Oracle Java Virtual Machine (JVM) Dependencies: Read more »
oracle.sysman.emSDK.emd.comm.OperationException: could not write to targets.xml.bak file
dmann — Mon, 01/26/2009 - 15:19
I had some trouble adding a new database to an OEM Grid installation this weekend.
I didn't find too many references to the above error so I wanted to post about it here. Of course Metalink was all doom and gloom. Note 745795.1 says to stop the agent, run fsck on the AGENT_HOME filesystem, then start the agent. After that you should be able to add new targets.
targets.xml lives in AGENT_HOME/sysman/emd. At the OS prompt I changed to that directory I was able to create new files there but for some reason the above error kept popping up when Grid tried to save a new target. Read more »
For Developers: Making Friends with the Oracle Database - presentation by Cary Millsap
dmann — Tue, 01/13/2009 - 14:47
Here is a link to a Cary Millsap presentation -- a must read for developers who interact with Oracle Databases. This article can save you some time and heartache!
http://method-r.com/downloads/doc_details/10-for-developers-making-frien...
From the Abstract: Read more »
Is Intermedia in use?
dmann — Tue, 12/02/2008 - 16:01
When copying or moving databases it is nice to know if features are used or not. Sure you can always query DBA_REGISTRY to see what has been set up on the source databases, but is it always necessary to install everything that shows up in DBA_REGISTRY on your target systems?
Intermedia is a feature that can be a particular pain to install and configure. Read more »