We have a mix of Oracle version starting from 8.1.7
Right now I have a few lines in the RMAN Hotbackup script that extracts the info (success or error) from the RMAN log and write into on my tables with the following info:
hostname, instance_name, start_time, end_time, status (varchar2(4000))
# Start of Code HOST=$(hostname) PROGRAM=${0##*/} START_TIME=$(date '+%m/%d/%y %X') BACKUP_LOGFILE="..../.../rman_backup.log"
if [[ -z "$STATUS" ]] then STATUS="Backup Successful" fi
$ORACLE_HOME/bin/sqlplus -S <<EOF / as sysdba
prompt Inserting Backup timing info into system.XXX_backup_status prompt START_TIME=$START_TIME END_TIME=$END_TIME STATUS=$STATUS
insert into system.XXXX_backup_status (INSTANCE_NAME,HOST_NAME,SCRIPT_NAME,START_TIME,END_TIME,STATUS) values ('$ORACLE_SID','$HOST','$PROGRAM',to_date('$START_TIME','MM/DD/YY HH24:MI:SS'), to_date('$END_TIME','MM/DD/YY HH24:MI:SS'),'$STATUS');
EOF
# End of Code
The SED is to remove the blank lines, other wise INSERT complains.
IF there are no errors then STATUS string will be zero, so I assume Backup is successful.
I am only hoping that VARCAHR2(4000) should be good enough to hold any type of RMAN Error message. Please note, I am collecting all the error messages lines, not just the last error message line.
Regards & Thanks BN
On 12/28/05, Johnson, George <GJohnson@(protected)> wrote: > > > I was under the impression that this was already stored or is that > only under 10g and with central catalog? I just remember reading something > about this in a tech doc somewhere. > > Rgds > > -- --Original Message-- -- > From: oracle-l-bounce@(protected) [mailto:oracle-l-bounce@(protected)] > On Behalf Of Grant Allen > Sent: 28 Dec 2005 7:34 > To: bnsarma@(protected) > Cc: lazydba > Subject: Re: Saving Backup Errros inside the db > > > BN wrote: > > > Greetings, > > > > I would like to save the following RMAN error messages inside a table > > along with the timestamp > > > > RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS > > > [snip] > > > Can somebody suggest me how I can do this. I want to save the new > > lines, as they appear in the error message. > > > > Am I looking at a CLOB or do I have other options. > > > BN - others are already suggesting the post-backup shell script, but you > do have options other than CLOB. You can save the new lines with some > easy regex work and the ever-useful chr(10) or chr(13)||chr(10) trick > (depending on your OS). This means you can opt for char or varchar2, > which you might find *much* easier to use in the long run. > > Ciao > Fuzzy > :-) > -- > http://www.freelists.org/webpage/oracle-l > > > > > **************************************************************************** > This message contains confidential information and is intended only > for the individual or entity named. If you are not the named addressee > you should not disseminate, distribute or copy this e-mail. > Please notify the sender immediately by e-mail if you have received > this e-mail by mistake and delete this e-mail from your system. > E-mail transmission cannot be guaranteed to be secure or error-free > as information could be intercepted, corrupted, lost, destroyed, arrive > late or incomplete, or contain viruses. The sender therefore does not > accept liability for any errors or omissions in the contents of this > message which arise as a result of e-mail transmission. > If verification is required please request a hard-copy version. > This message is provided for informational purposes and should not > be construed as an invitation or offer to buy or sell any securities or > related financial instruments. > GAM operates in many jurisdictions and is > regulated or licensed in those jurisdictions as required. > > **************************************************************************** > >
-- Regards & Thanks BN
<div>Greetings,</div> <div> </div> <div>Thank you all for your reply...</div> <div> </div> <div>We have a mix of Oracle version starting from 8.1.7</div> <div> </div> <div>Right now I have a few lines in the RMAN Hotbackup script that extracts the info (success or error) from the RMAN log and write into on my tables with the following info:</div> <div> </div> <div>hostname, instance_name, start_time, end_time, status (varchar2(4000) )</div> <div> </div> <div># Start of Code</div> <div>HOST=$(hostname)</div> <div>PROGRAM=${0##*/}</div> <div>START_TIME=$(date '+%m/%d/%y %X')</div> <div>BACKUP_LOGFILE="..../.../rman_backup.log"</div> <div> </div> <div>exec 2>&1 >> $BACKUP_LOGFILE</div> <div> </div> <div>RMAN Backup commands {}</div> <div> </div> <div>END_TIME=$(date '+%m/%d/%y %X')</div> <div> </div> <div>STATUS=$(awk '/ERROR MESSAGE STACK FOLLOWS/,/RMAN>/ {print $0}' <$ {BACKUP_LOGFILE}|sed '/^$/d')</div> <div> </div> <div>if [[ -z "$STATUS" ]]<br>then<br> STATUS=" ;Backup Successful"<br>fi<br> </div> <div> <p>$ORACLE_HOME/bin/sqlplus -S <<EOF<br>/ as sysdba</p> <p>prompt Inserting Backup timing info into system.XXX_backup_status<br>prompt START_TIME=$START_TIME END_TIME=$END_TIME STATUS=$STATUS</p> <p>insert into system.XXXX_backup_status<br>   ; (INSTANCE_NAME,HOST_NAME,SCRIPT_NAME,START_TIME,END_TIME,STATUS)<br> values<br> ('$ORACLE_SID','$HOST',' $PROGRAM',to_date('$START_TIME','MM/DD/YY HH24:MI:SS'),<br> to_date('$END_TIME','MM/DD/YY HH24:MI:SS') ,'$STATUS');</p> <p>EOF<br></p> <p># End of Code</p> <p>The SED is to remove the blank lines, other wise INSERT complains.</p></div> <div> </div> <div>IF there are no errors then STATUS string will be zero, so I assume Backup is successful.</div> <div> </div> <div>I am only hoping that VARCAHR2(4000) should be good enough to hold any type of RMAN Error message. Please note, I am collecting all the error messages lines, not just the last error message line.</div> <div> </div> <div>Regards & Thanks</div> <div>BN<br><br> </div> <div><span class="gmail_quote">On 12/28/05, <b class="gmail_sendername">Johnson , George</b> <<a href="mailto:GJohnson@(protected)">GJohnson@(protected)</a>> wrote:</span> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0 .8ex; BORDER-LEFT: #ccc 1px solid"><br> I was under the impression that this was already stored or is that only under 10g and with central catalog? I just remember reading something about this in a tech doc somewhere. <br><br> Rgds<br><br>-- --Original Message- ----<br>From: <a href="mailto:oracle-l-bounce@(protected)">oracle-l-bounce @(protected)</a> [mailto:<a href="mailto:oracle-l-bounce@(protected)">oracle -l-bounce@(protected) </a>] On Behalf Of Grant Allen<br>Sent: 28 Dec 2005 7:34<br>To: <a href="mailto :bnsarma@(protected)">bnsarma@(protected)</a><br>Cc: lazydba<br>Subject: Re: Saving Backup Errros inside the db<br><br><br>BN wrote:<br><br>> Greetings, <br>><br>> I would like to save the following RMAN error messages inside a table<br>> along with the timestamp<br>><br>> RMAN-00569: ========== ===== ERROR MESSAGE STACK FOLLOWS<br>><br>[snip]<br><br>> Can somebody suggest me how I can do this. I want to save the new <br>> lines, as they appear in the error message.<br>><br>> Am I looking at a CLOB or do I have other options.<br><br><br>BN - others are already suggesting the post-backup shell script, but you<br>do have options other than CLOB. You can save the new lines with some <br>easy regex work and the ever-useful chr(10) or chr(13)||chr(10) trick<br> (depending on your OS). This means you can opt for char or varchar2, <br>which you might find *much* easier to use in the long run.<br><br>Ciao<br> Fuzzy<br>:-)<br>--<br><a href="http://www.freelists.org/webpage/oracle-l">http: //www.freelists.org/webpage/oracle-l</a><br><br><br><br>************************ ****************************************************<br>This message contains confidential information and is intended only <br>for the individual or entity named. If you are not the named addressee<br>you should not disseminate, distribute or copy this e-mail.<br >Please notify the sender immediately by e-mail if you have received<br>this e -mail by mistake and delete this e-mail from your system. <br>E-mail transmission cannot be guaranteed to be secure or error-free<br>as information could be intercepted, corrupted, lost, destroyed, arrive<br>late or incomplete, or contain viruses. The sender therefore does not<br> accept liability for any errors or omissions in the contents of this<br>message which arise as a result of e-mail transmission.<br>If verification is required please request a hard-copy version.<br>This message is provided for informational purposes and should not <br>be construed as an invitation or offer to buy or sell any securities or<br >related financial instruments.<br>GAM operates in many jurisdictions and is<br >regulated or licensed in those jurisdictions as required.<br>****************** ********************************************************** <br><br></blockquote></div><br><br clear="all"><br>-- <br>Regards & Thanks <br>BN