- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: RMAN script through cron
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
тАО06-11-2003 08:18 AM
тАО06-11-2003 08:18 AM
Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2003 08:24 AM
тАО06-11-2003 08:24 AM
Re: RMAN script through cron
how do you schedule it ?
Can you prompt the line ?
I used RMAN from cron and it worked for me.
POut your command in a text file, called some.sql
and run
rman ....... @some.sql
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2003 08:42 AM
тАО06-11-2003 08:42 AM
Re: RMAN script through cron
su - c oracle "script command"
along with the normal shell redirection you use in cron.
This assumes your oracle db owner is oracle. Change that to fit your circumstances.
In the command section include the full path name of the script to execute.
To diagnose problems with the actual script, I would need to see a copy. You should be able to attach it.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-11-2003 08:50 AM
тАО06-11-2003 08:50 AM
Re: RMAN script through cron
If you're using su - oracle then you need to ensure that there is nothing in oracle's .profile that will need a response or tty. It would probably be safer to use su oracle; then source a file containing the necessary environmental setup. Otherwise you risk running into the "not a typewriter" type messages.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 01:40 AM
тАО06-12-2003 01:40 AM
Re: RMAN script through cron
1> #!/bin/sh
2> export ORACLE_SID=TMSPROD
3> export ORACLE_HOME=/oracle1/oracle/product/920
4> export RMAN=$ORACLE_HOME/bin/rman
5> cd /backup/TMSPROD/RMAN
6> cp tmsprod* /backup/TMSPROD/RMAN/old
7> rm tmsprod*
8> rman target / rcvcat rman/rman@tmsprod
9> run {
10> allocate channel c1 type disk
11> format '/backup/TMSPROD/RMAN/tmsprod_%U.dmp';
12> backup (database include current controlfile);
13> release channel c1;
14> allocate channel c1 type disk
15> format '/backup/TMSPROD/RMAN/tmsprod_al_%U.dmp;
16> sql "alter system archive log current";
17> backup (archivelog all delete input);
18> release channel c1;
19> }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 01:43 AM
тАО06-12-2003 01:43 AM
Solutionyou are doing a wrong re-direction on input (read: no redirection).
Script should be
1> #!/bin/sh
2> export ORACLE_SID=TMSPROD
3> export ORACLE_HOME=/oracle1/oracle/product/920
4> export RMAN=$ORACLE_HOME/bin/rman
5> cd /backup/TMSPROD/RMAN
6> cp tmsprod* /backup/TMSPROD/RMAN/old
7> rm tmsprod*
8> rman target / rcvcat rman/rman@tmsprod << EOF
9> run {
10> allocate channel c1 type disk
11> format '/backup/TMSPROD/RMAN/tmsprod_%U.dmp';
12> backup (database include current controlfile);
13> release channel c1;
14> allocate channel c1 type disk
15> format '/backup/TMSPROD/RMAN/tmsprod_al_%U.dmp;
16> sql "alter system archive log current";
17> backup (archivelog all delete input);
18> release channel c1;
19> }
20> EOF
or better:
put the
run (..)
in a sql called backup.sql
and start your script calling it
rman target / rcvcat .... @backup.sql
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 01:46 AM
тАО06-12-2003 01:46 AM
Re: RMAN script through cron
I know very little about RMAN, but I can see that you are trying to run internal RMAN commands through the posix shell... You will need to put the RMAN commands into a file and get RMAN to execute them, or perhaps use a here document .
To ease testing you could run the script manually from the command line rather than via cron as this is not a cron issue.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 02:10 AM
тАО06-12-2003 02:10 AM
Re: RMAN script through cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 03:12 AM
тАО06-12-2003 03:12 AM
Re: RMAN script through cron
[logtms01]/backup/scripts=$ ./tmsprod.sh
cp: cannot access tmsprod*: No such file or directory
rm: tmsprod* non-existent
Recovery Manager: Release 9.2.0.3.0 - 64bit Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database (not started)
connected to recovery catalog database
RMAN> run {
2> resync catalog;
3> change archivelog all crosscheck;
4> backup format '/backup/tmsprod/tmsprod_%U.dmp'
5> (database
6> include current controlfile);
7> backup format '/backup/tmsprod/tmsprod_%U.arc'
8> (archivelog all delete input);
9> }
10>
11>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of resync command at 06/12/2003 12:11:33
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
HP-UX Error: 2: No such file or directory
Recovery Manager complete.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-12-2003 03:18 AM
тАО06-12-2003 03:18 AM