- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell script using Oracle's RMAN
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
тАО03-05-2004 01:18 AM
тАО03-05-2004 01:18 AM
delete expired archivelogs all;
The command return 2 different results:
1) when it find expired archivelogs, it ask for confirmation:
Do you really want to delete the above objects (enter YES or NO)?
2) when it didn't find expired archivelogs, it return a message:
specification does not match any archive log in the recovery catalog
My script look like this:
rman target sys/pwd@PRCV catalog rman/rman@DRMAN <
delete expired archivelog all;
YES
release channel;
EOF
I worked fine if it find expired archivelogs. Otherwise it returned error message because it couldn't recognize "YES". How to make the script work under either conditions?
Any help on this will be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 02:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 02:52 AM
тАО03-05-2004 02:52 AM
Re: shell script using Oracle's RMAN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 03:05 AM
тАО03-05-2004 03:05 AM
Re: shell script using Oracle's RMAN
You may try with force.
Michael
FORCE
Deletes specified files (whether or not they exist on the media) and removes repository records. RMAN ignores any I/O errors for the deleted objects. RMAN displays the number of deleted objects at the end of the job.
NOPROMPT
Deletes specified files without first listing the files or prompting for confirmation. The DELETE NOPROMPT command still displays each item as it is deleted. By default, DELETE displays files and then prompts for confirmation. If the user confirms, then RMAN shows each item as it is deleted. If you are running commands from a command file, then NOPROMPT is the default.
EXPIRED
Removes only files whose status in the repository is EXPIRED. RMAN marks backups and copies as expired when you run a CROSSCHECK command and the files are absent or inaccessible. To determine which files are expired, run a LIST EXPIRED command.
Note: Beginning in Oracle9i, RMAN's default behavior is to prompt for confirmation when you run DELETE EXPIRED. In prior releases, RMAN did not prompt.
BACKUP
Deletes backup sets, backup pieces, and proxy copies. By default, RMAN deletes backups of the whole database. Specify the EXPIRED option to remove only backups that are marked EXPIRED in the repository. The KEY column of the LIST output indicates the primary key usable in the CHANGE and DELETE commands.
COPY
Deletes datafile copies, archived redo logs, and image copies of archived redo logs. By default, DELETE ... COPY removes copies of all files in the database. Specify the EXPIRED option to remove only copies that are marked EXPIRED in the repository
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 03:08 AM
тАО03-05-2004 03:08 AM
Re: shell script using Oracle's RMAN
this should work too:
delete noprompt expired archivelog all;
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 03:15 AM
тАО03-05-2004 03:15 AM
Re: shell script using Oracle's RMAN
When I do "noprompt", I got:
RMAN> delete noprompt expired archivelogs all;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01005: syntax error: found "identifier": expecting one of: "archivelog, backup, backuppiece, ba
ckupset, copy, controlfilecopy, datafilecopy, proxy"
RMAN-01008: the bad identifier was: archivelogs
RMAN-01007: at line 2 column 26 file: standard input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 03:20 AM
тАО03-05-2004 03:20 AM
Re: shell script using Oracle's RMAN
in case you didn't notice. In my last post the archivelog has no s at the end. ;-)
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-05-2004 04:21 AM
тАО03-05-2004 04:21 AM
Re: shell script using Oracle's RMAN
Duncan - your response was actually correct, except that there is an extra "s" after archivelog. Thanks!