SQLs for performance statistics in 10g

I need help in getting this information. Can somebody please provide the sqls. I don't seem to get this from AWR.
1. #transactions/sec
2. Physical reads/sec
3. Logical reads/sec
Database is 10.2.0.2 with RAC
Thanks

hi,
are you sure you have read awr correctly.
I have one and can easily spot
physical reads per sec
logical reads
transactions per sec
look in the Load Profile section of awr and then you can simply search for your information
rgds
alan

Similar Messages

  • Best practices for gathering statistics in 10g

    I would like to get some opinions on what is considered best practice for gathering statistics in 10g. I know that 10g has auto statistics gathering, but that doesn't seem to be very effective as I see some table stats are way out of date.
    I have recommended that we have at least a weekly job that generates stats for our schema using DBMS_STATS (DBMS_STATS.gather_schema_stats). Is this the right approach to generate object stats for a schema and keep it up to date? Are index stats included in that using CASCADE?
    Is it also necessary to gather system stats? I welcome any thoughts anyone might have. Thanks.

    Hi,
    Is this the right approach to generate object stats for a schema and keep it up to date? The choices of executions plans made by the CBO are only as good as the statistics available to it. The old-fashioned analyze table and dbms_utility methods for generating CBO statistics are obsolete and somewhat dangerous to SQL performance. As we may know, the CBO uses object statistics to choose the best execution plan for all SQL statements.
    I spoke with Andrew Holsworth of Oracle Corp SQL Tuning group, and he says that Oracle recommends taking a single, deep sample and keep it, only re-analyzing when there is a chance that would make a difference in execution plans (not the default 20% re-analyze threshold).
    I have my detailed notes here:
    http://www.dba-oracle.com/art_otn_cbo.htm
    As to system stats, oh yes!
    By measuring the relative costs of sequential vs. scattered I/O, the CBO can make better decisons. Here are the data items collected by dbms_stats.gather_system_stats:
    No Workload (NW) stats:
    CPUSPEEDNW - CPU speed
    IOSEEKTIM - The I/O seek time in milliseconds
    IOTFRSPEED - I/O transfer speed in milliseconds
    I have my notes here:
    http://www.dba-oracle.com/t_dbms_stats_gather_system_stats.htm
    Hope this helps. . . .
    Don Burleson
    Oracle Press author
    Author of “Oracle Tuning: The Definitive Reference”
    http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm

  • How to use forms trace file for performance tuning

    I am trying to use forms trace file in order to find cause of forms application performance problem.
    I have read the document B14032-03 where is described how to turn on tracing and how to convert binary trace file to xml or html format. However these xml/html files are useless because they only contain series of forms events, without possibility for grouping or sorting. Actually, they are like to database raw trace file. I need some tool, like tkprof for database trace, that will process xml/html file and generate some more useful format.
    Further, I have tried to load forms trace file into relational database tables in order to use SQL for performance problem investigation. I have followed procedure described in document A92175-01, but without success.
    Is there any way to process xml/html file with grouping, orderering or summing event duration or way to load either binary, xml or html trace file into structured data in database.

    Al-Salamu Alikum user630033
    It's not : elegant at all to thank people 4 No help,it's not their problem that u don't search enough, or u don't have access to db.
    We should always say thank ,or 'Jazak Allah Khiern' on both cases even they could or couldn't help u.
    Finally,i expect ' an appologize or even a thankful word ' and the kindness i am sure u had to publish the solution u found in order to share it with people who had same problem or at least to give them the info to get the appreciation or the thanksful word u deserve.
    Rem.Never give a bad feedback to people who tried to help u.
    Regards,
    Abdetu..

  • How does Index fragmentation and statistics affect the sql query performance

    Hi,
    How does Index fragmentation and statistics affect the sql query performance
    Thanks
    Shashikala
    Shashikala

    How does Index fragmentation and statistics affect the sql query performance
    Very simple answer, outdated statistics will lead optimizer to create bad plans which in turn will require more resources and this will impact performance. If index is fragmented ( mainly clustered index,holds true for Non clustred as well) time spent in finding
    the value will be more as query would have to search fragmented index to look for data, additional spaces will increase search time.
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • Step for performance tuning in oracle 10g

    hi,
    i want to know the step of persformance tuning and sql tuning.

    I'd suggest you to refer to documentation: [Oracle Database 2 Day + Performance Tuning Guide 10g Release 2 (10.2)|http://download.oracle.com/docs/cd/B19306_01/server.102/b28051/toc.htm]
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • SQL 2008 R2 Best Practices for Updating Statistics for a 1.5 TB VLDB

    We currently have a ~1.5 TB VLDB (SQL 2008 R2) that services both OLTP and DSS workloads pretty much on a 24x7x365 basis. For many years we have been updating statistics (full scan- 100% sample size) for this VLDB once a week on the weekend, which
    is currently taking up to 30 hours to complete.
    Somewhat recently we have been experiencing intermitent issues while statistics are being updated, which I doubt is just a coincidence. I'd like to understand exactly why the process of updating statistics can cause these issues (timeouts/errors). My theory
    is that the optimizer is forced to choose an inferior execution plan while the needed statistics are in "limbo" (stuck between the "old" and the "new"), but that is again just a theory. I'm somewhat surprised that the "old" statistics couldn't continue to
    get used while the new/current statistics are being generated (like the process for rebuilding indexes online), but I don't know all the facts behind this mechanism yet so that may not even apply here.
    I understand that we have the option of reducing the sample percentage/size for updating statistics, which is currently set at 100% (full scan).  Reducing the sample percentage/size for updating statistics will reduce the total processing time, but
    it's also my understanding that doing so will leave the optimizer with less than optimal statistics for choosing the best execution plans. This seems to be a classic case of not being able to have one’s cake and eat it too.
    So in a nutshell I'm looking to fully understand why the process of updating statistics can cause access issues and I'm also looking for best practices in general for updating statistics of such a VLDB. Thanks in advance.
    Bill Thacker

    I'm with you. Yikes is exactly right with regard to suspending all index optimizations for so long. I'll probably start a separate forum thread about that in the near future, but for now lets stick to the best practices for updating statistics.
    I'm a little disappointed that multiple people haven't already chimed in about this and offered up some viable solutions. Like I said previously, I can't be the first person in need of such a thing. This database has 552 tables with a whole lot more statistics
    objects than that associated with those tables. The metadata has to be there for determining which statistics objects can go (not utilized much if at all so delete them- also produce an actual script to delete the useless ones identified) and what
    the proper sample percentage/size should be for updating the remaining, utilized statistics (again, also produce a script that can be used for executing the appropriate update statistics commands for each table based on cardinality).
    The above solution would be much more ideal IMO than just issuing a single update statistics command that samples the same percentage/size for every table (e.g. 10%). That's what we're doing today at 100% (full scan).
    Come on SQL Server Community. Show me some love :)
    Bill Thacker

  • How to get performance statistics like OEM console 9i

    Hi All Gurus,
    I am having trouble getting the server load and seeing different session's statistics. As we all know, in OEM 9i java console, we were able to see the following useful columns for all the active sessions:
    CPU_TIME, PGA_MEMORY, PHYSICAL_DISK READS, LOGICAL READS, etc.
    But in OEM 10g java colsole, there are no such columns (I dont know why), for each session, the 10g console only gives basic info like, USER_NAME, OSUSER, MACHINE NAME, LOGON TIME, etc, but no tuning statistics.
    So, I was looking the dynamic performance views to see all these information. But I am confused, there are a number of views; they are v$sql, v$sqlearea, v$sql_workarea, v$sqlstats, v$session, v$sesstat, v$open_cursors, etc.
    Can somebody explain to me what are the relationships between them and exactly which ones are actually needed to produce the columns like those in OEM 9i. I am not sure does v$sql represent one sql statement or v$sqlarea?, how they are related to v$session? lot of confusions!!!! pls help. Thanks in advance.

    You have far more questions than can possibly be answered in a few short paragraphs.
    Pick up a copy of Jonathan Lewis' book on the CBO and you will find the answers to all of these questions and many more. Also check Jonathan's website and FAQ.
    You will find the link to it on the Links page of the PSOUG's website: www.psoug.org.

  • How to get sql server performance counters using query?

    Hai i want to see my sql server performance counters like, Full Scans/sec,  Buffer
    Cache Hit Ratio,  Database Transactions/sec, User
    Connections, Average Latch Wait Time (ms), Lock
    Waits/sec, Lock Timeouts/sec, Number
    of Deadlocks/sec, Total Server Memory, SQL
    Re-Compilations/sec, User Settable Query. If any one know how to get it by using query means, please help me.
    Thanks in advance

    Hello,
    Below is query created by Jonathan Kehayias for measuring Perfom counters using DMV sys.dm_os_performance_counter.
    You can download book from below link
    https://www.simple-talk.com/books/sql-books/troubleshooting-sql-server-a-guide-for-the-accidental-dba/
    DECLARE @CounterPrefix NVARCHAR(30)
    SET @CounterPrefix = CASE WHEN @@SERVICENAME = 'MSSQLSERVER'
    THEN 'SQLServer:'
    ELSE 'MSSQL$' + @@SERVICENAME + ':'
    END ;
    -- Capture the first counter set
    SELECT CAST(1 AS INT) AS collection_instance ,
    [OBJECT_NAME] ,
    counter_name ,
    instance_name ,
    cntr_value ,
    cntr_type ,
    CURRENT_TIMESTAMP AS collection_time
    INTO #perf_counters_init
    FROM sys.dm_os_performance_counters
    WHERE ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Full Scans/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Index Searches/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Lazy Writes/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Page life expectancy'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'Processes Blocked'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'User Connections'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Waits/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Wait Time (ms)'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Re-Compilations/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Memory Manager'
    AND counter_name = 'Memory Grants Pending'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'Batch Requests/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Compilations/sec'
    -- Wait on Second between data collection
    WAITFOR DELAY '00:00:01'
    -- Capture the second counter set
    SELECT CAST(2 AS INT) AS collection_instance ,
    OBJECT_NAME ,
    counter_name ,
    instance_name ,
    cntr_value ,
    cntr_type ,
    CURRENT_TIMESTAMP AS collection_time
    INTO #perf_counters_second
    FROM sys.dm_os_performance_counters
    WHERE ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Full Scans/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Access Methods'
    AND counter_name = 'Index Searches/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Lazy Writes/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Buffer Manager'
    AND counter_name = 'Page life expectancy'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'Processes Blocked'
    OR ( OBJECT_NAME = @CounterPrefix + 'General Statistics'
    AND counter_name = 'User Connections'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Waits/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Locks'
    AND counter_name = 'Lock Wait Time (ms)'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Re-Compilations/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'Memory Manager'
    AND counter_name = 'Memory Grants Pending'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'Batch Requests/sec'
    OR ( OBJECT_NAME = @CounterPrefix + 'SQL Statistics'
    AND counter_name = 'SQL Compilations/sec'
    -- Calculate the cumulative counter values
    SELECT i.OBJECT_NAME ,
    i.counter_name ,
    i.instance_name ,
    CASE WHEN i.cntr_type = 272696576
    THEN s.cntr_value - i.cntr_value
    WHEN i.cntr_type = 65792 THEN s.cntr_value
    END AS cntr_value
    FROM #perf_counters_init AS i
    JOIN #perf_counters_second AS s
    ON i.collection_instance + 1 = s.collection_instance
    AND i.OBJECT_NAME = s.OBJECT_NAME
    AND i.counter_name = s.counter_name
    AND i.instance_name = s.instance_name
    ORDER BY OBJECT_NAME
    -- Cleanup tables
    DROP TABLE #perf_counters_init
    DROP TABLE #perf_counters_second
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Oracle Enterprise Manager "Performance" tab  (Oracle 10g)

    Hi,
    How to I make a report based on Performance TAB.
    View Data -> Historical
    Sessions
    Runnable Process
    Active Sessions
    Instance Disk i/o
    Instance throughput
    Explain : What is (example :*what is session for?* ) , What is X and Y (example :*what is X = Y= Time and date*)
    Please reply.. I need it by today.. :(

    The help file explains it a lot better than I can... therefore:
    Interpreting the Host: Average Runnable Processes Chart
    If you have opted to show both the CPU cores and CPU threads,
    consistent values somewhere between the two line values may
    indicate that too many users are waiting in line for CPU time.
    Compare the values with those of CPU Used in the Average Active
    Sessions chart. If the sessions value is low and the run queue
    length value is high, this indicates that something else on the host
    other than your database is consuming the CPU.
    If you have selected Memory Access mode, the Host chart does
    not initially display historical data, except when the screen was
    loaded recently and cached historical data is still available. Host data
    is cached starting from the time the screen was first accessed,
    and gradually fills the history on the Host chart.
    Interpreting the Average Active Sessions Chart
    The Session Count is computed by categorizing the time
    that all active sessions consumed in the last sampling interval
    into different wait classes, summing the amount in each wait class,
    and dividing it by the sampling interval. For example, If there
    are 3 active sessions in the last 15-second sampling interval, and
    each session spent half of the time (7.5 seconds each) on CPU
    and half of the time idling, then 3 x 7.5 / 15 = 1.5 active sessions
    on CPU appear for that sampling interval.
    Compare the peaks on the Average Active Sessions chart with those
    on the Instance Throughput charts. If the Average Active Sessions
    chart displays a large number of sessions waiting, indicating internal
    contention, but throughput is high, then the situation may be
    acceptable. The database is probably also performing efficiently if
    internal contention is low but throughput is high. However, if internal
    contention is high but throughput is low, then consider tuning the database. Selecting Memory Access Mode for Slow or Hung Systems
    You can click the Monitor In Memory Access Mode link in the Related Links section to enable Memory Access Mode. The Database Performance page reappears with a Disable Memory Access Mode button and a Switch to SQL Access Mode button in the upper right corner.
    You can temporarily disable Memory Access Mode by clicking this button, upon which the Database Performance page reappears in SQL Access Mode. To reactivate Memory Access Mode, click the Monitor In Memory Access Mode link again, then click Enable Memory Access Mode when the Database Performance page reappears.
    In Memory Access Mode, performance statistics are retrieved directly from the Shared Global Area (SGA) using optimized/lightweight system-level calls as an alternative to SQL. Memory Access mode avoids the computation associated with parsing and executing SQL statements, thereby making it ideal for severe cases of library cache contention that can prevent the instance from being monitored in SQL Mode. You should switch to Memory Access Mode for slow or hung systems.
    Pages in Memory Access Mode contain data sampled at a higher frequency than pages in SQL Mode. (Charts may appear to be slightly different from SQL mode for this reason.) Consequently, Enterprise Manager provides better information about where events begin and end, and can also handle short-duration events that might otherwise be missed.
    >
    It basically tells you how much of a given resource was used at a point in time.
    John

  • SQL query performance issues.

    Hi All,
    I worked on the query a month ago and the fix worked for me in test intance but failed in production. Following is the URL for the previous thread.
    SQL query performance issues.
    Following is the tkprof file.
    CURSOR_ID:76  LENGTH:2383  ADDRESS:f6b40ab0  HASH_VALUE:2459471753  OPTIMIZER_GOAL:ALL_ROWS  USER_ID:443 (APPS)
    insert into cos_temp(
    TRX_DATE, DEPT, PRODUCT_LINE, PART_NUMBER,
    CUSTOMER_NUMBER, QUANTITY_SOLD, ORDER_NUMBER,
    INVOICE_NUMBER, EXT_SALES, EXT_COS,
    GROSS_PROFIT, ACCT_DATE,
    SHIPMENT_TYPE,
    FROM_ORGANIZATION_ID,
    FROM_ORGANIZATION_CODE)
    select a.trx_date,
    g.segment5 dept,
    g.segment4 prd,
    m.segment1 part,
    d.customer_number customer,
    b.quantity_invoiced units,
    --       substr(a.sales_order,1,6) order#,
    substr(ltrim(b.interface_line_attribute1),1,10) order#,
    a.trx_number invoice,
    (b.quantity_invoiced * b.unit_selling_price) sales,
    (b.quantity_invoiced * nvl(price.operand,0)) cos,
    (b.quantity_invoiced * b.unit_selling_price) -
    (b.quantity_invoiced * nvl(price.operand,0)) profit,
    to_char(to_date('2010/02/28 00:00:00','yyyy/mm/dd HH24:MI:SS'),'DD-MON-RR') acct_date,
    'DRP',
    l.ship_from_org_id,
    p.organization_code
    from   ra_customers d,
    gl_code_combinations g,
    mtl_system_items m,
    ra_cust_trx_line_gl_dist c,
    ra_customer_trx_lines b,
    ra_customer_trx_all a,
    apps.oe_order_lines l,
    apps.HR_ORGANIZATION_INFORMATION i,
    apps.MTL_INTERCOMPANY_PARAMETERS inter,
    apps.HZ_CUST_SITE_USES_ALL site,
    apps.qp_list_lines_v price,
    apps.mtl_parameters p
    where a.trx_date between to_date('2010/02/01 00:00:00','yyyy/mm/dd HH24:MI:SS')
    and to_date('2010/02/28 00:00:00','yyyy/mm/dd HH24:MI:SS')+0.9999
    and   a.batch_source_id = 1001     -- Sales order shipped other OU
    and   a.complete_flag = 'Y'
    and   a.customer_trx_id = b.customer_trx_id
    and   b.customer_trx_line_id = c.customer_trx_line_id
    and   a.sold_to_customer_id = d.customer_id
    and   b.inventory_item_id = m.inventory_item_id
    and   m.organization_id
         = decode(substr(g.segment4,1,2),'01',5004,'03',5004,
         '02',5003,'00',5001,5002)
    and   nvl(m.item_type,'0') <> '111'
    and   c.code_combination_id = g.code_combination_id+0
    and   l.line_id = b.interface_line_attribute6
    and   i.organization_id = l.ship_from_org_id
    and   p.organization_id = l.ship_from_org_id
    and   i.org_information3 <> '5108'
    and   inter.ship_organization_id = i.org_information3
    and   inter.sell_organization_id = '5108'
    and   inter.customer_site_id = site.site_use_id
    and   site.price_list_id = price.list_header_id
    and   product_attr_value = to_char(m.inventory_item_id)
    call        count       cpu   elapsed         disk        query      current         rows    misses
    Parse           1      0.47      0.56           11          197            0            0         1
    Execute         1   3733.40   3739.40        34893    519962154           11          188         0
    total           2   3733.87   3739.97        34904    519962351           11          188         1
    |         Rows Row Source Operation
    | ------------ ---------------------------------------------------
    |          188 HASH JOIN (cr=519962149 pr=34889 pw=0 time=2607.35)
    |          741 .TABLE ACCESS BY INDEX ROWID QP_PRICING_ATTRIBUTES (cr=519939426 pr=34889 pw=0 time=2457.32)
    |    254644500 ..NESTED LOOPS (cr=519939265 pr=34777 pw=0 time=3819.67)
    |    254643758 ...NESTED LOOPS (cr=8921833 pr=29939 pw=0 time=1274.41)
    |          741 ....NESTED LOOPS (cr=50042 pr=7230 pw=0 time=11.37)
    |          741 .....NESTED LOOPS (cr=48558 pr=7229 pw=0 time=11.35)
    |          741 ......NESTED LOOPS (cr=47815 pr=7223 pw=0 time=11.32)
    |         3237 .......NESTED LOOPS (cr=41339 pr=7223 pw=0 time=12.42)
    |         3237 ........NESTED LOOPS (cr=38100 pr=7223 pw=0 time=12.39)
    |         3237 .........NESTED LOOPS (cr=28296 pr=7139 pw=0 time=12.29)
    |         1027 ..........NESTED LOOPS (cr=17656 pr=4471 pw=0 time=3.81)
    |         1027 ...........NESTED LOOPS (cr=13537 pr=4404 pw=0 time=3.30)
    |          486 ............NESTED LOOPS (cr=10873 pr=4240 pw=0 time=0.04)
    |          486 .............NESTED LOOPS (cr=10385 pr=4240 pw=0 time=0.03)
    |          486 ..............TABLE ACCESS BY INDEX ROWID RA_CUSTOMER_TRX_ALL (cr=9411 pr=4240 pw=0 time=0.02)
    |        75253 ...............INDEX RANGE SCAN RA_CUSTOMER_TRX_N5 (cr=403 pr=285 pw=0 time=0.38)
    |          486 ..............TABLE ACCESS BY INDEX ROWID HZ_CUST_ACCOUNTS (cr=974 pr=0 pw=0 time=0.01)
    |          486 ...............INDEX UNIQUE SCAN HZ_CUST_ACCOUNTS_U1 (cr=488 pr=0 pw=0 time=0.01)
    |          486 .............INDEX UNIQUE SCAN HZ_PARTIES_U1 (cr=488 pr=0 pw=0 time=0.01)
    |         1027 ............TABLE ACCESS BY INDEX ROWID RA_CUSTOMER_TRX_LINES_ALL (cr=2664 pr=164 pw=0 time=1.95)
    |         2063 .............INDEX RANGE SCAN RA_CUSTOMER_TRX_LINES_N2 (cr=1474 pr=28 pw=0 time=0.22)
    |         1027 ...........TABLE ACCESS BY INDEX ROWID RA_CUST_TRX_LINE_GL_DIST_ALL (cr=4119 pr=67 pw=0 time=0.54)
    |         1027 ............INDEX RANGE SCAN RA_CUST_TRX_LINE_GL_DIST_N1 (cr=3092 pr=31 pw=0 time=0.20)
    |         3237 ..........TABLE ACCESS BY INDEX ROWID MTL_SYSTEM_ITEMS_B (cr=10640 pr=2668 pw=0 time=15.35)
    |         3237 ...........INDEX RANGE SCAN MTL_SYSTEM_ITEMS_B_U1 (cr=2062 pr=40 pw=0 time=0.33)
    |         3237 .........TABLE ACCESS BY INDEX ROWID OE_ORDER_LINES_ALL (cr=9804 pr=84 pw=0 time=0.77)
    |         3237 ..........INDEX UNIQUE SCAN OE_ORDER_LINES_U1 (cr=6476 pr=47 pw=0 time=0.43)
    |         3237 ........TABLE ACCESS BY INDEX ROWID MTL_PARAMETERS (cr=3239 pr=0 pw=0 time=0.04)
    |         3237 .........INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=2 pr=0 pw=0 time=0.01)
    |          741 .......TABLE ACCESS BY INDEX ROWID HR_ORGANIZATION_INFORMATION (cr=6476 pr=0 pw=0 time=0.10)
    |         6474 ........INDEX RANGE SCAN HR_ORGANIZATION_INFORMATIO_FK2 (cr=3239 pr=0 pw=0 time=0.03)Please help.
    Regards
    Ashish

    |    254644500 ..NESTED LOOPS (cr=519939265 pr=34777 pw=0 time=3819.67)
    |    254643758 ...NESTED LOOPS (cr=8921833 pr=29939 pw=0 time=1274.41)There is no way the optimizer should choose to process that many rows using nested loops.
    Either the statistics are not up to date, the data values are skewed or you have some optimizer parameter set to none default to force index access.
    Please post explain plan and optimizer* parameter settings.

  • Gathering system statistics in 10g

    I am confused. I read in the Oracle® Database Performance Tuning Guide, for 10g Release 1, that the system statistics are NOT automatically generated and must be manually generated using DBMS_STATS. However, when I query V$SESSTAT, V$STATNAME and V$OSSTAT I have records returned.
    I thought that DBMS_STATS was no longer used in 10g and that everything was automatic. Does anyone know which is correct? If I have data in those views does that mean that system statistics have been run?
    Thanks!

    You can still manually collect stats in 10g using DBMS_STATS, but 10g can also perform statistics collection on stale tables automatically, when enabled. Our other DBA was involved in setting up that item, but I think the Oracle tool involved is the Automatic Workload Repository.
    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10752/autostat.htm
    -Chuck

  • Replacement for 'Rule' hint in 10g

    Hi,
    We have upgraded database from 9i to 10g. We have some sql queries which are using 'RULE' hints, but 10g is not supporting 'RULE' hints, can you please suggest me any replacement hint for 'RULE' hint in 10g or alternative ways to tune the sql query so that it will work same as 9i in 10g also in performance.
    Kindly help me.
    Thanks

    Query:
    SELECT HOU.NAME EMPRESA,
    PAPF.FULL_NAME COMPRADOR,
    NVL(SUBSTR(CAEV.DE_CODE, 1, 10), ' ') DE_COMPRADOR,
    NVL(SUBSTR(CAEV.DI_CODE, 1, 10), ' ') DI_COMPRADOR,
    NVL(SUBSTR(CAEV.GG_CODE, 1, 10), ' ') GG_COMPRADOR,
    NVL(SUBSTR(CAEV.GA_CODE, 1, 10), ' ') GA_COMPRADOR,
    PH.SEGMENT1 ORDEM_COMPRA,
    PV.VENDOR_NAME FORNECEDOR,
    DECODE(PVSA.GLOBAL_ATTRIBUTE9,
    1,
    PVSA.GLOBAL_ATTRIBUTE10 || '' || PVSA.GLOBAL_ATTRIBUTE12,
    2,
    PVSA.GLOBAL_ATTRIBUTE10 || '' || PVSA.GLOBAL_ATTRIBUTE11 || '' ||
    PVSA.GLOBAL_ATTRIBUTE12,
    3,
    LPAD(PV.SEGMENT1 || REPLACE(PVSA.VENDOR_SITE_CODE, '-', ''),
    15,
    '0'),
    PVSA.GLOBAL_ATTRIBUTE10 || '' || PVSA.GLOBAL_ATTRIBUTE11 || '' ||
    PVSA.GLOBAL_ATTRIBUTE12) CNPJ,
    PVSA.VENDOR_SITE_CODE LOCAL,
    REPLACE(REPLACE(REPLACE(REPLACE(PH.COMMENTS, CHR(13) || CHR(10) || CHR(9), ' '),
    CHR(9), ' '), CHR(10), ' '), '#', '')
    DESCRIÇÃO,
    (SELECT LAST_NAME
    FROM APPS.PER_PEOPLE_F
    WHERE EMPLOYEE_NUMBER = PH.ATTRIBUTE1
    AND EFFECTIVE_END_DATE >= SYSDATE) GESTOR_DO_CONTRATO,
    NVL(SUBSTR(CAEV2.DE_CODE, 1, 10), ' ') DE_GESTOR,
    NVL(SUBSTR(CAEV2.DI_CODE, 1, 10), ' ') DI_GESTOR,
    NVL(SUBSTR(CAEV2.GG_CODE, 1, 10), ' ') GG_GESTOR,
    NVL(SUBSTR(CAEV2.GA_CODE, 1, 10), ' ') GA_GESTOR,
    NVL(CAEV2.GA_NOME, ' ') GA_NOME,
    PDT.TYPE_NAME TIPO,
    TO_CHAR(PH.START_DATE, 'DD/MM/YYYY') DATA_INICIAL_EFETIVAÇÃO,
    TO_CHAR(PH.END_DATE, 'DD/MM/YYYY') DATA_FINAL_EFETIVAÇÃO,
    NVL(PH.CLOSED_CODE, 'OPEN') STATUS_DO_FECHAMENTO,
    PH.BLANKET_TOTAL_AMOUNT VALOR_DO_CONTRATO,
    (SELECT EMAIL_ADDRESS
    FROM APPS.PER_PEOPLE_F
    WHERE EMPLOYEE_NUMBER = PH.ATTRIBUTE1
    AND EFFECTIVE_END_DATE >= SYSDATE) EMAIL_GESTOR_DO_CONTRATO
    ,FLV.MEANING STATUS_DA_APROVAÇÃO
    ,NVL((SELECT MCB.SEGMENT1 || '.' ||
    MCB.SEGMENT2 || '.' ||
    MCB.SEGMENT3 || '.' ||
    MCB.SEGMENT4 || '.' ||
    MCB.SEGMENT5
    FROM PO.PO_HEADERS_ALL PAI,
    PO.PO_HEADERS_ALL FILHO,
    PO.PO_LINES_ALL PLA,
    INV.MTL_CATEGORIES_B MCB
    WHERE MCB.CATEGORY_ID = PLA.CATEGORY_ID
    AND PAI.TYPE_LOOKUP_CODE = 'CONTRACT'
    AND PLA.CONTRACT_ID = PAI.PO_HEADER_ID
    AND PLA.PO_HEADER_ID = FILHO.PO_HEADER_ID
    AND PAI.PO_HEADER_ID = PH.PO_HEADER_ID
    AND NVL(PLA.CANCEL_FLAG, 'N') = 'N'
    AND MCB.SEGMENT1 = 'SV'
    AND ROWNUM = 1) ,
    (SELECT MCB.SEGMENT1 || '.' ||
    MCB.SEGMENT2 || '.' ||
    MCB.SEGMENT3 || '.' ||
    MCB.SEGMENT4 || '.' ||
    MCB.SEGMENT5
    FROM PO.PO_HEADERS_ALL PAI,
    PO.PO_HEADERS_ALL FILHO,
    PO.PO_LINES_ALL PLA,
    INV.MTL_CATEGORIES_B MCB
    WHERE MCB.CATEGORY_ID = PLA.CATEGORY_ID
    AND PAI.TYPE_LOOKUP_CODE = 'CONTRACT'
    AND PLA.CONTRACT_ID = PAI.PO_HEADER_ID
    AND PLA.PO_HEADER_ID = FILHO.PO_HEADER_ID
    AND PAI.PO_HEADER_ID = PH.PO_HEADER_ID
    AND NVL(PLA.CANCEL_FLAG, 'N') = 'N'
    AND MCB.SEGMENT1 = 'SE'
    AND ROWNUM = 1)) CATEGORIA,
    PH.ATTRIBUTE2 TIPO_DE_CONTRATO
    FROM ---
    (SELECT DISTINCT
    PAPF.PERSON_ID,
    PAPF.EMPLOYEE_NUMBER,
    PAPF.FULL_NAME,
    PAPF.EMAIL_ADDRESS,
    HAOU_GA.ATTRIBUTE10 GA_CODE,
    HAOU_GA.ATTRIBUTE11 GA_NOME,
    HAOU_GG.ATTRIBUTE10 GG_CODE,
    HAOU_GG.ATTRIBUTE11 GG_NOME,
    HAOU_DI.ATTRIBUTE10 DI_CODE,
    HAOU_DI.ATTRIBUTE11 DI_NOME,
    HAOU_DE.ATTRIBUTE10 DE_CODE,
    HAOU_DE.ATTRIBUTE11 DE_NOME
    FROM APPS.PER_ALL_PEOPLE_F PAPF,
    APPS.PER_ALL_ASSIGNMENTS_F PAAP,
    APPS.PER_ALL_POSITIONS PAP,
    APPS.HR_ALL_ORGANIZATION_UNITS HAOU_GA,
    APPS.HR_ALL_ORGANIZATION_UNITS HAOU_GG,
    APPS.HR_ALL_ORGANIZATION_UNITS HAOU_DI,
    APPS.HR_ALL_ORGANIZATION_UNITS HAOU_DE
    WHERE PAPF.PERSON_ID = PAAP.PERSON_ID
    AND PAAP.POSITION_ID = PAP.POSITION_ID(+)
    AND PAPF.EFFECTIVE_END_DATE = TO_DATE('31/12/4712', 'DD/MM/YYYY')
    AND PAAP.EFFECTIVE_END_DATE = TO_DATE('31/12/4712', 'DD/MM/YYYY')
    AND SUBSTR(PAP.NAME, 1, 12) = HAOU_GA.ATTRIBUTE9 (+)
    AND SUBSTR(PAP.NAME, 1, 10) = HAOU_GG.ATTRIBUTE9 (+)
    AND SUBSTR(PAP.NAME, 1, 8) = HAOU_DI.ATTRIBUTE9 (+)
    AND SUBSTR(PAP.NAME, 1, 6) = HAOU_DE.ATTRIBUTE9 (+)) CAEV2,
    APPS.PO_VENDORS PV,
    APPS.PO_VENDOR_SITES_ALL PVSA,
    APPS.PER_ALL_PEOPLE_F PAPF,
    APPS.PO_DOCUMENT_TYPES_ALL_TL PDT,
    APPS.HR_ALL_ORGANIZATION_UNITS HOU,
    (SELECT DISTINCT
    PAPF.PERSON_ID,
    PAPF.EMPLOYEE_NUMBER,
    PAPF.FULL_NAME,
    PAPF.EMAIL_ADDRESS,
    HAOU_GA.ATTRIBUTE10 GA_CODE,
    HAOU_GA.ATTRIBUTE11 GA_NOME,
    HAOU_GG.ATTRIBUTE10 GG_CODE,
    HAOU_GG.ATTRIBUTE11 GG_NOME,
    HAOU_DI.ATTRIBUTE10 DI_CODE,
    HAOU_DI.ATTRIBUTE11 DI_NOME,
    HAOU_DE.ATTRIBUTE10 DE_CODE,
    HAOU_DE.ATTRIBUTE11 DE_NOME
    FROM APPS.PER_ALL_PEOPLE_F PAPF,
    APPS.PER_ALL_ASSIGNMENTS_F PAAP,
    APPS.PER_ALL_POSITIONS PAP,
    APPS.HR_ALL_ORGANIZATION_UNITS HAOU_GA,
    APPS.HR_ALL_ORGANIZATION_UNITS HAOU_GG,
    APPS.HR_ALL_ORGANIZATION_UNITS HAOU_DI,
    APPS.HR_ALL_ORGANIZATION_UNITS HAOU_DE
    WHERE PAPF.PERSON_ID = PAAP.PERSON_ID
    AND PAAP.POSITION_ID = PAP.POSITION_ID(+)
    AND PAPF.EFFECTIVE_END_DATE = TO_DATE('31/12/4712', 'DD/MM/YYYY')
    AND PAAP.EFFECTIVE_END_DATE = TO_DATE('31/12/4712', 'DD/MM/YYYY')
    AND SUBSTR(PAP.NAME, 1, 12) = HAOU_GA.ATTRIBUTE9 (+)
    AND SUBSTR(PAP.NAME, 1, 10) = HAOU_GG.ATTRIBUTE9 (+)
    AND SUBSTR(PAP.NAME, 1, 8) = HAOU_DI.ATTRIBUTE9 (+)
    AND SUBSTR(PAP.NAME, 1, 6) = HAOU_DE.ATTRIBUTE9 (+)) CAEV,
    APPS.PO_HEADERS_ALL PH,
    APPS.FND_LOOKUP_VALUES FLV
    WHERE PV.VENDOR_ID(+) = PH.VENDOR_ID
    AND PVSA.VENDOR_ID(+) = PH.VENDOR_ID
    AND PVSA.VENDOR_SITE_ID(+) = PH.VENDOR_SITE_ID
    AND PVSA.GLOBAL_ATTRIBUTE9 <> 1
    AND PAPF.EFFECTIVE_END_DATE > SYSDATE
    AND PAPF.PERSON_ID(+) = PH.AGENT_ID
    AND PH.AGENT_ID = CAEV.PERSON_ID(+)
    AND PH.ATTRIBUTE1 = CAEV2.EMPLOYEE_NUMBER(+)
    AND PDT.LANGUAGE = 'PTB'
    AND PDT.ORG_ID(+) = PH.ORG_ID
    AND PDT.DOCUMENT_TYPE_CODE IN ('PO', 'PA')
    AND PDT.DOCUMENT_SUBTYPE(+) = PH.TYPE_LOOKUP_CODE
    AND HOU.ORGANIZATION_ID(+) = PH.ORG_ID
    AND PH.ORG_ID                       IN (90, 91, 92, 93, 94, 410, 414, 19626, 19628, 137) CVRD, HISPANOBRAS, KOBRASCO, NIBRASCO, ITABRASCO,CPBS,FGC,FCA,SALOBO,FVRD
    AND PH.ORG_ID                      IN (90,19626) CVRD,FCA
    AND NVL(PH.FROZEN_FLAG, 'N') = 'N'
    AND NVL(PH.CANCEL_FLAG, 'N') = 'N'
    AND NVL(PH.AUTHORIZATION_STATUS, 'INCOMPLETE') IN ('APPROVED', 'PRE-APPROVED', 'IN PROCESS', 'REQUIRES REAPPROVAL')
    AND PH.TYPE_LOOKUP_CODE = 'CONTRACT'
    AND EXISTS (SELECT 1
    FROM PO.PO_HEADERS_ALL PAI,
    PO.PO_HEADERS_ALL FILHO,
    PO.PO_LINES_ALL PLA,
    INV.MTL_CATEGORIES_B MCB
    WHERE MCB.CATEGORY_ID = PLA.CATEGORY_ID
    AND PAI.TYPE_LOOKUP_CODE = 'CONTRACT'
    AND PLA.CONTRACT_ID = PAI.PO_HEADER_ID
    AND PLA.PO_HEADER_ID = FILHO.PO_HEADER_ID
    AND PAI.PO_HEADER_ID = PH.PO_HEADER_ID
    AND NVL(PLA.CANCEL_FLAG, 'N') = 'N'
    AND MCB.SEGMENT1 IN ('SE', 'SV'))
    -- AND PH.ATTRIBUTE2 IN ('CUSTEIO (SERVIÇO)', 'INVESTIMENTO (SERVIÇO)')
    AND ((NVL(PH.CLOSED_CODE, 'OPEN') = 'OPEN') OR
    (NVL(PH.CLOSED_CODE, 'OPEN') = 'CLOSED' AND
    PH.END_DATE BETWEEN TO_DATE(:DATA_INICIO||' 00:00:00', 'DD/MM/YYYY HH24:MI:SS') AND
    TO_DATE(:DATA_FIM||' 23:59:59', 'DD/MM/YYYY HH24:MI:SS')))
    and flv.language = 'PTB'
    and flv.lookup_type = 'AUTHORIZATION STATUS'
    and flv.lookup_code = nvl(ph.authorization_status,'INCOMPLETE')

  • DB analysis for performance

    I have been assigned DB analysis for performance/problem detection. What things i should look in statspack report , & what other things i should check for over all analysis.

    From statsPack you can look for
    Top 5 wait events
    wait event section
    Redo log activity
    db file scattered read (I/O)
    sql parse, execution times.
    huge number of execution of same sql in a short duration
    On a Broader Level look for
    Application transaction volumes, response times
    database statistics
    Operating system statistics
    I/O
    Network
    Excessive CPU usage
    Physical I/O
    Non-Oracle Processes
    Oracle Processes
    Oracle CPU Statistics
    Resource bottlenecks on the client process
    usage of dblinks for network bottleneck
    Use OS tools like -- sar, top, prstat, vmstat, etc...
    Use Oracle tools like -- TK Prof, SQL Trace, EM Diagnostic Pack, Stats Pack.

  • Sql for selected Workbook Folder Items

    Hi,
    Have come across a lot of excellent sql for finding workbook to folder items and many thanks to the various authors for those. However, what i am trying to get is the selected items within a workbook that is saved to the database. Using the code that I mentioned earlier, I see a workbook in the DB, the Business Areas and the folders. However, i see ALL the items in the folder. I am interested in seeing only those items that have been chosen.....
    I would also settle for some good doco on the eul5_xxxxxxxxx tables that are created detailing their functions, some are obvious - other less so...
    many thanks
    patrick.

    Hi Patrick
    As you may well be aware I am the author of the Oracle Discoverer 10g Handbook. In Appendix A of that book you will find many scripts for querying the EUL along with explanations for how some of the EUL is put together. If you don't have a copy you should consider getting one. Many companies get one for each of their administrators and report writers.
    The particular issue you refer to here is not covered in the book, simply because there is no easy mechanism to see the SQL used inside a workbook. Workbooks are stored in a table called EUL5_WORKBOOKS as binary objects which means you cannot query their content.
    If you have the gathering of query statistics enabled then each time a worksheet is executed a log of that is stored inside the table called EUL5_QPP_STATS. The following code will allow you to examine the folders and items that have been used in previously executed worksheets.
    SELECT
    QS.QS_DOC_OWNER USER_NAME,
    QS.QS_DOC_NAME WORKBOOK,
    QS.QS_DOC_DETAILS WORKSHEET,
    TRUNC(QS.QS_CREATED_DATE) DOC_DATE,
    (LENGTH(TO_CHAR(EUL5_GET_ITEM_NAME(QS.QS_ID)))+1)/9 ITEMS,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),1, 6)) ITEM1,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),10, 6)) ITEM2,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),19, 6)) ITEM3,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),28, 6)) ITEM4,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),37, 6)) ITEM5,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),46, 6)) ITEM6,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),55, 6)) ITEM7,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),64, 6)) ITEM8,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),73, 6)) ITEM9,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),82, 6)) ITEM10,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),91, 6)) ITEM11,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),100,6)) ITEM12,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),109,6)) ITEM13,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),118,6)) ITEM14,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),127,6)) ITEM15,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),136,6)) ITEM16,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),145,6)) ITEM17,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),154,6)) ITEM18,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),163,6)) ITEM19,
    EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),172,6)) ITEM20
    FROM
    EUL5_QPP_STATS QS
    WHERE
    (LENGTH(TO_CHAR(EUL5_GET_ITEM_NAME(QS.QS_ID)))+1)/9 < 21
    As you can see, this code returns worksheets that use 20 or fewer items. You can easily alter this. Further, you may want to restrict this by searching for worksheets that have been run from a certain date using TRUNC(QS.QS_CREATED_DATE), or for a certain workbook using QS.QS_DOC_NAME, or for a certain user using QS.QS_DOC_OWNER. Sometimes you will see QS.QS_DOC_OWNER blank. This means the worksheet has been shared with someone else and was just executed without the user saving it.
    By the way, if you want to query this inside of Discoverer you will have to import the two functions that this uses: EUL5_GET_ITEM and EUL5_GET_ITEM_NAME. They are both owned by the EUL owner.
    Everyone: I will be having discussions with a publisher and a colleage of mine in early April to scope out a new Discoverer book. This book is intended to be a companion to the handbook but be more technical in its approach covering some of the more complex stuff in greater detail. We are looking at about 300 pages. If anyone has any suggestions for material that you would like to see included please send an email to me using [email protected]
    Best wishes
    Michael

  • How to block Sql Plus sessions in Oracle 10g

    Hi,
    I want to block all sql plus sessions in oracle 10g, as we have a application and we need each and every one to use this application not the sql plus session.
    Kindly update us as soon as possible. and also thanks in advanced.

    Understand the concept Karl, but a layered defense seldom works in the IP world. If I manage to get through the firewall, then how can you prevent me access, at IP level, at any other ISO stack layer? If you manage to get through, then your firewall policies could just be too weak :) at least you must have some kind of an IDS infrastructure in place..
    what I mean is, you can have infinite number of threats.. and this will be part of your Risk Analysis. Determining all possible threats to the assets, what are being protected and their associated value, and predicting the rate of occurrence.... with all of these you could probably come up with contingency plans and incident response.. And most of all, you should not ignore the fact that people are creative, ingenious, and curious, and they'll prove this to you by testing your security implementations. So you'll have to periodically evaluate your security.. that's why there are audits.. Also, you must balance Security, Performance, Usability, and your Budget.
    Yes, you can argue that if the entire firewall goes down (thus no IP defense), then something like DBV (or even denying IPs in sqlnet) can provide some defense. But is that not then a case of too little too late? It's better too little too late, than no protection at all... Imagine if there's no DBV, or if you have not implemented the concept of "Least Privilege"? or if the backups and exports are not encrypted? That would be more devastating.. that's the importance of database security options and features in providing "defense in depth"
    I question just what purpose and how effective IP packet security is at higher layers. It can never substitute doing this instead at firewall level. Well, it's not all about network security. All facets must be considered and the inter-relationships should be understand. Like the core information security and access management, physical and personnel security, training them, etc... And all of these are equally important in providing a secure ecosystem
    As for security that relies on the client to pass secure data (like executable name or o/s user name)... all this can easily be spoofed. Even if the app and Oracle driver are somehow digitally signed and these signatures can be verified on the server side, we only need to look at Vista to see how secure this really would be. Microsoft attempted to encrypt every single h/w and s/w layer from the physical DVD track to the pixel on the monitor.. and this was defeated. And this was done as o/s kernel level. It is less complex to hack at driver level and even trivial to do it at application level.Security is about risk management. Blocking SQL*Plus does not negate the risk of SQL from the wild being run on a production server. For example, the client is a VB client using ODBC. It is easy to create a proxy that accepts the ODBC connection from the VB client and proxy the OCI packets to the real Oracle server. Now you have a man-in-the-middle than can inspect every single SQL call made to Oracle, and inject any PL/SQL or SQL code it wants.
    Security is far beyond writing a login trigger to deny SQL*Plus sessions and calling that a defense. >
    Yes I agree with you. That's why there are independent organizations and regulating bodies that provides security best practices, to give us a headstart on comming up of strong security policies.
    And one of my favorites is the one provided by IASE (sponsored by Defense Information Systems Agency) where there's lot of content regarding hardening and policies
    http://iase.disa.mil/stigs/stig/index.html
    http://iase.disa.mil/stigs/checklist/index.html
    http://iase.disa.mil/stigs/SRR/index.html
    - Karl Arao
    http://karlarao.wordpress.com

Maybe you are looking for