<?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>Andrew Fraser DBA &#187; Rman</title>
	<atom:link href="http://andrewfraserdba.com/category/rman/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewfraserdba.com</link>
	<description>Oracle DBA (plus SQL Server)</description>
	<lastBuildDate>Wed, 18 Jan 2012 15:25:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>IBM Tivoli restores using dsmc</title>
		<link>http://andrewfraserdba.com/2010/12/23/ibm-tivoli-restores-using-dsmc/</link>
		<comments>http://andrewfraserdba.com/2010/12/23/ibm-tivoli-restores-using-dsmc/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 16:11:20 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rman]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=497</guid>
		<description><![CDATA[As root dsmc or, for more complex configurations, specify an optfile: dsmc -optfile=/opt/tivoli/tsm/client/ba/bin/dsm-ora.opt List backup files: tsm&#62; q backup "/oracle/*" -subdir=yes -inactive Restore: tsm&#62; restore "/oracle/mydb/*" /oracle/ -subdir=yes -pick Note how the second mention of directory path ommits the lowest &#8230; <a href="http://andrewfraserdba.com/2010/12/23/ibm-tivoli-restores-using-dsmc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As root</p>
<pre class="brush:bash, shell">dsmc</pre>
<p>or, for more complex configurations, specify an optfile:</p>
<pre class="brush:bash, shell">dsmc -optfile=/opt/tivoli/tsm/client/ba/bin/dsm-ora.opt</pre>
<p>List backup files:</p>
<pre class="brush:bash, shell">tsm&gt; q backup "/oracle/*" -subdir=yes -inactive</pre>
<p>Restore:</p>
<pre class="brush:bash, shell">tsm&gt; restore "/oracle/mydb/*" /oracle/ -subdir=yes -pick</pre>
<p>Note how the second mention of directory path <strong>ommits</strong> the lowest directory.</p>
<pre class="brush:bash, shell">tsm&gt; +   # to select all
tsm&gt; o   # ok, start restore</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/12/23/ibm-tivoli-restores-using-dsmc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find delete old files</title>
		<link>http://andrewfraserdba.com/2010/10/29/find-delete-old-files/</link>
		<comments>http://andrewfraserdba.com/2010/10/29/find-delete-old-files/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 08:27:21 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rman]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=449</guid>
		<description><![CDATA[# Delete files older than 15 minutes find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mmin +15 -delete #Delete files older than 2 days 50 8 * * * find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mtime +2 -delete Old versions of unix find do not have &#8230; <a href="http://andrewfraserdba.com/2010/10/29/find-delete-old-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<pre class="brush:bash, shell">#  Delete files older than 15 minutes
find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mmin +15 -delete

#Delete files older than 2 days
50 8 * * * find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mtime +2 -delete</pre>
<p>Old versions of unix find do not have the -delete option, so instead:</p>
<pre class="brush:bash, shell">#  Delete files older than 15 minutes
find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mmin +15 -exec rm {} \;

#Delete files older than 2 days
50 8 * * * find /ORA_DISK/redoarch/ -name 'arch_*.dbf' -mtime +2 -exec rm {} \;</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/10/29/find-delete-old-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RAC alter database archivelog</title>
		<link>http://andrewfraserdba.com/2010/10/28/rac-alter-database-archivelog/</link>
		<comments>http://andrewfraserdba.com/2010/10/28/rac-alter-database-archivelog/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 16:22:21 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[RAC]]></category>
		<category><![CDATA[Rman]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=447</guid>
		<description><![CDATA[Switch a RAC database into archivelog mode: alter system set log_archive_dest_1='location=/ORA_DISK/redoarch/arch_' scope=both sid='*' ; alter system set cluster_database=false scope=spfile sid='mydb1'; srvctl stop database -d mydb startup mount alter database archivelog ; alter system set cluster_database=true scope=spfile sid='mydb1'; shutdown immediate srvctl &#8230; <a href="http://andrewfraserdba.com/2010/10/28/rac-alter-database-archivelog/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Switch a RAC database into archivelog mode:</p>
<pre  class="brush:sql">alter system set log_archive_dest_1='location=/ORA_DISK/redoarch/arch_' scope=both sid='*' ;
alter system set cluster_database=false scope=spfile sid='mydb1';
srvctl stop database -d mydb
startup mount
alter database archivelog ;
alter system set cluster_database=true scope=spfile sid='mydb1';
shutdown immediate
srvctl start database -d mydb</pre>
<p><span id="more-447"></span>And switch it into noarchivelog mode:</p>
<pre  class="brush:sql">alter system reset log_archive_dest_1 scope=spfile sid='*' ;
alter system set cluster_database=false scope=spfile sid='mydb1';
srvctl stop database -d mydb
startup mount
alter database noarchivelog ;
alter system set cluster_database=true scope=spfile sid='mydb1';
shutdown immediate
srvctl start database -d mydb</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/10/28/rac-alter-database-archivelog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tivoli Storage Manager simple restore</title>
		<link>http://andrewfraserdba.com/2010/10/28/tivole-storage-manager-simple-restore/</link>
		<comments>http://andrewfraserdba.com/2010/10/28/tivole-storage-manager-simple-restore/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 13:52:11 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rman]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=436</guid>
		<description><![CDATA[Sample restore from command line Tivoli Storage Manager. Run as root. ps -ef &#124; grep dsm #here look to see if 'optfile' is set cd /mydir dsmc -optfile=/opt/tivoli/tsm/client/ba/bin/dsm-ora.opt tsm> restore /mydir/*.dbf -inactive -pick tsm> 1 #here choose which file number &#8230; <a href="http://andrewfraserdba.com/2010/10/28/tivole-storage-manager-simple-restore/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sample restore from command line Tivoli Storage Manager. Run as root. </p>
<pre class="brush:bash, shell">ps -ef | grep dsm  #here look to see if 'optfile' is set
cd /mydir
dsmc -optfile=/opt/tivoli/tsm/client/ba/bin/dsm-ora.opt
tsm> restore /mydir/*.dbf -inactive -pick
tsm> 1   #here choose which file number you want
tsm> 2   #choose another file if needed
tsm> o   #o='ok'
tsm> quit</pre>
<p>You should specify an &#8216;optfile&#8217; at line 3 only if you saw it in the output of line 1.<br />
<span id="more-436"></span><br />
Other useful options:</p>
<p>List backup files:</p>
<pre class="brush:bash, shell">tsm>q backup "/opt/fc-lun1/*" -inactive -subdir=yes</pre>
<p>Restore (note how second mention directory name is shorter):</p>
<pre class="brush:bash, shell">tsm> restore "/opt/fc-lun1/MYDB/mydb/*" /ORA_DISK/MYDB/infprod/ -subdir=yes –pick</pre>
<p>Select all files:</p>
<pre class="brush:bash, shell">tsm> +   # to select all files</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/10/28/tivole-storage-manager-simple-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RMAN set until time recover</title>
		<link>http://andrewfraserdba.com/2010/10/22/rman-set-until-time-recover/</link>
		<comments>http://andrewfraserdba.com/2010/10/22/rman-set-until-time-recover/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 09:19:01 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Rman]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=432</guid>
		<description><![CDATA[run { set until time "to_date('21-OCT-2010 14:45:00','DD-MON-YYYY HH24:MI:SS')"; restore database ; recover database ; alter database open resetlogs ; } (H/t Stefan Knecht)]]></description>
			<content:encoded><![CDATA[<pre  class="brush:sql">run {
set until time "to_date('21-OCT-2010 14:45:00','DD-MON-YYYY HH24:MI:SS')";
restore database ;
recover database ;
alter database open resetlogs ;
}</pre>
<p>(H/t <a href="http://www.orafaq.com/maillist/oracle-l/2007/09/25/0667.htm">Stefan Knecht</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/10/22/rman-set-until-time-recover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data block corruption cleared with alter system flush buffer_cache</title>
		<link>http://andrewfraserdba.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/</link>
		<comments>http://andrewfraserdba.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/#comments</comments>
		<pubDate>Thu, 19 Apr 2007 14:45:46 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Rman]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/</guid>
		<description><![CDATA[So I had: ORA-08103: object no longer exists being reported on SQL affecting one application table. But that table existed ok in dba_tables, could be described ok, and selects restricted to its indexed columns returned data ok. Suspicion was some &#8230; <a href="http://andrewfraserdba.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So I had:<br />
<code>ORA-08103: object no longer exists</code><br />
being reported on SQL affecting one application table. But that table existed ok in dba_tables, could be described ok, and selects restricted to its indexed columns returned data ok.</p>
<p>Suspicion was some sort of data block corruption. Rman backup logs had not reported any corrpution, but dbverify did find some corrupt blocks. Those blocks were not associated with any record in dba_extents though.</p>
<p>All that is curious enough, but it is the fix which was the real surprise. Running:<br />
<code>SQL&gt; alter system flush buffer_cache ;</code><br />
Fixed the problem. Implication of that is that there is intermittent data block corruption, and that  table was corrupt at the time it was first read into cache, and clean again (on disk) by the time I came along to look at it.</p>
<p>Dbverify later on also switched over to giving the datafiles a clean bill of health.</p>
<p>What&#8217;s the root cause? Don&#8217;t know (yet), but intermittent disk or memory hardware failure seems  the most likely. Nothing reported in server logs though.</p>
<p>This on Oracle 10.1.0.4.0 Enterprise Edition on Microsoft Windows Server 2003 Standard Edition Service Pack 1 on Intel Xeon 3.2GHz.</p>
<p>The dbverify syntax I used was like:<br />
<code>dbv file=D:\ORACLE\ORADATA\SYSTEM01.DBF logfile=4.log</code><br />
I didn&#8217;t have to specify block size because database was at the default block size for that version of dbv (seen with <code>dbv help=y</code>).</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/04/19/data-block-corruption-cleared-with-alter-system-flush-buffer_cache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Data Guard today</title>
		<link>http://andrewfraserdba.com/2007/03/07/data-guard-today/</link>
		<comments>http://andrewfraserdba.com/2007/03/07/data-guard-today/#comments</comments>
		<pubDate>Wed, 07 Mar 2007 15:29:27 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Rman]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/03/07/data-guard-today/</guid>
		<description><![CDATA[Today had noticed that redo logs were not being applied to standby. Checking live database alert log showed errors like: PING[ARC1]: Heartbeat failed to connect to standby '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=drserver)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=dbase_DR)(INSTANCE_NAME=dbase)(SERVER=dedicated)))'. Error is 12514. Wed Mar 07 10:51:10 2007 Error 12514 received logging &#8230; <a href="http://andrewfraserdba.com/2007/03/07/data-guard-today/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today had noticed that redo logs were not being applied to standby. Checking live database alert log showed errors like:<br />
<span id="more-33"></span><code>PING[ARC1]: Heartbeat failed to connect to standby '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=drserver)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=dbase_DR)(INSTANCE_NAME=dbase)(SERVER=dedicated)))'. Error is 12514.<br />
Wed Mar 07 10:51:10 2007<br />
Error 12514 received logging on to the standby<br />
Wed Mar 07 10:51:10 2007<br />
Errors in file d:\oracle\admin\dbase\bdump\dbase_arc1_2540.trc:<br />
ORA-12514: Message 12514 not found; No message file for product=RDBMS, facility=ORA</code></p>
<p>But they are somewhat misleading &#8211; ora-12514 implies listener issues, and the listener was actually working ok on the standby server.</p>
<p>Drc<em>dbname</em>.log had the right information:</p>
<p><code>DG 2007-03-07-07:12:42        0 2 0 RSM detected log transport problem: log transport for database 'dbase_DR' has the following error.<br />
DG 2007-03-07-07:12:42        0 2 0   ORA-12514: Message 12514 not found; No message file for product=RDBMS, facility=ORA<br />
DG 2007-03-07-07:12:42        0 2 0 RSM0: HEALTH CHECK ERROR: ORA-16737: the redo transport service for standby database "dbase_DR" has an error<br />
DG 2007-03-07-07:12:42        0 2 0 NSV1: Failed to connect to remote database dbase_DR. Error is ORA-01034<br />
DG 2007-03-07-07:12:42        0 2 0 NSV1: Message is dropped.<br />
DG 2007-03-07-07:12:42        0 2 606440720 DMON: Database dbase_DR returned ORA-01034<br />
DG 2007-03-07-07:12:42        0 2 606440720       for opcode = CTL_GET_STATUS, phase = BEGIN, req_id = 1.1.606440720<br />
DG 2007-03-07-07:12:42        0 2 606440720 Operation CTL_GET_STATUS cancelled during phase 2, error = ORA-16778<br />
DG 2007-03-07-07:12:42        0 2 606440720 Operation CTL_GET_STATUS cancelled during phase 2, error = ORA-16778</code></p>
<p>Checking Data Guard Manager on live server showed the same ORA-1034 error, with description added in:</p>
<p><code>C:\&gt;dgmgrl<br />
DGMGRL for 32-bit Windows: Version 10.2.0.1.0 - Production</code></p>
<p>Copyright (c) 2000, 2005, Oracle. All rights reserved.</p>
<p>Welcome to DGMGRL, type &#8220;help&#8221; for information.<br />
DGMGRL&gt; connect sys/password<br />
Connected.<br />
DGMGRL&gt; show configuration;</p>
<p>Configuration<br />
Name:                db_DOCUMENTUM<br />
Enabled:             YES<br />
Protection Mode:     MaxPerformance<br />
Fast-Start Failover: DISABLED<br />
Databases:<br />
dbase    &#8211; Primary database<br />
dbase_DR &#8211; Physical standby database</p>
<p>Current status for &#8220;db_DOCUMENTUM&#8221;:<br />
Warning: ORA-16607: one or more databases have failed</p>
<p>DGMGRL&gt; show database &#8216;dbase&#8217;;</p>
<p>Database<br />
Name:            dbase<br />
Role:            PRIMARY<br />
Enabled:         YES<br />
Intended State:  ONLINE<br />
Instance(s):<br />
dbase</p>
<p>Current status for &#8220;dbase&#8221;:<br />
Error: ORA-16778: redo transport error for one or more databases</p>
<p>DGMGRL&gt; show database &#8216;dbase_DR&#8217;;</p>
<p>Database<br />
Name:            dbase_DR<br />
Role:            PHYSICAL STANDBY<br />
Enabled:         YES<br />
Intended State:  ONLINE<br />
Instance(s):<br />
dbase</p>
<p>Current status for &#8220;dbase_DR&#8221;:<br />
Error: ORA-01034: ORACLE not available</p>
<p>So the standby database had stopped running (although its windows service was still up and running ok). To fix, first startup nomount the standby database:</p>
<p><code>sqlplus sys/password as sysdba<br />
SQL&gt;<br />
</code></p>
<h2>startup nomount</h2>
<p>At this point dgmgrl on live server reported:</p>
<p><code>DGMGRL&gt; show database 'dbase_DR';</code></p>
<p>Database<br />
Name:            dbase_DR<br />
Role:            PHYSICAL STANDBY<br />
Enabled:         YES<br />
Intended State:  ONLINE<br />
Instance(s):<br />
dbase</p>
<p>Current status for &#8220;dbase_DR&#8221;:<br />
Error: ORA-16525: the Data Guard broker is not yet available</p>
<p>And secondly, again on the standby database:</p>
<p><code>SQL&gt;<br />
</code></p>
<h2>alter database mount standby database ;</h2>
<p>Dgmgrl on live server now reported everything ok:</p>
<p><code>DGMGRL&gt; show database 'dbase_DR';</code></p>
<p>Database<br />
Name:            dbase_DR<br />
Role:            PHYSICAL STANDBY<br />
Enabled:         YES<br />
Intended State:  ONLINE<br />
Instance(s):<br />
dbase</p>
<p>Current status for &#8220;dbase_DR&#8221;:<br />
SUCCESS</p>
<p>DGMGRL&gt; show configuration;</p>
<p>Configuration<br />
Name:                db_DOCUMENTUM<br />
Enabled:             YES<br />
Protection Mode:     MaxPerformance<br />
Fast-Start Failover: DISABLED<br />
Databases:<br />
dbase    &#8211; Primary database<br />
dbase_DR &#8211; Physical standby database</p>
<p>Current status for &#8220;db_DOCUMENTUM&#8221;:<br />
SUCCESS</p>
<p>DGMGRL&gt;</p>
<p>Which alert logs for live and standby confirmed.</p>
<p>The standby alert log shows this command also:<br />
<code>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  THROUGH ALL SWITCHOVER DISCONNECT  NODELAY</code><br />
But that was issued behind the scenes by the Data Guard Broker, not issued manually by the DBA.</p>
<p>As an aside, 10g logical standby databases (that replay SQL rather than redo change vectors) are availalable with the same protection modes and fast start failover options as physical standby databases (the traditional type that replay redo). That is according to documentation, I haven&#8217;t had a chance to use those myself yet, but hope to be soon. The big advantage of logical standby databases is that they are available for reporting use without halting the replication. In the absence of other drawbacks (not unknown in new oracle features), that would make logical standby the preferred option.</p>
<p><strong>EDIT</strong> &#8211; for older databases or otherwise where data guard is not running, commands to use would instead be like:</p>
<p>recover managed standby database cancel;<br />
recover standby database;<br />
[auto]<br />
recover managed standby database disconnect;</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/03/07/data-guard-today/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Clone a database</title>
		<link>http://andrewfraserdba.com/2007/02/09/clone-a-database/</link>
		<comments>http://andrewfraserdba.com/2007/02/09/clone-a-database/#comments</comments>
		<pubDate>Fri, 09 Feb 2007 13:13:47 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Rman]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/02/09/clone-a-database/</guid>
		<description><![CDATA[The below SQL generates a SQL script that can be used to clone a database, putting tablespaces into hot backup mode one at a time. Run it on the source database, and edit the output to specify new target file &#8230; <a href="http://andrewfraserdba.com/2007/02/09/clone-a-database/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The below SQL generates a SQL script that can be used to clone a database, putting tablespaces into hot backup mode one at a time. Run it on the source database, and edit the output to specify new target file and directory names, and change cp to rcp or scp if cloning to another server.</p>
<p>Database clones can also be done with rman, which has the advantage of avoiding the performance draining hot backup mode.</p>
<pre class="brush:sql">set pages 9999 lines 132 serverout on size 99999
BEGIN
  FOR t IN ( select distinct tablespace_name from dba_data_files )
  LOOP
    dbms_output.put_line('alter tablespace '||t.tablespace_name||' begin backup ;') ;
    FOR f IN ( select file_name from dba_data_files where tablespace_name = t.tablespace_name )
    LOOP
      dbms_output.put_line('host cp '||f.file_name||' '||f.file_name ) ;
    END LOOP ;
    dbms_output.put_line('alter tablespace '||t.tablespace_name||' end backup ;') ;
  END LOOP ;
END ;
/
set lines 80
select 'alter tablespace '||tablespace_name||' add tempfile '||file_name||' size '||bytes/1024/1024||' m ;'
from dba_temp_files
/
prompt alter system switch logfile ;;
prompt alter system backup controlfile to trace ;;</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/02/09/clone-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NID to fix RMAN-20035: invalid high recid</title>
		<link>http://andrewfraserdba.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/</link>
		<comments>http://andrewfraserdba.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 13:20:43 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Rman]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/</guid>
		<description><![CDATA[For errors like: RMAN-03014: implicit resync of recovery catalog failed RMAN-06004: ORACLE error from recovery catalog database: RMAN-20035: invalid high recid You can switch the catalog over to a previous incarnation (before an open resetlogs): RMAN&#62; list incarnation of database &#8230; <a href="http://andrewfraserdba.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For errors like:</p>
<pre class="brush:sql">RMAN-03014: implicit resync of recovery catalog failed
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20035: invalid high recid</pre>
<p>You can switch the catalog over to a previous incarnation (before an open resetlogs):</p>
<pre class="brush:sql">RMAN&gt; list incarnation of database &lt;database name&gt;;
RMAN&gt; reset database to incarnation &lt;incarnation number&gt;;</pre>
<p>But that is only valid where you want to go back in time to have the catalog work with an old incarnation. If you have mutiple copies of the same database, and want them all registered in the same rman catalog, you have to give the copies different DBIDs, usng the Nid utility:</p>
<pre class="brush:sql">SQL&gt; shutdown immediate
SQL&gt; startup mount
$ nid target=sys/password@testdb</pre>
<p> (you don&#8217;t need to use a connect string here, but if you do, a remote login passwordfile is required)</p>
<pre class="brush:sql">SQL&gt; shutdown immediate</pre>
<p> (at least for 9i, is handled automatically with 10g according to documentation)</p>
<pre class="brush:sql">SQL&gt; startup mount
SQL&gt; alter database open resetlogs;
$ rman target / catalog=rman/password@catdb
RMAN&gt; register database;</pre>
<p>Nid comes with release 9iR2 and above, but can be run against older databases (at least with 8174 64 bit on Solaris), provided you use the connect string syntax with a remote login password file. It is
<pre class="brush:sql">$ORACLE_HOME/bin/nid</pre>
<p>. You have to set your full environment to the new (9iR2 or later) ORACLE_HOME before running nid that way &#8211; can use . oraenv naming a dummy (non existant) database and then typing in the new ORACLE_HOME when prompted.</p>
<p>Reference: Metalink Note:224266.1 or <a href="http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14215/dbnewid.htm#i1005317">Utilities doc</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/01/16/nid-to-fix-rman-20035-invalid-high-recid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>rman crosscheck archivelog all</title>
		<link>http://andrewfraserdba.com/2007/01/12/rman-crosscheck-archivelog-all/</link>
		<comments>http://andrewfraserdba.com/2007/01/12/rman-crosscheck-archivelog-all/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 20:55:30 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Rman]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://andrewfraser.wordpress.com/2007/01/12/rman-crosscheck-archivelog-all/</guid>
		<description><![CDATA[If archived redo logs are (wrongly) deleted/moved/compressed from disk without being backed up, the rman catalog will not know this has happened, and will keep attempting to backup the missing archived redo logs. That will cause rman archived redo log &#8230; <a href="http://andrewfraserdba.com/2007/01/12/rman-crosscheck-archivelog-all/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If archived redo logs are (wrongly) deleted/moved/compressed from disk without being backed up, the rman catalog will not know this has happened, and will keep attempting to backup the missing archived redo logs. That will cause rman archived redo log backups to fail altogether with an error like:</p>
<pre class="brush:sql">RMAN-06059: expected archived log not found, lost of archived log compromises recoverability</pre>
<p>If you can, you should bring back the missing archved redo logs to their original location and name, and let rman back them up. But if that is impossible, the workaround is to &#8220;crosscheck archivelog all&#8221;, like:</p>
<pre class="brush:sql">rman &lt;&lt;e1
connect target /
connect catalog username/password@catalog
run {
allocate channel c1 type disk ;
crosscheck archivelog all ;
release channel c1 ;
}
e1</pre>
<p>You&#8217;ll get output like this:</p>
<pre class="brush:sql">validation succeeded for archived log
archive log filename=D:REDOARCHARCH_1038.DBF recid=1017 stamp=611103638</pre>
<p>for every archived log as they are all checked on disk. That should  be the catalog fixed, run an archivelog backup to make sure.</p>
<p>[Ref: <a href="https://metalink.oracle.com/metalink/plsql/f?p=130:14:4990080915650096676::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,291415.1,1,1,1,helvetica">Metalink</a> ]</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2007/01/12/rman-crosscheck-archivelog-all/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

