Help with incremental bck

Hi,
I am trying to backup the dev and uat database to FRA using RMAN incremental backup option. The script is
# ~~~~~ start RMAN cold backup ~~~~~ #
rman target / nocatalog log=${LOG_FILE} <<EOF
run {
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
delete noprompt expired archivelog all;
recover copy of database tag "img_cpy_incr_bkp" until time 'SYSDATE-2';
BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG "img_cpy_incr_bkp" DATABASE;
exit;
EOF
Ok so from what I understand is that with this stratergy,
on day one RMAN will not find any level 0 bkp so it will do a full backup.
day 1, incremental backup
day 2, incremental backup again
day 3, incremental backup will be merged to level 0 bckp and day 0 bkp will be useless.
day 4, incremental backup will be merged to day 1 backup making day 1 backup as level 0.
day 5, incremental backup will be merged to day 2 backup making day 2 backup as level 0.
day 6, incremental backup will be merged to day 3 backup making day 3 backup as level 0.
Is that correct >>?? if so, then should I rerun the level 0 backup again on sunday ??? or should I keep on running this scrip.

Hi Dalji,
The size of the db is about 7 GB. I ran the script so as this is for the first time, should RMAN not do a level 0 backup ?? The following is the output of the script '
Starting backup at 28-SEP-07
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting incremental level 1 datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00006 name=/u05/oradata/jerry1/jerry1_data_002.dbf
input datafile fno=00001 name=/u05/oradata/jerry1/system01.dbf
input datafile fno=00008 name=/u05/oradata/jerry1/jerry1_indx_002.dbf
channel ORA_DISK_1: starting piece 1 at 28-SEP-07
channel ORA_DISK_2: starting incremental level 1 datafile backupset channel ORA_DISK_2: specifying datafile(s) in backupset input datafile fno=00009 name=/u05/oradata/jerry1/jerry1_data_003.dbf
input datafile fno=00002 name=/u05/oradata/jerry1/undotbs01.dbf
input datafile fno=00007 name=/u05/oradata/jerry1/jerry1_indx_001.dbf
channel ORA_DISK_2: starting piece 1 at 28-SEP-07
channel ORA_DISK_3: starting incremental level 1 datafile backupset channel ORA_DISK_3: specifying datafile(s) in backupset input datafile fno=00005 name=/u05/oradata/jerry1/jerry1_data_001.dbf
input datafile fno=00003 name=/u05/oradata/jerry1/sysaux01.dbf
input datafile fno=00004 name=/u05/oradata/jerry1/users01.dbf
channel ORA_DISK_3: starting piece 1 at 28-SEP-07
channel ORA_DISK_1: finished piece 1 at 28-SEP-07
piece handle=/u04/flash_recovery_area/jerry1/backupset/2007_09_28/o1_mf_nnnd1_TAG20070928T150923_3hs348dw_.bkp tag=TAG20070928T150923 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:02:46 channel ORA_DISK_2: finished piece 1 at 28-SEP-07 piece handle=/u04/flash_recovery_area/jerry1/backupset/2007_09_28/o1_mf_nnnd1_TAG20070928T150923_3hs348t0_.bkp tag=TAG20070928T150923 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:02:46 channel ORA_DISK_3: finished piece 1 at 28-SEP-07 piece handle=/u04/flash_recovery_area/jerry1/backupset/2007_09_28/o1_mf_nnnd1_TAG20070928T150923_3hs34khn_.bkp tag=TAG20070928T150923 comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:02:45 Finished backup at 28-SEP-07
Starting Control File and SPFILE Autobackup at 28-SEP-07
piece handle=/u04/flash_recovery_area/jerry1/autobackup/2007_09_28/o1_mf_s_634489931_3hs39f2n_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 28-SEP-07
When I chech FRA, the
87M backupset
11M block_change_tracking
7.2M autobackup
1K onlinelog
1K datafile
1K archivelog
$ cd backupset
$ cd 2007_09_28
$ ls
39M Sep 28 15:12 o1_mf_nnnd1_TAG20070928T150923_3hs34khn_.bkp
39M Sep 28 15:12 o1_mf_nnnd1_TAG20070928T150923_3hs348t0_.bkp
9.5M Sep 28 15:12 o1_mf_nnnd1_TAG20070928T150923_3hs348dw_.bkp
The whole backupset folder is only 87M. should it not be about 7G ????

Similar Messages

  • Please, help with Incremental Update for Linearized document.

    Hi, here is my problem.
    I'm working in my own annotation app. It incrementally updates pdfs. Works fine with most of the pdfs.
    But i've found couple of pdfs, that was being corrupted after updating.
    Here goes more details:
    Single page-linearized pdf: when i've looked into pdf source, i found that page object has /Parent key which referencing to non-existing object. Normally, as i understand /Parent for page object is /Type /Pages objects with /Kids /Count etc.
    12 0 obj
    <</ArtBox[26 0 585.999 792]/BleedBox[26 0 586 792]/Contents[14 0 R 15 0 R 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R]/CropBox[0 0 612 792]/MediaBox[0 0 612 792]/Parent 8 0 R/Resources 37 0 R/Rotate 0/TrimBox[26 0 586 792]/Type/Page>>
    endobj
    Parent 8 0 R - Is missing
    But all pdf viewers are ok with that.
    So, this pdf has two Xref tables:
    36 0 obj
    <</DecodeParms<</Columns 4/Predictor 12>>/Filter/FlateDecode/ID[<2C9B406A12A771465F8FE0D6A4DC67ED><9B829DD8BDB09849A00CA5D75E7 5CDF4>]/Index[10 54]/Info 9 0 R/Length 114/Prev 66739/Root 11 0 R/Size 64/Type/XRef/W[1 2 1]>>stream....
    and Second one at the end of file.
    5 0 obj
    <</DecodeParms<</Columns 5/Predictor 12>>/Filter/FlateDecode/ID[<2C9B406A12A771465F8FE0D6A4DC67ED><9B829DD8BDB09849A00CA5D75E7 5CDF4>]/Info 9 0 R/Length 51/Root 11 0 R/Size 10/Type/XRef/W[1 3 1]>>stream
    Linearized dict:
    10 0 obj
    <</Linearized 1/L 67043/O 12/E 48239/N 1/T 66738/H [ 534 185]>>
    endobj
    /T 66738 points to Xref table in 5 0 obj's stream
    Now, when my annotation is stored: i'm adding the following object to the end of file:
    8 0 obj <</Type /Pages/Count 1/Kids [ 12 0 R ]>>
    endobj
    I've create the missing 8 0 obj with Kids and /Count 1
    12 0 obj<</Type /Page/Annots [ 65 0 R ]/ArtBox [ 26 0 585.999 792 ]/BleedBox [ 26 0 586 792 ]/Contents [ 14 0 R 15 0 R 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R ]
    /CropBox [ 0 0 612 792 ]/MediaBox [ 0 0 612 792 ]/Parent 8 0 R/Resources 37 0 R/Rotate 0/TrimBox [ 26 0 586 792 ]>>
    endobj
    it's page objects with new Reference to Annotation object which is:
    65 0 obj<</Type /Annot/Contents (Test 2)/M (D:20120507172231+03'00')/Open true/P 12 0 R/Rect [ 0 0 100.000 100.000 ]/Subtype /Text/T(Test 1)>>
    endobj
    then goes my xref table
    xref
    8 1
    0000067045 00000 n
    0000067189 00000 n
    0000067591 00000 n
    trailer
    <<
    /ID [ <FE1185EC7443D19473E8A4A1569A1CB2> <FE1185EC7443D19473E8A4A1569A1CB2> ]
    /Info 64 0 R
    /Prev 66739
    /Root 11 0 R
    /Size 69
    >>
    startxref
    67760
    %%EOF
    And this totally broks my PDF.
    Questing: /Prev in my trailer should point ot 5 0 obj or 36 0 obj?

    Ok, thanks, and /Pref in my trailer should point to which xref? 5 0 (and the end of the original file) or 36 0 at the beginning?

  • Help with incrementing time (in excel)

    Hi!
    I need to find the difference between a start time and end time, calculate how much time has elapsed and divide that time period by a variable number of workers. (I have gotten that far with the formulas).
    Then I need to take the resulting minutes in that time period per worker, and add it to the start time, and that is where I could use some help!
    For an example, if the start time is 5:30 pm, and the end time is 6:00 pm, and I have 5 workers, I will get the amount of time per worker as 6 minutes.  How would I create a formula to add the amount of time per worker back to the original start
    time so that I can get a result of 5:36 PM?  

    Hi!
    I need to find the difference between a start time and end time, calculate how much time has elapsed and divide that time period by a variable number of workers. (I have gotten that far with the formulas).
    Then I need to take the resulting minutes in that time period per worker, and add it to the start time, and that is where I could use some help!
    For an example, if the start time is 5:30 pm, and the end time is 6:00 pm, and I have 5 workers, I will get the amount of time per worker as 6 minutes.  How would I create a formula to add the amount of time per worker back to the original start
    time so that I can get a result of 5:36 PM?  
    1. In cell A2 I have:-
    17:30:00
    2. In cell B2 I have:-
    18:00:00
    3. In cell C2 I have:-
    =(B2-A2)
    This displays a result of:-
    00:30:00
    4. In cell D2 I have:-
    5
    5. In cell E2 I have:-
    =(C2/D2)
    This displays a result of:-
    00:06:00
    6. In cell F2 I have:-
    =(A2+E2)
    This displays a result of:-
    17:36:00
    Does that give you what you want?
    The information above is in European time system (what Americans call, "military" time).
    If you are in the US just input the times in the formats that you would normally do and you should get the same results as I do except in AM / PM format.

  • I need help with event structure. I am trying to feed the index of the array, the index can vary from 0 to 7. Based on the logic ouput of a comparison, the index buffer should increment ?

    I need help with event structure.
    I am trying to feed the index of the array, the index number can vary from 0 to 7.
    Based on the logic ouput of a comparison, the index buffer should increment
    or decrement every time the output of comparsion changes(event change). I guess I need to use event structure?
    (My event code doesn't execute when there is an  event at its input /comparator changes its boolean state.
    Anyone coded on similar lines? Any ideas appreciated.
    Thanks in advance!

    You don't need an Event Structure, a simple State Machine would be more appropriate.
    There are many examples of State Machines within this forum.
    RayR

  • I need help with shooting in my flash game for University

    Hi there
    Ive tried to make my tank in my game shoot, all the code that is there works but when i push space to shoot which is my shooting key it does not shoot I really need help with this and I would appriciate anyone that could help
    listed below should be the correct code
    //checking if the space bar is pressed and shooting is allowed
    if(evt.keyCode == 32 && shootAllow){
        //making it so the user can't shoot for a bit
        shootAllow = false;
        //declaring a variable to be a new Bullet
        var newBullet:Bullet = new Bullet();
        //changing the bullet's coordinates
        newBullet.y = tank_mc.y + tank_mc.width/2 - newBullet.width/2;
        newBullet.x = tank_mc.x;
        //then we add the bullet to stage
        addChild(newBullet);
    listed below is my entire code
    import flash.display.MovieClip;
        //declare varibles to create mines
    //how much time before allowed to shoot again
    var cTime:int = 0;
    //the time it has to reach in order to be allowed to shoot (in frames)
    var cLimit:int = 12;
    //whether or not the user is allowed to shoot
    var shootAllow:Boolean = true;
    var minesInGame:uint;
    var mineMaker:Timer;
    var cursor:MovieClip;
    var index:int=0;
    var tankMine_mc:MovieClip;
    var antiTankmine_mc:MovieClip;
    var maxHP:int = 100;
    var currentHP:int = maxHP;
    var percentHP:Number = currentHP / maxHP;
    function initialiseMine():void
        minesInGame = 15;
        //create a timer fires every second
        mineMaker = new Timer(6000, minesInGame);
        //tell timer to listen for Timer event
        mineMaker.addEventListener(TimerEvent.TIMER, createMine);
        //start the timer
        mineMaker.start();
    function createMine(event:TimerEvent):void
    //var tankMine_mc:MovieClip;
    //create a new instance of tankMine
    tankMine_mc = new Mine();
    //set the x and y axis
    tankMine_mc.y = 513;
    tankMine_mc.x = 1080;
    // adds mines to stage
    addChild(tankMine_mc);
    tankMine_mc.addEventListener(Event.ENTER_FRAME, moveHorizontal);
    function moveHorizontal(evt:Event):void{
        evt.target.x -= Math.random()*5;
        if (evt.target.x >= stage.stageWidth)
            evt.target.removeEventListener(Event.ENTER_FRAME, moveHorizontal);
            removeChild(DisplayObject(evt.target));
    initialiseMine();
        //declare varibles to create mines
    var atmInGame:uint;
    var atmMaker:Timer;
    function initialiseAtm():void
        atmInGame = 15;
        //create a timer fires every second
        atmMaker = new Timer(8000, minesInGame);
        //tell timer to listen for Timer event
        atmMaker.addEventListener(TimerEvent.TIMER, createAtm);
        //start the timer
        atmMaker.start();
    function createAtm(event:TimerEvent):void
    //var antiTankmine_mc
    //create a new instance of tankMine
    antiTankmine_mc = new Atm();
    //set the x and y axis
    antiTankmine_mc.y = 473;
    antiTankmine_mc.x = 1080;
    // adds mines to stage
    addChild(antiTankmine_mc);
    antiTankmine_mc.addEventListener(Event.ENTER_FRAME, moveHorizontal);
    function moveHorizontal_2(evt:Event):void{
        evt.target.x -= Math.random()*10;
        if (evt.target.x >= stage.stageWidth)
            evt.target.removeEventListener(Event.ENTER_FRAME, moveHorizontal);
            removeChild(DisplayObject(evt.target));
    initialiseAtm();
    function moveForward():void{
        bg_mc.x -=10;
    function moveBackward():void{
        bg_mc.x +=10;
    var tank_mc:Tank;
    // create a new Tank and put it into the variable
    // tank_mc
    tank_mc= new Tank;
    // set the location ( x and y) of tank_mc
    tank_mc.x=0;
    tank_mc.y=375;
    // show the tank_mc on the stage.
    addChild(tank_mc);
    stage.addEventListener(KeyboardEvent.KEY_DOWN, onMovementKeys);
    //creates the movement
    function onMovementKeys(evt:KeyboardEvent):void
        //makes the tank move by 10 pixels right
        if (evt.keyCode==Keyboard.D)
        tank_mc.x+=5;
    //makes the tank move by 10 pixels left
    if (evt.keyCode==Keyboard.A)
    tank_mc.x-=5
    //checking if the space bar is pressed and shooting is allowed
    if(evt.keyCode == 32 && shootAllow){
        //making it so the user can't shoot for a bit
        shootAllow = false;
        //declaring a variable to be a new Bullet
        var newBullet:Bullet = new Bullet();
        //changing the bullet's coordinates
        newBullet.y = tank_mc.y + tank_mc.width/2 - newBullet.width/2;
        newBullet.x = tank_mc.x;
        //then we add the bullet to stage
        addChild(newBullet);
    if (tank_mc.hitTestObject(antiTankmine_mc))
            //tank_mc.gotoAndPlay("hit");
            currentHP -= 10;
            // remove anti tank mine
            removeChild(antiTankmine_mc);
    if (tank_mc.hitTestObject(tankMine_mc))
            //tank_mc.gotoAndPlay("hit");
            currentHP -= 10;
            // remove anti tank mine
            removeChild(tankMine_mc);
        //var maxHP:int = 100;
    //var currentHP:int = maxHP;
    //var percentHP:Number = currentHP / maxHP;
        //Incrementing the cTime
    //checking if cTime has reached the limit yet
    if(cTime < cLimit){
        cTime ++;
    } else {
        //if it has, then allow the user to shoot
        shootAllow = true;
        //and reset cTime
        cTime = 0;
    function updateHealthBar():void
        percentHP = currentHP / maxHP;
        healthBar.barColor.scaleX = percentHP;
        if(currentHP <= 0)
            currentHP = 0;
            trace("Game Over");
        updateHealthBar();

    USe the trace function to analyze what happens and what fails to happen in the code you showed.  trace the conditional values to see if they are set up to allow a shot when you press the key

  • Help with XML, display data on swipe/click

    Hello.
    I am trying to create a moibile app that displays XML data. It's basically a phone book. I want the data to change when swiped. I can get the data in just fine. I can get it to display fine. I am not seeing the correct image first, however. I think it's a problem with my imagenum variable.
    Then, I want to change what is displayed when the user clicks/swipes on the screen. How do I do that?
    stop();
    var nameArray:Array = new Array();
    var countryArray:Array = new Array();
    var portraitArray:Array = new Array();
    var flagArray:Array = new Array();
    var jobtitleArray:Array = new Array();
    var imageNum:Number=0;
    var totalImages:Number;
    //Load XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load(new URLRequest("recbook.xml"));
    XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(event:Event):void {
    var theXMLData:XML = new XML(XMLURLLoader.data);
    totalImages=theXMLData.name.length();
    for (var i:Number =0; i < totalImages; i++){
      //push xml data into the arrays
      nameArray.push(theXMLData.name[i]);
      countryArray.push(theXMLData.country[i]);
      portraitArray.push(theXMLData.portrait[i]);
      flagArray.push(theXMLData.flag[i]);
      jobtitleArray.push(theXMLData.jobtitle[i]);
    //data is processed
    loadData();
    function loadData():void {
    var thisPortrait:String = portraitArray[imageNum];
    var thisCountry:String = countryArray[imageNum];
    var thisName:String = nameArray[imageNum];
    var thisJobtitle:String = jobtitleArray[imageNum];
    var thisFlag:String = flagArray[imageNum];
    var dataLoader:Loader = new Loader();
    dataLoader.load(new URLRequest(portraitArray[imageNum]));
    dataLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dataLoaded);
    function dataLoaded(event:Event):void {
      //I want to start with image 0 (img1.jpg) and cycle through with a mouse click (finger swipe on iOS)
      stage.addEventListener(MouseEvent.CLICK, loadMainImage1);
      function loadMainImage1(event:MouseEvent):void {
       portraitUILoader.source=thisPortrait;
       flagUILoader.source=thisFlag;
       selectedName.text=thisName;
       selectedCountry.text=thisCountry;
       selectedJobtitle.text=thisJobtitle;
    //add to imageNum (1);
    imageNum++;
    if (imageNum < totalImages) {//stopping at img2
      trace("imageNum " + imageNum);
      trace("image name (thisPortrait) " + thisPortrait);//losing image 4 somewhere
      loadData();
      trace("Total Images " + totalImages);
    //click to move past the home screenI'd like to ditch this. don't know how.
    homeScreen_mc.addEventListener(MouseEvent.CLICK, goNext);
    function goNext(event:MouseEvent):void
    nextFrame();
    */here's the output:
    imageNum 1
    image name (thisPortrait) images/img1.jpg
    imageNum 2
    image name (thisPortrait) images/img2.jpg
    imageNum 3
    image name (thisPortrait) images/img3.jpg
    Total Images 4
    Total Images 4
    Total Images 4
    Total Images 4
    It starts the display on image 1 (the second in the series img2.jpg)*/

    Thank you.
    That helped. I get the correct images in the output, but not in the display. I also get the following error. Any chance you could help with that?
    new output after moving the increment:
    imageNum 0
    image name (thisPortrait) images/img1.jpg
    imageNum 1
    image name (thisPortrait) images/img2.jpg
    imageNum 2
    image name (thisPortrait) images/img3.jpg
    imageNum 3
    image name (thisPortrait) images/img4.jpg
    TypeError: Error #2007: Parameter url must be non-null.
    at flash.display::Loader/_load()
    at flash.display::Loader/load()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/loadData()
    at iOS_fla::MainTimeline/processXML()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

  • Issue with Incremental Recon?

    We're facing an issue with incremental recons. If a full recon is run on a resource and an entry exists on the resource but NOT in IdM, the entry is put in the account index with a situation of UNMATCHED.....so far so good....
    But if an IdM user is created for that entry, and incremental recon is run the incremental does not link up the resource account to the IdM user. It seems that the incremental doesn't handle the situation change of UNMATCHED to CONFIRMED?....Not sure if this is a bug (could've sworn that this used to work in a previous version of IdM) or if it's the intended functionality, and the full recon only is designed to handle this particular situation change....Thanks in advance for any insight!

    No link. Because the account index already has this resource account flagged as UNMATCHED the incremental reconciliation ignores it.
    You can manually assign the resource to the user account or perform a full reconciliation to resolve this UNMATCHED to CONFIRMED. This doesn't help in the case when there are a large number of UNMATCHED accounts or a full reconciliation takes a long time.

  • Really need help with MSI R7970-2PMD3GD5/OC:(

    Greetings to all,
    I really need help with my brand new MSI R7970-2PMD3GD5/OC. I've purchased it two days ago and I didn't really have time to test the card until yesterday. The card is I think way to hot for my "liking". It idles at 56c-60c, at full load in Heaven benchmark 3.0 in 1920x1080, extreme tessellation and 8xAA card reaches 95c-97c. Stock cloacks are 1010Mhz/1375Mhz and stock voltage is 1,174v. Case is being cooled by two Noctua NF-P12 fans. Also I tried lowering the voltage and "underclocking" the card to a standard 925Mhz in small increments, but it doesn't help at all. Each and every time it results in BSOD and dx dll errors and complete system failures. Replacing the card wouldn't be a problem if I lived in a "normal" country that has access to a steady supply. Retailer that sold me a card told me that only 5 cards total have been imported from the launch day and told me that i bought the "last" card in my country. They could order a replacement but it would take them more then a month to do so.:( Ohhh and one more thing I don't overclock, everything in my case is at their default values.
    Recently, I read that "Amd released" a bios update for a standard reference boards that turns them into a "GHZ editions". Also lot of users report a lower voltage requirements and lower temps with that "boost bios". As I understand this card pcb is not Amd's reference board design, I could be wrong it's not that uncommon.. So I didn't want to risk warranty by flashing it to a position 1. Will MSI release the boost bios for this model of card? I am humbly asking MSI staff on how to proceed regarding this problem. I would be immensely grateful for any help you could provide.

    Quote from: Svet on 24-August-12, 18:13:26
    what PC case you use exactly?
    have you tried to open PC case side door and to retest?
    Hi,
    it's open case. If i close it the temps get even worse:(
    They get better for other components, but not for gpu. Two Noctua NF-P12's are cooling the case, first one is positioned above gpu, left side next to cpu. Other is right beneath the gpu, right side of case. Just under the hdd section of the case. I tested each and every component with my backup card nv 8500gt. They function within the specified parameters. I'm getting somewhat worried.
    П.С. Поздрав Свет
    да ли сте ви са наших простора да не куцам на енглеском?

  • Help with counter

    Hi everyone,
    I am writing this page for users to register and to login, but the problem i have is knowing who are the most active users.
    I am trying to do this with a hit counter, as you can see in my last "if", but is not working as it should be.
    Can somebody help with this.
    thanks.
    <html>
    <head>
                     <title>   2  </title>
    </head>
    <body>
    <body bgcolor="#FFFFFF">
    <center>
    <br>
    <%
      Cookie[] cookies = request.getCookies();
      if (cookies == null){
        cookies = new Cookie[0];
      Cookie c = new Cookie("users","");
      response.addCookie(c);
      String username  = request.getParameter("username");
      String password = request.getParameter("password");
      Cookie newuser = null;
      if (username!=null && password!=null && username.length()>0) {
        newuser = new Cookie(username,password);
        response.addCookie(newuser);
          for (int i=0; i<cookies.length; i++) {
          if (newuser!=null && newuser.getName().equals(cookies.getName())){
    newuser = null;
    out.println("><BR> <H3>" + "That username already exists, please enter another."+"<BR> </H3>");
    if (newuser != null){
    out.println("<H3> Welcome new user: <BR>"+newuser.getName()+":\t"+ newuser.getValue()+"<BR> </H3>");
    int counter = 0;
    if (request.getParameter("registereduser") != null){
         for (int i=0; i<cookies.length; i++) {
              if (request.getParameter("registereduser").equals( cookies[i].getName() ) ){
         out.println("><BR> <H3>" + "Welcome again, "+ cookies[i].getName()+counter++"<BR> </H3>");
    %>
    </center>
    </body>
    </html>

    I'm trying to do it this way:
    I have declared an static counter to do the task, and is incrementing everytime the page is visited, but,
    I want that depending of the user, it will print a different output, for example:
    user "a", visted 3 times,
    or user "b" visited 8 times.
    I was thinking in a counter for each user, and to save it and restore it every time the user visits.
    how can i do that?
    <%! static int staticCounter = 1; %>
    <%
    if (request.getParameter("registereduser") != null){
               for (int i=0; i<cookies.length; i++) {
                     if (request.getParameter("registereduser").equals( cookies.getName() ) ){
         out.println("><BR> <H3>" + "Welcome again, "+ cookies[i].getName()+staticCounter++"<BR> </H3>");
    %>

  • Please help with SQL amount calulation

    -- Results
    with t as ( 
    select 'P11877' Mstr_Program,   1 Year_of_study, 'BUSI1490' program_module,  20 no_of_stud,    1 rank,   30 program_credits,  30 cumm_credits   from dual union all
    select 'P11877',                1,              'COMP1365',                 20,               2,        30,                  60               from dual union all
    select 'P11877',                1,              'BUSI1375',                 20,               3,        30,                  90               from dual union all
    select 'P11877',                1,              'COMP1363',                 20,               4,        30,                  120              from dual union all
    select 'P11877',                2,              'MARK1174',                 8,                1,        30,                  30               from dual union all
    select 'P11877',                2,              'FINA1068',                 8,                2,        15,                  45               from dual union all
    select 'P11877',                2,              'INDU1062',                 8,                3,        30,                  75               from dual union all
    select 'P11877',                2,              'BUSI1329',                 8,                4,        15,                  90               from dual union all
    select 'P11877',                2,              'MARK1138',                 8,                5,        30,                  120              from dual)
    select * from t;-- Each MSTR_PROGRAM can have 1 or many program_module
    -- MSTR_PROGRAM's can run for 1 or 2 years (case above is two years) so some modules run in year 1 and some in year 2
    -- NO_OF_STUD is the number of students on the module
    -- RANK basically ranks the modules by the number of students on them grouped by program and year
    -- e.g.row_number() OVER (PARTITION BY Mstr_Program, Year_of_study) ORDER BY COUNT(STUDENT_ID) DESC) rank
    -- PROGRAM_CREDITS: each module has a fixed number of credits
    -- CUMM_CREDITS: Increments the credit count of modules
    -- SUM(program_credits * 10) OVER (PARTITION BY Mstr_Program, Year_of_study
    -- ORDER BY count(STUDENT_ID) desc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) cumm_credits
    -- I want to trim of any modules once the CUM_CREDITS hits 120. As seen above. I achieve this by wrapping the main query is another SELECT then LIMIT
    -- that WHERE cum_credit <=120.
    -- But what I need is:
    -- In some cases the the cumm_credit maybe on lets say 90credits then the next module is worth 40 credits. This next module will not show as it
    -- will be greater than 120 credits, so i need to pro-rata it:
    -- So if credit_count > 120, then the last module is counted pro-rata as follows: 1- ((credit count - 120) / credits from last module
    -- Can anyone help with how I can incorporate this into my current code: The SELECT portion of the Original SQL is below: I simplified column names
    -- e.t.c in the above so they wont be the same
    SELECT * FROM (
         SELECT
               ,SR_PROGRAM Mstr_Program
               ,DECODE (SORLCUR_YEAR, 1, 1,
                                      2, 2,
                                      3, 3,
                                      4, 3, SR_YEAR) year_of_study
               ,SCT_SUBJ_CODE||SCT_CRSE_NUMB program_module
               ,COUNT(student_ID)                    no_of_stud
               ,row_number() OVER (PARTITION BY sr_program,
                                            DECODE (sr_year, 1, 1,
                                                                  2, 2,
                                                                  3, 3,
                                                                  4, 3, SR_YEAR) ORDER BY COUNT(student_id) DESC, scbcrse_title asc) rank
               ,(SCT_CREDIT_HRS * 10) program_credits
               ,SUM(SCT_CREDIT_HRS * 10) OVER (PARTITION BY sr_program, DECODE (sorlcur_year, 1, 1,
                                                                                                       2, 2,
                                                                                                       3, 3,
                                                                                                       4, 3, SR_YEAR)
                                                    ORDER BY count(student_id) desc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) cumm_credits
    WHERE cumm_credit <=120
    ORDER BY Mstr_Program, YEAR_OF_STUDY, RANK asc;

    Maybe
    SELECT Mstr_Program,year_of_study,program_module,no_of_stud,rank,program_credits old_program_credits,cumm_credits old_cumm_credits,
           case when cumm_credits > 120
                then program_credits - cumm_credits + 120
                else program_credits
           end new_program_credits,
           case when cumm_credits > 120
                then 120
                else cumm_credits
           end new_cumm_credits
      FROM (SELECT SR_PROGRAM Mstr_Program,
                   DECODE(SORLCUR_YEAR,1,1,2,2,3,3,4,3,SR_YEAR) year_of_study,
                   SCT_SUBJ_CODE||SCT_CRSE_NUMB program_module,
                   COUNT(student_ID) no_of_stud,
                   row_number() OVER (PARTITION BY sr_program,DECODE(sr_year,1,1,2,2,3,3,4,3,SR_YEAR)
                                          ORDER BY COUNT(student_id) DESC,scbcrse_title) rank,
                   10 * SCT_CREDIT_HRS program_credits,
                   10 * SUM(SCT_CREDIT_HRS) OVER (PARTITION BY sr_program,DECODE(sorlcur_year,1,1,2,2,3,3,4,3,SR_YEAR)
                                                      ORDER BY count(student_id) desc
                                                  ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) cumm_credits
    WHERE 0 <= case when cumm_credits > 120
                     then program_credits - cumm_credits + 120
                     else program_credits
                end
    ORDER BY Mstr_Program,YEAR_OF_STUDY,RANKRegards
    Etbin
    Edited by: Etbin on 16.12.2011 8:50
    with
    t as   /* simulating the result achieved */
    (select 'P11877' Mstr_Program,1 Year_of_study, 'BUSI1490' program_module,20 no_of_stud,1 rank,30 program_credits,30 cumm_credits from dual union all
    select 'P11877',             1,               'COMP1365',               20,           2,     40,                70              from dual union all
    select 'P11877',             1,               'BUSI1375',               20,           3,     30,                100             from dual union all
    select 'P11877',             1,               'COMP1363',               20,           4,     40,                140             from dual union all
    select 'P11877',             2,               'MARK1174',               8,            1,     30,                30              from dual union all
    select 'P11877',             2,               'FINA1068',               8,            2,     50,                80              from dual union all
    select 'P11877',             2,               'INDU1062',               8,            3,     30,                110             from dual union all
    select 'P11877',             2,               'BUSI1329',               8,            4,     50,                160             from dual union all
    select 'P11877',             2,               'MARK1138',               8,            5,     30,                190             from dual
    select Mstr_Program,Year_of_study,program_module,no_of_stud,rank,program_credits old_credits,cumm_credits old_cumm,
           case when cumm_credits > 120
                then program_credits - cumm_credits + 120
                else program_credits
           end new_program_credits,
           case when cumm_credits > 120
                then 120
                else cumm_credits
           end new_cumm_credits
      from t
    where 0 <= case when cumm_credits > 120
                     then program_credits - cumm_credits + 120
                     else program_credits
                end

  • Help with scaling of chart

    I have a problem manipulating the scale of the graph here.
    in the VI that i attached, there's two chart. The one at the top is the problem that i am facing. I want to have a chart that has time on the x-scale in 24-hr format with increment of 1 hour. For the first chart to show every hourly value on the x-scale i have to stretch it too much and the incremental value becomes 30 minutes.
    I intend to remain the size of the chart as the chart at the bottom.As you can see, the x-scale can not show every hourly value from 08:00 09:00 10:00 all the way to 20:00.
    This should be what i want to get
    | | | | | |
    08:00 09:00 11:00 12:00 13:00 14:00 ... 20:00 x-scale
    and maintaining the size as of
    the chart at the bottom.
    i've tried changing property node values for interval, max, min to no avail.
    Thanks for any help
    Parker
    Attachments:
    chart.vi ‏15 KB

    Hi Parker,
    In your second graph you've got 8:00 - 12:00 - 20:00. What you need to do is replace the 12:00 by 9:00 (clic on 12:00) without adjusting any property.
    The graph should then show the different times you want.
    Hope this helps !
    Julien
    Attachments:
    From_8_to_20.jpg ‏30 KB

  • Help with unhappy beginner code...

    Hello Java gurus,
    I'm learning java and one of my class assignments is the old "mortgage calculator"... I made code up, compiled okay, but it won't execute. Gives me all sorts of errors. I THINK it's to do with the double vs int vs float... Please help!!! I've been playing with this and can't figure whats erroring. I know its prob something simple so please explain when you write back what I'm not understanding... Thank you! -nika
    Assignment:
    The monthly payment on mortgage loan of L dollars, at a rate of interest r is given by
    Monthly payment = []
    Where N is the number of years of mortgage. Write a program to find the monthly
    payment for 30 years, for principals from $100,000 through $200,000(with increments
    of $20,000) and interest rates of 6% through 10% (with increments of 0.5%). Print
    monthly payment as a whole number (rounded off).
    The output must be a neat table, similar to the following (your answers may be slightly
    different because of rounding off).
    Principal 6% 6.5% 7% 7.5% 8% 8.5% 9% 9.5% 10%
    100000 600 632 665 699 733 768 804 840 877
    120000 719 758 798 839 880 922 965 1009 1053
    140000 � � � � � � � � �
    160000 � � � � � � � � �
    180000 � � � � � � � � �
    200000 � � � � � � � � �
    Hint: Use the following idea to compute (1 + r/12)12N
    double temp = 1+r/12;
    double temp1 = 1;
    for (int i = 1; i<=12*N;i++)
    temp1 = temp1*temp;
    The final formula now becomes:
    double mp = (L*(r/12)*temp1)/(temp1-1);
    MY CODE:
    import java.util.*;
    class MortgagePmt {
    public static void main(String args[])     {
    int n = 30;     
    System.out.println("Mortgage Monthly Payment");
    System.out.println("Principal 6.0% 6.5% 7.0% 7.5% 8.0% 8.5% 9.0% 9.5% 10.0% ");
    for (int l = 100000; l<=200000; l=l+20000){
    System.out.printf("%9d ",l);
    for(double r = 6.0; r<=10.0; r=r+0.5){
    double temp = 1+r%12;
    double temp1 = 1;
    for (int i = 1; i<=12*n;i++)
    temp1 = temp1*temp;
    double mp = (l*(r%12)*(temp1))/(temp1 - 1);
    System.out.printf("%5.0f", mp);
    System.out.println("");
    }

    You really need to do an analysis on your algo... there is NO WAY that it is correct.
    MY CODE:
    import java.util.*;
    class MortgagePmt {
    public static void main(String args[])     {
    int n = 30;     
    System.out.println("Mortgage Monthly Payment");
    System.out.println("Principal 6.0% 6.5% 7.0% 7.5% 8.0% 8.5% 9.0% 9.5% 10.0% ");
    for (int l = 100000; l<=200000; l=l+20000){
    System.out.printf("%9d ",l);
    for(double r = 6.0; r<=10.0; r=r+0.5){
    double temp = 1+r%12;
    double temp1 = 1;What is this following little section for? temp1 comes out of there at 1.7x10^304... err, no way that is right. I do not believe there is that much anything in the world, let alone money.
    for (int i = 1; i<=12*n;i++)
    temp1 = temp1*temp;
    double mp = (l*(r%12)*(temp1))/(temp1 - 1);
    System.out.printf("%5.0f", mp);
    System.out.println("");
    }One of the best things you can do at this point, if it's not thee very best thing, is to get your debugger out and find out how to use it. Your code ran as you posted it, but your algorithm is not right and numbers you are calculating do not even make sense--all of them output as NaN (not a number). Take each feature of your assignment and code it 1 piece at a time tracing each seeing that the numbers you calculate make sense, and as you get that piece to work, move on to the next feature of your assignment. This way you don't write out a bunch of none tested code that you don't know what it is doing.
    Throwing out code that you think is a solution that you do not know what it does and have no hope of fixing is no better than no solution at all--IMO it is far worse: you'll work attempting to fix it, not knowing what it is doing and all the time all you are building is your frustration.
    (BTW: don't think I'm singling you out and speaking harshly to you--I've been there too. Sometimes it's better to just start over. Get a handle on what needs to be done. Get a working pencil and paper model, then describe the process in an algorithm, then code from that algorithm. Implement in steps and make sure each step works before moving on to the next. There is no magic in the computer--it won't make a bad process good--on the contrary it usually makes bad things worse, you have to design a good process first to implement a good process.)

  • Please help with Berkeley DB, desperate student here

    I am a student and I have to complete a project within a week. Problem is, I never used Berkeley DB. What I am supposed to do is this...
    Basically, in the Berkeley DB, I need to implement a replication scheme for distributed real-time databases.
    The replication scheme simply allows a database which needs temporal data from another database to create a local replica of the data needed from the other database, and to receive the data in constant updates for a specified period of time. This scheme is beneficial because it eliminates the transmission delays from asking for the data every time it needs it from the remote datavabase. The recipient database will not need to keep sending a request for the data, it will automatically be sent to the replica in specified time increments, and for a specified period of time depending on what the transaction specifies.
    The DB must support transactions. This is ideally meant for real time databases too.
    Could you please tell me who could help me implement this? I really need help with this as soon as possible. I don't know where to get started regarding installing the correct DB, starting it up, and putting in sample data. I need a accurate step by step instruction for which DB to install, how to install it, and how to install sample data and how to access the data, and then how to proceed to modify it so that it can support the replication I mentioned above. Everything. I am new to this. ANyone's help would be the best. Thank you.

    Alan, thanks for chiming in. I am in the process of reading the link you posted. Thank you. At this point, after having installed Berkeley DB 4.5.20, are there some preliminary steps that you can outline for me in terms of setting up a sample database and getting started? Is there a step-by-step somewhere on the site? After I do that, and then study the link you sent, it is my intent to dive into the code and make the adjustments/additions I need to model the algorithm I need to accomplish.
    Disregard my time constraint which I mentioned earlier. I simply need to get everything running as a workable DB with data at this point, and then I can dive into the replication material. Let me know, and thanks for your help.
    Ron, sorry for the multiple posts. I was initially trying to post in categories which I believed were relevant to my situation. I will stick to this thread.

  • Stored procedure to update particular key column with increment of +1

    Hi,
    This is my table
    EMPID,NAME
    1 SSS
    2 AAA
    I NEED STORED PROCEDURE TO UPDATE EMPID WITH INCREMENT OF +1.BASED ON
    MAX(EMPID).fOr example if i execute stored procedure once it will update empid 2 as 3,
    if i run same procedure again it will take increment +1 then emp id should be 4 like that i want output.
    Any one please help me on this scenario...

    937506 wrote:
    Hi All,
    I have two tables,one is date dimension table,one is fact table.
    when we load data through informatica (source as csv file),then key will be populated in fact table based on lookup on
    date dimension table.it will create corresponding date key in fact table.
    My scenario:we load data in to fact table with etl with "n" number of records only once at a time.
    But next time onwords we will update that datekey in fact table through stored procedure.stored procedure
    will take only max(date_key) from fact table then update that key as like +1(logic n+1)
    If i run stored procedure nextday it will update that record with increment +1.
    we wil schedule this storedprocedure to run daily once.For this i need stored procedure..
    I think you will clear now................
    thxSo, are you saying you want to keep the same data you loaded "yesterday" but update the date_key so it appears as if it was from today?
    Still seems strange: why aren't you loading today's data?
    Also, you are assuming that the date_key in the date dimension table increments with no gaps: if it was sequence generated, that might not be true.

  • Help with Threads

    I need help with threads. How can I break this code into teo threads without chaning the data objects at all? Producer will produce string line by line and consumer will take the line and search for the word. Help me please.
    Thank you
    public class WordFinder
    * Main program opens the file given by the user as an argument and
    * searches for the word given by the user. If the word is found,
    * the line number on which the word occurs is displayed.
    * @param args[0] Word to search for
    * @param args[1] Name of file to search
    public static void main(String[] args) throws IOException
    // To keep track of how long the program runs we'll set the startTime
    // variable to the current time in milliseconds and use that at
    // the end of the program to find out how long we ran.
    long startTime = System.currentTimeMillis();
    String wordToFind;
    String currentLine;
    int lineCount = 0; // Keep track of line numbers
    BufferedReader inputFile = null; // Needed to get compiler to quit
    // complaining about uninitialized
    // variables.
    // Make sure we have 2 arguments passed to us
    if (args.length < 2)
    // Nope. Show user how to run and then exit with an error (1)
    System.out.println("usage: java WordFinder <word> <file pathname>");
    System.exit(1);
    // So far, so good. Now try to open the file the user gave us as
    // a parameter. We'll use a BufferedReader object to read the file
    // so we can read one line at a time from the input. If opening the
    // file fails, print an error message and exit with an error (1).
    try
    inputFile = new BufferedReader(new FileReader(args[1]));
    catch (FileNotFoundException e)
    System.out.println(args[1] + ": File not found or is not readable");
    System.exit(1);
    // Set the wordToFind variable to refer to args[0]. We don't
    // really need to do this, but it makes our code more readable
    wordToFind = args[0];
    // We're going to read the file one line at a time. For each
    // line, we'll create a StringTokenizer object to break the line
    // into distinct words, checking each word to see if it's the same
    // as the given search word.
    // Read first line from the file
    currentLine = inputFile.readLine();
    while (currentLine != null) // Repeat until we reach EOF
    // Have a valid input line, increment the counter
    lineCount++;
    // Create a StringTokenizer object over the current line
    StringTokenizer tokens = new StringTokenizer(currentLine);
    // Check each word in the string by accessing each token
    while (tokens.hasMoreTokens())
    // See if the next word is the one we're looking for and
    // advance the token iterator to the next token
    if (wordToFind.equals(tokens.nextToken()))
    // Yes, display the current line number
    System.out.println(wordToFind + " found on line " + lineCount);
    // Read next line from the file
    currentLine = inputFile.readLine();
    } // while
    // Done with the input file
    inputFile.close();
    // Display the running time of this program in milliseconds by
    // subtracting the start time from the current time
    System.out.println((System.currentTimeMillis() - startTime) + " milliseconds");
    } // main
    } // WordFinder

    You may create Queue object. (I guess that you're already know QUEUE)
    Then ... use producer thread to load input file into queue. (Enqueue)
    Consumer ... dequeue
    Queue can be empty because of
    - Input file was read to EOF and Consumer had produced all queue.
    or
    - Cunsumer works too fast... So the queue is empty.
    So, you may have to use ... wait() in Consumer in case of the queue is empty.
    And use notify() in Producer to wake up consumer ...
    Is this right ?

Maybe you are looking for