dmann's blog

DBMS_XPLAN.DISPLAY_CURSOR and "User has no SELECT privilege"

I have been making use of the GATHER_PLAN_STATISTICS hint more and more lately. In the interest of getting the most accurate data I usually log in as the user that normally executes the query. These are usually non-privileged accounts that just have access to their own objects. In order to use DBMS_XPLAN.DISPLAY_CURSOR in a session that does not have DBA or SELECT CATALOG ROLE, grant the following permissions to them:
SQL> GRANT SELECT ON V_$SESSION TO &&MYUSER;
SQL> GRANT SELECT ON V_$SQL TO &&MYUSER;

Taking TKProf to the next level ... TVD$XTAT...

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.

Old versions of Oracle... don't forget about Oracle EDelivery

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.

http://edelivery.oracle.com/

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.

RMAN to /dev/null?

On Oracle-L there was a recent discussion about detecting block corruption. One suggestion was to do an Export to /dev/null. While this may get you 95% of the way there it is mainly relying on side effects of data access to detect any issues. If blocks are cached then it might not root out physical corruption.

Food for thought - Who Should Tune SQL - DBA or Developer?

Iggy Fernandez covers the topic of who is better suited to tune SQL - Developers or DBAs. Also listed are 5 Dangerous Beliefs which may influence the answer to that question.

https://iggyfernandez.wordpress.com/2009/07/12/who-should-tune-sql-the-dba-or-the-developer/

-Dave

Can't leave well enough alone...

Here is some code to update the previous widget to show data in a green/yellow/red bar graph like an audio meter: The code is here:
CREATE OR REPLACE FUNCTION GetGraph (p_value IN NUMBER, p_total IN NUMBER DEFAULT 100) 
RETURN VARCHAR2
IS 

  -- David Mann
  -- 05/26/2009
  -- Create HTML bar graph widget for use in Application Express reports. 
  -- Has thresholds for yellow and red. 
  -- Parameters: p_value - Top of ratio fraction or percentage as whole number (0-100)

Quickie bar graph widget for use in Apex Reports...

I'm trying not to scare my users off with endless rows and columns of numbers. I have an app that analyzes memory usage and swap space usage of some of our servers. Instead of throwing all kinds of computer sciency '65535' and '32767' numbers at my user I decided to create a small function to return a bar graph widget. Here is an example of the graph in use: Here is a function that will return the HTML for the widget:
CREATE OR REPLACE FUNCTION GetGraph (p_value IN NUMBER, p_total IN NUMBER) 

Solaris Zones & finding machine name

If you use Solaris Zones sometimes it is nice to be able to know the name of the global/parent machine the zone is running on. Using 'arp -a' you can get information about network interfaces shared by the hosts on 1 machine. I'm not going to give a whole full blown script to do this as our naming standards are probably different than yours but you can see the steps you may need to follow below to get the info: Here is how to see all the network interfaces for you current host:
HOSTNAME=`hostname`
/u01/app/oracle >arp -a | grep $HOSTNAME

Copying Oracle JVM Permissions

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:

SQL Developer Custom Report Example - Long Operations Graph

I added a new tutorial to my collection of SQL Developer information. The tutorial covers creation of a HTML Custom Report for SQL Developer.

Here is an example of the report running and showing 1 long operation (click to enlarge):

If you would like to see how this is done the tutorial is available here.

--Dave

Pages

Subscribe to RSS - dmann's blog