- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- RMAN script to delete archive file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 07:59 AM
тАО08-18-2008 07:59 AM
In my RMAN backup script I backup the database, and archivelogs, I would then like to run a script that will run a query on dba_logmnr_log
Where KEEP =NO, and then delete the archive log.
Can I run a loop from within RMAN.
So, query dba_logmnr_log. Where KEEP=NO
Store sequence number, then run a loop to delete the archive log.
--RMAN> connect target /
--RMAN> crosscheck archivelog all;
--RMAN> delete archivelog sequence=###;
--RMAN> crosscheck archivelog all;
Has anyone done this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2008 10:57 AM
тАО08-18-2008 10:57 AM
Re: RMAN script to delete archive file
The only way to do this is to dynamically generate the rman script and run it.
e.g Use SQL and spool command to generate the scripts.
hope this helps!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2008 02:12 AM
тАО08-19-2008 02:12 AM
SolutionI don't have streams neither 10g here but why don't you backup and delete the archivelogs in your rman backup script:
run{
...
backup
archivelog all delete input;
}
Best Regards,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2008 09:23 AM
тАО08-19-2008 09:23 AM
Re: RMAN script to delete archive file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2008 04:05 AM
тАО08-25-2008 04:05 AM
Re: RMAN script to delete archive file
As Yogeeraj already said, the only way to do this is to dynamically generate the script and execute it after.
It would be something like this:
select
'run { allocate channel ''dev_0'' type ''sbt_tape'' backup archivelog from sequence = '
||min(al.sequence#)||' until sequence = '||max(al.sequence#)||' delete input;'
||'}'
from v$archived_log al
This works for me for v$archived_log: just change v$archived_log to dba_logmnr_log and, if sequence# doesn't exists, the approriate column. Finally, add it the "where KEEP=NO" clause:
select
'run { allocate channel ''dev_0'' type ''sbt_tape'' backup archivelog from sequence = '
||min(dll.sequence#)||' until sequence = '||max(dll.sequence#)||' delete input;'
||'}'
from dba_logmnr_log dll
where KEEP=NO
Best Regards,
Eric Antunes