DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: Hotbackup Script - ORA-01142: cannot end online backup -

  1. #1
    Join Date
    Apr 2007
    Posts
    33

    Hotbackup Script - ORA-01142: cannot end online backup -

    My hotbackup log is reporting:

    ORA-01142: cannot end online backup - none of the files are in backup

    None of the files are in backup mode prior to running the script but this error is still being reported. Not sure why the tablespaces are not being placed in a backup mode.


    1* select file#, status from v$backup
    SQL> /

    FILE# STATUS
    ---------- ------------------
    1 NOT ACTIVE
    2 NOT ACTIVE
    3 NOT ACTIVE
    4 NOT ACTIVE
    5 NOT ACTIVE
    6 NOT ACTIVE
    7 NOT ACTIVE
    8 NOT ACTIVE
    9 NOT ACTIVE
    10 NOT ACTIVE
    11 NOT ACTIVE

    A section of the hotbackup script :

    alter tablespace SYSTEM begin backup ;
    HOST OCOPY E:\ORACLE\ORADATA\TESTDB\SYSTEM01.DBF E:\Backup\hotbackup
    alter tablespace SYSTEM end backup ;

    The database is in archivelog mode, database version 9201.

    Please let me know why this is being reported.

    Thanks

    Naa

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    well your script is trying to end the backup mode with the files not being in the backup mode
    Last edited by davey23uk; 02-09-2009 at 06:00 AM.

  3. #3
    Join Date
    Apr 2007
    Posts
    33
    Hi Davey

    I thought the copy will complete before the third script is executed. What do you suggest please?

    Your advise is appreciated.

    Thanks

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    its your script, you need to see what it is doing, the error is quite clear - the datafile files arent in backup mode when you are running that command!

  5. #5
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Quote Originally Posted by naa_lomo View Post
    I thought the copy will complete before the third script is executed. What do you suggest please?
    ... does it means you have divided your backup procedure into several independent scripts?

    Just to be clear, could you describe your backup process?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  6. #6
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Talking Use RMAN!

    An easier and better way to do backup's is using RMAN -- kinda like these commands:
    Code:
    run {
    allocate channel c0 type disk;
    allocate channel c1 type disk;
    allocate channel c2 type disk;
    allocate channel c3 type disk;
    BACKUP  DATABASE 
      FORMAT 'E:\Backup\hotbackup\RMAN\%d_dbf_%s_%t%u'
      PLUS ARCHIVELOG DELETE INPUT;
    }
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  7. #7
    Join Date
    Apr 2007
    Posts
    33
    I have a batch script run_hotbackup_exchange.bat with this script:

    sqlplus " / as sysdba" @C:\support\hotbackup\hotbackup_exchange.sql


    Hotbackup_exchange.sql

    rem --------SYSTEM -------------------
    alter tablespace SYSTEM begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\SYSTEM01.DBF E:\Backup\hotbackup
    alter tablespace SYSTEM end backup ;

    rem --------UNDOTBS1 -------------------
    alter tablespace UNDOTBS1 begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\UNDOTBS01.DBF E:\Backup\hotbackup
    alter tablespace UNDOTBS1 end backup ;

    rem -------- CWMLITE -------------------
    alter tablespace CWMLITE begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\CWMLITE01.DBF E:\Backup\hotbackup
    alter tablespace CWMLITE end backup ;

    rem -------- DRSYS -------------------
    alter tablespace DRSYS begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\DRSYS01.DBF E:\Backup\hotbackup
    alter tablespace DRSYS end backup ;

    rem -------- EXAMPLE-------------------
    alter tablespace EXAMPLE begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\EXAMPLE01.DBF E:\Backup\hotbackup
    alter tablespace EXAMPLE end backup ;

    rem -------- INDX-------------------
    alter tablespace INDX begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\INDX01.DBF E:\Backup\hotbackup
    alter tablespace INDX end backup ;


    rem -------- ODM-------------------
    alter tablespace ODM begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\ODM01.DBF E:\Backup\hotbackup
    alter tablespace ODM end backup ;


    rem -------- TOOLS-------------------
    alter tablespace TOOLS begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\TOOLS01.DBF E:\Backup\hotbackup
    alter tablespace TOOLS begin backup ;


    rem -------- USERS -------------------
    alter tablespace USERS begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\USERS01.DBF E:\Backup\hotbackup
    alter tablespace USERS begin backup ;

    rem -------- XDB-------------------
    alter tablespace XDB begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\XDB01.DBF E:\Backup\hotbackup
    alter tablespace XDB end backup ;


    rem -------- EXCHANGE-------------------
    alter tablespace EXCHANGE begin backup ;
    host D:\oracle\ora92\bin\ocopy E:\ORACLE\ORADATA\EXCHANGE\EXCHANGE.DBF E:\Backup\hotbackup
    alter tablespace EXCHANGE end backup ;

    The status of v$backup is NOT ACTIVE. The alter tablespace begin backup is not putting it in backup mode. Query of v$backup still shows its as NOT ACTIVE.

    Sorry to be bothering you with a simple script which does not run , I find this puzzling.

    I just want to knock together an old fashion script to do the backup before I look into RMAN.

    Thank you for your time.

    Naa

  8. #8
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Some of your tablespaces like TOOLS have two begin backup and no end backup.

    Either way, what do you see in alert log?
    Last edited by PAVB; 02-09-2009 at 01:32 PM.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  9. #9
    Join Date
    Apr 2007
    Posts
    33
    Thanks well spotted, I copied the wrong script. I deleted all the rems and dotted lines in my script and this works without errors.

    Thank you all.

  10. #10
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Glad it worked out
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width