Two queries against aud$ with different results

hi guys
I'm not so good with queries and that is the reason for my question:
We have audit activated and we want to get the following information (monthly):
- how many times the user logon to database.
- every logon of each user in a month.
For the first (1) requirement we have the following query:
select USERID "Cuenta", USERHOST, TERMINAL, nombres||' '||PRIMER_APELLIDO||' '||SEGUNDO_APELLIDO "WhiteList"
, count(*) "TOTAL"
from aud$, ab.usuarios
where (ACTION# = 100) and
(NTIMESTAMP# between (to_date(to_char('01092013 00:00:00'),'ddmmyyyy HH24:MI:SS'))
    and (to_date(to_char('30092013 23:59:00'),'ddmmyyyy HH24:MI:SS'))) and
USERID = CODIGO_USUARIO(+) and
USERID not in ('DBSNMP','SYSMAN')
group by USERID, USERHOST, TERMINAL,  nombres||' '||PRIMER_APELLIDO||' '||SEGUNDO_APELLIDO
order by USERID, USERHOST, TERMINAL;
the result of this query shows like this:
Header 1
Cuenta               USERHOST                  TERMINAL        WhiteList                                     TOTAL                                                                                     
ASEGUR               MAQUINADIAB\SSSSS        IUOOO          PEPITO GARCIA Y GARCIA SOCIED                    10                                                                                     
ASEGUR               POSADASDE\MNNN4550094  MNNN4550094    PEPITO GARCIA Y GARCIA SOCIED                     1                                                                                     
ASEGUR               POSADASDE\YUMI          YUMI            PEPITO GARCIA Y GARCIA SOCIED                    10                                                                                     
ASEGUR               YUH                                       PEPITO GARCIA Y GARCIA SOCIED                    20                                                                                     
ASEGUR               SDFRG                                    PEPITO GARCIA Y GARCIA SOCIED                    13                                                                                     
ASEGUR               signy                                     PEPITO GARCIA Y GARCIA SOCIED                    29                                                                                     
ASEGUR               sigurd                                    PEPITO GARCIA Y GARCIA SOCIED                    32                                                                                     
ASEGUR               valhalla-Legacy                           PEPITO GARCIA Y GARCIA SOCIED                    12                                                                                     
ADMIN                MAQUINADIAB\SSSSS        IUOOO          USUARIO ADMINISTRADOR NETWORKING                3                                                                                     
SPRINGUSR            bragi                                                                                      98                                                                                     
SPRINGUSR            hermod                                                                                     59                                                                                     
SPRINGUSR            YUH                                                                                        49
So, is the total logons in a month by user.
for the second requirement we are using the follow query:
select USERID "Cuenta", USERHOST, TERMINAL, to_char(NTIMESTAMP#,'YYYYMMDD HH24:MI:SS') "Fec Ing", nombres||' '||PRIMER_APELLIDO||' '||SEGUNDO_APELLIDO "WhiteList"
--, count(*) "TOTAL"
from aud$, ab.usuarios
where (ACTION# = 100) and
--to_char(NTIMESTAMP#,'dd-mm-yy')=to_char(sysdate-50,'dd-mm-yy') and
(NTIMESTAMP# between (to_date(to_char('01062013 18:00:00'),'ddmmyyyy HH24:MI:SS'))
    and (to_date(to_char('30062013 23:59:00'),'ddmmyyyy HH24:MI:SS'))) and
USERID = CODIGO_USUARIO(+) and
USERID not in ('DBSNMP','SYSMAN')
group by USERID, USERHOST, TERMINAL,to_char(NTIMESTAMP#,'YYYYMMDD HH24:MI:SS'), nombres||' '||PRIMER_APELLIDO||' '||SEGUNDO_APELLIDO
order by USERID, USERHOST, TERMINAL;
Header 1
Cuenta               USERHOST                  TERMINAL        Fec Ing              WhiteList                                                                                                                                                            
USER12               DOMINIODDD\IOIPOP        IOIPOP          20130930 12:08:33    ANGEL ROBERTO GARCIA Y GARCIA S                                                                                                                                        
USER12               DOMINIODDD\IOIPOP        IOIPOP          20130930 14:28:47    ANGEL ROBERTO GARCIA Y GARCIA S                                                                                                                                        
USER12               DOMINIODDD\IOIPOP        IOIPOP          20130930 16:24:43    ANGEL ROBERTO GARCIA Y GARCIA S 
so, shows each logon done by user in a month.
But in the both queries, the results are different. It is not suppose that they have to be the same number of logons?
I mean, If I sum the numbers in TOTAL column I have less that I get in the second query. Always !!!
could you help us?
thank you

Your timeframes are different:
(NTIMESTAMP# between (to_date(to_char('01092013 00:00:00'),'ddmmyyyy HH24:MI:SS')) 
and (to_date(to_char('30092013 23:59:00'),'ddmmyyyy HH24:MI:SS'))) and 
versus
(NTIMESTAMP# between (to_date(to_char('01062013 18:00:00'),'ddmmyyyy HH24:MI:SS')) 
    and (to_date(to_char('30062013 23:59:00'),'ddmmyyyy HH24:MI:SS'))) and 

Similar Messages

  • Can two peeps use iChat with different accounts on the same computer?

    What do I do to REMOVE an old AIM account and replace it with a new account in IChat?
    Can two peeps use iChat with different accounts in the same computer?
    (Actually, two people share a laptop, but one of us cannot use her AIM account cuz mine is in iChat already... And, when traveling, I have the computer - and I would like to use iChat on the computer...)

    In iChat 4 you can have more than one AIM Valid name logged in at once.
    AIM valid = AIM, @mac.com or a MobileMe name.
    What you are then stuck with is that iChat is linked to one Buddy Picture and The one Mac User Account's Address Book which may or may not have Full Names, emails details, or a Nickname in iChat 4 linked to the Screen Names.
    Whilst it does let you both log in whilst using one Mac User Account there are drawbacks about who uses the keyboard and reading meesages from the other persons Buddies.
    8:50 PM Sunday; November 30, 2008

  • Spatial overlay queries involving tables with different spatial extents

    We are using GeoMedia Professional 6.1 with an Oracle 10g database. For validating geometry, we use a standard minimum bounding rectangle (MBR) that is fairly tight to our city boundary. Some city departments are requesting that we extend the spatial limits to create a larger MBR for some new features. This will involve using a new SDO_DIMINFO array in the MDSYS.SDO_GEOM_METADATA_TABLE and creating new spatial indexes. It is our intention to leave the existing features "as-is" with the original MBR and spatial indexes. I have done some preliminary testing in GeoMedia and have not run into any issues when doing spatial queries involving features with different MBRs. Spatial intersections, spatial differences and spatial filters seem to complete in a reasonable amount of time, even with large data sets. Does anyone have any experience using different MBRs with Oracle spatial overlay queries? Are there any other potential issues we should be aware of when working with tables that are created with different spatial extents such as performance?

    Luc ... Thank you for supplying the URL for Simon Greener’s website. This article supports information we already received from our GIS software provider.
    With regards to your questions: One of the checks carried out in our “ValidateGeometry” procedure is to ensure that a new or modified geometry is within the bounding rectangle defined by the SDO_DIMINFO. An error is raised if the user tries to add a polygon that is well beyond the city boundary rather than within the prescribed city area. Currently, we do not use different MBR’s as layer extents (there are only a couple of exceptions). We are in the process of conducting system and performance testing to identify potential issues that may be encountered when tables created with expanded upper and lower bounds are used in downstream applications such as intranet/internet web maps. We are still trying to identify any potential “hotspots”.

  • Siri comes up with different results than google maps

    I was doing a search for Food Lion through Siri but she wasn't finding the one right around the corner from my house. I went into maps and it found it no problem. Why do they come up with different results? I thought Siri searched google maps.

    Because Apple maps is NOT google maps.

  • Issues with iCloud synchronisation and contacts over two or more devices.  iTouch and iPad2 sync with different results from iMac.  Thoughts?

    Has any one experienced issues with iCloud synchronisation and contacts over two or more devices? The primary machine is an iMac running Lion. Address Book was created from vcf file (backup of address book prior to moving to iCloud). iTouch replicates Contacts just fine and matches the Address Book on the iMac. The iPad 2 does not showing only 123 contacts where there should be 200. I have turned off iCloud on both devices thus erasing the iCloud content of both devices and staring from scratch with both devices with identical results. Even turned off iCloud on the iMac and erased the Address Book and rebuilt with the same results. Anyone have any ideas or suggestions? I am going nuts.....

    To follow-up with this issue:
    I ended up performing a security wipe on my device. The security wipe finished, and I was about to reconnect with Exchange when I decided to visit our host's web site to see if they had any articles covering the issues I was experiencing. While they didn't have anything specific, I did find a step-by-step guide to connecting a BB10 device to Exchange... and right there at the end, it said "Do NOT enable memo sync."
    I contacted support, and the rep told me that OS 10 has an issue with memo sync and it can cause all sorts of unpredictable behavior. Now, whether or not this is accurate I can say this: So far, the device is not disconnecting and reconnecting like it was before. Problem is, is this a result of not enabling memo sync, or is this a result of the security wipe?
    I may have overlooked it, but I don't recall reading anything about that anywhere else. I'm tempted to try re-enabling the memo sync to see if everything blows up again. At least that way I can see for myself if the memo sync is a real issue. Of course, perhaps it's an issue with SherWeb (our host) specifically. Hm...
    Anyway, for those that were interested, and for those that may come along in the future with a similar situation, the strange behavior that I first reported is no longer happening. I just don't know if it was a result of a security wipe or a result of not enabling memo sync with Exchange.
    Ian

  • Same circuit twice with different results

    I've been having some trouble having Multisim match a circuit I have modeled in MATLAB. During the troubleshooting process I put voltage probes on each wire used. The circuit portion in question involves an AC Voltage source connected to a resistor which is then connected to an inductor. I made a copy of the circuit and started from scratch. One of the circuits gives a voltage drop across the resistor, while the other one doesn't drop any voltage at all. I've checked all of the connections and they are all good. The only difference I can see is that one has the pins labeled 1 - 2 while the other is 2 - 1. Does anyone know what the problem is here? I shouldn't not be getting two different results for the same circuit.

    Hi Jmerc,
    Maybe you can post the circuits so that we can compare.
    Tien P.
    National Instruments

  • In vs. Exists with  different results

    Hi all
    I have a general question
    Are there any cases where using the exists operator can produce different results/amount of results
    Vs. using the IN operator ?
    If yes please post an Example
    the reason that i'm asking this it's because the exists returns true if the subquery returns at least one row and
    it doesn't continue to check , but IN check all the values ,
    this is critical for me to know , if i need to returns the amount of rows etc.
    Thanks In advanced
    Naama
    Edited by: naama on Jun 21, 2011 11:52 PM

    Hi,
    naama wrote:
    Hi all
    I have a general question
    Are there any cases where using the exists operator can produce different results/amount of results
    Vs. using the IN operator ?
    If yes please post an Example I don't believe that's really your question.
    The answer to the question above is: Yes, of course. Most of the time, EXISTS and IN will produce different results. For example, this query returns 3 rows:
    SELECT     dname
    FROM     scott.dept     
    WHERE     deptno   IN (
                   SELECT  deptno
                   FROM     scott.emp
    ;but this query produces 0 rows:
    SELECT     dname
    FROM     scott.dept     d
    WHERE     EXISTS      (
                   SELECT  NULL
                   FROM     scott.emp
                   WHERE     sal     = d.deptno
    ;Try again; what really is your question?
    An important difference between EXISTS and IN is that EXISTS always returns TRUE or FALSE, but IN can return any of the 3 logical values: TRUE, FALSE or UNKNOWN. When you say "WHERE condition_1" in a query, the row is included if condition_1 is TRUE, and the row is not included if condition is either FALSE or UNKNOWN. That means you can have situations where these two conditions:
    WHERE  deptno IN (subquery_a)always produces the exact same results as
    WHERE  EXISTS (subquery_b)but
    WHERE  deptno NOT IN (subquery_a)always produces the exact same results as
    WHERE  NOT EXISTS (subquery_b)for the exact same subqueries. That's because it's possible for neither
    "IN (subquery_a)" or
    "NOT IN (subquery_a)" to be TRUE, but either
    "EXISTS (subquery_b)" or
    "NOT EXISTS (subquery_b)" will always be TRUE.
    Review SQL's 3-valued logic. NOT UNKNOWN is the same as UNKNOWN.

  • Networking two NI lookout servers with different windows OS

    Can I networking two NI lookout servers with 50
    I/O, one with windows98 SE and one with Withows XP pro.?

    What's your lookout version on two computers? You need first to make two lookouts run, and then try to networking them. For example, if you run lookout 6.2 on windows 98, I'm not sure if it will work.
    Ryan Shi
    National Instruments

  • Webutil_File_Transfer.DB_To_Client with different result

    hi
    Forms 10.1.2.3
    i use in Forms this function to Downlaod BLOBs
    Webutil_File_Transfer.DB_To_Client
         ('H:\l.xml',
         'T_DEV_ARCHIV',
         'dar_xml_blob',
         'dar_id=110874')
    In the BLOB are German letters inside ü, ä, ö ..
    Result on two Clients:
    at the first client the result looks good
    On the other Client I’m missing the German letters.
    Why the transfer is different? What has to do with the client?
    BLOB's are binary files !!!
    I just despair.
    Edited by: alinzenb on 04.03.2013 13:16

    Yes, but did you add a characterset definition to your XML file, and does the data stored in the XML match this characterset?
    If you have e.g.
    <?xml version="1.0" encoding="windows-1252" ?>But the data in the blob is actually UTF-8 encoded you have a Characterset-Problem, as the XML parser will treat your (UTF-8 data) as windows-1252 data...
    cheers

  • Use two Time Machine Drives with different settings?

    Hello everybody, is it possible to use time machine with two drives and use different settings for each drive?
    For example: at home I currently have two external LaCie d2 quadra drives. My plan is to leave one at home, and take one to Uni. On the drive which I have at home, I have backups of a secont parttion of the drive which I am taking to Uni, which contains some important files (about 500 GB). Is it possible to have a backup of that data partiton on the drive which I'm leaving at home, but not on the drive which I'm taking to uni?
    I know that I can set up two drives to work simultaneously, but can I say to exclude folder A on drive A, but not on drive B?
    Thanks a lot in advance

    Thanks for the fast reply. II'll try to make things clearer. I have two drives (let's call them drive A and B). Drive A has one partition, and is my primary back up drive. Drive B has two partitions (one with files and one for Time Machine). Currently, the files partition of Drive B is being backed up to Drive A. When I connect drive B, Time machine asks me if I want to replace the existing drive, or use both. Using both is what I want. However, I don't need Drive B to back up the files from it's second partition, as that would not make any sense; I do, however, want drive A to back up the data partition from drive B. I guess the easiest way is to manually change the settings, or just live with a larger backup....

  • Modify Batch Sequence to generate two reports per UUT with different names.

    I have a special situation for the batch model.
    Each UUT consist of two separate products that must be tested as a single unit.
    I can run each UUT and generate a test report for each.  - aka. The standard use case works great.
    However we are keeping records using this method. So I need a separate copy with a different name for each run.
    The idea behind this is that we might have a running history for each half of the UUT. Since the two halves will probably never meet again.
    I have looked at the BatchModel.seq and read some of the documentation, however I am having a hard time figuring out what is going on.
    I assume the Highlighted Items above are where the UUT Reports are generated. I do not however know the mechanism for giving them the names from the Report Options->Report File Pathname menu or how to change it between those points in time. Also is there any tricks to getting duplicate Report with a diffrent path put into this setup.
    Any links to relevant information would be useful. Thanks
    Solved!
    Go to Solution.

    Just copy those two steps and between them and the copies have another step that is just a Statement.  In there you can change the report path by setting parameters.TestSocket.ReportFilePath to the new path.
    Ideally what you would do is have the client set it by using a callback.  So your code would look like this:
    Write UUT Report
    Write UUT Report (on the fly)
    Set Report Path Callback (override in client OR statement step)
    Write UUT Report
    Write UUT Report (on the fly)
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How to Run sequencially two Key-Commit triggers with different scope

    Hi all
    I have two Key-Commit triggers at form and Block level. Form level trigger is inherited from a library. In block level trigger, I have some additional checks. What I want is, to execute the Block level trigger first and than the form level. I tried working with the override/Before/after property of triggers which does the job of sequencing execution but the Raise Form_Trigger_Failure in the block level trigger doesn't stop the execution of form level trigger. Block level trigger does the checks and display corresponding alerts but than the form level trigger also executes.
    I don't wanna copy the code from Form level trigger to the block level trigger as it is common to whole application and may need some additional coding/ bug fixing later.
    Any help would be appreciated.
    RMA

    Thanks for all the help.
    In Key-Commit trigger I am just setting the Blocks' properties, nothing special, the main checks are in On-Commit trigger. I also understand the work around by using a user defined trigger but, to my knowledge, Oracle doesn't recommend it.
    My form has two datablocks, Parent and a child. The entered quantity in the Master block needs to be verified against the Number of units entered in the child block. If they are not the same, I want the alert and stop execution.
    Now I am using Pre-Insert trigger in the master block but was a little surprised because of the sequencing behavior. My understanding was that RAISE FORM_TRIGGER_FAILURE stops execution of all the code after it even is it is in another trigger/procedure ..but now it appears that I was wrong :-(
    Any suggestions??
    RMA

  • HT204266 Two users of itunes with different types of apps.

    There are two users of itunes on my computer with completely different styles of music and apps.  My problem is when they sync, everything goes on each others ipod, which creates a big problem.  I can not figure out how to keep the apps separate.  With the music, I check and uncheck everything, since there are hundreds of songs, It is a big pain.  Is there an easier way?

    See:
    What is the best way to manage multiple...: Apple Support Communities
    How to use multiple iPods, iPads, or iPhones with one computer

  • Linking 2 text boxes with different results

    Hello
    I am trying to Link a drop down box with names, to a text field containing the relative identification of that person,
    Here is what I am trying to do.
    The drop down would have              and the result in the linked text box
    Richard                                                       123456
    Steve                                                            654321
    Jerry                                                                125874
    Fred                                                                  987542
    I have attached a screen shot with some graphics
    How can I do this please?
    Thanks in advance

    Thank you so very much I will give it a go I am totally new to theis program.
    Sorry for asking more but.
    If the Dropdown has the names and once they have selected the name using the dropdown, I would like the texbox called "Certificatenumber" to associate the name with the correct number, how do I link the boxes.
    Any chance of a couple of screen shots.
    Sorry I am so bad on this I just started with forms like the other day.
    Thank you for your time everyone.
    (Thank you MarkWalsh)

  • Project 7 - Pop menu magic 2 - 1 template with different results

    I just noticed something strange on my website.
    I only use 1 template which should normally give the same result on all pages.
    However on 4 pages the menu bar is split into 2 row.  All other pages are correct as per template.
    Here is the link for the correct page : http://www.lotolux.com/media.html
    And here are the links of the 4 pages with the error.
    http://www.lotolux.com/biography.html
    http://www.lotolux.com/actingcareer.html
    http://www.lotolux.com/burbank08concert.html
    http://www.lotolux.com/london08concert.html
    Can somebody help me solving this?
    Many thanks
    Martine

    And it becomes more stranger.
    I recreated those 4 pages using the template.  I copied and pasted all info from the old pages onto the new ones.
    The new pages have the same name - I only added 2 at the end.
    http://www.lotolux.com/biography2.html
    http://www.lotolux.com/actingcareer2.html
    http://www.lotolux.com/burbank08concert2.html
    http://www.lotolux.com/london08concert2.html
    They are uploaded and the error is gone. BUT BUT BUT BUT BUT ....................if I update the P7 -PMM2 menu bar ......the error is back there.
    It is a mystery to me and get frustrated from it.   Uploaded without linked in the menu bar = all ok, but if the link is made = back to zero.

Maybe you are looking for