<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.twig.es/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Oracle_RMAN_production_script</id>
		<title>Oracle RMAN production script - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Oracle_RMAN_production_script"/>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Oracle_RMAN_production_script&amp;action=history"/>
		<updated>2026-05-06T15:09:28Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.0</generator>

	<entry>
		<id>https://wiki.twig.es/index.php?title=Oracle_RMAN_production_script&amp;diff=3634&amp;oldid=prev</id>
		<title>George2 at 09:04, 11 October 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Oracle_RMAN_production_script&amp;diff=3634&amp;oldid=prev"/>
				<updated>2016-10-11T09:04:47Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 09:04, 11 October 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# First attempt at ONLINE RMAN backup scripts - by xxxxxxxxx modified by xxxxxxxxx July 2010&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# First attempt at ONLINE RMAN backup scripts - by xxxxxxxxx modified by xxxxxxxxx July 2010&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# remark xxxxxxxxx, restore without catalog must use DBID, here is the current &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;aleph20 &lt;/del&gt;DBID=&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;1911789030&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# remark xxxxxxxxx, restore without catalog must use DBID, here is the current &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;db_name&amp;gt; &lt;/ins&gt;DBID=&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;xxxxxxxxxxx&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Make sure only oracle can run our script&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Make sure only oracle can run our script&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>George2</name></author>	</entry>

	<entry>
		<id>https://wiki.twig.es/index.php?title=Oracle_RMAN_production_script&amp;diff=3633&amp;oldid=prev</id>
		<title>George2 at 09:04, 11 October 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Oracle_RMAN_production_script&amp;diff=3633&amp;oldid=prev"/>
				<updated>2016-10-11T09:04:24Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 09:04, 11 October 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#!/bin/bash&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#!/bin/bash&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# First attempt at ONLINE RMAN backup scripts - by &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Charleston Chin, &lt;/del&gt;modified by xxxxxxxxx July 2010&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# First attempt at ONLINE RMAN backup scripts - by &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;xxxxxxxxx &lt;/ins&gt;modified by xxxxxxxxx July 2010&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# remark xxxxxxxxx, restore without catalog must use DBID, here is the current aleph20 DBID=1911789030&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# remark xxxxxxxxx, restore without catalog must use DBID, here is the current aleph20 DBID=1911789030&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>George2</name></author>	</entry>

	<entry>
		<id>https://wiki.twig.es/index.php?title=Oracle_RMAN_production_script&amp;diff=3631&amp;oldid=prev</id>
		<title>George2: Created page with &quot;&lt;source lang=&quot;bash&quot;&gt; #!/bin/bash # # First attempt at ONLINE RMAN backup scripts - by Charleston Chin, modified by xxxxxxxxx July 2010 # # remark xxxxxxxxx, restore without ca...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Oracle_RMAN_production_script&amp;diff=3631&amp;oldid=prev"/>
				<updated>2016-10-11T08:40:02Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt; #!/bin/bash # # First attempt at ONLINE RMAN backup scripts - by Charleston Chin, modified by xxxxxxxxx July 2010 # # remark xxxxxxxxx, restore without ca...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# First attempt at ONLINE RMAN backup scripts - by Charleston Chin, modified by xxxxxxxxx July 2010&lt;br /&gt;
#&lt;br /&gt;
# remark xxxxxxxxx, restore without catalog must use DBID, here is the current aleph20 DBID=1911789030&lt;br /&gt;
#&lt;br /&gt;
# Make sure only oracle can run our script&lt;br /&gt;
if [ &amp;quot;$(id -u)&amp;quot; != &amp;quot;101&amp;quot; ]; then&lt;br /&gt;
   echo &amp;quot;This script must be run as user Oracle \n&amp;quot; 1&amp;gt;&amp;amp;2&lt;br /&gt;
   exit 1&lt;br /&gt;
fi&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
#set ORACLE_HOME&lt;br /&gt;
ORACLE_HOME=/xxxxxx/app/oracle/product/11&lt;br /&gt;
ORACLE_SID=xxxxxxxx&lt;br /&gt;
export ORACLE_HOME ORACLE_SID&lt;br /&gt;
dayofweek=`date +%a`&lt;br /&gt;
#&lt;br /&gt;
BACKUP_LOCATION=/rman_nfs&lt;br /&gt;
BACKUP_LOGS=/rman_nfs/logs/rman_backup`date +%Y%m%d`.log&lt;br /&gt;
&lt;br /&gt;
if [ &amp;quot;$dayofweek&amp;quot; = &amp;quot;Thu&amp;quot; ]; then&lt;br /&gt;
   backuptype=&amp;quot;BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG delete all input&amp;quot;&lt;br /&gt;
else&lt;br /&gt;
   backuptype=&amp;quot;RECOVER copy of database with tag 'incremental_backup' until time 'sysdate-7'; BACKUP INCREMENTAL LEVEL 1 FOR RECOV&lt;br /&gt;
ER OF COPY WITH TAG 'incremental_backup' DATABASE PLUS ARCHIVELOG delete all input&amp;quot;&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo =========================&lt;br /&gt;
echo Backup Started : $(date)&lt;br /&gt;
echo =========================&lt;br /&gt;
before=&amp;quot;$(date +%s)&amp;quot;&lt;br /&gt;
### Dont' shutdown oracle as we are doing ONLINE BACKUP&lt;br /&gt;
#$ORACLE_HOME/bin/dbshut $ORACLE_HOME &amp;gt;&amp;amp; $ORACLE_HOME/dbshut.log&lt;br /&gt;
$ORACLE_HOME/bin/rman target / log=${BACKUP_LOGS} &amp;lt;&amp;lt;EOF&lt;br /&gt;
RUN&lt;br /&gt;
{&lt;br /&gt;
         CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;&lt;br /&gt;
         CONFIGURE COMPRESSION ALGORITHM 'ZLIB';&lt;br /&gt;
         CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;&lt;br /&gt;
         CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '${BACKUP_LOCATION}/database_f%t_s%s_s%p';&lt;br /&gt;
         CONFIGURE BACKUP OPTIMIZATION ON;&lt;br /&gt;
         CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;br /&gt;
         CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '${BACKUP_LOCATION}/controlfile_%F';&lt;br /&gt;
         allocate CHANNEL m1 TYPE DISK FORMAT '${BACKUP_LOCATION}/database_f%t_s%s_s%p';&lt;br /&gt;
         CROSSCHECK BACKUP;&lt;br /&gt;
         CROSSCHECK ARCHIVELOG ALL;&lt;br /&gt;
         # backup recovery area;  only backup recovery area to local tape drive&lt;br /&gt;
         DELETE NOPROMPT FORCE EXPIRED BACKUP;&lt;br /&gt;
         DELETE NOPROMPT FORCE EXPIRED ARCHIVELOG ALL;&lt;br /&gt;
         DELETE NOPROMPT FORCE OBSOLETE;&lt;br /&gt;
         ${backuptype};&lt;br /&gt;
         BACKUP CURRENT CONTROLFILE;&lt;br /&gt;
         release CHANNEL m1;&lt;br /&gt;
}&lt;br /&gt;
EXIT&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
after=&amp;quot;$(date +%s)&amp;quot;&lt;br /&gt;
elapsed_seconds=&amp;quot;$(expr $after - $before)&amp;quot;&lt;br /&gt;
echo &amp;quot;&amp;quot;&lt;br /&gt;
echo =========================&lt;br /&gt;
echo Backup Ended : $(date)&lt;br /&gt;
echo =========================&lt;br /&gt;
echo Elapsed time: $(date -d &amp;quot;1970-01-01 $elapsed_seconds sec&amp;quot; +%H:%M:%S)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if grep -q &amp;quot;error&amp;quot; $BACKUP_LOGS 1&amp;gt; /dev/null&lt;br /&gt;
then&lt;br /&gt;
  echo &amp;quot;&amp;quot;&lt;br /&gt;
  echo &amp;quot;Error! RMAN backup error&amp;quot;&lt;br /&gt;
  echo &amp;quot;=====&amp;quot;&lt;br /&gt;
  cat $BACKUP_LOGS&lt;br /&gt;
  echo &amp;quot;=====&amp;quot;&lt;br /&gt;
  ### email us for failure backup with the attachment of the $BACKUP_LOGS&lt;br /&gt;
else&lt;br /&gt;
  echo &amp;quot;&amp;quot;&lt;br /&gt;
  echo &amp;quot;Success RMAN Backup -&amp;quot; .$BACKUP_LOGS&lt;br /&gt;
  echo &amp;quot;=====&amp;quot;&lt;br /&gt;
  cat $BACKUP_LOGS&lt;br /&gt;
  echo &amp;quot;=====&amp;quot;&lt;br /&gt;
  ### email us for successful backup with the attachment of the $BACKUP_LOGS&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>George2</name></author>	</entry>

	</feed>