<?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>碧海蓝天 &#187; asm</title>
	<atom:link href="http://wajoynece.cn/tag/asm/feed/" rel="self" type="application/rss+xml" />
	<link>http://wajoynece.cn</link>
	<description>Oracle DataBase Linux Software</description>
	<lastBuildDate>Tue, 06 Sep 2011 08:26:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ASM之迁移到ASM</title>
		<link>http://wajoynece.cn/2009/08/asm-migrate/</link>
		<comments>http://wajoynece.cn/2009/08/asm-migrate/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 08:58:54 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[asm]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=147</guid>
		<description><![CDATA[oracle@wayne-laptop:~$ rman target / Recovery Manager: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:20:41 2009 Copyright (c) 1982, 2007, Oracle.  All rights reserved. connected to target database: ORA10G (DBID=4013050375) RMAN&#62; BACKUP AS COPY INCREMENTAL LEVEL 0  DATABASE FORMAT &#8216;+dg1&#8242;TAG &#8216;ORA_ASM_MIGRATION&#8217;; Starting backup at 11-AUG-09 using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile copy input datafile [...]]]></description>
			<content:encoded><![CDATA[<p>oracle@wayne-laptop:~$ <strong>rman target /</strong></p>
<p>Recovery Manager: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:20:41 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All rights reserved.</p>
<p>connected to target database: ORA10G (DBID=4013050375)</p>
<p>RMAN&gt; <strong>BACKUP AS COPY INCREMENTAL LEVEL 0  DATABASE FORMAT &#8216;+dg1&#8242;TAG &#8216;ORA_ASM_MIGRATION&#8217;;</strong></p>
<p>Starting backup at 11-AUG-09<br />
using channel ORA_DISK_1<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00001 name=/home/oracle/app/oradata/ora10g/system01.dbf<br />
output filename=+DG1/ora10g/datafile/system.264.694628679 tag=ORA_ASM_MIGRATION recid=7 stamp=694628715<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00002 name=/home/oracle/app/oradata/ora10g/undotbs01.dbf<br />
output filename=+DG1/ora10g/datafile/undotbs1.265.694628721 tag=ORA_ASM_MIGRATION recid=8 stamp=694628745<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00003 name=/home/oracle/app/oradata/ora10g/sysaux01.dbf<br />
output filename=+DG1/ora10g/datafile/sysaux.266.694628757 tag=ORA_ASM_MIGRATION recid=9 stamp=694628773<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00005 name=/home/oracle/app/oradata/ORA10G/datafile/o1_mf_wayne_57q7y8hp_.dbf<br />
output filename=+DG1/ora10g/datafile/wayne.268.694628781 tag=ORA_ASM_MIGRATION recid=10 stamp=694628787<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15<br />
channel ORA_DISK_1: starting datafile copy<br />
input datafile fno=00004 name=/home/oracle/app/oradata/ora10g/users01.dbf<br />
output filename=+DG1/ora10g/datafile/users.261.694628797 tag=ORA_ASM_MIGRATION recid=11 stamp=694628796<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01<br />
channel ORA_DISK_1: starting datafile copy<br />
copying current control file<br />
output filename=+DG1/ora10g/controlfile/backup.262.694628797 tag=ORA_ASM_MIGRATION recid=12 stamp=694628799<br />
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03<br />
channel ORA_DISK_1: starting incremental level 0 datafile backupset<br />
channel ORA_DISK_1: specifying datafile(s) in backupset<br />
including current SPFILE in backupset<br />
channel ORA_DISK_1: starting piece 1 at 11-AUG-09<br />
channel ORA_DISK_1: finished piece 1 at 11-AUG-09<br />
piece handle=+DG1/ora10g/backupset/2009_08_11/nnsnn0_ora_asm_migration_0.263.694628803 tag=ORA_ASM_MIGRATION comment=NONE<br />
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02<br />
Finished backup at 11-AUG-09</p>
<p>RMAN&gt; <strong>run {<br />
2&gt; backup as backupset spfile;<br />
3&gt; restore spfile to &#8216;+dg1/spfile&#8217;;<br />
4&gt; }</strong></p>
<p>Starting backup at 11-AUG-09<br />
using channel ORA_DISK_1<br />
channel ORA_DISK_1: starting full datafile backupset<br />
channel ORA_DISK_1: specifying datafile(s) in backupset<br />
including current SPFILE in backupset<br />
channel ORA_DISK_1: starting piece 1 at 11-AUG-09<br />
channel ORA_DISK_1: finished piece 1 at 11-AUG-09<br />
piece handle=/home/oracle/app/flash_recovery_area/ORA10G/backupset/2009_08_11/o1_mf_nnsnf_TAG20090811T162849_582by1ts_.bkp tag=TAG20090811T162849 comment=NONE<br />
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01<br />
Finished backup at 11-AUG-09</p>
<p>Starting restore at 11-AUG-09<br />
using channel ORA_DISK_1</p>
<p>channel ORA_DISK_1: starting datafile backupset restore<br />
channel ORA_DISK_1: restoring SPFILE<br />
output filename=+dg1/spfile<br />
channel ORA_DISK_1: reading from backup piece /home/oracle/app/flash_recovery_area/ORA10G/backupset/2009_08_11/o1_mf_nnsnf_TAG20090811T162849_582by1ts_.bkp<br />
channel ORA_DISK_1: restored backup piece 1<br />
piece handle=/home/oracle/app/flash_recovery_area/ORA10G/backupset/2009_08_11/o1_mf_nnsnf_TAG20090811T162849_582by1ts_.bkp tag=TAG20090811T162849<br />
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02<br />
Finished restore at 11-AUG-09</p>
<p>RMAN&gt; exit</p>
<p>Recovery Manager complete.<br />
oracle@wayne-laptop:~$ sqlplus / as sysdba</p>
<p>SQL*Plus: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:29:42 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.</p>
<p>Connected to:<br />
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options</p>
<p>SQL&gt; <strong>startup force nomount PFILE=&#8221;/tmp/pfile.ora&#8221;;</strong><br />
ORACLE instance started.</p>
<p>Total System Global Area  205520896 bytes<br />
Fixed Size            1266584 bytes<br />
Variable Size          100666472 bytes<br />
Database Buffers       96468992 bytes<br />
Redo Buffers            7118848 bytes<br />
SQL&gt; <strong>alter system set control_files=&#8217;+dg1/ct1.f&#8217;,'+fra/ct2.f&#8217; scope=spfile;</strong></p>
<p>System altered.</p>
<p>SQL&gt; <strong>alter system set DB_RECOVERY_FILE_DEST_SIZE=2g scope=spfile;</strong></p>
<p>System altered.</p>
<p>SQL&gt; <strong>alter system set DB_RECOVERY_FILE_DEST=&#8217;+fra&#8217; scope=spfile;</strong></p>
<p>System altered.</p>
<p>SQL&gt; <strong>shutdown immediate</strong><br />
ORA-01507: database not mounted</p>
<p>ORACLE instance shut down.<br />
SQL&gt;<strong> startup nomount PFILE=&#8221;/tmp/pfile.ora&#8221;;</strong><br />
ORACLE instance started.</p>
<p>Total System Global Area  205520896 bytes<br />
Fixed Size            1266584 bytes<br />
Variable Size          100666472 bytes<br />
Database Buffers       96468992 bytes<br />
Redo Buffers            7118848 bytes<br />
SQL&gt; exit<br />
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options<br />
oracle@wayne-laptop:~$ rman target /</p>
<p>Recovery Manager: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:33:18 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All rights reserved.</p>
<p>connected to target database: ora10g (not mounted)</p>
<p>RMAN&gt; <strong>restore controlfile from &#8216;/home/oracle/app/oradata/ora10g/control03.ctl&#8217;;</strong></p>
<p>Starting restore at 11-AUG-09<br />
using target database control file instead of recovery catalog<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: sid=156 devtype=DISK</p>
<p>channel ORA_DISK_1: copied control file copy<br />
output filename=+DG1/ct1.f<br />
output filename=+FRA/ct2.f<br />
Finished restore at 11-AUG-09</p>
<p>RMAN&gt; <strong>alter database mount;</strong></p>
<p>database mounted<br />
released channel: ORA_DISK_1</p>
<p>RMAN&gt; <strong>switch database to copy;</strong></p>
<p>datafile 1 switched to datafile copy &#8220;+DG1/ora10g/datafile/system.264.694628679&#8243;<br />
datafile 2 switched to datafile copy &#8220;+DG1/ora10g/datafile/undotbs1.265.694628721&#8243;<br />
datafile 3 switched to datafile copy &#8220;+DG1/ora10g/datafile/sysaux.266.694628757&#8243;<br />
datafile 4 switched to datafile copy &#8220;+DG1/ora10g/datafile/users.261.694628797&#8243;<br />
datafile 5 switched to datafile copy &#8220;+DG1/ora10g/datafile/wayne.268.694628781&#8243;</p>
<p>RMAN&gt; <strong>recover database;</strong></p>
<p>Starting recover at 11-AUG-09<br />
allocated channel: ORA_DISK_1<br />
channel ORA_DISK_1: sid=156 devtype=DISK</p>
<p>starting media recovery<br />
media recovery complete, elapsed time: 00:00:03</p>
<p>Finished recover at 11-AUG-09</p>
<p>RMAN&gt; <strong>run {<br />
set newname for tempfile 1 to &#8216;+dg1&#8242;;<br />
switch tempfile all;<br />
}</strong><br />
2&gt; 3&gt; 4&gt;<br />
executing command: SET NEWNAME</p>
<p>renamed temporary file 1 to +dg1 in control file</p>
<p>RMAN&gt; <strong>ALTER DATABASE OPEN;<br />
</strong><br />
database opened</p>
<p>RMAN&gt; exit</p>
<p>Recovery Manager complete.</p>
<p>oracle@wayne-laptop:~$ sqlplus / as sysdba</p>
<p>SQL*Plus: Release 10.2.0.4.0 &#8211; Production on Tue Aug 11 16:39:03 2009</p>
<p>Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.</p>
<p>Connected to:<br />
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 &#8211; Production<br />
With the Partitioning, OLAP, Data Mining and Real Application Testing options</p>
<p>SQL&gt;<br />
SQL&gt;<br />
<strong>declare<br />
cursor rlc is<br />
select group# grp, thread# thr, bytes/1024 bytes_k, &#8216;NO&#8217; srl<br />
from v$log<br />
union<br />
select group# grp, thread# thr, bytes/1024 bytes_k, &#8216;YES&#8217; srl<br />
from v$standby_log<br />
order by 1;<br />
stmt     varchar2(2048);<br />
swtstmt  varchar2(1024) := &#8216;alter system switch logfile&#8217;;<br />
ckpstmt  varchar2(1024) := &#8216;alter system checkpoint global&#8217;;<br />
begin<br />
for rlcRec in rlc loop<br />
if (rlcRec.srl = &#8216;YES&#8217;) then<br />
stmt := &#8216;alter database add standby logfile thread &#8216; ||<br />
rlcRec.thr || &#8216; &#8221;+DG1&#8221; size &#8216; ||<br />
rlcRec.bytes_k || &#8216;K&#8217;;<br />
execute immediate stmt;<br />
stmt := &#8216;alter database drop standby logfile group &#8216; || rlcRec.grp;<br />
execute immediate stmt;<br />
else<br />
stmt := &#8216;alter database add logfile thread &#8216; ||<br />
rlcRec.thr || &#8216; &#8221;+DG1&#8221; size &#8216; ||<br />
rlcRec.bytes_k || &#8216;K&#8217;;<br />
execute immediate stmt;<br />
begin<br />
stmt := &#8216;alter database drop logfile group &#8216; || rlcRec.grp;<br />
dbms_output.put_line(stmt);<br />
execute immediate stmt;<br />
exception<br />
when others then<br />
execute immediate swtstmt;<br />
execute immediate ckpstmt;<br />
execute immediate stmt;<br />
end;<br />
end if;<br />
end loop;<br />
38  end;<br />
39  /</strong></p>
<p>PL/SQL procedure successfully completed.</p>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/08/asm-migrate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASM之建立实验环境</title>
		<link>http://wajoynece.cn/2009/08/asm-init/</link>
		<comments>http://wajoynece.cn/2009/08/asm-init/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 08:49:39 +0000</pubDate>
		<dc:creator>wajoynece</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[asm]]></category>

		<guid isPermaLink="false">http://wajoynece.cn/?p=142</guid>
		<description><![CDATA[准备模拟磁盘文件 root@wayne-laptop:/home/oracle/test# for i in 0 1 2 3 ;do dd if=/dev/zero of=file_disk$i bs=1024 count=524288 ; done 524288+0 records in 524288+0 records out 536870912 bytes (537 MB) copied, 14.0764 s, 38.1 MB/s 524288+0 records in 524288+0 records out 536870912 bytes (537 MB) copied, 15.2912 s, 35.1 MB/s 524288+0 records in 524288+0 records out 536870912 bytes [...]]]></description>
			<content:encoded><![CDATA[<p>准备模拟磁盘文件</p>
<blockquote><p>root@wayne-laptop:/home/oracle/test# for i in 0 1 2 3 ;do dd if=/dev/zero of=file_disk$i bs=1024 count=524288 ; done<br />
524288+0 records in<br />
524288+0 records out<br />
536870912 bytes (537 MB) copied, 14.0764 s, 38.1 MB/s<br />
524288+0 records in<br />
524288+0 records out<br />
536870912 bytes (537 MB) copied, 15.2912 s, 35.1 MB/s<br />
524288+0 records in<br />
524288+0 records out<br />
536870912 bytes (537 MB) copied, 18.8882 s, 28.4 MB/s<br />
524288+0 records in<br />
524288+0 records out<br />
536870912 bytes (537 MB) copied, 18.276 s, 29.4 MB/s<br />
root@wayne-laptop:/home/oracle/test# ls -l<br />
total 2099216<br />
-rw-r&#8211;r&#8211; 1 root root 536870912 2009-08-10 10:48 file_disk0<br />
-rw-r&#8211;r&#8211; 1 root root 536870912 2009-08-10 10:48 file_disk1<br />
-rw-r&#8211;r&#8211; 1 root root 536870912 2009-08-10 10:49 file_disk2<br />
-rw-r&#8211;r&#8211; 1 root root 536870912 2009-08-10 10:49 file_disk3</p></blockquote>
<p>创建loop设备</p>
<blockquote><p>root@wayne-laptop:/home/oracle/test# for i in 0 1 2 3 ; do losetup /dev/loop$i file_disk$i; done<br />
root@wayne-laptop:/home/oracle/test# losetup -a<br />
/dev/loop0: [0805]:1917697 (file_disk0)<br />
/dev/loop1: [0805]:1917709 (file_disk1)<br />
/dev/loop2: [0805]:1917711 (file_disk2)<br />
/dev/loop3: [0805]:1917712 (file_disk3)<br />
root@wayne-laptop:/dev# chown oracle:dba /dev/loop*</p></blockquote>
<p>配置css</p>
<blockquote><p>+++++++++++++++出现的问题以及解决++++++++++++++++++++++++++<br />
root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# localconfig add<br />
/home/oracle/app/10.2.0/db_1/bin/crsctl.bin: /usr/lib/libstdc++.so.5: version `CXXABI_1.2&#8242; not found (required by /home/oracle/app/10.2.0/db_1/bin/crsctl.bin)<br />
/home/oracle/app/10.2.0/db_1/bin/crsctl.bin: /usr/lib/libstdc++.so.5: version `GLIBCPP_3.2&#8242; not found (required by /home/oracle/app/10.2.0/db_1/bin/crsctl.bin)</p></blockquote>
<blockquote><p>root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# cd /usr/lib<br />
root@wayne-laptop:/usr/lib# ls -l | grep libstdc__<br />
root@wayne-laptop:/usr/lib# ls -l | grep libstdc++<br />
lrwxrwxrwx  1 root root       23 2009-05-12 11:16 libstdc++.so.5 -&gt; /usr/lib/libstdc++.so.6<br />
lrwxrwxrwx  1 root root       18 2009-05-11 18:32 libstdc++.so.6 -&gt; libstdc++.so.6.0.9<br />
-rw-r&#8211;r&#8211;  1 root root   970680 2009-02-19 18:42 libstdc++.so.6.0.9</p></blockquote>
<blockquote><p>root@wayne-laptop:/usr/lib# aptitude install libstdc++5<br />
root@wayne-laptop:/usr/lib# ln -sf libstdc++.so.5.0.7 libstdc++.so.5<br />
+++++++++++++++++++++++++++++++++++++++++</p></blockquote>
<blockquote><p>root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# mkdir -p /var/lock/subsys<br />
root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# localconfig reset<br />
Successfully accumulated necessary OCR keys.<br />
Creating OCR keys for user &#8216;root&#8217;, privgrp &#8216;root&#8217;..<br />
Operation successful.<br />
Configuration for local CSS has been initialized</p></blockquote>
<blockquote><p>Adding to inittab<br />
Startup will be queued to init within 30 seconds.<br />
Checking the status of new Oracle init process&#8230;<br />
Expecting the CRS daemons to be up within 600 seconds.</p></blockquote>
<blockquote><p>^c</p></blockquote>
<blockquote><p>root@wayne-laptop:/home/oracle/app/10.2.0/db_1/bin# nohup /etc/init.d/init.cssd run &gt;/dev/null 2&gt;&amp;1<br />
[1] 17991</p></blockquote>
<p>创建asm实例</p>
<blockquote><p>$ dbca -silent -configureASM             \<br />
-asmSysPassword change_on_install \<br />
-diskString &#8220;/dev/loop*&#8221;          \<br />
-diskList /dev/loop1              \<br />
-diskGroupName DG1                \<br />
-redundancy EXTERNAL</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://wajoynece.cn/2009/08/asm-init/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

