ba6.us - Dave's Database Related Stuff

  • home
  • blog
  • notebooks
  • projects
  • recent
  • about
  • manifesto
  • !
Home

Tag Cloud

apex Application Express Auditing data dbi development export funnies HTML Java linux monitoring oem oracle performance perl rman scripting sql SQL Developer sqlplus tuning unix windows
more tags

Search

RSS Feed

Blog Posts :

Navigation

  • Feed aggregator

User login

  • Request new password
  1. Default Stats Jobs

    dmann — Fri, 07/29/2011 - 14:13

    Show current Global defaults for object stats gathering

    These can be set with the DBMS_STATS.SET_GLOBAL_PREFS procedure.
    Read more »
  2. VPD - VIRtual Private Database - Using and Debugging

    dmann — Fri, 01/20/2012 - 13:38

    Debugging Info

    AskTom Thread on debugging VPD

    Helpful Role

    This roll will help developers that need to investigate VPD issues without having to give them 'Keys to the Castle' DBA Role:
    CREATE ROLE VPD_SUPPORT_ROLE;
    
    GRANT SELECT_CATALOG_ROLE TO VPD_SUPPORT_ROLE;
    
    GRANT SELECT ON DBA_AUDIT_POLICIES TO VPD_SUPPORT_ROLE;
    GRANT SELECT ON DBA_AUDIT_POLICY_COLUMNS TO VPD_SUPPORT_ROLE;
    GRANT SELECT ON DBA_POLICIES TO VPD_SUPPORT_ROLE;
    GRANT SELECT ON D Read more »
  3. Shared Oracle Homes

    dmann — Tue, 01/17/2012 - 23:27

    Pros:

    o Recovering from machine failure - mount the Home and Datafiles mounts on another server, do a little config and you are back up and running.

    o Bringing newly installed machines into the 'fold' is a lot easier than firing up OUI and waiting for the install to run. Even if you have it scripted with a response file this can be painful to wait for.

    o You are guaranteed to be running the same binaries everywhere. Read more »

  4. Oracle bug announcement - the sky is not falling...

    dmann — Tue, 01/17/2012 - 15:43

    ...well not yet...

    An Infoworld article was released today describing an Oracle vulnerability. The SCN space can be exhausted via bugs or attackers exploiting bugs. Metalink doc: 1376995.1 [Bulletin : Information on the System Change Number (SCN) and how it is used in the Oracle Database] covers a technical description for what SCNs are used for.

    You can use this query to find out how close you are to the SCN limit. Read more »

    • bug
    • oracle
    • scn
    • dmann's blog
    • Add new comment
  5. SQL Monitoring

    dmann — Sun, 01/15/2012 - 05:19

    Bind Variables

    Tanel Poder mentions looking at v$sql_monitor.bind_xml for currently running (or recently run) bind variables for a SQL statement.

    Querying SQL Monitoring Info

    todo
  6. Subquery Info

    dmann — Sun, 01/15/2012 - 05:07

    Optimizer Decisions

    Great article from Oracle Optimizer team covering Subquery Unnesting including mechanics and limitations of Optimizer Subquery Unnesting: Part 1 | Part 2
  7. Diagnosing slow client processing of result sets...

    dmann — Tue, 01/10/2012 - 13:48

    Here are two runs of the same SQL from different programs. The top is an automated process, the bottom is Toad. (SQL is the same, but SQL_ID is different because of white space issues): So why is one finished in 7.2 minutes and one still at 4.7 hours and still counting up?
    Read more »
    • performance
    • sql monitoring
    • dmann's blog
    • Add new comment
  8. Installation

    dmann — Thu, 05/26/2011 - 10:26

    Installation

    Initial Installation

    cd ~/sqlt/install
    sqlplus "/ as sysdba" @sqcreate.sql
    
    This script will create the SQLTXPLAIN user and associated objects. You will have to answer some questions about paths and tablespaces.

    Silent Installation

    cd ~/sqlt/install
    sqlplus "/ as sysdba"
    
    START sqdrop.sql
    START sqcsilent2.sql '' xplain USERS TEMP 'SCHEMA' T
    REM To speed up execution, run these commands:
    EXEC sqltxplain.sqlt$a.set_param('test_case_builder', 'N');
     Read more »
  9. Statistics Freshness Check

    dmann — Mon, 01/25/2010 - 14:41

    Find Candidates for Statistics Gathering

    Anything that has more than 10% changes (inserts+deletes+updates) since last analyze should probably be analyzed again. This can be checked Oracle's Table Monitoring feature. This query will show a list of database tables with the most changed first.

    Verify Table Monitoring is On

    Survey table monitoring

    SELECT MONITORING, 
           COUNT(*)
      FROM USER_TABLES 
    GROUP BY MONITORING;
    

    Turn table monitoring on for 1 table

     Read more »
  10. Quick filter for Application Express Reports

    dmann — Mon, 12/05/2011 - 12:44

    I normally get a lot of mileage out of Application Express interactive reports. Unfortunately there are some restrictions on the SELECT statements that can be used with them. Here is a demonstration of a technique I use when I want to add some interactivity to a plain old Apex report. I will create a Select List dropdown that submits and refreshes the report data automagically. The value in the select list will be applied as a filter to the report when it refreshes.

    1) Create the Select List

    • Items -> New Item -> Select List • Choose "Select List with Submit" • Next
    Read more »
    • Application Express
    • sql
    • dmann's blog
    • Add new comment
  11. Updated Developer Days Virtual Machine available...

    dmann — Wed, 11/30/2011 - 17:33

    I just noticed there is a 11gR2 version of the Developer Days VM available now. You can have a running copy of 11gR2,
    Oracle TimesTen In-Memory Database, Oracle XML DB, Oracle SQL Developer, Oracle SQL Developer Data Modeler, Oracle Application Express, Oracle JDeveloper, and Hands-On-Labs (accessed via the Toolbar Menu in Firefox) on a copy of Oracle Enterprise Linux 5.

    This is great as a sandbox for development or an easy way to stand up a DB for messing around with. The image supplied by Oracle runs inside Oracle VirtualBox VM engine which is also free. Read more »

    • virtualbox
    • vm
    • dmann's blog
    • Add new comment
  12. HAVING & Bind Variables

    dmann — Tue, 11/22/2011 - 17:34

    Had an odd one come across my desk today. I have seen Bind variables used in the WHERE clause thousands of times. I have seen Binds in the SELECT lists hundreds of times. I have seen it used in the HAVING clause zero times... until today when it turns out it was causing a performance issue. With the Bind variable in the HAVING clause we were seeing an execution plan with lots of Full Table Scans and 12+ second runtimes. When editing the query and using a literal in the HAVING clause we saw 100ms or less performance and very efficient Execution Plans.
    Read more »
    • bind variables
    • sql
    • dmann's blog
    • Add new comment
  13. OraPad

    dmann — Sat, 11/26/2011 - 08:21

    OraPad is an Oracle utility program I am writing as a Tuning Scratchpad. I need a place to coordinate my activities when I am in the thick of a tuning issue. Right now it seems like I am using multiple tools and I would like a central place to organize my tuning information and thoughts. Bonus if we are able to wrap some functionality to cut out extra tools required to do the tuning investigation.
    Read more »
    • Groovy
    • Java
    • OraPad
    • utilities
    • Add new comment
  14. About ba6.us

    I am a Software Developer and Oracle DBA by trade, but have worked with many RDBMS systems ranging from small DBaseIV / FoxPro PC databases, medium sized MySQL databases, and large Sybase, Oracle, and MS SQL Server databases. I hope you can find some useful information here. I have been collecting posts and notes since July 2007. The information presented in Blog Posts and Notebook Pages is a wide ranging collection of hints, tips, tricks, and caveats. If you are not a regular reader then hopefully you land here from a Google search and take something away that helps you solve a problem.
    Read more »
  15. New web host...

    dmann — Sat, 11/26/2011 - 08:39

    We moved to a new web host on Black Friday. My old host doesn't appreciate repeat business so it was time to make the change and try something new. I just started up with DreamHost and so far I am impressed. Migration of the site went quicker than expected and so far I only made one mistake that caused any issues but I will blame that on waiting for DNS changes to propagate :) Read more »

    • maintenance
    • dmann's blog
    • Add new comment
  16. Tuner's Manifesto

    Note: This note contains some ideas for getting customers and tuners on the same page. Oracle is a complex piece of software and doesn't always do the 'right thing'.
    • SQL Selects can have multiple logically equivalent forms.
      5 people could write a SQL Query to solve the same problem but they may arrive at the same correct result set using different combinations of SQL constructs and SQL features.
    • Logically equivalent forms can be analyzed differently by the CBO
    Read more »
  17. Speed up SQL Developer Startup

    dmann — Mon, 11/14/2011 - 15:23

    If you are using SQL Developer 2.x you can reduce your startup time by about 20% by disabling any unneeded extensions. I was able to reduce my startup time from 11 seconds to 8 seconds by turning off all extensions (none of which I really needed anyway). Read more »

    • performance
    • SQL Developer
    • dmann's blog
    • Add new comment
  18. Golden Gate - OS User Permissions on *nix - DBA vs ETL Admin

    dmann — Mon, 11/14/2011 - 13:11

    Seems like Golden Gate is following me around. I used their tools in 2005 to replicate from OLTP databases to a central reporting database for my previous employer. Now that Oracle bought them the buzz in my current company is to leave Oracle's multiple and complicated incarnations of replication technologies in the dust and try moving forward with GG. Fine with me, I like the product, not a fan of the licensing as I think Oracle has been on the lagging side of vendor supplied replication tools, but hey what do I know, I just arrange zeroes and ones for a living.
    Read more »
    • Golden Gate
    • permissions
    • dmann's blog
    • Add new comment
  19. Need sample data?

    dmann — Sat, 11/12/2011 - 21:48

    Check out http://www.freebase.com/.

    You can sort and filter some of their data, download it or access it via an API.

    They offer an API for a lot of languages but no PL/SQL directly just yet. But it looks like JSON can be used and there are ways to use JSON in PL/SQL if you want to do the work.

    -Dave

    • sample data
    • dmann's blog
    • Add new comment
  20. SQLDeveloper Used Defined Reports Pack

    dmann — Thu, 11/10/2011 - 00:37

    I have started a project to collect useful SQL Developer User Defined Reports. More info to follow after I complete a few check-ins.

    https://github.com/dmann99/SQLDevUDRepPack

    -Dave

    • reports
    • sql
    • SQLDeveloper
    • Add new comment
  21. SQL Plan Management

    dmann — Mon, 08/22/2011 - 13:14

    References: Oracle Whitepaper - SQL Plan Management in Oracle Database 11g - November 2010 11gR1 Documentation Liang - Manual Loading from AWR or SQLTS
    Read more »
  22. Displaying Execution Plans

    dmann — Wed, 11/02/2011 - 11:17

    Display Most Recent Plan from PLAN_TABLE

    WITH CurrPlan AS (SELECT * FROM PLAN_TABLE WHERE TIMESTAMP=(SELECT MAX(TIMESTAMP) FROM PLAN_TABLE)) 
    select 
      ID, 
      lpad(' ', level-1) || 'ParID='||PARENT_ID || ':'||operation || ' (' || options || ')' "Operation", 
      object_name "Object",
      CurrPlan.*
    from 
      CurrPlan
     start with id = 0 
    connect by prior id=parent_id;
    

    Display from Cursor Cache

    Add a unique comment hint (like QUERYCOMMENT001 below) so we can locate the SQL easily in v$sql.
    WITH targetsql AS
     Read more »
  23. Execution Plans

    dmann — Thu, 01/14/2010 - 15:40

    Information about generating Execution Plans
  24. Groovy/Griffon

    dmann — Tue, 11/01/2011 - 22:19

    Setting up a new project

    griffon create-app myApp
    
    # Visual
    griffon install-plugin abeilleform-builder
    griffon install-plugin miglayout
    
    # Database
    # griffon install-plugin activejdbc
    
    # Eclipse integration
    griffon integrate-with --eclipse
    griffon install-plugin eclipse-support
    griffon eclipse-update
    
    eclipse --> import existing project
  25. Java

    dmann — Tue, 11/01/2011 - 22:06


Cornify
  • home
  • blog
  • notebooks
  • projects
  • recent
  • about
  • manifesto
  • !

Content Copyright 2006-2010. Links are copyright of respective owners.