CPU being used on the LIVE database server

Hi,
I'm seeing a lot of CPU being used on the LIVE database server, primarily by sessions running the following SQL :- As this is for audit log and a developer wrote it how can i optimize it or advise me pls
select * from ( select this_.ID as ID22_0_, this_.EVENT_TIME as EVENT2_22_0_, this_.AUDIT_LOG_EVENT_ID as AUDIT3_22_0_, this_.USER_ID as USER4_22_0_, this_.PUBLIC_OBJECT_ID as PUBLIC5_22_0_, this_.DESCRIPTION as DESCRIPT6_22_0_ from AUDIT_LOG this_ where this_.PUBLIC_OBJECT_ID=:1 order by this_.ID desc ) where rownum <= :2
thanks

It's a Top-N query and can be better written this way:
select this_.ID as ID22_0_, this_.EVENT_TIME as EVENT2_22_0_,
       this_.AUDIT_LOG_EVENT_ID as AUDIT3_22_0_,
       this_.USER_ID as USER4_22_0_, this_.PUBLIC_OBJECT_ID as PUBLIC5_22_0_,
       this_.DESCRIPTION as DESCRIPT6_22_0_ 
  from (select AUDIT_LOG.*, row_number() over (Order by ID desc) rn
          from AUDIT_LOG
     where PUBLIC_OBJECT_ID=:1 ) this_
where rn <= :2I don't know if it will solve your issue...there are so many other variables...
Max
http://oracleitalia.wordpress.com

Similar Messages

  • How to list all the datatypes are being used in the database?

    Is there any way you can list all the oracle datatypes are being used in the database?
    Thanks,
    Chau

    Use USER_TAB_COLUMNS or DBA_TAB_COLUMNS to determing various data type but USER_TAB_COLUMNS will show you what type being used by a schema user

  • Materialized view not being used in the report

    I have had a materialized view (MV) for a particular report. Recently, the report definition has changed little bit, so the existing MV is not being used by the report anymore. I copied the code Discoverer's SQL Inspection and recreated the materialized view. But still it is not working. Obviously, I am missing something at the database level. Does anyone have any idea? The database is 9i and Discoverer is 9.0.2. Thank you!

    The SQL that you see from the Inspect SQL option will provide you with the SQL that Discoverer sends to the database. The database then may do a query rewrite to point to an available materialized view if available. This rewrite won't be seen from the inspect sql option. You need to check at the database level to verify if a query rewrite did in fact take place.
    You may want to check the section titled "Query Rewrite with Materialized Views" from Ch1 - "Introduction to the Optimizer" in the Oracle9i Database Performance Tuning Guide and Reference, Release 2 (9.2), Part Number A96533-02, available at http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96533/optimops.htm#37287
    Regards
    Abhinav Agarwal
    Oracle Business Intelligence Product Management
    http://www.oracle.com/bi
    http://www.oracle.com/technology/documentation/bi_ee.html
    http://www.oracle.com/technology/software/products/ias/htdocs/101320bi.html
    http://oraclebi.blogspot.com/

  • Error when installing 9.0.1.4.0 patch set for the Oracle Database Server.

    Hi to all.
    Currently, i am trying to install patches for portal server.
    The server OS is Sun Solaris 8.
    We are using Oracle9iAS.
    Now, we are installing 9.0.1.4.0 patch set for the Oracle Database Server.
    We managed to install the patch, but have problem with the Post Install Action.
    We managed to run
    -ALTER SYSTEM ENABLE RESTRICTED SESSION;
    -@rdbms/admin/catpatch.sql
    -ALTER SYSTEM DISABLE RESTRICTED SESSION;
    -CONNECT / AS SYSDBA
    -update obj$ set status=5 where type#=29 and owner#!=0;
    -commit;
    But, when we come to the next command, which is to shutdown, it gives us like
    this..
    SQL> update obj$ set status=5 where type#=29 and owner#!=0;
    1402 rows updated.
    SQL> commit;
    Commit complete.
    SQL> shutdown immediate
    Database closed.
    Database dismounted.
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01219: database not open: queries allowed on fixed tables/views only
    We tried to startup the database..it gives us this error..
    SQL> startup
    ORA-01081: cannot start already-running ORACLE - shut it down first
    So, we tried to shutdown again..
    SQL> shutdown immediate
    ORA-01089: immediate shutdown in progress - no operations are permitted
    I been informed that this is maybe a Database problem related. Any ideas?
    Best Wishes,
    Rushdan Md Saad.

    Patchsets could be obtained (only) from http://metalink.oracle.com
    You need to have valid CSI for access.
    P.S: Sorry Werner, I didn't see you post.
    Message was edited by:
    Ivan Kartik

  • RMAN-05001 auxiliary .... conflicts with a file used by the target database

    I can´t recreate my physical standby.
    It worked in the past.
    Now I reinstalled the 3 standbyclients.
    Copied the spfile from the primary - modified the entries and did a rman backup.
    But when issuing the duplicate database command - it comes up with the error above
    SPFILE standyby db:
    *.db_file_name_convert='+DATA/prim/','+DATA/stdy/','+RECOVERY/prim','+RECOVERY/stdy'
    *.log_file_name_convert='+DATA/prim/','+DATA/stdy/','+RECOVERY/prim','+RECOVERY/stdy'
    Starting restore at 15-APR-10
    using channel ORA_AUX_DISK_1
    channel ORA_AUX_DISK_1: starting datafile backupset restore
    channel ORA_AUX_DISK_1: restoring control file
    channel ORA_AUX_DISK_1: reading from backup piece /oracle/stage/33lb65n2_1_1
    channel ORA_AUX_DISK_1: restored backup piece 1
    piece handle=/oracle/stage/33lb65n2_1_1 tag=TAG20100415T102434
    channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:11
    output filename=+REDO1/stdy/controlfile/current.262.716293055
    output filename=+REDO2/stdy/controlfile/backup.262.716293055
    Finished restore at 15-APR-10
    sql statement: alter database mount standby database
    released channel: ORA_AUX_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 04/15/2010 10:31:46
    RMAN-05501: aborting duplication of target database
    RMAN-05001: auxiliary filename DATA/prim/datafile/system.262.715097535 conflicts with a file used by the target database+
    RMAN-05001: auxiliary filename DATA/prim/datafile/sysaux.263.715097499 conflicts with a file used by the target database+
    RMAN-05001: auxiliary filename DATA/prim/datafile/undotbs3.269.710521021 conflicts with a file used by the target database+
    RMAN-05001: auxiliary filename DATA/prim/datafile/undotbs2.270.710521021 conflicts with a file used by the target database+
    RMAN-05001: auxiliary filename DATA/prim/datafile/example.272.710521021 conflicts with a file used by the target database+
    RMAN-05001: auxiliary filename DATA/prim/datafile/users.268.710521021 conflicts with a file used by the target database+
    RMAN-05001: auxiliary filename DATA/prim/datafile/sysaux.273.710521021 conflicts with a file used by the target database+
    RMAN-05001: auxiliary filename DATA/prim/datafile/undotbs1.271.710521021 conflicts with a file used by the target database+
    RMAN-05001: auxiliary filename DATA/prim/datafile/system.264.710521021 conflicts with a file used by the target database+

    Hi ,
    I feel you are using ASM but still check the below details:
    Cause
    Production and Auxiliary have same directory structure and are running on two different machines. RMAN must be told not check that the target datafiles are sharing the same names as the duplicated files being created. Otherwise, the following errors will be returned:
    RMAN-05001: auxiliary filename /qmaxnt/u04/qmaxntorafiles/table/QMAXAD08_03.dbf
    conflicts with a file used by the target database
    RMAN-05001: auxiliary filename /qmaxnt/u04/qmaxntorafiles/table/QMAXAD08_02.dbf
    Solution
    To implement the solution, please use nofilenamecheck in syntax as follows:
    1. Connect to Target, auxiliary, and rman catalog and
    2. use script as
    run{
    set until time "to_date('2005/09/17 14:00:00','yyyy/mm/dd HH24:MI:SS')";
    allocate auxiliary channel aux1 type 'sbt_tape';
    allocate auxiliary channel aux2 type 'sbt_tape';
    duplicate target database for standby dorecover nofilenamecheck;
    Make sure to use auxiliary type of channel so RMAN restore take place at auxiliary database.
    Thanks,
    Rafi.
    http://rafioracledba.blogspot.com/

  • DUPLICATE DB : ORA-17629: Cannot connect to the remote database server

    [oracle@ora11g1 ~]$ export ORACLE_SID=sales
    [oracle@ora11g1 ~]$ rman target sys/sales@sales
    Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jun 5 13:00:15 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
    connected to target database: SALES (DBID=690066655)
    RMAN> connect auxiliary sys/salestby2@salestby2
    connected to auxiliary database: SALES (not mounted)
    RMAN> DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE SPFILE
    2> SET DB_NAME= 'sales'
    3> SET DB_UNIQUE_NAME= 'salestby2'
    4> SET control_files='/u02/oradata/salestby2/control01.ctl','/u02/oradata/salestby2/control02.ctl'
    5> SET DB_FILE_NAME_CONVERT='/u02/oradata/sales/','/u02/oradata/salestby2/'
    6> SET LOG_FILE_NAME_CONVERT='/u02/oradata/sales/','/u02/oradata/salestby2/';
    Starting Duplicate Db at 05-JUN-13
    using target database control file instead of recovery catalog
    allocated channel: ORA_AUX_DISK_1
    channel ORA_AUX_DISK_1: SID=20 device type=DISK
    contents of Memory Script:
    backup as copy reuse
    targetfile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwsales' auxiliary format
    '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwsalestby2' targetfile
    '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilesales.ora' auxiliary format
    '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilesalestby2.ora' ;
    sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfilesalestby2.ora''";
    executing Memory Script
    Starting backup at 05-JUN-13
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=58 device type=DISK
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 06/05/2013 13:05:26
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server
    continuing other job steps, job failed will not be re-run
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 06/05/2013 13:05:27
    RMAN-03015: error occurred in stored script Memory Script
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 06/05/2013 13:05:27
    ORA-17629: Cannot connect to the remote database server
    ORA-17627: ORA-01017: invalid username/password; logon denied
    ORA-17629: Cannot connect to the remote database server

    Welcome to the oracle forums!
    Please take some time to go through [url https://forums.oracle.com/forums/ann.jspa?annID=1535]FAQ PAGE
    Always post 4 digit oracle version and OS details.
    Post any query out put between \  \ tags
    Mark your questions as answered if you get the answer
    Password of SYS user on primary and standby must be same.Copy the password file from primary to standby server
    scp $ORACLE_HOME/dbs/orapwv112 <oracle_user@auxiliary_host>:/u01/app/oracle/product/11.2/dbs/orapwdupv112

  • How to know the full path which is being used in the dataconnection .

    How to know the full path which is being used in the dataconnection without going and looking into coding.
    I am new to crystal reports.
    Plz advice.Thanks in advance
    Jay

    This forum is dedicated to topics related to custom application development or deployment with Crystal Reports in .Net. This includes full versions of Crystal Reports as well as those versions of Crystal Reports bundled with Microsoft Visual Studio .Net.
    As you do not want to do any coding, this query is in the wrong forum. However, in most versions of Crystal Reports, you can look up the database connection information by simply opening the report in the CR designer. Then go to the database menu and select "Set Datasource Location..."
    Ludek

  • I'm trying to set up my iPad2.  I am entering my Apple ID and get a message that says "try another apple id, this ID is already being used.  The only time I've used this Apple ID (my email), is when I bought a mac for my college student.

    I'm trying to set up my iPad2.  I am entering my Apple ID and get a message that says "try another apple id, this ID is already being used.  The only time I've used this Apple ID (my emal) was when I purchased a mac for my college aged child.

    Thank you...I had selected the incorrect option to create an Apple ID....so backing up a few pages and doing as you stated worked!

  • Iphone 4s - how do I change the name in the contacts for the owner of the phone - it is coming up as the other person who uses the laptop - so when ringing or texting anyone 2 names are being used as the caller id on the screen

    Iphone 4s - how do I change the name in the contacts for the owner of the phone - it is coming up as the other person who uses the laptop - so when ringing or texting anyone 2 names are being used as the caller id on the screen

    *Ralph Johns* writes:
    "Your options are:
    Get a trial account form @mac which will work as an iChat name after the 60 days run out but not be a email account that is valid (And is free)"
    Do you mean a trial account from .Mac? (DotMac)
    "Get an AIM Screen name and set it to Display what you want as you set it up.
    The Screen name can be whatever yu want but you can also set it to display something else as well."
    I had thought about this, but it seems other people have already chosen the screen name "pinksharkmark" and virtually every variation of it I can think of. So that isn't an option for me. As for getting it to display something else as well, do you mean that if I were to get an AIM screen name like "CromulentCat" I could somehow log in to iChat under the AIM account "CromulentCat" yet get iChat to represent me to my Buddies as "PinkSharkMark"? Because I have to admit I don't see how that can be done. It appears as if iChat displays to anyone chatting with you precisely the account name you logged in under and nothing else. So if you logged in using a .Mac account, then you are displayed as "[email protected]" while if you logged in under an AIM account, you are displayed as "CromulentCat". But that's it that's all... there is no way to change CromulentCat to PinkSharkMark.
    Thanks very much for taking the time to reply, though.

  • Partial fields of Secondary index being used by the DB Optimizer

    Hello,
    I have written the following Query to select an std. SAP Index from GLPCA~1. However, when i run the SQL trace although the index is selected by the DB optimizer the results say that only 3 matching columns were used.
    bold Index GLPCA~1. bold
    KOKRS
    RYEAR
    RPRCTR
    RVERS
    RACCT
        SELECT rldnr
               rrcty
               rvers
               ryear
               rtcur
               rpmax
               rbukrs
               rprctr
               rfarea
               kokrs
               racct
               hslvt
               hsl01
               hsl02
               hsl03
               hsl04
               hsl05
               hsl06
               hsl07
               hsl08
               hsl09
               hsl10
               hsl11
               hsl12
               kslvt
               ksl01
               ksl02
               ksl03
               ksl04
               ksl05
               ksl06
               ksl07
               ksl08
               ksl09
               ksl10
               ksl11
               ksl12
               FROM glpct
               INTO TABLE i_glpct
               WHERE kokrs = 'BFS'
                  AND ryear = p_gjahr
                  AND rprctr IN r_prctr
                  AND rvers = '000'
                  AND racct IN r_acct.
    Now i am not sure which of the above 3 fields of the where condition are being selected but probably KOKRS and RVERS are not being used by the optimizer.
    Any pointers on how to make the optimizer utilize all 5 fields would be greatly appreciated.
    Thanks,
    Minhaj.

    Hello,
    I have written the following Query to select an std. SAP Index from GLPCA~1. However, when i run the SQL trace although the index is selected by the DB optimizer the results say that only 3 matching columns were used.
    bold Index GLPCA~1. bold
    KOKRS
    RYEAR
    RPRCTR
    RVERS
    RACCT
        SELECT rldnr
               rrcty
               rvers
               ryear
               rtcur
               rpmax
               rbukrs
               rprctr
               rfarea
               kokrs
               racct
               hslvt
               hsl01
               hsl02
               hsl03
               hsl04
               hsl05
               hsl06
               hsl07
               hsl08
               hsl09
               hsl10
               hsl11
               hsl12
               kslvt
               ksl01
               ksl02
               ksl03
               ksl04
               ksl05
               ksl06
               ksl07
               ksl08
               ksl09
               ksl10
               ksl11
               ksl12
               FROM glpct
               INTO TABLE i_glpct
               WHERE kokrs = 'BFS'
                  AND ryear = p_gjahr
                  AND rprctr IN r_prctr
                  AND rvers = '000'
                  AND racct IN r_acct.
    Now i am not sure which of the above 3 fields of the where condition are being selected but probably KOKRS and RVERS are not being used by the optimizer.
    Any pointers on how to make the optimizer utilize all 5 fields would be greatly appreciated.
    Thanks,
    Minhaj.

  • Is there a way to find out which CSS rules are being used by the different html files?

    Is there a way in Dreamweaver CS3 to find out which CSS rules are being used by the different html files, sitewide?
    Thanks - Dave

    Firefox add-on "Web Developer Toolbar" is a must have.  Information > Display Div & Class details.
    https://addons.mozilla.org/en-US/firefox/addon/60
    Another  handy Firefox Add-on  to add to your tool chest is called "Dust-Me Selectors."
    http://www.sitepoint.com/dustmeselectors/
    "It extracts all the selectors from all the stylesheets on the page you're viewing, then analyzes that page to see which of those selectors are not used. The data is then stored so that when testing subsequent pages, selectors can be crossed off the list as they're encountered.
    You can test pages individually, or spider an entire site, and you'll end up with a profile of which selectors are not used anywhere."
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How to know the Z tcodes being used by the company.

    Hi Everyone,
    Can you please tell me how do i know what are the Z tcodes being used by the company.My client is asking me to check all the Ztodes & tell them if there is any problem in them or not.
    Regards,
    Reah

    Hello
    You can find transaction code list in table TSTC.
    All Z transaction code start with character Y or Z, you can query above table to get list of Z transaction codes.
    Additionally you can use transaction code SE93 to view list of transaction Z transaction code and reports associated with these tcodes.
    For second question you should get adequate knowledge transfer from existing IT or developer who developed these reports to be able to understand and test functionality of z tcodes.
    Or
    Please refer functional and technical documentation of these Z tcodes or reports.
    Thanks!
    Raju

  • Auxiliary filename  conflicts with a file used by the target database

    Hi,
    I am using RMAN backup to duplicate my prod database.
    My database is 10g on Linux.
    My RMAN script is like this
    connect auxiliary /;
    connect catalog rman/rman@catalog;
    connect target sys/sys@prod;
    sql "alter session set optimizer_mode=RULE";
    run {
    allocate auxiliary channel dup1 type disk;
    allocate auxiliary channel dup2 type disk;
    allocate auxiliary channel dup3 type disk;
    set newname for datafile 1 to '/d05/u08/oracle/qadata/system01.dbf';
    set newname for datafile 2 to '/d05/u08/oracle/qadata/system02.dbf';
    set newname for datafile 3 to '/d05/u08/oracle/qadata/system03.dbf';
    set newname for tempfile 1 to '/d05/u09/oracle/qadata/temp01.dbf';
    set newname for tempfile 2 to '/d05/u09/oracle/qadata/temp02.dbf';
    set newname for tempfile 3 to '/d05/u09/oracle/qadata/temp03.dbf';
    set newname for tempfile 4 to '/d05/u09/oracle/qadata/temp04.dbf';
    duplicate target database to qa logfile
    group 1 ('/d05/u09/oracle/qadata/log1a.log',
    '/d05/u09/oracle/qadata/log1b.log') size 50m,
    group 2 ('/d05/u09/oracle/qadata/log2a.log',
    '/d05/u09/oracle/qadata/log2b.log') size 50m,
    group 3 ('/d05/u09/oracle/qadata/log3a.log',
    '/d05/u09/oracle/qadata/log3b.log') size 50m;
    I am getting the following error in the middle
    Starting Duplicate Db at 18-SEP-10
    released channel: dup1
    released channel: dup2
    released channel: dup3
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of Duplicate Db command at 09/18/2010 11:32:07
    RMAN-05501: aborting duplication of target database
    RMAN-05001: auxiliary filename /db01/u08/oracle/proddata/GRCM.dbf conflicts with a file used by the target database
    Recovery Manager complete.
    Previously the duplicate db was successful, but now it is giving error.
    How can I solve this.
    Thanks,
    Kavitha

    5001, 1, "auxiliary file name %s conflicts with a file used by the target database"
    // *Cause: RMAN is attempting to use the specified file name as a restore
    //         destination in the auxiliary database, but this name is already
    //         in use by the target database.
    // *Action: Use the CONFIGURE AUXNAME command to specify a name for the data
    //          file that does not conflict with a file name in use by the
    //          target db.

  • My old apple ID is being used for the iCloud account.  I need to change it to my current Apple ID, My old apple ID is being used for the iCloud account.  I need to change it to my current Apple ID

    My old Apple ID is being used for the iCloud account on my phone.  I cannot change the account when I click on iCloud Settings.  Please help!!

    You will have to sign out from the iCloud preference pane and sign in with the new ID. Of course when you sign out all your iCloud data - email, calendars, contacts - will disappear from your Mac, assuming you have indeed been syncing them to the iCloud account you want to stop using. You can transfer the calendars and contacts manually, but you can't move the email addresses from one iCloud account to another.

  • Can i revert back to the ios 5 maps on my pad. Im not quite satisfied with the maps being used on the ios 6 especially the street/ regular map

    Can i revert back to the ios 5 maps on my pad. Im not quite satisfied with the maps being used on the ios 6 especially the street/ regular map. It looks good but some details like gas station, restaurants, sidestreets which are good references when travelling are not there anymore.

    Load this map and save it on your Home Screen
    https://maps.google.com/

Maybe you are looking for

  • How can i continue my icloud keychain on my ipod if i no longer have the phone number from my iphone5c?

    How can I get my icloud keychain to my ipod if I no longer have my iphone 5c

  • How to I get the tab line and the clock to appear on any page?

    Once I had a line of tabs across the top of my screen -- all the open tabs. Now that line has shrunk only to be opened by moving the cursor to the topmost part of my screen. I don't like that. How do I get it back so the tabs are always showing??? At

  • Work Item Attachment

    Hi Guru's I need to attach a Pdf file to work item. Actually I have wrritten a code for converting the Smartform into PDF format but now i need to send this as a mail with workitem attachment. for this we need Use SOFM Object but i'm not having clear

  • AD Powershell script

    Hello Guys, I research a script to move AD Computer from a txt file to a different OU and for each machine disable the account. Also I want finally a logfile that define all the different result. Thank you in advance,

  • My whole music store is in French!

    Hi! I've just updated my old iTunes and iPod to the newest version. But oh dear, the whole music store is in French and I can't understand anything. I want podcasts, English podcasts, goddamnit! If anyone could explain to me how to change the languag