<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BlogOnTap</title>
	<atom:link href="http://www.blogontap.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.blogontap.com</link>
	<description>Virtualization &#38; Storage</description>
	<lastBuildDate>Mon, 20 Jun 2011 11:44:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to add an Hyper-V cluster node with proper naming ?</title>
		<link>http://www.blogontap.com/powershell/how-to-add-an-hyper-v-cluster-node-with-proper-naming</link>
		<comments>http://www.blogontap.com/powershell/how-to-add-an-hyper-v-cluster-node-with-proper-naming#comments</comments>
		<pubDate>Mon, 20 Jun 2011 11:44:15 +0000</pubDate>
		<dc:creator>Remy Audibert</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Failover Cluster]]></category>
		<category><![CDATA[Naming]]></category>
		<category><![CDATA[Uppercase]]></category>

		<guid isPermaLink="false">http://www.blogontap.com/?p=172</guid>
		<description><![CDATA[I&#8217;m publishing this article because I ran into the issue lately. I created an Hyper-V Cluster with 3 Nodes, lets say : You noticed I used uppercase letters. In the Failover Cluster, I can see all the nodes as I added them in uppercase letters. For some reason, I had to remove one node from [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m publishing this article because I ran into the issue lately.</p>
<p>I created an Hyper-V Cluster with 3 Nodes, lets say :</p>
<div class='et-box et-shadow'>
					<div class='et-box-content'><ul>
<li>HYPERV-01</li>
<li>HYPERV-02</li>
<li>HYPERV-03</li>
</ul></div></div>
<p>You noticed I used uppercase letters.</p>
<p>In the Failover Cluster, I can see all the nodes as I added them in uppercase letters.</p>
<p>For some reason, I had to remove one node from the cluster and when I added it again using the wizard the name of the node was this one :</p>
<div class='et-box et-shadow'>
					<div class='et-box-content'><ul>
<li>hyperv-03</li>
</ul></div></div>
<p>So after some research, I found out that using the <strong>cluster</strong> command I could define correctly my node name in the cluster.</p>
<p>To do so, just open Windows Powershell with all modules and enter the following command :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">cluster.exe <span style="color: pink;">/</span>cluster:CLUSTER<span style="color: pink;">-</span>NAME <span style="color: pink;">/</span>add <span style="color: pink;">/</span>node:HYPERV<span style="color: pink;">-</span>03</pre></div></div>

<p>I hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blogontap.com/powershell/how-to-add-an-hyper-v-cluster-node-with-proper-naming/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Protect SMO for Windows backups with SnapVault ?</title>
		<link>http://www.blogontap.com/storage/how-to-protect-smo-for-windows-backups-with-snapvault</link>
		<comments>http://www.blogontap.com/storage/how-to-protect-smo-for-windows-backups-with-snapvault#comments</comments>
		<pubDate>Tue, 22 Feb 2011 22:30:56 +0000</pubDate>
		<dc:creator>Remy Audibert</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[NetApp]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SMO]]></category>
		<category><![CDATA[SnapManager For Oracle]]></category>
		<category><![CDATA[SnapVault]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.blogontap.com/?p=40</guid>
		<description><![CDATA[Introduction On UNIX servers, SnapManager for Oracle is able to protect its backups on a secondary storage system through a DataFabric Manager server. It can even restore from that secondary location. SnapManager for Oracle on Windows, on the other hand, is unfortunately not on par with the UNIX version. When you want to protect a [...]]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>On UNIX servers, <strong>SnapManager for Oracle</strong> is able to protect its backups on a secondary storage system through a DataFabric Manager server. It can even restore from that secondary location.</p>
<p><strong>SnapManager for Oracle on Windows</strong>, on the other hand, is unfortunately not on par with the UNIX version. When you want to protect a backup with it, you just can&#8217;t. The option is shaded in the graphical user interface.</p>
<p><strong>So how can we protect our backups with SnapVault then ?</strong></p>
<p>The only way is through some scripting and I&#8217;ll show you how I implemented it. But first of all, let&#8217;s take a look at the big picture here. What are the basic principles in protecting a backup with SnapVault ?</p>
<ol>
<li>First, we need to create a backup at the source with SnapManager for Oracle.</li>
<li>Then, we have to update our SnapVault relationship using the snapshots we made before.</li>
<li>Finally we can take a snapshot at the destination and our backup is protected</li>
</ol>
<p><strong>So now let&#8217;s take a look at our setup.</strong></p>
<p>We got an oracle database which Oracle SID is BLOGONTAP.</p>
<p>All files are hosted on NetApp LUNs in these volumes :</p>
<ul>
<li><strong>ora_blogontap_datavol</strong> : Data Files</li>
<li><strong>ora_blogontap_archvol </strong>: Archive Logs</li>
<li><strong>ora_blogontap_logvol </strong>: Redo Logs</li>
<li><strong>ora_blogontap_ctrlvol </strong>: Control Files</li>
<li><strong>ora_blogontap_tmpvol </strong>: Temporary Files</li>
</ul>
<p>We initialized our snapvault relationships using these commands :</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">snapvault start -S BOT1:/vol/ora_blogontap_datavol/- BOT2:/vol/svora_blogontap_backup/data
snapvault start -S BOT1:/vol/ora_blogontap_archvol/- BOT2:/vol/svora_blogontap_backup/arch
snapvault start -S BOT1:/vol/ora_blogontap_logvol/- BOT2:/vol/svora_blogontap_backup/log
snapvault start -S BOT1:/vol/ora_blogontap_ctrlvol/- BOT2:/vol/svora_blogontap_backup/ctrl</pre></div></div>

<p>In the SMO Profile properties, I edited the <strong>Snapname Pattern</strong> to be able to locate easily a new snapshot in a NetApp FlexVol.</p>
<p>Here is the Snapname Pattern I use : <strong>{db-sid}_{class}_{label}_{smid}</strong></p>
<p>As you&#8217;ll see a little further, I will create backups using custom labels. Adding the label to the snapshot name will make it possible for me to locate my last snapshot.</p>
<p><strong>Finally, you&#8217;ll need some tools.</strong></p>
<p>To create these scripts, I will use Powershell and the NetApp DataONTAP Powershell Toolkit. You&#8217;ll be able to download it from <a href="http://communities.netapp.com/community/interfaces_and_tools/data_ontap_powershell_toolkit">here</a>.</p>
<h1>So how to proceed ?</h1>
<h2>I &#8211; Creating Backups</h2>
<p>Schedule backups in SMO are identified by their auto-generated label. We will use these labels to free our backups on primary storage a few days after their creation. Unfortunately, the auto-generated labels are unpredictable. They are refering not only to the date of creation but also to the exact second of creation &#8230;</p>
<p>I don&#8217;t understand the naming convention as we do not backup our Oracle databases several times a minute. Anyway, a workaround is to create the backups ourselves using the <strong>smo backup create </strong>command. Then we will be able to specify a label name.</p>
<div class='et-box et-shadow'>
					<div class='et-box-content'>Backup at 11:30 PM on February 13, 2011 (auto-generated) : <code><strong>F_A_20110213233002CET
</strong></code>Backup at 11:30 PM on February 13, 2011 (own naming convention) : <code><strong>S_V_20110213</strong></code></div></div>
<p>So, here is the command I would use to create a backup from command line :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Command to create a daily backup with a custom label</span>
smo backup create <span style="color: #660033;">-profile</span> blogontap <span style="color: #660033;">-online</span> <span style="color: #660033;">-full</span> <span style="color: #660033;">-retain</span> <span style="color: #660033;">-daily</span> <span style="color: #660033;">-label</span> S_V_20110221
&nbsp;
<span style="color: #666666; font-style: italic;"># Command to create a daily backup with a custom auto-generated label using Windows Command line</span>
smo backup create <span style="color: #660033;">-profile</span> blogontap <span style="color: #660033;">-online</span> <span style="color: #660033;">-full</span> <span style="color: #660033;">-retain</span> <span style="color: #660033;">-daily</span> <span style="color: #660033;">-label</span> S_V_<span style="color: #000000; font-weight: bold;">%</span><span style="color: #c20cb9; font-weight: bold;">date</span>:~<span style="color: #000000;">6</span>,<span style="color: #000000;">4</span><span style="color: #000000; font-weight: bold;">%%</span><span style="color: #c20cb9; font-weight: bold;">date</span>:~<span style="color: #000000;">3</span>,<span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">%%</span><span style="color: #c20cb9; font-weight: bold;">date</span>:~<span style="color: #000000;">0</span>,<span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">%</span></pre></div></div>

<p>I made my script using <strong>Powershell</strong> so it would look like this :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># Database SID</span>
<span style="color: #800080;">$orasid</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;blogontap&quot;</span>
&nbsp;
<span style="color: #008000;"># Getting the date as YYYYMMDD</span>
<span style="color: #800080;">$date</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-Date</span> <span style="color: #008080; font-style: italic;">-uformat</span> <span style="color: #800000;">&quot;%Y%m%d&quot;</span>
&nbsp;
<span style="color: #008000;"># The command line to execute</span>
<span style="color: #800080;">$command</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;smo backup create -profile $orasid -online -full -retain -daily -label S_V_$($date)&quot;</span>
&nbsp;
<span style="color: #008000;"># There I execute that command remotely using PSExec from the Sysinternals Suite</span>
psexec \\ORAHOST cmd <span style="color: pink;">/</span>c $command</pre></div></div>

<h2>II &#8211; Getting Snapshot Names</h2>
<p>Once the backup is created, we are going to update the snapvault relationships with it. As you may know, while making a backup, SMO creates two snapshots. The first one will backup the database files during the <strong>Online Backup Mode</strong> while the second will backup everything else : archivelogs, redologs and control files.</p>
<p>Consequently, we will update the SnapVault relationship of <strong>ora_blogontap_datavol </strong>from the first snapshot and the other ones from the second.</p>
<p>So the first thing to do here, is to get the name of the snapshots we just made.</p>
<p>That&#8217;s where the NetApp DataONTAP Powershell Toolkit comes in handy :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># Loading the DataONTAP Module</span>
Import<span style="color: pink;">-</span>Module DataONTAP
&nbsp;
<span style="color: #008000;"># Database SID</span>
<span style="color: #800080;">$orasid</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;blogontap&quot;</span>
&nbsp;
<span style="color: #008000;"># Date in same format as in our Label</span>
<span style="color: #800080;">$date</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-Date</span> <span style="color: #008080; font-style: italic;">-uformat</span> <span style="color: #800000;">&quot;%Y%m%d&quot;</span>
&nbsp;
<span style="color: #008000;"># Prefix for first snapshot</span>
<span style="color: #800080;">$prefix1</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$orasid</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_daily_s_v&quot;</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$date</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_1&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008000;"># Prefix for second snapshot</span>
<span style="color: #800080;">$prefix2</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$orasid</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_daily_s_v&quot;</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$date</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_2&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008000;"># Connect to the filer hosting the LUNs</span>
Connect<span style="color: pink;">-</span>NaController BOT1
&nbsp;
<span style="color: #008000;"># Get last snapshot of Data Files</span>
<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$snapshot</span> <span style="color: #0000FF;">in</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>NaSnapshot <span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;ora_&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$orasid</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_datavol&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
     <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$snapshot</span>.name.StartsWith<span style="color: #000000;">&#40;</span><span style="color: #800080;">$prefix1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><span style="color: #800080;">$lastdata</span> <span style="color: pink;">=</span> <span style="color: #800080;">$snapshot</span>.name<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;"># Get last snapshot of Redo Logs</span>
<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$snapshot</span> <span style="color: #0000FF;">in</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>NaSnapshot <span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;ora_&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$orasid</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_logvol&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
     <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$snapshot</span>.name.StartsWith<span style="color: #000000;">&#40;</span><span style="color: #800080;">$prefix2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><span style="color: #800080;">$lastlog</span> <span style="color: pink;">=</span> <span style="color: #800080;">$snapshot</span>.name<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;"># Get last snapshot of Archive Logs</span>
<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$snapshot</span> <span style="color: #0000FF;">in</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>NaSnapshot <span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;ora_&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$orasid</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_archvol&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
     <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$snapshot</span>.name.StartsWith<span style="color: #000000;">&#40;</span><span style="color: #800080;">$prefix2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><span style="color: #800080;">$lastarch</span> <span style="color: pink;">=</span> <span style="color: #800080;">$snapshot</span>.name<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;"># Get last snapshot of Control Files</span>
<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$snapshot</span> <span style="color: #0000FF;">in</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>NaSnapshot <span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;ora_&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$orasid</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;_ctrlvol&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
     <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$snapshot</span>.name.StartsWith<span style="color: #000000;">&#40;</span><span style="color: #800080;">$prefix2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><span style="color: #800080;">$lastctrl</span> <span style="color: pink;">=</span> <span style="color: #800080;">$snapshot</span>.name<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<h2>III &#8211; Creating the XML Specification File for restore operations</h2>
<p>We are going to protect our backups on a Secondary storage system but SMO for Windows can&#8217;t handle protected backups so how are we going to restore from secondary ?</p>
<p>After we free a backup on primary, if we try to restore it, SMO for Windows will ask for a Specification File. Actually we will have to connect the LUNs in the snapshot from secondary manually with snapdrive and create that Specification file that will tell SMO where our backups are mounted.</p>
<p>This specification file will also contain the original mount points and the original snapshot names.</p>
<p>My LUNs got these mount points :</p>
<ul>
<li>C:\Databases\blogontap\arch</li>
<li>C:\Databases\blogontap\data</li>
<li>C:\Databases\blogontap\log</li>
<li>C:\Databases\blogontap\ctrl</li>
<li>C:\Databases\blogontap\tmp</li>
</ul>
<p>I know that when I&#8217;ll mount a backup from secondary, I will use these mount points :</p>
<ul>
<li>C:\Databases\blogontap\arch_0</li>
<li>C:\Databases\blogontap\data_0</li>
<li>C:\Databases\blogontap\log_0</li>
<li>C:\Databases\blogontap\ctrl_0</li>
</ul>
<p>So I got everything I need to generate that XML file during the protection process.</p>
<p>To do that I will execute that powershell file which contains the XML content, the snapshots and Oracle SID variables :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># file restore.ps1</span>
<span style="color: pink;">@</span><span style="color: #800000;">&quot;
&lt;?xml version=&quot;</span><span style="color: #804000;">1.0</span><span style="color: #800000;">&quot; encoding=&quot;</span>UTF<span style="color: pink;">-</span><span style="color: #804000;">8</span><span style="color: #800000;">&quot;?&gt;
&lt;restore-specification xmlns=&quot;</span>http:<span style="color: pink;">//</span>www.netapp.com<span style="color: #800000;">&quot;&gt; 
&lt;!-- &quot;</span>Specification File<span style="color: #800000;">&quot; --&gt; 
&lt;mountpoint-mapping&gt; 
    &lt;original-location&gt;C:\Databases\$orasid\data&lt;/original-location&gt; 
    &lt;snapname&gt;$lastdata&lt;/snapname&gt; 
    &lt;alternate-location&gt;C:\Databases\$orasid\data_0&lt;/alternate-location&gt; 
&lt;/mountpoint-mapping&gt;
&lt;mountpoint-mapping&gt;
    &lt;original-location&gt;C:\Databases\$orasid\log&lt;/original-location&gt; 
    &lt;snapname&gt;$lastlog&lt;/snapname&gt; 
    &lt;alternate-location&gt;C:\Databases\$orasid\log_0&lt;/alternate-location&gt; 
&lt;/mountpoint-mapping&gt;
&lt;mountpoint-mapping&gt;
    &lt;original-location&gt;C:\Databases\$orasid\arch&lt;/original-location&gt; 
    &lt;snapname&gt;$lastarch&lt;/snapname&gt; 
    &lt;alternate-location&gt;C:\Databases\$orasid\arch_0&lt;/alternate-location&gt; 
&lt;/mountpoint-mapping&gt;
&lt;mountpoint-mapping&gt;
    &lt;original-location&gt;C:\Databases\$orasid\ctrl&lt;/original-location&gt; 
    &lt;snapname&gt;$lastctrl&lt;/snapname&gt; 
    &lt;alternate-location&gt;C:\Databases\$orasid\ctrl_0&lt;/alternate-location&gt; 
&lt;/mountpoint-mapping&gt;
&lt;/restore-specification&gt;
&quot;</span><span style="color: pink;">@</span></pre></div></div>

<p>The encoding of the file must be ANSI. If not, you&#8217;ll get an error while loading it with SMO.</p>
<p>So here is the command I use :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># Generate the XML Specification File that will be used to restore from secondary</span>
.\restore.ps1 <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">out<span style="color: #FF0000;">-file</span></span> C:\RestoreXML\$<span style="color: #000000;">&#40;</span><span style="color: #800080;">$orasid</span><span style="color: #000000;">&#41;</span>_<span style="color: #800080;">$date</span>.xml <span style="color: #008080; font-style: italic;">-encoding</span> Default</pre></div></div>

<h2>IV &#8211; Updating the SnapVault relationships</h2>
<p>We made our backup and now we will update the SnapVault relationships like this on the destination filer :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">plink <span style="color: #660033;">-ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>BOT2 <span style="color: #660033;">-pw</span> pass snapvault update <span style="color: #660033;">-w</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$lastdata</span> <span style="color: #000000; font-weight: bold;">/</span>vol<span style="color: #000000; font-weight: bold;">/</span>svora_$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$orasid</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>_backup<span style="color: #000000; font-weight: bold;">/</span>data
plink <span style="color: #660033;">-ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>BOT2 <span style="color: #660033;">-pw</span> pass snapvault update <span style="color: #660033;">-w</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$lastlog</span> <span style="color: #000000; font-weight: bold;">/</span>vol<span style="color: #000000; font-weight: bold;">/</span>svora_$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$orasid</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>_backup<span style="color: #000000; font-weight: bold;">/</span>log
plink <span style="color: #660033;">-ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>BOT2 <span style="color: #660033;">-pw</span> pass snapvault update <span style="color: #660033;">-w</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$lastarch</span> <span style="color: #000000; font-weight: bold;">/</span>vol<span style="color: #000000; font-weight: bold;">/</span>svora_$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$orasid</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>_backup<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">arch</span>
plink <span style="color: #660033;">-ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>BOT2 <span style="color: #660033;">-pw</span> pass snapvault update <span style="color: #660033;">-w</span> <span style="color: #660033;">-s</span> <span style="color: #007800;">$lastctrl</span> <span style="color: #000000; font-weight: bold;">/</span>vol<span style="color: #000000; font-weight: bold;">/</span>svora_$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">$orasid</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>_backup<span style="color: #000000; font-weight: bold;">/</span>ctrl</pre></div></div>

<p>As I was not using the latest version of DataONTAP powershell Toolkit I couldn&#8217;t update my relationships using a source snapshot so I used <strong>plink</strong> instead.</p>
<p>So here we are, our backup is on the secondary filer. We just need to enable scheduled snapshots on the volume and we are done.</p>
<h2>V &#8211; Freeing backup on Primary</h2>
<p>The main goal of SnapVault is to use Secondary less expensive storage to retain more backup days.</p>
<p>The manual backups we made won&#8217;t free itselves. We must free them using their label name.</p>
<p>For example, at the end of each backup, I free the 3-day-old backup to keep only 3 daily on Primary :</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># The date three days before</span>
<span style="color: #800080;">$datefree</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">get-date</span> <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">get-date</span><span style="color: #000000;">&#41;</span>.AddDays<span style="color: #000000;">&#40;</span><span style="color: pink;">-</span><span style="color: #804000;">3</span><span style="color: #000000;">&#41;</span> <span style="color: #008080; font-style: italic;">-uformat</span> <span style="color: pink;">%</span>Y<span style="color: pink;">%</span>m<span style="color: pink;">%</span>d<span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008000;"># The command to free the backup</span>
<span style="color: #800080;">$commandfree</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;smo backup free -profile $orasid -label S_V_$($datefree)&quot;</span>
&nbsp;
<span style="color: #008000;"># Here I execute the backup remotely on my Oracle Host</span>
psexec \\ORAHOST cmd <span style="color: pink;">/</span>c $commandfree</pre></div></div>

<h1>Mission Accomplished ; )</h1>
]]></content:encoded>
			<wfw:commentRss>http://www.blogontap.com/storage/how-to-protect-smo-for-windows-backups-with-snapvault/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

