Need help gems Oracle frm to answer 3 questions. your help w'l b enjoy.

Hello

I want to know the answer to three questions, Hope you help out me.

1. how to create pfile from spfile, when the database is down (no permission to use the command 'no strings' no newspaper alerts very convenient).

2. How can we check only backup controlfile (State and location) through RMAN. (AutoSave is disabled).

3. can we have local undotbs in the case of CARS

Thank you
FRDZ.

Salvation;

1. how to create pfile from spfile, when the database is down (no permission to use the command 'no strings' no newspaper alerts very convenient).

Inactive db connection
sqlplus "virtue sysdba".
SQL > create pfile ='/ tmp/xx ' from spfile;

2. How can we check only backup controlfile (State and location) through RMAN. (AutoSave is disabled).

Connect rman
RMAN > list backup of controlfile;

3. can we have local undotbs in the case of CARS

http://oracleabc.com/b/archives/2523

Respect of
HELIOS

Tags: Database

Similar Questions

  • Need help - financial Oracle 11i vs (payable Oracle and Oracl pay) r12

    Hi all

    I am beginner in Oracle Application and request your help answering my questions.

    Background:
    Three years ago, my company intended to implement ERP Oracle Financials.
    To facilitate the plan, an open call for tenders was created to find the best implementation of the company at an affordable price.
    The tender was created when Oracle Financials 11i.
    When the contract was signed 2 years ago by my company and the winning company, it is mentioned that the installed version must be the last.
    The answer to the needs, the winning company said that payment activity will be facilitated by Oracle Payable.
    Now, the project is going and the Oracle has the version of recommendation 12.

    Problem:
    To 11i, there was only a single module related to the activities of payment, that is Payable to Oracle.
    Recommendation 12, Oracle has a new module, i.e. Oracle payment, which was the subdomain of Oracle Payable.

    Question:
    1. is my view on the relationship between Oracle and Oracle payment payable above correct?
    2 - is my company has the right to ask for payment of the Oracle installation?
    3. If the answer to the number 2 is Yes, what is the basis for this?

    Thanks for the explanation.
    Sorry if I ask a simple question.

    Kind regards
    Dodydh

    Published by: 840286 on February 28, 2011 03:28

    Hi Dodydh,

    I'm afraid, your statement "Oracle to recommendation 12, a new module, i.e. Oracle payment, which was the subdomain of Oracle to pay." is not correct.

    Oracle payments is a version upgrade of Oracle 11i iPayments and this module is supposed to use Self service modules. But lots of payment which is part of the creditors of the Oracle was moved to Oracle payments.

    You may very well ask to implement payment lots (process related to the disbursement of funds) but not all of the module.

    Please let me know if you need more information.

    Kind regards
    Sridhar

  • In fact, I need help but can't find the answer. Please... Lately when it is open a new tab it does not open with a blank page. I don't want to put my home page as

    In fact, I need help but can't find the answer.
    Please... Lately when it is open a new tab it does not open with a blank page. I don't want to put my home page as empty as when I open Firefox, it automatically load my hotmail page. But then if I open other pages I don't get a blank page. Help, please?
    Thank you.

    [Personal information deleted by the moderator. Please read the guidelines and rules of the Forum, thank you.]

    Hello, please refer to customize the page new tab to turn off the function.

  • I need help, I forgot my security answers and Email not send to my Email of relief.

    I need help, I forgot my security answers and Email not send to my Email of relief.

    Unless it is in a spam filter, you have to ask Apple to reset your security questions. To do this, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    (137175)

  • is there a phone number I can contact microsoft on. I need help and forum live gives me no answers

    is there someone I can actually talk about microsoft? my hotmail has been hacked and I need help to get it back! I tried windows live forum coming from running me around, no doubt, that there must be someone who can help me

    Hello

    Answers is a peer group supported and unfortunately has no real influence on Hotmail.

    HotMail has its own Forums, so you can ask your questions there.

    Windows Live Solution Center - HotMail - HotMail Forums Solutions
    http://windowslivehelp.com/

    Hotmail - Forums
    http://windowslivehelp.com/forums.aspx?ProductID=1

    Hotmail - Solutions
    http://windowslivehelp.com/solutions.aspx?ProductID=1

    How to contact Windows Live Hotmail Support
    http://email.about.com/od/hotmailtips/Qt/et_hotmail_supp.htm

    Windows Live Hotmail Top issues and Support information
    http://support.Microsoft.com/kb/316659/en-us

    Compromised account - access unauthorized account - how to recover your account
    http://windowslivehelp.com/solution.aspx?SolutionID=6ea0c7b3-1473-4176-b03f-145b951dcb41

    Hotmail hacked? Take these steps
    http://blogs.msdn.com/b/securitytipstalk/archive/2010/07/07/Hotmail-hacked-take-these-steps.aspx

    I hope this helps.

  • I need help with a problem of file softdub.dll any answers or how to replace it?

    I need help with a problem of file softdub.dll all the answers, or how to replace it?  Yes, it's a problem of Vista vs itunes and apparently I lost? This file somehow.  I have no idea how blessed remedy.  I tried all the normal fixes / easy I know, but I am a novice at best.  so please, be gentle and try to guide me through a response.  Please, I beg you!

    Hello

    Did you download and save iTunes on the desktop > then right-click > select run as administrator to install?

    If you don't have anything done, see if this information helps you.

    "Not to install iTunes or QuickTime for Windows"

    http://support.Apple.com/kb/HT1926

    «Remove and reinstall iTunes, QuickTime, and other software components for Windows Vista or Windows 7»

    http://support.Apple.com/kb/HT1923

    If the advice already given does not, please contact Apple for assistance.

    "iTunes support-how to use iTunes.

    http://www.Apple.com/support/iTunes/

    "Contact iTunes Support.

    http://www.Apple.com/support/iTunes/contact/

    Or ask in the community Apple iTunes:

    https://discussions.Apple.com/community/iTunes

    See you soon.

  • Need help with Oracle SQL merge records according to date and term dates

    Hi all

    I need help to find this little challenge.

    I have groups and flags and effective dashboards and dates of term against these indicators according to the following example:

    GroupName Flag_A Flag_B Eff_date Term_date
    Group_ATHERETHERE2011010199991231
    Group_ANN2010010120101231
    Group_ANN2009010120091231
    Group_ANN2006010120081231
    Group_ANTHERE2004010120051231
    Group_ATHERETHERE2003010120031231
    Group_BNTHERE2004010199991231
    Group_BNTHERE2003010120031231

    As you can see, group_A had the same combination of (N, N) flag for three successive periods. I want to merge all the time periods with the same indicators in one. Where entry into force will be the most early (underlined) time period and end date will be later (underlined)

    So the final result should look like this:

    GroupName Flag_A Flag_B Eff_date Term_date
    Group_ATHERETHERE2011010199991231
    Group_ANN2006010120101231
    Group_ANTHERE2004010120051231
    Group_ATHERETHERE2003010120031231
    Group_BNTHERE2003010199991231

    Thanks for your help

    Here's the DDL script

    drop table TMP_group_test;

    create table TMP_group_test (groupname varchar2 (8))

    , flag_a varchar2 (1)

    , flag_b varchar2 (1)

    , eff_date varchar2 (8)

    , term_date varchar2 (8)

    );

    insert into TMP_group_test values ('Group_A', 'Y', 'Y', ' 20110101 ', ' 99991231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20100101 ', ' 20101231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20090101 ', ' 20091231');

    insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20060101 ', ' 20081231');

    insert into TMP_group_test values ('Group_A', 'n', 'Y', ' 20040101 ', ' 20051231');

    insert into TMP_group_test values ('Group_A', 'Y', 'Y', ' 20030101 ', ' 20031231');

    insert into TMP_group_test values ('Group_B', 'n', 'Y', ' 20040101 ', ' 99991231');

    insert into TMP_group_test values ('Group_B', 'n', 'Y', ' 20030101 ', ' 20031231');

    commit;

    Post edited by: user13040446

    It is the closest, I went to the solution


    I create two rows;

    Rnk1: partition by group name, order of eff_date / / desc: this grade will sort the records of the most recent and handed to zero for each group\

    Rnk2: (dense) partition by group name, flag_A, flagb: this grade for each combination of group\flag gives a number so that they are classified as "families".

    Then I use the function analytic min

    Min (eff_date) more (partition of GroupName, rnk2): the idea is that, for each Member of the same family, the new date is the min of the family (and the max for the date of the term), at the end I just need separate so that the duplicates are gone

    Now the problem. As you can see from the query below, records of 1 and 6 (as identified by rownum) are identified in the same family, because they have the same combination of flag, but they are not successive, so everyone must keep its own date of entry into force.

    If only I can make the distinction between these two that would solve my problem


    Query:


    Select rowNum,GroupName, flag_a, flag_b, eff_date, term_date, rnk1, rnk2

    , min (eff_date) more than (partition by GroupName rnk2( ) min_eff

    Of

    (

    Select rowNum,

    GroupName , flag_a , flag_b , eff_date , term_date

    rank() more than (partition by GroupName stopped by eff_date desc) rnk1

    DENSE_RANK() more than (partition by GroupName order by flag_A flag_B ( ) rnk2

    de dsreports . tmp_group_test

    ) order by rowNum

    Hello

    user13040446 wrote:

    Hi KSI.

    Thanks for your comments, you were able to distinguish between these lines highlight, but lost lines 2,3,4 which are supposed to have the same date min = 20060101.

    Please see the table wanted to see the final result I want to reach

    Thanks again

    This first answer is basically correct, but in the main query, you want to use the function MIN, not the analytical function aggregation and GROUP BY columns with common values, like this:

    WITH got_output_group AS

    (

    SELECT GroupName, flag_a, flag_b, eff_date, term_date

    ROW_NUMBER () OVER (PARTITION BY GroupName

    ORDER BY eff_date

    )

    -ROW_NUMBER () OVER (PARTITION BY GroupName, flag_a, flag_b)

    ORDER BY eff_date

    ) AS output_group

    OF tmp_group_test

    )

    SELECT GroupName, flag_a, flag_b

    MIN (eff_date) AS eff_date

    MAX (term_date) AS term_date

    OF got_output_group

    GROUP BY GroupName, flag_a, flag_b

    output_group

    ORDER BY GroupName

    eff_date DESC

    ;

    The result I get is

    GROUP_NA F F EFF_DATE TERM_DAT

    -------- - - -------- --------

    Group_A Y 20110101 99991231 Y

    N Group_A 20101231 20060101 N

    Group_A N 20051231 20040101 Y

    Group_A Y Y 20031231-20030101

    Group_B N Y 99991231 20030101

    which is what you asked for.

  • Need help to install Oracle Business Intelligence 11.1.1 Applications. 7.1

    Hello

    I intend to install some Applications Oracle Business Intelligence 11.1.1.7.1 in my machine. I need some clarification before you install it.

    (1) can I install and run unity of repository on the local computer (that is not a server)?

    (2) don't need an application server for the installation of the Oracle Applications Business Intelligence 11.1.1.7.1?  If so where should I install the server applications or server or in my local computer?

    Thanks in advance

    Here you go...

    (1) can I install and run unity of repository on the local computer (that is not a server)?

    Yes, you can, if you have a database and ongoing running and accessible from your machine.

    (2) don't need an application server for the installation of the Oracle Applications Business Intelligence 11.1.1.7.1?  If so where should I install the server applications or server or in my local computer?

    Yes you need, and it will be good to have it on your machine.

    Before installing, make sure that you have min 4 GB of ram to work actively on OBIEE.

    So useful mark...

    Let me know if you need help with the installation.

  • Need help to provide a page for the Oracle PeopleSoft HCM on internet

    Hello

    I need help to provide that a page of Oracle PeopleSoft HCM on internet for vacancies may be available for recruitment. How can I provide a Peoplesoft Web page?

    TKS

    Bruno will read

    Of Peoplebooks

    Access to external Sites

    External candidates, by definition, do not have the nicknames PeopleSoft. To allow external users access to a site, you put a link to the site on a location such as your public Web site. The site definition includes a field to set the URL of this external link.

    Deployed in this mode, the instance of PeopleSoft to be accessed by external users must have the appropriate security settings to allow users to bypass the access code. In other words, a user who clicks on the link is not presented with a PeopleSoft signon pages but is instead signed the using a user ID generic comments so that the user can be taken directly to the candidate Gateway.

    If an external candidate allows a more inactive candidate gateway session that the timeout you set, the default system behavior is to provide a link to the login page of PeopleSoft with the visible invited user ID.  According to your logic of password, the guest user ID might be locked if the applicant tries in vain to connect. For more security and ease of use, replace the code page to a page that displays an appropriate message.   For example, to display a message that the session has expired and provide a link back to the bridge of the candidate.

    Development of Sites

  • Need help! I just want to cancel my subscription for one year. No response from support by mail, noone answers when I call, chat support do not work.

    Need help! I just want to cancel my subscription for one year. No response from support by mail, noone answers when I call, chat support do not work.

    Hello

    I will pass on your details to our Russian team and they will contact you to help others.

    Kind regards

    Bev

  • Need help for query flat_file type clobdata oracle table data.

    Hi Sir,

    I need help to query oracle table flat file data having given clob type.
    Oracle Version:
    
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    
    
    Source table
    
      CREATE TABLE order_details 
       (     QUEUE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         LINE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, 
         CHAR_DATA CLOB, 
         OPTIMISTIC_LOCK_KEY NUMBER(20,0)
       ) 
    COLUMN FOR CHAR_DATA FLAT_FILE
    EU,6067AT,AT10,000000402004,NexiumGERDManagementProject,Z435,,ZZ29,NIS-GOLD,AT
    EU,6067AT,AT10,000000402038,NIS-OEU-ARI-2007/1,Z450,,ZZ29,NIS-OEU-ARI-2007/1,AT
    EU,6067AT,AT10,000000402039,SymbicortNISinCOPD,Z450,,ZZ29,NIS-REU-DUM-2007/1,AT
    EU,6067AT,AT10,000000402040,D1443L00044SeroquelXRRuby,Z450,,ZZ29,D1443L00044,AT
    EU,6067AT,AT10,000000402041,NIS-GEU-DUM-2008/1,Z450,,ZZ29,NIS-GEU-DUM-2008/1,AT
    EU,6067AT,AT10,000000402042,SonstigeAktivitätenLCM,Z450,,ZZ29,.,AT
    EU,6067AT,AT10,000000402134,D1680L00002Saxagliptin,Z450,,ZZ29,D1680L00002,AT
    EU,6067AT,AT10,000000402199,SeroquelWaveNIS,Z450,,ZZ29,NIS-NEU-DUM-2009/1,AT
    EU,6067AT,AT10,000000402313,SeroquelExtra(D1443L00082),Z450,,ZZ29,D1443L00082,AT
    EU,6067AT,AT10,000000402517,AtlanticD5130L00006(AZD6140),Z450,,ZZ29,D5130L00006,AT
    EU,6067AT,AT10,000000554494,ArimidexSt.Gallen(13+2),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554495,ArimidexASCO(5delegates),Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554496,ArimidexSanAntonio6delegates,Z142,,ZZ09,,AT
    EU,6067AT,AT10,000000554497,ArimidexBreastCancerSummit(13+2),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554498,ArimidexEIH(15delegates),Z130,,ZZ09,,AT
    EU,6067AT,AT10,000000554499,ArimidexNIFA(200delegates),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554500,ArimidexNIFAworkshops(8x25),Z135,,ZZ09,,AT
    EU,6067AT,AT10,000000554501,ArimidexPraktischeGyn.Fortbildung,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554502,ArimidexAGO,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554503,ArimidexHämato/OnkologieKongress,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554504,ARIMIDEXGYNäKOLOGENKONGRESS,Z147,,ZZ09,,AT
    EU,6067AT,AT10,000000554505,ArimidexChirurgenkongress,Z147,,ZZ09,,AT
    EXPECTED RESULTS:
    AFFIRM_CODE COMPANY_CODE INTERNAL_ORDER_CODE INTERNAL_ORDER_DESC ENIGMA_ACTIVITY             SUB_ACTIVITY_CODE IN_AFF_IND ORDER_TYPE EXTERNAL_ORDER COUNTRY        
    EU          6067AT       AT10                 000000402004       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             
    EU          6068AT       AT11                 000000402005       NEXIUMGERDMANAGEMENTPROJECT     Z435           NULL        ZZ29       NIS-GOLD        AT             

    Sorry, my bad. Without database at hand, I'll try 'baby steps' (borrowed from Frank) so you don't confuse it with errors that I might add (happens far too often already, but at least you won't "swallow" as forum members think is one of the main goals of this fighter - help her learn - providing not only the proverbial fish.)
    Search the Forum - your problem is one of its best sellers. Watching {message identifier: = 10694602} ("split string into" was the key word used in research) you can try something as

    select table_row,
           level clob_row,
           regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) the_line
      from (select to_char(queue_seqnum)||':'||to_char(line_seqnum) table_row,
                   char_data
              from order_details
           )
     connect by regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) is not null
            and prior char_data = char_data
            and prior table_row = table_row
            and prior sys_guid() is not null
    

    to get all the s the_lineall CLOB and after that the use of the example even to get your columns of each the_line.

    Concerning

    Etbin

    Edited by: Etbin on 3.2.2013 09:01

    .. .but I m connected to do things according to the instructions, I can't do something.

    Used to happen to me too and I did as told to the but only after explaining any disadvantages, I was aware of in time. The last sentence is usually: "O.K. now be just and Don't come back with that kind of thing when it turns out that this isn't the right thing."
    rp0428 post - something to remember.

  • Need to download Oracle Directory Server 11.1.1.7.0 for AIX 7.1

    Hello

    I need to download Oracle Directory Server Enterprise Edition 11 g Release 1 (11.1.1.7.0) for AIX 7.1 but couldn't find Installer to Oracle Software Delivery Cloud.

    Can someone please help me find the installer.

    Thank you

    Himanshu

    Hello

    The list of platforms supported for ODSEE 11 GR 1 material is available at http://www.oracle.com/technetwork/middleware/downloads/odsee-11gr1certmatrix-161592.xls

    AIX is not supported.

    Note that the Directory Unified Oracle (OUD) is supported on AIX (http://www.oracle.com/technetwork/middleware/id-mgmt/documentation/identity-access-111220certmatrix-2105036.xlsx)

    Sylvain

    Please mark this answer as correct or helpful, when it is appropriate to make it easier for others to find

  • Need help with my preparation and suggestion

    I'm looking for new jobs of my existing role. All interviews are I get here is script based and I'm not able to answer most of them and thus be rejected in all cases. . In my work daily I am part of the team of DBA and daily work is to monitor the tablespace, Auditor, audit point mounting important space, for instance health check and backup of surveillance, it becomes boring, day after day, it's why I want to spend. But how to prepare for these typical scenarios based queries, I have both and unique and Dataguard setup in my laptop to play with, but I don't get any idea how to stimulate different scenario that can help me to crack interviews.

    Any idea or advice and suggestions will be highly appreciated and will be followed diligently. Thanks in advance.

    Hello

    I hope that... .in real time world... .they expects more from you than what you do now... as a DBA...

    in fact as a DBA, you will need to practice/play on your laptop computer or test environments... many things is to do...

    How to prepare to answer these scenario type of problem and their solutions

    convenient and... practice... practice... practice... practice... practice... practice... practice... practice... practice... practice... practice... practice... various scenarious... on your test computer...

    example: 1st thing is you need to learn oracle architecture and get good knowledge about this... book architecture expert oracle by thomas kyte...
    2:backup and recovery... .every interviewer waiting for information from you in this category... I hope... you need to practice various scenorious on the test computer.
    as some are below... take a full backup of your database before us all. R & D...
    1:datafile loss... system datafile losss... remove from the disk and try to restore/recover the PB... practice using backup bcakup online/offline...
    2 repeat corruption... size of newspaper for modifing do it again...
    (3) controfile corruption / lost
    DataGuard 4) standby log archive lack of sequence as gap next... WRT primary... pause connection N/W try this... practice scenario switch on / switch on scenarious... etc...
    point 5) practice in recovery time...
    Take 6) the practice of the above database hot backup like data lost/corruption...etc file...
    (7) unconsciously table drop... flashback technology...
    RMAN 8)... beauty of oracle... a lot is there to play the test using RMAN...
    Configuration... show all... it will give you a few parameters conf try to read each conf setting if its other than default configuration... If you... backup... restore... any file missing practice/play cmds RMAN... like missing file controfile file missing... etc...
    now, one day each interviewer ask a lot about RMAN...
    (9) make cloning using offline online backup/backup/RMAN

    http://gavinsoorma.com/2010/06/some-more-RMAN-recovery-scenarios/
    http://docs.Oracle.com/CD/B28359_01/backup.111/b28270/rcmintro.htm
    http://docs.Oracle.com/CD/B19306_01/backup.102/b14191.PDF
    Once you got the good knowledge over things... then... the performance optimization analysis statspack report/awr...etc...

    my suggestion is to get the habit of Forum oracle fallow every day... If possible, each Hr... and try to read old messages in the form... problem to reproduce by your free the.experts and fallow solution and document those it will be useful for you made good things ahead for you... the best...

    Thank you
    DBC,
    SR DBA.

    Published by: dbc001 on March 10, 2013 10:36

  • Need help in the interpretation of a file of Trace 10053

    Hello

    I need help to interpret an event 10053 (optimizer Trace) trace file

    Everything that happens on AIX with Oracle 11.2.0.2

    It is not obvious to me why the optimizer chooses the path with the highest cost.
    But I found the following quote in the trace file, which is probably the answer, but I did not understand what circumstances allow the optimizer to say such things:


    New AP rejected: guess used for New, but not for the current best

    So, it was the short story, now the witch for a long time one quote of the trace file

    Here the query directly in the trace file. I can't modify this query, even a hint is not feasible, so I need to understand the incorrect path to avoid it.
    **************************
    Automatic degree of parallelism (ADOP)
    **************************
    Automatic degree of parallelism is disabled: Parameter.
    
    PM: Considering predicate move-around in query block SEL$1 (#0)
    **************************
    Predicate Move-Around (PM)
    **************************
    OPTIMIZER INFORMATION
    
    ******************************************
    ----- Current SQL Statement for this session (sql_id=0zdbb3hzztdaf) -----
    explain plan for
    SELECT
      aktl_aend,
      aktl_akgrnr,
      aktl_akgrpos,
      aktl_akh,
      aktl_alterart,
      aktl_anz_in,
      aktl_anz_nach,
      aktl_artrab,
      aktl_beg,
      aktl_belart1,
      aktl_belart2,
      aktl_belnr1,
      aktl_belnr2,
      aktl_bestkz,
      aktl_bestmg1,
      aktl_bestmg1_alt,
      aktl_bestmg2,
      aktl_bestmg2_alt,
      aktl_eindat,
      aktl_ek,
      aktl_ekdat1,
      aktl_ekdat2,
      aktl_ekkopie,
      aktl_ekn,
      aktl_eknorm,
      aktl_ek_alt,
      aktl_end,
      aktl_fbdarst,
      aktl_fbd_alt,
      aktl_fbseite,
      aktl_fbs_alt,
      aktl_fbtxt,
      aktl_info_werbeabt,
      aktl_info_wgm,
      aktl_kaek,
      aktl_kaekn,
      aktl_kaek_alt,
      aktl_kombiart,
      aktl_ldat1,
      aktl_ldat2,
      aktl_lf,
      aktl_lf_alt,
      aktl_mgfk,
      aktl_mg_p,
      aktl_mg_r,
      aktl_mindmg,
      aktl_neudat,
      aktl_nnek,
      aktl_nnekn,
      aktl_pabw,
      aktl_pic,
      aktl_plan_menge,
      aktl_plan_menge_hela,
      aktl_plan_stueck,
      aktl_plan_stueck_hela,
      aktl_plan_woche,
      aktl_plan_woche_hela,
      aktl_rdat,
      aktl_ro_p,
      aktl_ro_r,
      aktl_seite,
      aktl_sigkz,
      aktl_sokoeur,
      aktl_sokoeur_alt,
      aktl_sokopr,
      aktl_sokopr_alt,
      aktl_sort_vorab,
      aktl_stat,
      aktl_text,
      aktl_txtbau,
      aktl_txtbaukz,
      aktl_um_p,
      aktl_um_r,
      aktl_user,
      aktl_vk,
      aktl_vkn,
      aktl_vk_alt,
      aktl_zen,
      akt_at_at_no,
      akt_at_at_se_se_ag_ag_no,
      akt_at_at_se_se_ag_ag_wg,
      akt_at_at_se_se_no,
      ROWID,
      rownum,
      uid,
      USER,
      vid
    FROM
      akt
    WHERE
      (
        aktl_stat <> :"SYS_B_0"
      )
    AND
      (
        aktl_zen = :"SYS_B_1"
      )
    AND
      (
        aktl_akh BETWEEN :"SYS_B_2" AND :"SYS_B_3"
      AND
        (
          (
            akt_at_at_se_se_ag_ag_wg   = :"SYS_B_4"
          AND akt_at_at_se_se_ag_ag_no = :"SYS_B_5"
          )
        )
      )
    ORDER BY
      akt_at_at_se_se_ag_ag_wg ASC,
      akt_at_at_se_se_ag_ag_no ASC,
      aktl_akh ASC,
      aktl_akgrnr ASC,
      aktl_akgrpos ASC,
      aktl_kombiart ASC,
      akt_at_at_se_se_no ASC,
      akt_at_at_no ASC
    *******************************************
    And here's the strange part.
    As far as I know, in this quotation that the optimizer realizes, that there is a better path than the AKT_INDEX, but he ignores it.
    ***************************************
    BASE STATISTICAL INFORMATION
    ***********************
    Table Stats::
      Table: AKT  Alias: AKT
        #Rows: 14006583  #Blks:  477882  AvgRowLen:  281.00  ChainCnt:  570341.00
    Index Stats::
      Index: AKTL_UMNUM  Col#: 44
        LVLS: 2  #LB: 60137  #DK: 64171  LB/K: 1.00  DB/K: 179.00  CLUF: 11535830.00
      Index: AKT_INDEX  Col#: 2 3 4 5 1 6
        LVLS: 3  #LB: 83897  #DK: 13955093  LB/K: 1.00  DB/K: 1.00  CLUF: 11889950.00
      Index: AKT_INDEX010  Col#: 54 56
        LVLS: 2  #LB: 37453  #DK: 392568  LB/K: 1.00  DB/K: 5.00  CLUF: 1127943.00
      Index: AKT_INDEX011  Col#: 55 57
        LVLS: 2  #LB: 33967  #DK: 2102  LB/K: 65.00  DB/K: 869.00  CLUF: 449507.00
      Index: AKT_INDEX012  Col#: 2 3 4 5 6
        LVLS: 2  #LB: 66503  #DK: 2506277  LB/K: 1.00  DB/K: 5.00  CLUF: 13420693.00
      Index: FK_AKH_AKTL_AKH  Col#: 1 6
        LVLS: 2  #LB: 35870  #DK: 184651  LB/K: 1.00  DB/K: 6.00  CLUF: 1131183.00
      Index: KEY_AKT  Col#: 1 2 3 4 5 6
        LVLS: 2  #LB: 82467  #DK: 13793510  LB/K: 1.00  DB/K: 1.00  CLUF: 11691370.00
    Access path analysis for AKT
    ***************************************
    SINGLE TABLE ACCESS PATH 
      Single Table Cardinality Estimation for AKT[AKT] 
      Column (#6): 
        NewDensity:0.000000, OldDensity:0.000000 BktCnt:4202816, PopBktCnt:4202810, PopValCnt:133, NDV:139
      Column (#6): AKTL_ZEN(
        AvgLen: 4 NDV: 139 Nulls: 0 Density: 0.000000 Min: 1 Max: 61044
        Histogram: Freq  #Bkts: 139  UncompBkts: 4202816  EndPtVals: 139
      Column (#2): 
        NewDensity:0.129575, OldDensity:0.000000 BktCnt:4201875, PopBktCnt:4201875, PopValCnt:2, NDV:2
      Column (#2): AKT_AT_AT_SE_SE_AG_AG_WG(
        AvgLen: 3 NDV: 2 Nulls: 0 Density: 0.129575 Min: 6 Max: 7
        Histogram: Freq  #Bkts: 2  UncompBkts: 4201875  EndPtVals: 2
      Column (#3): 
        NewDensity:0.000000, OldDensity:0.000000 BktCnt:4197711, PopBktCnt:4197711, PopValCnt:52, NDV:52
      Column (#3): AKT_AT_AT_SE_SE_AG_AG_NO(
        AvgLen: 3 NDV: 52 Nulls: 0 Density: 0.000000 Min: 6 Max: 99
        Histogram: Freq  #Bkts: 52  UncompBkts: 4197711  EndPtVals: 52
      Column (#85): SYS_STUF1FT2E0X6B6C$__BGEZQRHS(
        AvgLen: 12 NDV: 5571 Nulls: 0 Density: 0.000180 Min: 2117233 Max: 9997926970
      Column (#84): 
        NewDensity:0.000000, OldDensity:0.000000 BktCnt:4201269, PopBktCnt:4201265, PopValCnt:71, NDV:75
      Column (#84): SYS_STULHCKPI#FOQE1JMOOXNGSFB0(
        AvgLen: 12 NDV: 75 Nulls: 0 Density: 0.000000 Min: 157628517 Max: 9982459671
        Histogram: Freq  #Bkts: 75  UncompBkts: 4201269  EndPtVals: 75
      Column (#4): 
        NewDensity:0.000001, OldDensity:0.000000 BktCnt:4201338, PopBktCnt:4201338, PopValCnt:69, NDV:69
      Column (#4): AKT_AT_AT_SE_SE_NO(
        AvgLen: 3 NDV: 69 Nulls: 0 Density: 0.000001 Min: 1 Max: 98
        Histogram: Freq  #Bkts: 69  UncompBkts: 4201338  EndPtVals: 69
      Column (#5): AKT_AT_AT_NO(
        AvgLen: 4 NDV: 7466 Nulls: 0 Density: 0.000134 Min: 1 Max: 9964
      Column (#1): AKTL_AKH(
        AvgLen: 5 NDV: 16307 Nulls: 0 Density: 0.000061 Min: 14 Max: 543136
      Column (#55): 
        NewDensity:0.000001, OldDensity:0.000000 BktCnt:4203610, PopBktCnt:4203610, PopValCnt:5, NDV:5
      Column (#55): AKTL_BELART2(
        AvgLen: 3 NDV: 5 Nulls: 0 Density: 0.000001
        Histogram: Freq  #Bkts: 5  UncompBkts: 4203610  EndPtVals: 5
      Column (#57): 
        NewDensity:0.000002, OldDensity:0.000001 BktCnt:254, PopBktCnt:253, PopValCnt:1, NDV:2102
      Column (#57): AKTL_BELNR2(
        AvgLen: 3 NDV: 2102 Nulls: 0 Density: 0.000002 Min: 0 Max: 9902670
        Histogram: HtBal  #Bkts: 254  UncompBkts: 254  EndPtVals: 2
      Column (#54): 
        NewDensity:0.000088, OldDensity:0.000000 BktCnt:4204429, PopBktCnt:4204429, PopValCnt:6, NDV:6
      Column (#54): AKTL_BELART1(
        AvgLen: 3 NDV: 6 Nulls: 0 Density: 0.000088
        Histogram: Freq  #Bkts: 6  UncompBkts: 4204429  EndPtVals: 6
      Column (#56): 
        NewDensity:0.000000, OldDensity:0.000001 BktCnt:254, PopBktCnt:223, PopValCnt:1, NDV:392568
      Column (#56): AKTL_BELNR1(
        AvgLen: 3 NDV: 392568 Nulls: 0 Density: 0.000000 Min: 0 Max: 9904026
        Histogram: HtBal  #Bkts: 254  UncompBkts: 254  EndPtVals: 32
      ColGroup (#5, Index) AKT_INDEX
        Col#: 1 2 3 4 5 6    CorStregth: 8702149.74
      ColGroup (#3, Index) AKT_INDEX012
        Col#: 2 3 4 5 6    CorStregth: 2971.37
      ColGroup (#1, VC) SYS_STUF1FT2E0X6B6C$__BGEZQRHS
        Col#: 2 3 6    CorStregth: 2.59
      ColGroup (#4, Index) FK_AKH_AKTL_AKH
        Col#: 1 6    CorStregth: 12.28
      ColGroup (#7, Index) AKT_INDEX010
        Col#: 54 56    CorStregth: 6.00
      ColGroup (#6, Index) AKT_INDEX011
        Col#: 55 57    CorStregth: 5.00
      ColGroup (#2, VC) SYS_STULHCKPI#FOQE1JMOOXNGSFB0
        Col#: 2 3    CorStregth: 1.39
      ColGroup Usage:: PredCnt: 3  Matches Full: #2  Partial:  Sel: 0.0133
      Column (#34): 
        NewDensity:0.000000, OldDensity:0.000000 BktCnt:4199313, PopBktCnt:4199311, PopValCnt:9, NDV:11
      Column (#34): AKTL_STAT(
        AvgLen: 2 NDV: 11 Nulls: 0 Density: 0.000000
        Histogram: Freq  #Bkts: 11  UncompBkts: 4199313  EndPtVals: 11
      Table: AKT  Alias: AKT
        Card: Original: 14006583.000000  Rounded: 3  Computed: 3.05  Non Adjusted: 3.05
      Access Path: TableScan
        Cost:  131075.91  Resp: 131075.91  Degree: 0
          Cost_io: 129428.00  Cost_cpu: 16864951683
          Resp_io: 129428.00  Resp_cpu: 16864951683
    kkofmx: index filter:"AKT"."AKTL_ZEN"=TO_NUMBER(:B1)
    
    kkofmx: index filter:"AKT"."AKTL_AKH">=TO_NUMBER(:B1)
    
    kkofmx: index filter:"AKT"."AKTL_AKH"<=TO_NUMBER(:B1)
    
    kkofmx: index filter:"AKT"."AKTL_ZEN"=TO_NUMBER(:B1)
    
    kkofmx: index filter:"AKT"."AKTL_ZEN"=TO_NUMBER(:B1)
    
    kkofmx: index filter:"AKT"."AKTL_ZEN"=TO_NUMBER(:B1)
    
    kkofmx: index filter:"AKT"."AKT_AT_AT_SE_SE_AG_AG_WG"=TO_NUMBER(:B1)
    
    kkofmx: index filter:"AKT"."AKT_AT_AT_SE_SE_AG_AG_NO"=TO_NUMBER(:B1)
    
      ColGroup Usage:: PredCnt: 2  Matches Full: #2  Partial:  Sel: 0.0133
      ColGroup Usage:: PredCnt: 3  Matches Full: #2  Partial:  Sel: 0.0133
      ColGroup Usage:: PredCnt: 3  Matches Full: #2  Partial:  Sel: 0.0133
      Access Path: index (RangeScan)
        Index: AKT_INDEX
        resc_io: 1128.00  resc_cpu: 45259416
        ix_sel: 0.013333  ix_sel_with_filters: 0.000000 
     ***** Logdef predicate Adjustment ****** 
     Final IO cst 0.00 , CPU cst 150.00
     ***** End Logdef Adjustment ****** 
     ***** Logdef predicate Adjustment ****** 
     Final IO cst 0.00 , CPU cst 151.08
     ***** End Logdef Adjustment ****** 
     ***** Logdef predicate Adjustment ****** 
     Final IO cst 0.00 , CPU cst 151.13
     ***** End Logdef Adjustment ****** 
        Cost: 567.59  Resp: 567.59  Degree: 1
      ColGroup Usage:: PredCnt: 2  Matches Full: #2  Partial:  Sel: 0.0133
      ColGroup Usage:: PredCnt: 3  Matches Full: #2  Partial:  Sel: 0.0133
      ColGroup Usage:: PredCnt: 3  Matches Full: #2  Partial:  Sel: 0.0133
      Access Path: index (skip-scan)
        SS sel: 0.000096  ANDV (#skips): 7466.000000
        SS io: 7466.000000 vs. index scan io: 887.000000
        Skip Scan rejected
      Access Path: index (RangeScan)
        Index: AKT_INDEX012
        resc_io: 2177.00  resc_cpu: 54677577
        ix_sel: 0.013333  ix_sel_with_filters: 0.000096 
     ***** Logdef predicate Adjustment ****** 
     Final IO cst 0.00 , CPU cst 150.00
     ***** End Logdef Adjustment ****** 
        Cost: 1092.54  Resp: 1092.54  Degree: 1
    
    
      Access Path: index (RangeScan)
        Index: FK_AKH_AKTL_AKH
        resc_io: 201.00  resc_cpu: 15070140
        ix_sel: 0.004500  ix_sel_with_filters: 0.000032 
        Cost: 101.24  Resp: 101.24  Degree: 1
    New AP rejected: guess used for New but not for Current Best
      ColGroup Usage:: PredCnt: 3  Matches Full: #2  Partial:  Sel: 0.0133
      ColGroup Usage:: PredCnt: 3  Matches Full: #2  Partial:  Sel: 0.0133
      Access Path: index (RangeScan)
        Index: KEY_AKT
        resc_io: 380.00  resc_cpu: 15131385
        ix_sel: 0.004500  ix_sel_with_filters: 0.000000 
     ***** Logdef predicate Adjustment ****** 
     Final IO cst 0.00 , CPU cst 150.00
     ***** End Logdef Adjustment ****** 
        Cost: 191.20  Resp: 191.20  Degree: 1
    New AP rejected: guess used for New but not for Current Best
      ****** trying bitmap/domain indexes ******
    
    
      Access Path: index (IndexOnly)
        Index: FK_AKH_AKTL_AKH
        resc_io: 164.00  resc_cpu: 13914716
        ix_sel: 0.004500  ix_sel_with_filters: 0.000032 
        Cost: 82.68  Resp: 82.68  Degree: 0
        SORT ressource         Sort statistics
          Sort width:         612 Area size:     1048576 Max Area size:   107366400
          Degree:               1
          Blocks to Sort: 1 Row size:     21 Total Rows:            252
          Initial runs:   1 Merge passes:  0 IO Cost / pass:          0
          Total IO sort cost: 0      Total CPU sort cost: 10324700
          Total Temp space used: 0
      ColGroup Usage:: PredCnt: 2  Matches Full: #2  Partial:  Sel: 0.0133
      ColGroup Usage:: PredCnt: 2  Matches Full: #2  Partial:  Sel: 0.0133
      ColGroup Usage:: PredCnt: 2  Matches Full: #2  Partial:  Sel: 0.0133
      Access Path: index (IndexOnly)
        Index: AKT_INDEX
        resc_io: 1122.00  resc_cpu: 45203856
        ix_sel: 0.013333  ix_sel_with_filters: 0.013333 
        Cost: 563.21  Resp: 563.21  Degree: 0
        SORT ressource         Sort statistics
          Sort width:         612 Area size:     1048576 Max Area size:   107366400
          Degree:               1
          Blocks to Sort: 481 Row size:     21 Total Rows:         186754
          Initial runs:   2 Merge passes:  1 IO Cost / pass:        262
          Total IO sort cost: 743      Total CPU sort cost: 169417045
          Total Temp space used: 3015000
      Bitmap nodes:
        Used FK_AKH_AKTL_AKH
          Cost = 83.692016, sel = 0.000018
        Not used AKT_INDEX
          Cost = 1940.139796, sel = 0.013333
      ****** finished trying bitmap/domain indexes ******
      Best:: AccessPath: IndexRange
      Index: AKT_INDEX
             Cost: 567.59  Degree: 1  Resp: 567.59  Card: 3.05  Bytes: 0
    
    ***************************************
    So my question, of course, why not make the path through FK_AKH_AKTL_AKH?

    THX in advance

    Joerg

    Published by: Joerg on September 23, 2011 17:05

    The bind variable you made are non-peekable, because the example you did evidence "explain plan" - which means that the optimizer uses is standard figures assumed that for "between: bind1 and: bind2 ', on the other hand, as predicates" column =: channels3 "can legally be estimated according to the density of the column.

    This means that you probably searching for the case described in a blog post that I wrote some time ago:
    http://jonathanlewis.WordPress.com/2010/09/07/CBO-surprise-3/

    Concerning
    Jonathan Lewis

  • Need help with this problem please

    Hi all
    I have 2 tables and I am runnig the following query against it:
    select t1.ID_NBR, t1.START_DATE,t1.END_DATE,t1.SAMPLE_ID,t2.END_INTV_TIME,t2.CIN_DATA_ID
    from sample t1,weekend t2
    where t1.SAMPLE_ID=t2.SAMPLE_ID_1
    and t1.WEEKEND_FLAG='Y'
    and t1.SITE_ID_NBR='000097117011'
    and get the following dataset:
    ID_NBR     START_DATE     END_DATE     SAMPLE_ID     END_INTV_TIME     CIN_DATA_ID
                             
    97117011     91908     92108     143493     100     131834
    97117011     91908     92108     143493     200     131835
    97117011     91908     92108     143493     300     131836
    97117011     91908     92108     143493     400     131837
    97117011     91908     92108     143493     500     131838
    97117011     91908     92108     143493     600     131839
    97117011     91908     92108     143493     700     131840
    97117011     91908     92108     143493     800     131841
    97117011     91908     92108     143493     900     131842
    97117011     91908     92108     143493     1000     131843
    97117011     91908     92108     143493     1100     131844
    97117011     91908     92108     143493     1200     131845
    97117011     91908     92108     143493     1300     131846
    97117011     91908     92108     143493     1400     131847
    97117011     91908     92108     143493     1500     131848
    97117011     91908     92108     143493     1600     131849
    97117011     91908     92108     143493     1700     131850
    97117011     91908     92108     143493     1800     131851
    97117011     91908     92108     143493     1900     131852
    97117011     91908     92108     143493     2000     131853
    97117011     91908     92108     143493     2100     131854
    97117011     91908     92108     143493     2200     131855
    97117011     91908     92108     143493     2300     131856
    97117011     91908     92108     143493     2400     131857
    97117011     91908     92108     143493     100     131858
    97117011     91908     92108     143493     200     131859
    97117011     91908     92108     143493     300     131860
    97117011     91908     92108     143493     400     131861
    97117011     91908     92108     143493     500     131862
    97117011     91908     92108     143493     600     131863
    97117011     91908     92108     143493     700     131864
    97117011     91908     92108     143493     800     131865
    97117011     91908     92108     143493     900     131866
    97117011     91908     92108     143493     1000     131867
    97117011     91908     92108     143493     1100     131868
    97117011     91908     92108     143493     1200     131869
    97117011     91908     92108     143493     1300     131870
    97117011     91908     92108     143493     1400     131871
    97117011     91908     92108     143493     1500     131872
    97117011     91908     92108     143493     1600     131873
    97117011     91908     92108     143493     1700     131874
    97117011     91908     92108     143493     1800     131875
    97117011     91908     92108     143493     1900     131876
    97117011     91908     92108     143493     2000     131877
    97117011     91908     92108     143493     2100     131878
    97117011     91908     92108     143493     2200     131879
    97117011     91908     92108     143493     2300     131880
    97117011     91908     92108     143493     2400     131881
    97117011     91908     92108     143493     100     131882
    97117011     91908     92108     143493     200     131883
    97117011     91908     92108     143493     300     131884
    97117011     91908     92108     143493     400     131885
    97117011     91908     92108     143493     500     131886
    97117011     91908     92108     143493     600     131887
    97117011     91908     92108     143493     700     131888
    97117011     91908     92108     143493     800     131889
    97117011     91908     92108     143493     900     131890
    97117011     91908     92108     143493     1000     131891
    97117011     91908     92108     143493     1100     131892
    97117011     91908     92108     143493     1200     131893
    97117011     91908     92108     143493     1300     131894
    97117011     91908     92108     143493     1400     131895
    97117011     91908     92108     143493     1500     131896
    97117011     91908     92108     143493     1600     131897
    97117011     91908     92108     143493     1700     131898
    97117011     91908     92108     143493     1800     131899
    97117011     91908     92108     143493     1900     131900
    97117011     91908     92108     143493     2000     131901
    97117011     91908     92108     143493     2100     131902
    97117011     91908     92108     143493     2200     131903
    97117011     91908     92108     143493     2300     131904
    97117011     91908     92108     143493     2400     131905
    What I wanted was to add 2 columns to all data above, the reason is the dataset above has 72 files, one file per hour for 3 days from Friday 01:00 and ending the Sunday i 2400, but all have in all of the above data is just the date of beginning and end, so I created the following query to add the columns :
    SELECT *
      FROM (SELECT t.*,
                   TO_CHAR (TO_DATE (start_date, 'mmddrr') + TRUNC (rn / 24),
                            'Day'
                           ) AS weekday,
                                  TO_CHAR (TO_DATE (start_date, 'mmddrr') + TRUNC (rn / 24),
                            'mmddyy'
                           ) AS next_date
              FROM (SELECT t1.id_nbr,
                                                  t1.start_date,
                           TO_CHAR (TO_DATE (t1.start_date, 'mm/dd/yy'),
                                    'fmDay'
                                   ) AS start_day,
                           t1.end_date,
                           TO_CHAR (TO_DATE (t1.end_date, 'mm/dd/yy'),
                                    'fmDay'
                                   ) AS end_day,
                           t2.sample_id_1, t2.cin_data_id,
                           t2.end_intv_time, ROW_NUMBER () OVER (PARTITION BY t2.sample_id_1 ORDER BY t2.cin_data_id)
                                                                            AS rn,
                           COUNT (t2.cin_data_id) OVER (PARTITION BY t2.sample_id_1)
                                                                           AS cnt,
                           t1.weekend_flag
                      FROM sample t1,
                           weekend t2
                     WHERE t1.sample_id = t2.sample_id_1
                       AND t1.weekend_flag = 'Y') t)
     WHERE TRIM (weekday) IN ('Friday', 'Saturday', 'Sunday')
       AND nbr = '000097117011'
    And the problem I have now is instead of 72 for 3 days I get only 71 and time 2400 is paased on the next day, I tried to use CEIL instead and ended up getting 48 reocrds instead, the following dataset is when I used the above query
    ID_NBR     START_DATE     START_DAY     NEXT_DATE     WEEKDAY     END_DATE     END_DAY     SAMPLE_ID     CIN_DATA_ID     END_INTV_TIME
                                                 
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131848     1500
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131849     1600
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131850     1700
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131851     1800
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131852     1900
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131853     2000
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131854     2100
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131855     2200
    97117011     91908     Friday     91908     Friday        92108     Sunday     143493     131856     2300
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131857     2400
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131858     100
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131859     200
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131860     300
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131861     400
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131862     500
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131863     600
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131864     700
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131865     800
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131866     900
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131867     1000
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131868     1100
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131869     1200
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131870     1300
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131871     1400
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131872     1500
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131873     1600
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131874     1700
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131875     1800
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131876     1900
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131877     2000
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131878     2100
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131879     2200
    97117011     91908     Friday     92008     Saturday      92108     Sunday     143493     131880     2300
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131881     2400
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131882     100
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131883     200
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131884     300
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131885     400
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131886     500
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131887     600
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131888     700
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131889     800
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131890     900
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131891     1000
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131892     1100
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131893     1200
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131894     1300
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131895     1400
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131896     1500
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131897     1600
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131898     1700
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131899     1800
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131900     1900
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131901     2000
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131902     2100
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131903     2200
    97117011     91908     Friday     92108     Sunday        92108     Sunday     143493     131904     2300
    Need help please.
    Thank you

    Hello

    Hours in a range of 0 to 23 hours day after midnight. You count from 1, not 0, so the 24th hour (from Friday) is actually from 00:00 on Saturday, and the 72nd hour is 00:00 Monday, that you are not counting in the WHERE clause.

    Maybe when you calculate tn, you might simply subtract 1:

     SELECT *
      FROM (SELECT t.*,
                   TO_CHAR (TO_DATE (start_date, 'mmddrr') + TRUNC (rn / 24),
                            'Day'
                           ) AS weekday,
                                  TO_CHAR (TO_DATE (start_date, 'mmddrr') + TRUNC (rn / 24),
                            'mmddyy'
                           ) AS next_date
              FROM (SELECT t1.id_nbr,
                                                  t1.start_date,
                           TO_CHAR (TO_DATE (t1.start_date, 'mm/dd/yy'),
                                    'fmDay'
                                   ) AS start_day,
                           t1.end_date,
                           TO_CHAR (TO_DATE (t1.end_date, 'mm/dd/yy'),
                                    'fmDay'
                                   ) AS end_day,
                           t2.sample_id_1, t2.cin_data_id,
                           t2.end_intv_time, ROW_NUMBER () OVER (PARTITION BY t2.sample_id_1 ORDER BY t2.cin_data_id)
                                 - 1           -- Added
                                                                            AS rn,
                           COUNT (t2.cin_data_id) OVER (PARTITION BY t2.sample_id_1)
                                                                           AS cnt,
                           t1.weekend_flag
                      FROM sample t1,
                           weekend t2
                     WHERE t1.sample_id = t2.sample_id_1
                       AND t1.weekend_flag = 'Y') t)
     WHERE TRIM (weekday) IN ('Friday', 'Saturday', 'Sunday')
       AND nbr = '000097117011'
    

    To view the actual end time, add one hour before posting.

    What happens if you are missing a row for some reason any? Just using ROW_NUMBER won't take the missing line into account. It would be preferable to derive the time of the end_intc_timecolumn. Of course, it would be even better to store the date and time ending in a DATE column all the way.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    You must not post a lot of data: 6 hours, ending at midnight Monday, should be enough to show the problem and its solution.

    Always tell what version of Oracle you are using.

Maybe you are looking for