-
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
-
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.
-
Hi Davey
I thought the copy will complete before the third script is executed. What do you suggest please?
Your advise is appreciated.
Thanks
-
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!
-
Originally Posted by naa_lomo
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.
-
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
-
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
-
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.
-
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.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|