<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>AnySQL.net</title>
	
	<link>http://www.anysql.net</link>
	<description>数据复制，数据迁移，数据库优化，系统监控，备份恢复，报表展现，原创工具等</description>
	<lastBuildDate>Tue, 19 Mar 2013 15:03:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AnySQL" /><feedburner:info uri="anysql" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><image><link>http://www.anysql.net</link><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url><title>AnySQL.net</title></image><feedburner:emailServiceId>AnySQL</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
		<title>orastats &amp; mysqlstats通用监控工具</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/iGEZAqC25co/oracle-mysql-stats-perf-tool.html</link>
		<comments>http://www.anysql.net/tools/oracle-mysql-stats-perf-tool.html#comments</comments>
		<pubDate>Tue, 19 Mar 2013 15:03:14 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tuning]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=816</guid>
		<description><![CDATA[&#160; &#160; 以前曾写过Oracle与MySQL的监控工具，但随着数据库版本的变化，性能指标也在发生变化，常常需要改进代码，然后再进行编译，比较麻烦。这个时间和OceanBase开发人员在一起久了，受了他们一点灵气的影响，想出了通用的监控工具的方法。 &#160; &#160; 将所有性能指标理解成一个Key及一个Value的组合，Key为字符串类型，Value为浮点数类型，可以自定义SQL在数据库中查询出来。比如下面的SQL语句： select name, bytes from v$sgastat union all select name, value from v$sysstat &#160; &#160; 将上面查询的结果，再加一个当前的时间点(Key=orastats.timestamp)存放到一个Hash表中，然后根据一定的格式规则显示出其中的数据，就是一个非常好的通用监控工具了，我们以如下SQL为例。 select name, value from v$sga &#160; &#160; 输出格式使用如下格式进行控制，对任何一个Key需要指定数值的类型（显示当前值还是差量值？），然后指定一个简写的指标名字。 Key&#124;{CURR&#124;DELTA}&#124;Label&#124;... &#160; &#160; 编写如下的文本文件(orastats.txt)。 user=sys query=select name, value from v$sga format=Fixed Size&#124;curr&#124;Fixed&#124; &#160; &#160; &#160; &#160; Variable Size&#124;curr&#124;VarS&#124; &#160; &#160; &#160; &#160; Database Buffers&#124;curr&#124;Data&#124; loop=10 wait=5 [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; 以前曾写过Oracle与MySQL的监控工具，但随着数据库版本的变化，性能指标也在发生变化，常常需要改进代码，然后再进行编译，比较麻烦。这个时间和OceanBase开发人员在一起久了，受了他们一点灵气的影响，想出了通用的监控工具的方法。</p>
<p>&nbsp; &nbsp; 将所有性能指标理解成一个Key及一个Value的组合，Key为字符串类型，Value为浮点数类型，可以自定义SQL在数据库中查询出来。比如下面的SQL语句：</p>
<blockquote class="prefont"><p>
select name, bytes from v$sgastat<br />
union all<br />
select name, value from v$sysstat
</p></blockquote>
<p>&nbsp; &nbsp; 将上面查询的结果，再加一个当前的时间点(Key=orastats.timestamp)存放到一个Hash表中，然后根据一定的格式规则显示出其中的数据，就是一个非常好的通用监控工具了，我们以如下SQL为例。</p>
<blockquote class="prefont"><p>
select name, value from v$sga
</p></blockquote>
<p>&nbsp; &nbsp; 输出格式使用如下格式进行控制，对任何一个Key需要指定数值的类型（显示当前值还是差量值？），然后指定一个简写的指标名字。</p>
<blockquote class="prefont"><p>
Key|{CURR|DELTA}|Label|...
</p></blockquote>
<p>&nbsp; &nbsp; 编写如下的文本文件(orastats.txt)。</p>
<blockquote class="prefont"><p>
user=sys<br />
query=select name, value from v$sga<br />
format=Fixed Size|curr|Fixed|<br />
&nbsp; &nbsp; &nbsp; &nbsp; Variable Size|curr|VarS|<br />
&nbsp; &nbsp; &nbsp; &nbsp; Database Buffers|curr|Data|<br />
loop=10<br />
wait=5
</p></blockquote>
<p>&nbsp; &nbsp; 使用orastats工具来运行，就可以得到如下有效的监控输出。</p>
<blockquote class="prefont"><p>
D:\MyTools\x64&gt;orastats parfile=orastats.txt<br />
2013-03-19 22:57:08 Fixed VarS Data<br />
2013-03-19 22:57:08 2174k 134m 134m<br />
2013-03-19 22:57:13 2174k 134m 134m<br />
2013-03-19 22:57:18 2174k 134m 134m<br />
2013-03-19 22:57:23 2174k 134m 134m<br />
2013-03-19 22:57:28 2174k 134m 134m<br />
2013-03-19 22:57:37 2174k 134m 134m
</p></blockquote>
<p>&nbsp; &nbsp; 不指定Format选项的话，会以Key/Value的方式显示数据。</p>
<blockquote class="prefont"><p>
D:\MyTools\x64&gt;orastats parfile=orastats.txt wait=5 loop=1 format=<br />
orastats.timestamp=2013-03-19 22:58:46<br />
Database Buffers=134217728.000000<br />
Fixed Size=2174888.000000<br />
Redo Buffers=5005312.000000<br />
Variable Size=134217816.000000
</p></blockquote>
<p>&nbsp; &nbsp; 为MySQL也准备了类拟的工具(mysqlstats)，这样的话数据库的版本变了，只需要改一下配置文件即可以跟上时代了，明天会加入Linux下的一些基本负载信息，就可以完全用于收集Oracle或MySQL的性能数据了。</p>

<div class="wp_rp_wrap  wp_rp_plain" id="wp_rp_first"><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2009/06/25 -- <a href="http://www.anysql.net/tools/oramon-system-event.html" class="wp_rp_title">oramon如何收集V$SYSTEM_EVENT数据?</a> (3)</li><li >2009/06/24 -- <a href="http://www.anysql.net/oracle/oramon-system-statistics.html" class="wp_rp_title">oramon如何从V$SYSSTAT收集性能数据?</a> (1)</li><li >2013/01/18 -- <a href="http://www.anysql.net/tools/mysql-text-unloader.html" class="wp_rp_title">从MySQL数据库自由导出文本</a> (0)</li><li >2013/02/01 -- <a href="http://www.anysql.net/tools/mysql-oracle-data-copy.html" class="wp_rp_title">从MySQL迁移数据到Oracle库的工具</a> (0)</li><li >2009/11/07 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-data-migration-test.html" class="wp_rp_title">MySQL数据迁移测试</a> (8)</li><li >2008/11/28 -- <a href="http://www.anysql.net/tools/ociuldr_data_form_display.html" class="wp_rp_title">ociuldr还有可改进之处!</a> (5)</li><li >2009/06/25 -- <a href="http://www.anysql.net/tools/oramon-session-history.html" class="wp_rp_title">oramon如何从V$SESSION收集性能数据?</a> (0)</li><li >2007/08/20 -- <a href="http://www.anysql.net/tools/oramon_running_one_week.html" class="wp_rp_title">oramon稳定运行一周</a> (5)</li><li >2007/04/10 -- <a href="http://www.anysql.net/mysql/mysql_binlog_concept.html" class="wp_rp_title">MySQL的binlog, InnoDB的日志和Oracle的日志</a> (4)</li><li >2010/01/26 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess2.html" class="wp_rp_title">逻辑连接层与物理连接层(2)</a> (1)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=iGEZAqC25co:v95GNejuLj4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=iGEZAqC25co:v95GNejuLj4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=iGEZAqC25co:v95GNejuLj4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=iGEZAqC25co:v95GNejuLj4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=iGEZAqC25co:v95GNejuLj4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=iGEZAqC25co:v95GNejuLj4:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/iGEZAqC25co" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/oracle-mysql-stats-perf-tool.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/oracle-mysql-stats-perf-tool.html</feedburner:origLink></item>
		<item>
		<title>从MySQL迁移数据到Oracle库的工具</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/3EEoddXMqmE/mysql-oracle-data-copy.html</link>
		<comments>http://www.anysql.net/tools/mysql-oracle-data-copy.html#comments</comments>
		<pubDate>Fri, 01 Feb 2013 13:16:02 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=812</guid>
		<description><![CDATA[&#160; &#160; MySQL用于处理简单事务，还是不错的，但用于保存较大的数据则还不行，一般公司的历史库之类的还是可以用Oracle进行保存，那么从MySQL如何迁移数据到Oracle呢？MySQL的文本导出工具（MYSQLULDR2）固然是一个不错的选择，将数据导成文本，然后用SQL*Loader进行导入，不过不落地的工具使用起来会更方便。在以前写的程序的基础上，很容易就写出了一个MYSQL2ORA工具，并且性能也不错。 &#160; &#160; 使用Direct Load方式，将MySQL的表对拷到Oracle数据库中，要以用如下语法，因为MySQL中建议用自增主键，所以相对于Oracle中多了一个ID列，在导入过程中使用FILLER选项直接跳过。 mysql2ora.exe user1=/@::test user2=test/test table1=emp_his table2=emp_his direct=yes filler=id &#160; &#160; &#160; &#160; &#160; 0 rows processed at 2013-02-01 21:01:39. &#160; &#160; 1000000 rows processed at 2013-02-01 21:01:41. &#160; &#160; 2000000 rows processed at 2013-02-01 21:01:44. &#160; &#160; 3000000 rows processed at 2013-02-01 21:01:46. &#160; &#160; 3830800 rows processed at [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; MySQL用于处理简单事务，还是不错的，但用于保存较大的数据则还不行，一般公司的历史库之类的还是可以用Oracle进行保存，那么从MySQL如何迁移数据到Oracle呢？MySQL的文本导出工具（MYSQLULDR2）固然是一个不错的选择，将数据导成文本，然后用SQL*Loader进行导入，不过不落地的工具使用起来会更方便。在以前写的程序的基础上，很容易就写出了一个MYSQL2ORA工具，并且性能也不错。</p>
<p>&nbsp; &nbsp; 使用Direct Load方式，将MySQL的表对拷到Oracle数据库中，要以用如下语法，因为MySQL中建议用自增主键，所以相对于Oracle中多了一个ID列，在导入过程中使用FILLER选项直接跳过。</p>
<blockquote class="prefont"><p>
mysql2ora.exe user1=/@::test user2=test/test table1=emp_his table2=emp_his direct=yes filler=id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  0 rows processed at 2013-02-01 21:01:39.<br />
&nbsp; &nbsp;  1000000 rows processed at 2013-02-01 21:01:41.<br />
&nbsp; &nbsp;  2000000 rows processed at 2013-02-01 21:01:44.<br />
&nbsp; &nbsp;  3000000 rows processed at 2013-02-01 21:01:46.<br />
&nbsp; &nbsp;  3830800 rows processed at 2013-02-01 21:01:48.
</p></blockquote>
<p>&nbsp; &nbsp; 使用普通方式，只要不加DIRECT选项就行了，拷贝数据的话，本质是源端一个SQL语句（query1）以及目标端一个DML语句（query2），大家可以更灵活地指定。</p>
<blockquote class="prefont"><p>
mysql2ora.exe user1=/@::test user2=test/test table1=emp_his table2=emp_his filler=id<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  0 rows processed at 2013-02-01 21:11:24.<br />
&nbsp; &nbsp;  1000000 rows processed at 2013-02-01 21:11:28.<br />
&nbsp; &nbsp;  2000000 rows processed at 2013-02-01 21:11:32.<br />
&nbsp; &nbsp;  3000000 rows processed at 2013-02-01 21:11:37.<br />
&nbsp; &nbsp;  3830800 rows processed at 2013-02-01 21:11:40.
</p></blockquote>
<p>&nbsp; &nbsp; 可以下载<a href="http://www.anysql.net/software/mysql2ora.zip">Windows版本</a>或<a href="http://www.anysql.net/software/mysql2ora_linux32_10204.zip">Linux版本</a>进行测试，商业环境使用请支持100RMB给开发者，以创造良好的技术生存环境。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2009/11/07 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-data-migration-test.html" class="wp_rp_title">MySQL数据迁移测试</a> (8)</li><li >2011/04/02 -- <a href="http://www.anysql.net/tools/oracle-mysql-data-migration-tool.html" class="wp_rp_title">Oracle到MySQL的数据迁移工具</a> (6)</li><li >2010/04/16 -- <a href="http://www.anysql.net/tools/parallel-inside-datacopy.html" class="wp_rp_title">DataCopy : Parallel Inside Now!</a> (3)</li><li >2012/06/05 -- <a href="http://www.anysql.net/tools/mysqlcopy-delete-source.html" class="wp_rp_title">使用mysqlcopy来迁移MySQL历史数据 </a> (0)</li><li >2011/03/28 -- <a href="http://www.anysql.net/tools/datacopy-300gb-data-test.html" class="wp_rp_title">DataCopy通过300GB的数据测试</a> (17)</li><li >2010/05/12 -- <a href="http://www.anysql.net/tools/datacopy-gui-version.html" class="wp_rp_title">图形版Oracle数据迁移工具</a> (11)</li><li >2010/03/20 -- <a href="http://www.anysql.net/tools/datacopy-conflict-filler-options.html" class="wp_rp_title">DataCopy选项: conflict和filler</a> (0)</li><li >2009/06/09 -- <a href="http://www.anysql.net/tools/copydata-perl-scripts.html" class="wp_rp_title">copydata异构数据拷贝</a> (6)</li><li >2013/03/19 -- <a href="http://www.anysql.net/tools/oracle-mysql-stats-perf-tool.html" class="wp_rp_title">orastats &#038; mysqlstats通用监控工具</a> (0)</li><li >2013/01/18 -- <a href="http://www.anysql.net/tools/mysql-text-unloader.html" class="wp_rp_title">从MySQL数据库自由导出文本</a> (0)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=3EEoddXMqmE:y_IJv8WyCZk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=3EEoddXMqmE:y_IJv8WyCZk:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=3EEoddXMqmE:y_IJv8WyCZk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=3EEoddXMqmE:y_IJv8WyCZk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=3EEoddXMqmE:y_IJv8WyCZk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=3EEoddXMqmE:y_IJv8WyCZk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/3EEoddXMqmE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/mysql-oracle-data-copy.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/mysql-oracle-data-copy.html</feedburner:origLink></item>
		<item>
		<title>按事务一致性导出的数据</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/ks8MyEoDPxs/sqluldr2-read-only-transaction.html</link>
		<comments>http://www.anysql.net/tools/sqluldr2-read-only-transaction.html#comments</comments>
		<pubDate>Thu, 31 Jan 2013 05:15:51 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Text]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=811</guid>
		<description><![CDATA[&#160; &#160; 昨天收到一邮件，内容如下： Hi Fangxin, I’ve just discovered your tool and am excited about the prospect of using it for some of our extract needs. The problem is, I often have sets of tables which must be extracted with a consistent view across those tables at a specific point in time. As such, we normally, [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; 昨天收到一邮件，内容如下：</p>
<blockquote class="prefont"><p>
Hi Fangxin,</p>
<p>I’ve just discovered your tool and am excited about the prospect of using it for some of our extract needs.  The problem is, I often have sets of tables which must be extracted with a consistent view across those tables at a specific point in time.  As such, we normally, set a read only transaction, extract the data from table 1 to file 1, then table 2 to file 2, then table 3 to file 3, then commit.  This gives us data integrity and consistency across those tables even if updates/deletes are going on while we are extracting.  Is there any way to accomplish this using your sqluldr2 tool?</p>
<p>Please note that our customer does not enable Oracle flashback in production so using the “as of” notation across separate runs is not an option.  Thanks in advance for your assistance.</p>
<p>-Eric
</p></blockquote>
<p>&nbsp; &nbsp; 想一想这个要求还是合理的，于是给工具增加了query2-query9的选项，以实现按事务导出功能，加上"presql"选项就可以实现按读事务导出了, 使用方法如下：</p>
<blockquote class="prefont"><p>
user=stats_user/stats_user@tooldb<br />
presql=set transaction read only<br />
query=select * from all_objects<br />
file=nul<br />
query2=select * from all_tables<br />
file2=nul
</p></blockquote>
<p>&nbsp; &nbsp; 执行的日志如下所示，在一个命令里导出多个表。</p>
<blockquote class="prefont"><p>
E:\&gt;.\sqluldr2 parfile=test.txt<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  0 rows exported at 2013-01-31 13:07:43, size 0 MB.<br />
&nbsp; &nbsp; &nbsp;  12916 rows exported at 2013-01-31 13:07:44, size 1 MB.<br />
&nbsp; &nbsp; &nbsp; &nbsp;  output file nul closed at 12916 rows, size 1 MB.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  0 rows exported at 2013-01-31 13:07:44, size 0 MB.<br />
&nbsp; &nbsp; &nbsp; &nbsp; 1435 rows exported at 2013-01-31 13:07:44, size 0 MB.<br />
&nbsp; &nbsp; &nbsp; &nbsp;  output file nul closed at 1435 rows, size 0 MB.
</p></blockquote>
<p>&nbsp; &nbsp; 不过这个改动还是没有能够满足那个网友的要求，他有192个表需要在一个事务里时出，用SQL*Plus太慢了，才找到我这个工具的，这样的需求是不是有一点点特殊? 还是大家都有同样的需求？</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2010/06/19 -- <a href="http://www.anysql.net/tools/sqluldr2-non-free-features.html" class="wp_rp_title">2011年起SQLULDR2中的收费功能</a> (11)</li><li >2010/04/18 -- <a href="http://www.anysql.net/tools/parallel-inside-sqluldr2.html" class="wp_rp_title">SQLULDR2 : Parallel Inside Now!</a> (12)</li><li >2010/06/24 -- <a href="http://www.anysql.net/tools/sqluldr2-charset-option.html" class="wp_rp_title">控制SQLULDR2的字符集</a> (6)</li><li >2010/05/11 -- <a href="http://www.anysql.net/tools/sqluldr2-gui-version.html" class="wp_rp_title">图形版Oracle文本导出工具</a> (10)</li><li >2010/02/08 -- <a href="http://www.anysql.net/tools/sqluldr2-form-display.html" class="wp_rp_title">SQLULDR2也可改善用户体验</a> (5)</li><li >2008/01/25 -- <a href="http://www.anysql.net/tools/ociuldr_update_20080125.html" class="wp_rp_title">ociuldr更新(2008/01/25)</a> (16)</li><li >2013/01/14 -- <a href="http://www.anysql.net/tools/sqluldr2-content-cryption.html" class="wp_rp_title">SQLULDR2的安全保密功能</a> (8)</li><li >2009/04/02 -- <a href="http://www.anysql.net/tools/sqluldr2_license.html" class="wp_rp_title">给SQLULDR2加上Key保护</a> (6)</li><li >2009/03/31 -- <a href="http://www.anysql.net/tools/sqluldr2_simple_query.html" class="wp_rp_title">指定表名导出文本</a> (0)</li><li >2009/10/27 -- <a href="http://www.anysql.net/tools/sqluldr2-more-escape-chars.html" class="wp_rp_title">将SQLULDR2转义符进行到底</a> (3)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=ks8MyEoDPxs:xQ7dTI7apUY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=ks8MyEoDPxs:xQ7dTI7apUY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=ks8MyEoDPxs:xQ7dTI7apUY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=ks8MyEoDPxs:xQ7dTI7apUY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=ks8MyEoDPxs:xQ7dTI7apUY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=ks8MyEoDPxs:xQ7dTI7apUY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/ks8MyEoDPxs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/sqluldr2-read-only-transaction.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/sqluldr2-read-only-transaction.html</feedburner:origLink></item>
		<item>
		<title>从MySQL数据库自由导出文本</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/QKCzgZlRIlg/mysql-text-unloader.html</link>
		<comments>http://www.anysql.net/tools/mysql-text-unloader.html#comments</comments>
		<pubDate>Fri, 18 Jan 2013 00:04:33 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=809</guid>
		<description><![CDATA[&#160; &#160; MySQL上处理一些简单的事务是不错的，但历史数据的保存不能靠MySQL，所以还是得将数据导出来，存放到其他数据库（Oracle）或数据仓库（HBase），MySQL本身虽然提供了生成文本文件的方法，但并不是很好用，比如将文本文件导入到Oracle的话，还需要一个控制文件，编写控制文件是一个比较麻烦的事情，SQL Server或Sybase也需要一个格式说明文件，才能方便地导入。为此将Oracle的文本导出工具改造了一下，发布了MySQL版的文本导出工具 -- MySQLULDR2。 SQL*UnLoader: Fast Oracle Text Unloader (GZIP, Parallel), Release 4.0.1 (@) Copyright Lou Fangxin (AnySQL.net) 2004 - 2010, all rights reserved. Usage: MYSQLULDR2 keyword=value [,keyword=value,...] Valid Keywords: &#160; user&#160; &#160; = username/password@tnsname &#160; sql&#160; &#160; = SQL file name &#160; query&#160; = select statement &#160; field&#160; = separator string between [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; MySQL上处理一些简单的事务是不错的，但历史数据的保存不能靠MySQL，所以还是得将数据导出来，存放到其他数据库（Oracle）或数据仓库（HBase），MySQL本身虽然提供了生成文本文件的方法，但并不是很好用，比如将文本文件导入到Oracle的话，还需要一个控制文件，编写控制文件是一个比较麻烦的事情，SQL Server或Sybase也需要一个格式说明文件，才能方便地导入。为此将Oracle的文本导出工具改造了一下，发布了MySQL版的文本导出工具 -- MySQLULDR2。</p>
<blockquote class="prefont"><p>
SQL*UnLoader: Fast Oracle Text Unloader (GZIP, Parallel), Release 4.0.1<br />
(@) Copyright Lou Fangxin (AnySQL.net) 2004 - 2010, all rights reserved.</p>
<p>Usage: MYSQLULDR2 keyword=value [,keyword=value,...]</p>
<p>Valid Keywords:<br />
&nbsp;  user&nbsp; &nbsp; = username/password@tnsname<br />
&nbsp;  sql&nbsp; &nbsp;  = SQL file name<br />
&nbsp;  query&nbsp;  = select statement<br />
&nbsp;  field&nbsp;  = separator string between fields<br />
&nbsp;  record&nbsp; = separator string between records<br />
&nbsp;  rows&nbsp; &nbsp; = print progress for every given rows (default, 1000000)<br />
&nbsp;  file&nbsp; &nbsp; = output file name(default: uldrdata.txt)<br />
&nbsp;  log&nbsp; &nbsp;  = log file name, prefix with + to append mode<br />
&nbsp;  fast&nbsp; &nbsp; = auto tuning the session level parameters(YES)<br />
&nbsp;  text&nbsp; &nbsp; = output type (MYSQL, CSV, MYSQLINS, ORACLEINS, FORM, SEARCH).<br />
&nbsp;  charset = character set name of the target database.<br />
&nbsp;  ncharset= national character set name of the target database.<br />
&nbsp;  parfile = read command option from parameter file</p>
<p>&nbsp; for field and record, you can use '0x' to specify hex character code,<br />
&nbsp; \r=0x0d \n=0x0a |=0x7c ,=0x2c, \t=0x09, :=0x3a, #=0x23, "=0x22 '=0x27
</p></blockquote>
<p>&nbsp; &nbsp; 使用方法很简单，指定一个连接信息（用户名/口令@主机:端口:数据库），并指定一个查询语句或者表名就可以了。比如：</p>
<blockquote class="prefont"><p>
D:\MyTools&gt;mysqluldr2 /@::test query=emp_his file=emp_his.txt<br />
&nbsp; &nbsp; &nbsp;  0 rows exported at 2013-01-18 07:56:14, size 0 MB.<br />
&nbsp; 819200 rows exported at 2013-01-18 07:56:16, size 42 MB.<br />
&nbsp; &nbsp; &nbsp; &nbsp;  output file emp_his.txt closed at 819200 rows, size 42 MB.
</p></blockquote>
<p>&nbsp; &nbsp; 直接指定表名时，会自动生成Oracle SQL*Loader的控制文件，内容如下：</p>
<blockquote class="prefont"><p>
OPTIONS(BINDSIZE=2097152,READSIZE=2097152,ERRORS=-1,ROWS=50000)<br />
LOAD DATA<br />
INFILE 'emp_his.txt' "STR X'0a'"<br />
INSERT INTO TABLE emp_his<br />
FIELDS TERMINATED BY X'2c' TRAILING NULLCOLS <br />
(<br />
&nbsp; empno CHAR(16) NULLIF empno=BLANKS,<br />
&nbsp; ename CHAR(10) NULLIF ename=BLANKS,<br />
&nbsp; job CHAR(9) NULLIF job=BLANKS,<br />
&nbsp; mgr CHAR(16) NULLIF mgr=BLANKS,<br />
&nbsp; hiredate DATE "YYYY-MM-DD HH24:MI:SS" NULLIF hiredate=BLANKS,<br />
&nbsp; sal CHAR(20) NULLIF sal=BLANKS,<br />
&nbsp; comm CHAR(20) NULLIF comm=BLANKS,<br />
&nbsp; deptno CHAR(16) NULLIF deptno=BLANKS<br />
)
</p></blockquote>
<p>&nbsp; &nbsp; 可以下载<a href="http://www.anysql.net/software/mysqluldr2.zip">Windows版本</a>或<a href="http://www.anysql.net/software/mysqluldr2_linux32.zip">Linux版本</a>进行测试，商业环境使用请支持100RMB给开发者，以创造良好的技术生存环境。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2010/06/24 -- <a href="http://www.anysql.net/tools/sqluldr2-charset-option.html" class="wp_rp_title">控制SQLULDR2的字符集</a> (6)</li><li >2010/03/06 -- <a href="http://www.anysql.net/tools/sqluldr2-better-command-options.html" class="wp_rp_title">简化SQLULDR2的命令行选项设置</a> (1)</li><li >2009/10/27 -- <a href="http://www.anysql.net/tools/sqluldr2-more-escape-chars.html" class="wp_rp_title">将SQLULDR2转义符进行到底</a> (3)</li><li >2009/12/25 -- <a href="http://www.anysql.net/tools/sqluldr2-customized-escape-chars.html" class="wp_rp_title">SQLULDR2的自定义转义符处理</a> (2)</li><li >2009/10/26 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-escape-char.html" class="wp_rp_title">SQLULDR2处理MySQL转义符</a> (1)</li><li >2009/03/23 -- <a href="http://www.anysql.net/tools/sqluldr_comming.html" class="wp_rp_title">ociuldr企业版, sqluldr</a> (27)</li><li >2009/10/28 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-insert-sqls.html" class="wp_rp_title">SQLULDR2生成Insert SQL语句</a> (4)</li><li >2009/10/30 -- <a href="http://www.anysql.net/tools/sqluldr2-high-perf-insert-unload.html" class="wp_rp_title">SQLULDR2功能增加, 性能不减</a> (14)</li><li >2012/06/05 -- <a href="http://www.anysql.net/tools/mysqlcopy-delete-source.html" class="wp_rp_title">使用mysqlcopy来迁移MySQL历史数据 </a> (0)</li><li >2008/11/28 -- <a href="http://www.anysql.net/tools/ociuldr_data_form_display.html" class="wp_rp_title">ociuldr还有可改进之处!</a> (5)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=QKCzgZlRIlg:QfXqTvesfgg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=QKCzgZlRIlg:QfXqTvesfgg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=QKCzgZlRIlg:QfXqTvesfgg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=QKCzgZlRIlg:QfXqTvesfgg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=QKCzgZlRIlg:QfXqTvesfgg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=QKCzgZlRIlg:QfXqTvesfgg:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/QKCzgZlRIlg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/mysql-text-unloader.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/mysql-text-unloader.html</feedburner:origLink></item>
		<item>
		<title>SQLULDR2的安全保密功能</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/wSucV4sb1nQ/sqluldr2-content-cryption.html</link>
		<comments>http://www.anysql.net/tools/sqluldr2-content-cryption.html#comments</comments>
		<pubDate>Mon, 14 Jan 2013 08:39:11 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQLLDR]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=806</guid>
		<description><![CDATA[&#160; &#160; SQLULDR2也许是我所有工具中被使用最广泛的，因此也是最成熟的，上一次修改需求是在一年多以前，为MySQL的Insert语句导出功能增加Hex函数支持。不过用户的需求是无止境的，有网友要求增加一个安全保密功能，对导出的数据内容进行简单的加密操作,我觉得是合理的功能，就快速实现了。 &#160; &#160; 只需要在导出时加上"crack"选项，指定加密的KEY就可以了，不管生成的是格式化文本，还是Insert语句，所有内容都被加密了。 E:\&#62;sqluldr2 user=dict/ali88@tooldb query=tab file=a.dat crack=anysql &#160; &#160; &#160; 0 rows exported at 2013-01-14 16:28:06, size 0 MB. &#160; &#160; 128 rows exported at 2013-01-14 16:28:06, size 0 MB. &#160; &#160; &#160; &#160; output file a.dat closed at 128 rows, size 0 MB. &#160; &#160; 同样SQLULDR2也提供了解密功能，同样需要用"uncrack"选项来指定解密的KEY，以及用"file"选项来指定要解密的文件（可以接受标准输入），解密后的内容写出到标准输出设备。 E:\&#62;sqluldr2 uncrack=anysql file=a.dat TASK_INFO,TABLE, [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; SQLULDR2也许是我所有工具中被使用最广泛的，因此也是最成熟的，上一次修改需求是在一年多以前，为MySQL的Insert语句导出功能增加Hex函数支持。不过用户的需求是无止境的，有网友要求增加一个安全保密功能，对导出的数据内容进行简单的加密操作,我觉得是合理的功能，就快速实现了。</p>
<p>&nbsp; &nbsp; 只需要在导出时加上"crack"选项，指定加密的KEY就可以了，不管生成的是格式化文本，还是Insert语句，所有内容都被加密了。</p>
<blockquote class="prefont"><p>
E:\&gt;sqluldr2 user=dict/ali88@tooldb query=tab file=a.dat crack=anysql<br />
&nbsp; &nbsp; &nbsp;  0 rows exported at 2013-01-14 16:28:06, size 0 MB.<br />
&nbsp; &nbsp;  128 rows exported at 2013-01-14 16:28:06, size 0 MB.<br />
&nbsp; &nbsp; &nbsp; &nbsp;  output file a.dat closed at 128 rows, size 0 MB.
</p></blockquote>
<p>&nbsp; &nbsp; 同样SQLULDR2也提供了解密功能，同样需要用"uncrack"选项来指定解密的KEY，以及用"file"选项来指定要解密的文件（可以接受标准输入），解密后的内容写出到标准输出设备。</p>
<blockquote class="prefont"><p>
E:\&gt;sqluldr2 uncrack=anysql file=a.dat<br />
TASK_INFO,TABLE,<br />
ALI_SQLFILE,TABLE,<br />
ALI_SQLSTATEMENT,TABLE,<br />
TRANS_TMP_1,TABLE,<br />
TRANS_TMP_2,TABLE,<br />
......
</p></blockquote>
<p>&nbsp; &nbsp; 如果要接受标准输入来进行解释，则指定"file"选项的值为"-"就可以。</p>
<blockquote class="prefont"><p>
E:\&gt;type a.dat | sqluldr2 uncrack=anysql file=-<br />
TASK_INFO,TABLE,<br />
ALI_SQLFILE,TABLE,<br />
ALI_SQLSTATEMENT,TABLE,<br />
TRANS_TMP_1,TABLE,<br />
TRANS_TMP_2,TABLE,<br />
......
</p></blockquote>
<p>&nbsp; &nbsp; 加密功能本身的逻辑比较简单，并且会影响性能，希望不是在巨量数据导出中使用。</></p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2008/01/25 -- <a href="http://www.anysql.net/tools/ociuldr_update_20080125.html" class="wp_rp_title">ociuldr更新(2008/01/25)</a> (16)</li><li >2006/11/23 -- <a href="http://www.anysql.net/tools/ociuldr_option_batch.html" class="wp_rp_title">ociuldr支持分成几个文件导出了</a> (8)</li><li >2009/05/08 -- <a href="http://www.anysql.net/tools/sqluldr2_free_of_charge.html" class="wp_rp_title">SQLULDR2免费使用</a> (8)</li><li >2009/10/27 -- <a href="http://www.anysql.net/tools/sqluldr2-more-escape-chars.html" class="wp_rp_title">将SQLULDR2转义符进行到底</a> (3)</li><li >2009/04/02 -- <a href="http://www.anysql.net/tools/sqluldr2_license.html" class="wp_rp_title">给SQLULDR2加上Key保护</a> (6)</li><li >2009/04/16 -- <a href="http://www.anysql.net/tools/sqluldr2_compress.html" class="wp_rp_title">SQLULDR2集成GZIP压缩</a> (8)</li><li >2007/01/02 -- <a href="http://www.anysql.net/tools/ociuldr_bind_variable.html" class="wp_rp_title">在ociuldr的SQL中使用绑定变量</a> (4)</li><li >2007/08/22 -- <a href="http://www.anysql.net/tools/ociuldr_option_array.html" class="wp_rp_title">ociuldr的更新, 为了更好的long类型支持</a> (1)</li><li >2010/04/18 -- <a href="http://www.anysql.net/tools/parallel-inside-sqluldr2.html" class="wp_rp_title">SQLULDR2 : Parallel Inside Now!</a> (12)</li><li >2009/10/30 -- <a href="http://www.anysql.net/tools/sqluldr2-high-perf-insert-unload.html" class="wp_rp_title">SQLULDR2功能增加, 性能不减</a> (14)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=wSucV4sb1nQ:Z_qxcoH8Cbw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=wSucV4sb1nQ:Z_qxcoH8Cbw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=wSucV4sb1nQ:Z_qxcoH8Cbw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=wSucV4sb1nQ:Z_qxcoH8Cbw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=wSucV4sb1nQ:Z_qxcoH8Cbw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=wSucV4sb1nQ:Z_qxcoH8Cbw:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/wSucV4sb1nQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/sqluldr2-content-cryption.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/sqluldr2-content-cryption.html</feedburner:origLink></item>
		<item>
		<title>用自定义Tag在JSP中集成WebChart的图表功能</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/VKOTLCCEtdY/webchart-jsp-tag-support.html</link>
		<comments>http://www.anysql.net/tools/webchart-jsp-tag-support.html#comments</comments>
		<pubDate>Wed, 25 Jul 2012 05:42:11 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=804</guid>
		<description><![CDATA[&#160; &#160; WebChart可以让我们很方便地显示表格和图形，但对于页面布快控制，则不够灵活，而JSP页面可以很好地控制页面布局，但不容易解决表格和图形的显示功能。如果两者能结合起来，使用上就会更灵活，简单的页面布局可以用WebChart自带的，而复杂的页面布局则可以用JSP来控制。 &#160; &#160; 通过为WebChart编写自定议的JSP Tag库，就可以做到这两者的无缝集成，在JSP页面中先引入WebChart的Tag库。 &#60;%@ taglib uri="webchart" prefix="webchart" %&#62; &#160; &#160; 然后可以在页面中，直接使用Tag来引用WebChart的功能，可以通过文件名进行调用。 &#60;webchart:webchart page="test.rhtml" /&#62; &#160; &#160; 或者直接将页面定义在标记中，例如： &#60;webchart:webchart&#62;webchart.cache=gantt_demowebchart.type=barwebchart.width=450webchart.height=320webchart.query_1=select col1, col4 from gantt_demo&#60;/webchart:webchart&#62; &#160; &#160; 下面是一个完整的JSP代码，用来从数据库中查询数据，然后阵出一个条状图表。 &#60;%@ taglib uri="webchart" prefix="webchart" %&#62; &#60;HTML&#62; &#60;HEAD&#62; &#60;TITLE&#62;WebChart in JSP Demo&#60;/TITLE&#62; &#60;/HEAD&#62; &#60;BODY bgcolor="#ffffcc"&#62; &#60;webchart:webchart&#62; webchart.cache=gantt_demo webchart.alpha=0.8 webchart.type=bar webchart.width=450 webchart.height=320 webchart.query_1=select col1, col4 from gantt_demo &#60;/webchart:webchart&#62; [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; WebChart可以让我们很方便地显示表格和图形，但对于页面布快控制，则不够灵活，而JSP页面可以很好地控制页面布局，但不容易解决表格和图形的显示功能。如果两者能结合起来，使用上就会更灵活，简单的页面布局可以用WebChart自带的，而复杂的页面布局则可以用JSP来控制。</p>
<p>&nbsp; &nbsp; 通过为WebChart编写自定议的JSP Tag库，就可以做到这两者的无缝集成，在JSP页面中先引入WebChart的Tag库。</p>
<blockquote class="prefont"><p>
&lt;%@ taglib uri="webchart" prefix="webchart" %&gt;</p></blockquote>
<p>&nbsp; &nbsp; 然后可以在页面中，直接使用Tag来引用WebChart的功能，可以通过文件名进行调用。</p>
<blockquote class="prefont"><p>
&lt;webchart:webchart page="test.rhtml" /&gt;
</p></blockquote>
<p>&nbsp; &nbsp; 或者直接将页面定义在标记中，例如：</p>
<blockquote class="prefont"><p>
&lt;webchart:webchart&gt;<br />webchart.cache=gantt_demo<br />webchart.type=bar<br />webchart.width=450<br />webchart.height=320<br />webchart.query_1=select col1, col4 from gantt_demo<br />&lt;/webchart:webchart&gt;
</p></blockquote>
<p>&nbsp; &nbsp; 下面是一个完整的JSP代码，用来从数据库中查询数据，然后阵出一个条状图表。</p>
<blockquote class="prefont"><p>
&lt;%@ taglib uri="webchart" prefix="webchart" %&gt;</p>
<p>&lt;HTML&gt;<br />
&lt;HEAD&gt;<br />
&lt;TITLE&gt;WebChart in JSP Demo&lt;/TITLE&gt;<br />
&lt;/HEAD&gt;</p>
<p>&lt;BODY bgcolor="#ffffcc"&gt;</p>
<p>&lt;webchart:webchart&gt;<br />
webchart.cache=gantt_demo<br />
webchart.alpha=0.8<br />
webchart.type=bar<br />
webchart.width=450<br />
webchart.height=320<br />
webchart.query_1=select col1, col4 from gantt_demo<br />
&lt;/webchart:webchart&gt;</p>
<p>&lt;/BODY&gt;<br />
&lt;/HTML&gt;
</p></blockquote>
<p>&nbsp; &nbsp; WebChart中的连接池功能、高级缓存功能在JSP中同样有效，可以非常快速地创建高效的页面程序，不浪费时间是现代工作中最重要的一个原则。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2009/07/08 -- <a href="http://www.anysql.net/tools/webchart-data-unionall.html" class="wp_rp_title">DataReport的结果集合并</a> (0)</li><li >2009/04/20 -- <a href="http://www.anysql.net/tools/webchart_multi_lines_value.html" class="wp_rp_title">设定WebChart多行值</a> (0)</li><li >2009/06/30 -- <a href="http://www.anysql.net/tools/webchart-query-data-share.html" class="wp_rp_title">DataReport的数据共享改进</a> (2)</li><li >2010/05/07 -- <a href="http://www.anysql.net/tools/webchart-batch-query.html" class="wp_rp_title">批量数据查询需求</a> (0)</li><li >2009/07/25 -- <a href="http://www.anysql.net/tools/webchart-business-chart-service.html" class="wp_rp_title">DataReport的图片服务功能</a> (0)</li><li >2009/07/20 -- <a href="http://www.anysql.net/tools/tomcat6-page-encoding.html" class="wp_rp_title">解决Tomcat 6上的中文问题</a> (0)</li><li >2009/04/01 -- <a href="http://www.anysql.net/tools/webchart_custom_colors.html" class="wp_rp_title">WebChart的颜色定制</a> (0)</li><li >2009/07/23 -- <a href="http://www.anysql.net/tools/webchart-cell-formater.html" class="wp_rp_title">更灵活的DataReport格式控制</a> (0)</li><li >2010/03/04 -- <a href="http://www.anysql.net/tools/webchart-rows-filter.html" class="wp_rp_title">为DataReport增加条件过滤功能</a> (1)</li><li >2009/12/28 -- <a href="http://www.anysql.net/tools/webchart-one-java-servlet.html" class="wp_rp_title">统一DataReport的Servlet</a> (2)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=VKOTLCCEtdY:0JefM2rwzqo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=VKOTLCCEtdY:0JefM2rwzqo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=VKOTLCCEtdY:0JefM2rwzqo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=VKOTLCCEtdY:0JefM2rwzqo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=VKOTLCCEtdY:0JefM2rwzqo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=VKOTLCCEtdY:0JefM2rwzqo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/VKOTLCCEtdY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-jsp-tag-support.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-jsp-tag-support.html</feedburner:origLink></item>
		<item>
		<title>让WebChart从本地文件读取数据</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/zS89PMrbX1I/webchart-load-text-file.html</link>
		<comments>http://www.anysql.net/tools/webchart-load-text-file.html#comments</comments>
		<pubDate>Wed, 06 Jun 2012 08:26:04 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=803</guid>
		<description><![CDATA[&#160; &#160; WebChart是做简易数据分析的好平台，但要求数据先进入到数据库，这个限制会使做一些临时性的数据分析的工作比较复杂，比如从日志grep出来的数据，很容易存成格式化文本，但装载到数据库这一步，却让很多人非DBA的从业人员感到为难。本着客户第一的精神，对WebChart做了改进，可以从本地文件读取数据。 &#160; &#160; 在磁盘上有一个文件(datatest.txt)，里面包含如下记录： D:\&#62;type datatest.txt A,10 B,20 C,30 D:\&#62; &#160; &#160; 在WebChart中可以用DATA标记，来指定各个列的类型，并且读入指定的文本文件，这时可以不指定QUERY标记。 WEBCHART.DATA_1= &#160; &#160; ADD X VARCHAR &#160; &#160; ADD Y INTEGER &#160; &#160; LOAD D:\\DATATEST.TXT , &#160; &#160; 接下来就可以在网页上使用数据了，不过这个功能不支持行列转换（交叉表）功能，希望这个本地数据读取功能能给你带来工作上的方便。 Relative Posts:2009/06/30 -- DataReport的数据共享改进 (2)2009/12/29 -- DataReport中的Cache为王 (4)2010/01/20 -- 逻辑连接层与物理连接层 (4)2009/04/20 -- 设定WebChart多行值 (0)2010/12/18 -- 控制DataReport的表格格式 (5)2010/01/08 -- DataReport的重复值合并 (0)2009/07/08 -- [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; WebChart是做简易数据分析的好平台，但要求数据先进入到数据库，这个限制会使做一些临时性的数据分析的工作比较复杂，比如从日志grep出来的数据，很容易存成格式化文本，但装载到数据库这一步，却让很多人非DBA的从业人员感到为难。本着客户第一的精神，对WebChart做了改进，可以从本地文件读取数据。</p>
<p>&nbsp; &nbsp; 在磁盘上有一个文件(datatest.txt)，里面包含如下记录：</p>
<blockquote class="prefont"><p>
D:\&gt;type datatest.txt<br />
A,10<br />
B,20<br />
C,30<br />
D:\&gt;
</p></blockquote>
<p>&nbsp; &nbsp; 在WebChart中可以用DATA标记，来指定各个列的类型，并且读入指定的文本文件，这时可以不指定QUERY标记。</p>
<blockquote class="prefont"><p>
WEBCHART.DATA_1=<br />
&nbsp; &nbsp; ADD X VARCHAR<br />
&nbsp; &nbsp; ADD Y INTEGER<br />
&nbsp; &nbsp; LOAD D:\\DATATEST.TXT ,
</p></blockquote>
<p>&nbsp; &nbsp; 接下来就可以在网页上使用数据了，不过这个功能不支持行列转换（交叉表）功能，希望这个本地数据读取功能能给你带来工作上的方便。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2009/06/30 -- <a href="http://www.anysql.net/tools/webchart-query-data-share.html" class="wp_rp_title">DataReport的数据共享改进</a> (2)</li><li >2009/12/29 -- <a href="http://www.anysql.net/tools/webchart-page-cache.html" class="wp_rp_title">DataReport中的Cache为王</a> (4)</li><li >2010/01/20 -- <a href="http://www.anysql.net/tools/webchart-logical-dbaccess.html" class="wp_rp_title">逻辑连接层与物理连接层</a> (4)</li><li >2009/04/20 -- <a href="http://www.anysql.net/tools/webchart_multi_lines_value.html" class="wp_rp_title">设定WebChart多行值</a> (0)</li><li >2010/12/18 -- <a href="http://www.anysql.net/tools/datareport-table-formater.html" class="wp_rp_title">控制DataReport的表格格式</a> (5)</li><li >2010/01/08 -- <a href="http://www.anysql.net/tools/webchart-merge-dup-values.html" class="wp_rp_title">DataReport的重复值合并</a> (0)</li><li >2009/07/08 -- <a href="http://www.anysql.net/tools/webchart-data-unionall.html" class="wp_rp_title">DataReport的结果集合并</a> (0)</li><li >2010/03/04 -- <a href="http://www.anysql.net/tools/webchart-rows-filter.html" class="wp_rp_title">为DataReport增加条件过滤功能</a> (1)</li><li >2009/07/20 -- <a href="http://www.anysql.net/tools/tomcat6-page-encoding.html" class="wp_rp_title">解决Tomcat 6上的中文问题</a> (0)</li><li >2009/04/01 -- <a href="http://www.anysql.net/tools/webchart_custom_colors.html" class="wp_rp_title">WebChart的颜色定制</a> (0)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=zS89PMrbX1I:Yijjaw1wtdA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=zS89PMrbX1I:Yijjaw1wtdA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=zS89PMrbX1I:Yijjaw1wtdA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=zS89PMrbX1I:Yijjaw1wtdA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=zS89PMrbX1I:Yijjaw1wtdA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=zS89PMrbX1I:Yijjaw1wtdA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/zS89PMrbX1I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchart-load-text-file.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchart-load-text-file.html</feedburner:origLink></item>
		<item>
		<title>使用mysqlcopy来迁移MySQL历史数据</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/KvEXJgXK16w/mysqlcopy-delete-source.html</link>
		<comments>http://www.anysql.net/tools/mysqlcopy-delete-source.html#comments</comments>
		<pubDate>Tue, 05 Jun 2012 03:56:57 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=801</guid>
		<description><![CDATA[&#160; &#160; mysqlcopy工具可以很方便地用来在MySQL库之间拷贝数据，虽然极限速度上没有通过文本LOAD DATA来得快，但一秒钟两三万条足够一般场合使用了。除了拷贝数据的场合外，我们还有移动数据的需求，也就是在拷贝后还要删除原端的原始数据，来做行级历史数据迁移，mysqlcopy的delete选项就是为此目的设计的。 &#160; &#160; 假设我们有TEST3和TEST4两个表，要将TEST3的记录移动到TEST4表中。 mysql&#62; select count(*) from test3; +----------+ &#124; count(*) &#124; +----------+ &#124;&#160; &#160; 13088 &#124; +----------+ 1 row in set (0.01 sec) mysql&#62; select count(*) from test4; +----------+ &#124; count(*) &#124; +----------+ &#124;&#160; &#160; &#160; &#160; 0 &#124; +----------+ 1 row in set (0.00 sec) &#160; &#160; 为mysqlcopy配置一个参数文件，请注意DELETE选项可以指定一个在源端数据库要执行的SQL语句. E:\dbpress&#62;type [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; mysqlcopy工具可以很方便地用来在MySQL库之间拷贝数据，虽然极限速度上没有通过文本LOAD DATA来得快，但一秒钟两三万条足够一般场合使用了。除了拷贝数据的场合外，我们还有移动数据的需求，也就是在拷贝后还要删除原端的原始数据，来做行级历史数据迁移，mysqlcopy的delete选项就是为此目的设计的。</p>
<p>&nbsp; &nbsp; 假设我们有TEST3和TEST4两个表，要将TEST3的记录移动到TEST4表中。</p>
<blockquote class="prefont"><p>
mysql&gt; select count(*) from test3;<br />
+----------+<br />
| count(*) |<br />
+----------+<br />
|&nbsp; &nbsp; 13088 |<br />
+----------+<br />
1 row in set (0.01 sec)</p>
<p>mysql&gt; select count(*) from test4;<br />
+----------+<br />
| count(*) |<br />
+----------+<br />
|&nbsp; &nbsp; &nbsp; &nbsp; 0 |<br />
+----------+<br />
1 row in set (0.00 sec)
</p></blockquote>
<p>&nbsp; &nbsp; 为mysqlcopy配置一个参数文件，请注意DELETE选项可以指定一个在源端数据库要执行的SQL语句. </p>
<blockquote class="prefont"><p>
E:\dbpress&gt;type test.txt<br />
user1=/@::test<br />
user2=/@::test<br />
table1=test3<br />
table2=test4<br />
sync=arrins<br />
delete=delete from test3 where object_id=:object_id
</p></blockquote>
<p>&nbsp; &nbsp; 在命令行下，可以很方便地进行MySQL库之间的数据迁移了. </p>
<blockquote class="prefont"><p>
E:\dbpress&gt;mysqlcopy parfile=test.txt<br />
&nbsp; &nbsp; &nbsp; &nbsp;  0 rows processed at 2012-06-05 11:34:06.<br />
&nbsp; &nbsp;  13088 rows processed at 2012-06-05 11:34:10.
</p></blockquote>
<p>&nbsp; &nbsp; 检查一下结果，是否所有的记录过去了？</p>
<blockquote class="prefont"><p>
mysql&gt; select count(*) from test3;<br />
+----------+<br />
| count(*) |<br />
+----------+<br />
|&nbsp; &nbsp; &nbsp; &nbsp; 0 |<br />
+----------+<br />
1 row in set (0.00 sec)</p>
<p>mysql&gt; select count(*) from test4;<br />
+----------+<br />
| count(*) |<br />
+----------+<br />
|&nbsp; &nbsp; 13088 |<br />
+----------+<br />
1 row in set (0.02 sec)
</p></blockquote>
<p>&nbsp; &nbsp; 此工具并没有使用分布式事务来保证事务性，只是保证在目标端数据库提交成功后，源端的DELETE才会提交。请不要用于非常严格要求的财务数据的迁移。在没有DB LINK的MySQL库之间，这个工具可以发挥DB Link的部份作用。专业去IOE DBA团队，尽在阿里巴巴！</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2011/04/02 -- <a href="http://www.anysql.net/tools/oracle-mysql-data-migration-tool.html" class="wp_rp_title">Oracle到MySQL的数据迁移工具</a> (6)</li><li >2009/03/31 -- <a href="http://www.anysql.net/tools/sqluldr2_simple_query.html" class="wp_rp_title">指定表名导出文本</a> (0)</li><li >2009/10/27 -- <a href="http://www.anysql.net/tools/sqluldr2-more-escape-chars.html" class="wp_rp_title">将SQLULDR2转义符进行到底</a> (3)</li><li >2011/03/28 -- <a href="http://www.anysql.net/tools/datacopy-300gb-data-test.html" class="wp_rp_title">DataCopy通过300GB的数据测试</a> (17)</li><li >2008/11/28 -- <a href="http://www.anysql.net/tools/ociuldr_data_form_display.html" class="wp_rp_title">ociuldr还有可改进之处!</a> (5)</li><li >2009/10/26 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-escape-char.html" class="wp_rp_title">SQLULDR2处理MySQL转义符</a> (1)</li><li >2009/10/30 -- <a href="http://www.anysql.net/tools/sqluldr2-high-perf-insert-unload.html" class="wp_rp_title">SQLULDR2功能增加, 性能不减</a> (14)</li><li >2013/01/18 -- <a href="http://www.anysql.net/tools/mysql-text-unloader.html" class="wp_rp_title">从MySQL数据库自由导出文本</a> (0)</li><li >2009/12/25 -- <a href="http://www.anysql.net/tools/sqluldr2-customized-escape-chars.html" class="wp_rp_title">SQLULDR2的自定义转义符处理</a> (2)</li><li >2009/10/28 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-insert-sqls.html" class="wp_rp_title">SQLULDR2生成Insert SQL语句</a> (4)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=KvEXJgXK16w:qjS-e5d2BSA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=KvEXJgXK16w:qjS-e5d2BSA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=KvEXJgXK16w:qjS-e5d2BSA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=KvEXJgXK16w:qjS-e5d2BSA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=KvEXJgXK16w:qjS-e5d2BSA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=KvEXJgXK16w:qjS-e5d2BSA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/KvEXJgXK16w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/mysqlcopy-delete-source.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/mysqlcopy-delete-source.html</feedburner:origLink></item>
		<item>
		<title>用squldr2进行Oracle到MySQL的数据迁移</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/oImUgdoQUtk/sqluldr2-mysql-data-migration.html</link>
		<comments>http://www.anysql.net/tools/sqluldr2-mysql-data-migration.html#comments</comments>
		<pubDate>Thu, 17 May 2012 01:00:47 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=799</guid>
		<description><![CDATA[&#160; &#160; 从Oracle迁移数据到MySQL时，通常用文本或SQL语句的方式，但都为MySQL的特殊字符处理而发愁，后来淘宝丁奇告诉MySQL的标准函数中有unhex函数，可以将十六进制的串转换成原来的字符串，从而轻松解决原来很麻烦的特殊字符处理的问题，于是对sqluldr2作了改进处理，对于所有的字符字段，都直接转换成十六进制串处理算了。 E:\dbpress&#62;sqluldr2 anysql/anysql query=tab text=mysqlins INSERT INTO `tab` (`TNAME`,`TABTYPE`,`CLUSTERID`) VALUES (unhex('4150505f43415445474f5259'),unhex('5441424c45'),null), (unhex('4150505f444550454e4453'),unhex('5441424c45'),null), ...... (unhex('545f4d565445535432'),unhex('5441424c45'),null); &#160; &#160; 不管增加了多不功能，sqluldr2都保持了一如即往的导出性能，生成复杂INSERT语句的速度和直接导出文本一样快。 E:\dbpress&#62;sqluldr2 anysql/anysql query=test3 text=mysqlins file=temp.txt &#160; &#160; &#160; 0 rows exported at 2012-05-17 08:38:51, size 0 MB. 1000000 rows exported at 2012-05-17 08:38:59, size 244 MB. 2000000 rows exported at 2012-05-17 08:39:11, size 492 MB. 3000000 [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; 从Oracle迁移数据到MySQL时，通常用文本或SQL语句的方式，但都为MySQL的特殊字符处理而发愁，后来淘宝丁奇告诉MySQL的标准函数中有unhex函数，可以将十六进制的串转换成原来的字符串，从而轻松解决原来很麻烦的特殊字符处理的问题，于是对sqluldr2作了改进处理，对于所有的字符字段，都直接转换成十六进制串处理算了。</p>
<blockquote class="prefont"><p>
E:\dbpress&gt;sqluldr2 anysql/anysql query=tab text=mysqlins<br />
INSERT INTO `tab` (`TNAME`,`TABTYPE`,`CLUSTERID`) VALUES<br />
(unhex('4150505f43415445474f5259'),unhex('5441424c45'),null),<br />
(unhex('4150505f444550454e4453'),unhex('5441424c45'),null),<br />
......<br />
(unhex('545f4d565445535432'),unhex('5441424c45'),null);
</p></blockquote>
<p>&nbsp; &nbsp; 不管增加了多不功能，sqluldr2都保持了一如即往的导出性能，生成复杂INSERT语句的速度和直接导出文本一样快。</p>
<blockquote class="prefont"><p>
E:\dbpress&gt;sqluldr2 anysql/anysql query=test3 text=mysqlins file=temp.txt<br />
&nbsp; &nbsp; &nbsp;  0 rows exported at 2012-05-17 08:38:51, size 0 MB.<br />
 1000000 rows exported at 2012-05-17 08:38:59, size 244 MB.<br />
 2000000 rows exported at 2012-05-17 08:39:11, size 492 MB.<br />
 3000000 rows exported at 2012-05-17 08:39:23, size 740 MB.<br />
 4000000 rows exported at 2012-05-17 08:39:37, size 984 MB.<br />
 4764032 rows exported at 2012-05-17 08:39:46, size 1175 MB.<br />
&nbsp; &nbsp; &nbsp; &nbsp;  output file temp.txt closed at 4764032 rows, size 1175 MB.
</p></blockquote>
<p>&nbsp; &nbsp; 有了这个功能后，sqluldr2会成为最流行的从Oracle迁移数据到MySQL的工具，我们自己及淘宝DBA都在日常工作中使用它。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2009/10/30 -- <a href="http://www.anysql.net/tools/sqluldr2-high-perf-insert-unload.html" class="wp_rp_title">SQLULDR2功能增加, 性能不减</a> (14)</li><li >2009/10/27 -- <a href="http://www.anysql.net/tools/sqluldr2-more-escape-chars.html" class="wp_rp_title">将SQLULDR2转义符进行到底</a> (3)</li><li >2008/11/28 -- <a href="http://www.anysql.net/tools/ociuldr_data_form_display.html" class="wp_rp_title">ociuldr还有可改进之处!</a> (5)</li><li >2009/12/25 -- <a href="http://www.anysql.net/tools/sqluldr2-customized-escape-chars.html" class="wp_rp_title">SQLULDR2的自定义转义符处理</a> (2)</li><li >2009/10/28 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-insert-sqls.html" class="wp_rp_title">SQLULDR2生成Insert SQL语句</a> (4)</li><li >2013/01/14 -- <a href="http://www.anysql.net/tools/sqluldr2-content-cryption.html" class="wp_rp_title">SQLULDR2的安全保密功能</a> (8)</li><li >2010/04/18 -- <a href="http://www.anysql.net/tools/parallel-inside-sqluldr2.html" class="wp_rp_title">SQLULDR2 : Parallel Inside Now!</a> (12)</li><li >2009/11/07 -- <a href="http://www.anysql.net/tools/sqluldr2-mysql-data-migration-test.html" class="wp_rp_title">MySQL数据迁移测试</a> (8)</li><li >2009/03/27 -- <a href="http://www.anysql.net/tools/sqluldr2_comming.html" class="wp_rp_title">用OCI 8实现了sqluldr2</a> (9)</li><li >2008/01/25 -- <a href="http://www.anysql.net/tools/ociuldr_update_20080125.html" class="wp_rp_title">ociuldr更新(2008/01/25)</a> (16)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=oImUgdoQUtk:Gm4Qw_0Ga60:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=oImUgdoQUtk:Gm4Qw_0Ga60:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=oImUgdoQUtk:Gm4Qw_0Ga60:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=oImUgdoQUtk:Gm4Qw_0Ga60:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=oImUgdoQUtk:Gm4Qw_0Ga60:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=oImUgdoQUtk:Gm4Qw_0Ga60:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/oImUgdoQUtk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/sqluldr2-mysql-data-migration.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/sqluldr2-mysql-data-migration.html</feedburner:origLink></item>
		<item>
		<title>WebChart的JSON格式输出</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/amYjJUUJKLM/webchar-json-output.html</link>
		<comments>http://www.anysql.net/tools/webchar-json-output.html#comments</comments>
		<pubDate>Fri, 09 Dec 2011 04:51:08 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tool]]></category>
		<category><![CDATA[WebChart]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=797</guid>
		<description><![CDATA[&#160; &#160; WebChart增加JSON格式输出，可以将查询结果以JSON格式的文本进行输出，直接作为ExtJS的Ext.data.Store的输入. 页面(jsontest.rhtml)定义如下: webchart.doctype=json webchart.query_1=select empno, ename from emp order by empno &#160; &#160; 用浏览器访问页面时，返回JSON格式的纯文本. { &#160; "metaData": &#160; { &#160; &#160; &#160; "root": "rows", &#160; &#160; &#160; "fields": [ &#160; &#160; &#160; &#160; {"name": "empno", "type": "int"}, &#160; &#160; &#160; &#160; {"name": "ename"}], &#160; &#160; &#160; "remoteSort": true &#160; }, &#160; "rows": &#160; [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; WebChart增加JSON格式输出，可以将查询结果以JSON格式的文本进行输出，直接作为ExtJS的Ext.data.Store的输入. 页面(jsontest.rhtml)定义如下: </p>
<blockquote class="prefont"><p>
webchart.doctype=json</p>
<p>webchart.query_1=select empno, ename from emp order by empno
</p></blockquote>
<p>&nbsp; &nbsp; 用浏览器访问页面时，返回JSON格式的纯文本. </p>
<blockquote class="prefont"><p>
{<br />
&nbsp; "metaData":<br />
&nbsp; {<br />
&nbsp; &nbsp; &nbsp; "root": "rows",<br />
&nbsp; &nbsp; &nbsp; "fields": [<br />
&nbsp; &nbsp; &nbsp; &nbsp; {"name": "empno", "type": "int"},<br />
&nbsp; &nbsp; &nbsp; &nbsp; {"name": "ename"}],<br />
&nbsp; &nbsp; &nbsp; "remoteSort": true<br />
&nbsp; },<br />
&nbsp; "rows":<br />
&nbsp; [<br />
&nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "empno": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "ename": "Lou Fangxin"<br />
&nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "empno": 2,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "ename": "Zhi Qiong"<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; ]<br />
}
</p></blockquote>
<p>&nbsp; &nbsp; 在ExtJS 4中可以直接用如下代码，得到一个Store类型变量. </p>
<blockquote class="prefont"><p>
Ext.define('mydata', {extend: 'Ext.data.Model'});<br />
var store2 = Ext.create('Ext.data.Store', <br />
&nbsp; &nbsp; {model: 'mydata', proxy:{type: 'ajax', url: 'sampledata.txt', reader: {type: 'json'}}});
</p></blockquote>
<p>&nbsp; &nbsp; 然后用ExtJS进行表格输出或者画图，将数据接口直接交给WebChart来方便地处理. </p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2009/12/04 -- <a href="http://www.anysql.net/tools/webchart-auto-reload-page.html" class="wp_rp_title">报表页面自动刷新属性</a> (0)</li><li >2010/03/15 -- <a href="http://www.anysql.net/tools/datacopy-utility.html" class="wp_rp_title">学习OCI之DataCopy程序</a> (8)</li><li >2009/02/07 -- <a href="http://www.anysql.net/tools/webchart_chart_demo.html" class="wp_rp_title">WebChart的图形例子</a> (4)</li><li >2010/03/04 -- <a href="http://www.anysql.net/tools/webchart-rows-filter.html" class="wp_rp_title">为DataReport增加条件过滤功能</a> (1)</li><li >2009/03/18 -- <a href="http://www.anysql.net/tools/tomcat_https_access.html" class="wp_rp_title">配置Tomcat的HTTPS访问</a> (1)</li><li >2010/01/21 -- <a href="http://www.anysql.net/tools/anysql-jdbc-driver.html" class="wp_rp_title">AnySQL JDBC Driver</a> (1)</li><li >2009/03/12 -- <a href="http://www.anysql.net/tools/webchart_encryption.html" class="wp_rp_title">WebChart密码加密功能</a> (6)</li><li >2009/12/02 -- <a href="http://www.anysql.net/tools/webchart-xml-html-escape-chars.html" class="wp_rp_title">添加URL/HTML字符转义功能</a> (1)</li><li >2009/03/10 -- <a href="http://www.anysql.net/tools/webchart_expression.html" class="wp_rp_title">计算列或公式列</a> (0)</li><li >2010/05/07 -- <a href="http://www.anysql.net/tools/webchart-batch-query.html" class="wp_rp_title">批量数据查询需求</a> (0)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=amYjJUUJKLM:rvY_Y7_y3lc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=amYjJUUJKLM:rvY_Y7_y3lc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=amYjJUUJKLM:rvY_Y7_y3lc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=amYjJUUJKLM:rvY_Y7_y3lc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=amYjJUUJKLM:rvY_Y7_y3lc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=amYjJUUJKLM:rvY_Y7_y3lc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/amYjJUUJKLM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/webchar-json-output.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/webchar-json-output.html</feedburner:origLink></item>
		<item>
		<title>多个测试环境的表结构同步</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/K8zuNoTX1rk/ocidiff-oracle-schema-auto-repair.html</link>
		<comments>http://www.anysql.net/tools/ocidiff-oracle-schema-auto-repair.html#comments</comments>
		<pubDate>Tue, 19 Apr 2011 05:57:04 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Compare]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Table]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=796</guid>
		<description><![CDATA[&#160; &#160; 一个复杂系统往往会有几套开发测试环境，对于开发DBA或测试环境DBA来讲，维护这些环境之间的同步是一个比较烦琐的事情。在2005年时，曾和当时的三个同事，花了足足三天时间来手工同步两个环境的表结构差异，最后促使我去开发一个表结构自动同步工具，现在是对那个工具的进一步升级。 -- GetDDL: DDL Script Generator for Oracle, Release 3.0.1 -- (@) Copyright Lou Fangxin (AnySQL.net) 2010, all rights reserved. -- Oracle Data Recovery, System Tuning and Monitoring and Tuning Service Usage: ocidiff fromuser=... touser=... file=... Options: &#160; fromuser&#160; -- Source Connection String &#160; fromschema -- Source Schema to Switch &#160; touser&#160; &#160; [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; 一个复杂系统往往会有几套开发测试环境，对于开发DBA或测试环境DBA来讲，维护这些环境之间的同步是一个比较烦琐的事情。在2005年时，曾和当时的三个同事，花了足足三天时间来手工同步两个环境的表结构差异，最后促使我去开发一个表结构自动同步工具，现在是对那个工具的进一步升级。</p>
<blockquote class="prefont"><p>
-- GetDDL: DDL Script Generator for Oracle, Release 3.0.1<br />
-- (@) Copyright Lou Fangxin (AnySQL.net) 2010, all rights reserved.<br />
-- Oracle Data Recovery, System Tuning and Monitoring and Tuning Service</p>
<p>Usage: ocidiff fromuser=... touser=... file=...</p>
<p>Options:<br />
&nbsp; fromuser&nbsp;  -- Source Connection String<br />
&nbsp; fromschema -- Source Schema to Switch<br />
&nbsp; touser&nbsp; &nbsp;  -- Destination Connection String<br />
&nbsp; toschema&nbsp;  -- Destination Schema to Swith<br />
&nbsp; tstab&nbsp; &nbsp; &nbsp; -- Tablespace for Tables<br />
&nbsp; tsind&nbsp; &nbsp; &nbsp; -- Tablespace for Indexes<br />
&nbsp; sync&nbsp; &nbsp; &nbsp;  -- Sync List (ALL,SEQUENCE,TABLE,INDEX,VIEW,SOURCE,COMMENT)<br />
&nbsp; file&nbsp; &nbsp; &nbsp;  -- Output Script File Name<br />
&nbsp; log&nbsp; &nbsp; &nbsp; &nbsp; -- SQL*Plus Spool log file name<br />
&nbsp; auto&nbsp; &nbsp; &nbsp;  -- Automaticall call SQL*Plus to sync(YES)
</p></blockquote>
<p>&nbsp; &nbsp; 上面的命令行选项，对于DBA来讲应当都比较容易理解，就不一个一个讲了。File和Log选项有一些特殊的设置，指定文件名时可以用%Y来表示年份，用%M来表示月份，同理用%D来表示日期，以便给自动同步工具留下足够的运行日志。</p>
<blockquote class="prefont"><p>
ocidiff ...... file=scott_%%y%%m%%d.sql log=scott_%%y%%m%%d.log ...
</p></blockquote>
<p>&nbsp; &nbsp; 运行时加上"AUTO=YES"选项，会自动调用SQL*Plus连接到远程库上执行，执行后会留带日期的SQL和日志文件。</p>
<blockquote class="prefont"><p>
D:\ocidiff&gt;dir /b scott_*<br />
scott_20110419.log<br />
scott_20110419.sql
</p></blockquote>
<p>&nbsp; &nbsp; 对于生成的自动同步SQL的脚本准确性，还需要进行大量的测试及进一步的改进，<a href="http://www.anysql.net/software/ocidiff.zip">下载</a>试试吧。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2007/12/24 -- <a href="http://www.anysql.net/tools/get_table_ddl.html" class="wp_rp_title">Get DDL工具</a> (7)</li><li >2010/01/15 -- <a href="http://www.anysql.net/tools/sqluldr2-create-table-syntax.html" class="wp_rp_title">两个用户的SQLULDR2需求</a> (1)</li><li >2008/03/04 -- <a href="http://www.anysql.net/tools/ocidiff_assist_51job_dba.html" class="wp_rp_title">ocidiff助力51job日常维护</a> (6)</li><li >2008/05/15 -- <a href="http://www.anysql.net/dba/aul_better_for_nchar.html" class="wp_rp_title">将dmp数据导入到另一个表</a> (3)</li><li >2009/02/05 -- <a href="http://www.anysql.net/dba/change_export_tablespace.html" class="wp_rp_title">导出时如何统一表空间?</a> (2)</li><li >2006/10/13 -- <a href="http://www.anysql.net/tools/oracle_tool_hotcopy_02.html" class="wp_rp_title">使用HotCopy来移动数据文件</a> (0)</li><li >2006/10/12 -- <a href="http://www.anysql.net/tools/oracle_tool_hotcopy_01.html" class="wp_rp_title">热备份文件的小工具 &#8212; HotCopy</a> (2)</li><li >2007/03/01 -- <a href="http://www.anysql.net/oracle/oracle_external_table.html" class="wp_rp_title">如何定义Oracle外部表中的DATE类型字段?</a> (3)</li><li >2007/08/02 -- <a href="http://www.anysql.net/oracle/oracle_kernel_table_index.html" class="wp_rp_title">如何以较好的性能访问Oracle内核表?</a> (1)</li><li >2007/04/28 -- <a href="http://www.anysql.net/dba/table_organization_by_cluster.html" class="wp_rp_title">Organization Index之后是Organization Cluster</a> (1)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=K8zuNoTX1rk:g1M68UF0QKQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=K8zuNoTX1rk:g1M68UF0QKQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=K8zuNoTX1rk:g1M68UF0QKQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=K8zuNoTX1rk:g1M68UF0QKQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=K8zuNoTX1rk:g1M68UF0QKQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=K8zuNoTX1rk:g1M68UF0QKQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/K8zuNoTX1rk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/ocidiff-oracle-schema-auto-repair.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/ocidiff-oracle-schema-auto-repair.html</feedburner:origLink></item>
		<item>
		<title>AUL for Oracle ASM数据恢复测试</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/IpLBk68p6hM/oracle-asm-data-recovery-testcase.html</link>
		<comments>http://www.anysql.net/aulmydul/oracle-asm-data-recovery-testcase.html#comments</comments>
		<pubDate>Mon, 18 Apr 2011 07:15:00 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[AUL/MyDUL]]></category>
		<category><![CDATA[ASM]]></category>
		<category><![CDATA[DUL]]></category>
		<category><![CDATA[MyDUL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Recovery]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=795</guid>
		<description><![CDATA[&#160; &#160; 创建了一个跨越在两个盘中的Oracle ASM表空间，并在上面建了一个有49万条记录的表，用来进行ASM恢复测试。 SQL&#62; select disk_number, name,path from v$asm_disk; DISK_NUMBER NAME&#160; &#160; &#160; &#160; &#160; &#160; PATH ----------- ---------------- ------------------------------ &#160; &#160; &#160; &#160; &#160; 0 TEST_0000&#160; &#160; &#160; &#160; D:\ORACLEASM\FILE01.ASM &#160; &#160; &#160; &#160; &#160; 1 TEST_0001&#160; &#160; &#160; &#160; D:\ORACLEASM\FILE02.ASM SQL&#62; create table emp_asm tablespace asmdemo as &#160; 2&#160; select * from [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; 创建了一个跨越在两个盘中的Oracle ASM表空间，并在上面建了一个有49万条记录的表，用来进行ASM恢复测试。</p>
<blockquote class="prefont"><p>
SQL&gt; select disk_number, name,path from v$asm_disk;</p>
<p>DISK_NUMBER NAME&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  PATH<br />
----------- ---------------- ------------------------------<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 TEST_0000&nbsp; &nbsp; &nbsp; &nbsp; D:\ORACLEASM\FILE01.ASM<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 TEST_0001&nbsp; &nbsp; &nbsp; &nbsp; D:\ORACLEASM\FILE02.ASM</p>
<p>SQL&gt; create table emp_asm tablespace asmdemo as<br />
&nbsp; 2&nbsp; select * from emp_bak where rownum &lt; 500000;
</p></blockquote>
<p>&nbsp; &nbsp; 第一次测试是在两个ASM盘都在的情况，应当可以恢复出49万条记录才是准确的，先从ASM中恢复出Oracle数据文件。</p>
<blockquote class="prefont"><p>
ASM&gt; disk disk.txt<br />
&nbsp;  2 ASM disks opened.<br />
---- -----------------------------------<br />
&nbsp;  0 d:\oracleasm\file01.asm<br />
&nbsp;  1 d:\oracleasm\file02.asm<br />
ASM&gt; scan<br />
 RFN File&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Size&nbsp;  Blocks<br />
---- --------------- ----- --------<br />
&nbsp;  5 aulasm_0005.dbf&nbsp; &nbsp; 25&nbsp; &nbsp;  3079<br />
ASM&gt; create file aulasm_0005.dbf size 26<br />
ASM&gt; open rfn 5 file aulasm_0005.dbf<br />
 RFN File<br />
---- ---------------------------------------------------------<br />
&nbsp;  5 aulasm_0005.dbf<br />
ASM&gt; restore<br />
Restore by ASM extent map file.
</p></blockquote>
<p>&nbsp; &nbsp; 然后在AUL中进行数据恢复，确认是不是恢复出全部49万条记录。</p>
<blockquote class="prefont"><p>
AUL&gt; unload object 13456 to 13456.txt;<br />
2011-04-18 14:52:45<br />
Sucessfully unload 499999 rows ...<br />
2011-04-18 14:53:05
</p></blockquote>
<p>&nbsp; &nbsp; 第二次测试中丢失了第二块盘，应当可以恢复出大约一半的记录才是对的，先从ASM中恢复出Oracle数据文件。</p>
<blockquote class="prefont"><p>
ASM&gt; disk disk.txt<br />
&nbsp;  1 ASM disks opened.<br />
---- -----------------------------------<br />
&nbsp;  0 d:\oracleasm\file01.asm<br />
ASM&gt; scan<br />
 RFN File&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Size&nbsp;  Blocks<br />
---- --------------- ----- --------<br />
&nbsp;  5 aulasm_0005.dbf&nbsp; &nbsp; 25&nbsp; &nbsp;  3079<br />
ASM&gt; create file aulasm_0005.dbf size 26<br />
ASM&gt; open rfn 5 file aulasm_0005.dbf<br />
 RFN File<br />
---- ---------------------------------------------------------<br />
&nbsp;  5 aulasm_0005.dbf<br />
ASM&gt; restore<br />
Restore by ASM extent map file.
</p></blockquote>
<p>&nbsp; &nbsp; 然后在AUL中进行数据恢复，看看从AUL中恢复出来多少条记录，在这里刚好是将近一半，说明结果良好。</p>
<blockquote class="prefont"><p>
AUL&gt; unload object 13456 to 13456.txt;<br />
2011-04-18 14:55:09<br />
Sucessfully unload 257375 rows ...<br />
2011-04-18 14:55:20
</p></blockquote>
<p>&nbsp; &nbsp; 第三次测试中丢失了第一块盘，应当可以恢复出另一半的记录才是对的，理论上第二次和第三次恢复记录数之和应当和第一次恢复的记录数相等。</p>
<blockquote class="prefont"><p>
ASM&gt; disk disk.txt<br />
&nbsp;  1 ASM disks opened.<br />
---- -----------------------------------<br />
&nbsp;  0 d:\oracleasm\file02.asm<br />
ASM&gt; scan<br />
 RFN File&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Size&nbsp;  Blocks<br />
---- --------------- ----- --------<br />
&nbsp;  5 aulasm_0005.dbf&nbsp; &nbsp; 24&nbsp; &nbsp;  3071<br />
ASM&gt; create file aulasm_0005.dbf size 26<br />
ASM&gt; open rfn 5 file aulasm_0005.dbf<br />
 RFN File<br />
---- ---------------------------------------------------------<br />
&nbsp;  5 aulasm_0005.dbf<br />
ASM&gt; restore<br />
Restore by ASM extent map file.
</p></blockquote>
<p>&nbsp; &nbsp; 然后在AUL中进行数据恢复，看看从AUL中恢复出来多少条记录。计算了一下第二次和第三次恢复出来的记录数之后刚好等于第一次恢复的记录数，证明ASM恢复软件可用。</p>
<blockquote class="prefont"><p>
AUL&gt; unload object 13456 to 13456.txt;<br />
2011-04-18 14:57:30<br />
Sucessfully unload 242624 rows ...<br />
2011-04-18 14:57:40
</p></blockquote>
<p>&nbsp; &nbsp; 顺便透露一个Linux版AUL的改进消息，许可证不再动态了，只有服务器重起了才会改变，以方便大家进行数据恢复，毕竟Linux服务器很稳定，对大家来讲应当是更有利的许可证模式。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2011/04/15 -- <a href="http://www.anysql.net/aulmydul/oracle-asm-recovery-aulasm.html" class="wp_rp_title">Oracle ASM灾难恢复工具&#8211;AULASM</a> (2)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_recover_table_indexes.html" class="wp_rp_title">AUL恢复Oracle触发器?</a> (0)</li><li >2008/03/19 -- <a href="http://www.anysql.net/aulmydul/oracle_final_data_recovery.html" class="wp_rp_title">Oracle数据恢复服务模式</a> (0)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_recover_triggers.html" class="wp_rp_title">AUL恢复Oracle Sequence?</a> (0)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_recover_sequences.html" class="wp_rp_title">AUL恢复Oracle视图代码?</a> (0)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_recover_source_code.html" class="wp_rp_title">AUL恢复Oracle索引结构?</a> (0)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_data_recovery_mode.html" class="wp_rp_title">AUL恢复Oracle存贮过程</a> (0)</li><li >2008/03/26 -- <a href="http://www.anysql.net/aulmydul/try_make_good_suggestion.html" class="wp_rp_title">不是好人, 这么无耻!</a> (24)</li><li >2008/04/17 -- <a href="http://www.anysql.net/aulmydul/aul_for_sybase_ase.html" class="wp_rp_title">Oracle DUL不行就用AUL</a> (10)</li><li >2008/05/12 -- <a href="http://www.anysql.net/aulmydul/undo_and_index_bugs.html" class="wp_rp_title">Oracle不行再用AUL</a> (7)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=IpLBk68p6hM:aYn4qnFJf8M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=IpLBk68p6hM:aYn4qnFJf8M:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=IpLBk68p6hM:aYn4qnFJf8M:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=IpLBk68p6hM:aYn4qnFJf8M:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=IpLBk68p6hM:aYn4qnFJf8M:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=IpLBk68p6hM:aYn4qnFJf8M:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/IpLBk68p6hM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/aulmydul/oracle-asm-data-recovery-testcase.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.anysql.net/aulmydul/oracle-asm-data-recovery-testcase.html</feedburner:origLink></item>
		<item>
		<title>Oracle ASM灾难恢复工具–AULASM</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/xzzlsHjUruQ/oracle-asm-recovery-aulasm.html</link>
		<comments>http://www.anysql.net/aulmydul/oracle-asm-recovery-aulasm.html#comments</comments>
		<pubDate>Fri, 15 Apr 2011 01:30:38 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[AUL/MyDUL]]></category>
		<category><![CDATA[ASM]]></category>
		<category><![CDATA[DUL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Recovery]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=793</guid>
		<description><![CDATA[&#160; &#160; 昨天晚上花了几个小时时间，写了一个Oracle ASM的灾难恢复软件, 当Oracle ASM一个或多个盘损坏或丢失时, 可以最大化地将其余盘上的数据恢复出来. &#160; &#160; 程序还是采用不为大家所爱的命令行界面. AUL : AnySQL UnLoader(MyDUL) for Oracle ASM, release 1.0.0 (C) Copyright Lou Fangxin 2011 (AnySQL.net), all rights reserved. ASM&#62; help &#160; DISK&#160; &#160; &#160; -- open ASM disks. &#160; SCAN&#160; &#160; &#160; -- scan ASM disks &#160; RESTORE&#160; &#160; -- restore data file from ASM [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; 昨天晚上花了几个小时时间，写了一个Oracle ASM的灾难恢复软件, 当Oracle ASM一个或多个盘损坏或丢失时, 可以最大化地将其余盘上的数据恢复出来. </p>
<p>&nbsp; &nbsp; 程序还是采用不为大家所爱的命令行界面. </p>
<blockquote class="prefont"><p>
AUL : AnySQL UnLoader(MyDUL) for Oracle ASM, release 1.0.0</p>
<p>(C) Copyright Lou Fangxin 2011 (AnySQL.net), all rights reserved.</p>
<p>ASM&gt; help<br />
&nbsp; DISK&nbsp; &nbsp; &nbsp;  -- open ASM disks.<br />
&nbsp; SCAN&nbsp; &nbsp; &nbsp;  -- scan ASM disks<br />
&nbsp; RESTORE&nbsp; &nbsp; -- restore data file from ASM<br />
&nbsp; CREATE&nbsp; &nbsp;  -- create empty data file<br />
&nbsp; OPEN&nbsp; &nbsp; &nbsp;  -- open data file<br />
&nbsp; QUIT/EXIT&nbsp; -- exit the program.
</p></blockquote>
<p>&nbsp; &nbsp; 打开磁盘组文件, 配置文件中列出各个盘的路径或镜象文件位置就行. </p>
<blockquote class="prefont"><p>
ASM&gt; disk disk.txt<br />
&nbsp;  2 ASM disks opened.<br />
---- -----------------------------------<br />
&nbsp;  0 d:\oracleasm\file01.asm<br />
&nbsp;  1 d:\oracleasm\file02.asm
</p></blockquote>
<p>&nbsp; &nbsp; 扫描磁盘组，找出可能的数据文件. </p>
<blockquote class="prefont"><p>
ASM&gt; scan<br />
&nbsp;  5 aulasm_0005.dbf&nbsp; &nbsp; 1&nbsp; &nbsp; &nbsp;  12
</p></blockquote>
<p>&nbsp; &nbsp; 创建空的数据文件, 并打开. </p>
<blockquote class="prefont"><p>
ASM&gt; create file aulasm_0005.dbf size 1<br />
ASM&gt; open rfn 5 file aulasm_0005.dbf<br />
 RFN File<br />
---- ---------------------------------------------------------<br />
&nbsp;  5 aulasm_0005.dbf
</p></blockquote>
<p>&nbsp; &nbsp; 从ASM中读出数据块，写入对应的文件。</p>
<blockquote class="prefont"><p>
ASM&gt; restore
</p></blockquote>
<p>&nbsp; &nbsp; 然后用AUL去恢复，这里步骤就不详解了。</p>
<blockquote class="prefont"><p>
D:\oracleasm&gt;aul5b<br />
Register Code: QYOW-EHSO-EIXO-MEKA-VQFG<br />
AUL : AnySQL UnLoader(MyDUL) for Oracle 8/8i/9i/10g/11g, release 5.1.2</p>
<p>(C) Copyright Lou Fangxin 2005-2010 (AnySQL.net), all rights reserved.</p>
<p>AUL&gt; open db.txt<br />
*&nbsp; ts#&nbsp; fno&nbsp; rfn ver bsize&nbsp; &nbsp;  blocks filename<br />
- ---- ---- ---- --- ----- ---------- -----------------------------------<br />
Y&nbsp; &nbsp; 6&nbsp; &nbsp; 5&nbsp; &nbsp; 5 a2&nbsp;  8192&nbsp; &nbsp; &nbsp; 16384 aulasm_0005.dbf<br />
AUL&gt; scan data<br />
2011-04-15 09:19:38<br />
RDBA=0x0140000c(5/12),type=0x06,fmt=0xa2,seq=0x02,flag=0x04<br />
seg/obj=0x00003486=13446,csc=0x0000.00412ee2,itc=3,typ=1 - DATA<br />
tab#=&nbsp; 0&nbsp; &nbsp;  nrow=&nbsp;  2&nbsp; &nbsp;  offs=&nbsp;  0</p>
<p>2011-04-15 09:19:38
</p></blockquote>
<p>&nbsp; &nbsp; 下载<a href="http://www.anysql.net/software/aulasm.zip">Windows版本</a>玩玩吧。</p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2011/04/18 -- <a href="http://www.anysql.net/aulmydul/oracle-asm-data-recovery-testcase.html" class="wp_rp_title">AUL for Oracle ASM数据恢复测试</a> (4)</li><li >2008/03/19 -- <a href="http://www.anysql.net/aulmydul/oracle_final_data_recovery.html" class="wp_rp_title">Oracle数据恢复服务模式</a> (0)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_recover_table_indexes.html" class="wp_rp_title">AUL恢复Oracle触发器?</a> (0)</li><li >2008/05/12 -- <a href="http://www.anysql.net/aulmydul/undo_and_index_bugs.html" class="wp_rp_title">Oracle不行再用AUL</a> (7)</li><li >2008/08/01 -- <a href="http://www.anysql.net/aulmydul/to_date_from_quarter.html" class="wp_rp_title">终极Oracle数据恢复工具 &#8212; AUL</a> (8)</li><li >2008/04/17 -- <a href="http://www.anysql.net/aulmydul/aul_for_sybase_ase.html" class="wp_rp_title">Oracle DUL不行就用AUL</a> (10)</li><li >2008/03/26 -- <a href="http://www.anysql.net/aulmydul/try_make_good_suggestion.html" class="wp_rp_title">不是好人, 这么无耻!</a> (24)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_recover_triggers.html" class="wp_rp_title">AUL恢复Oracle Sequence?</a> (0)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_recover_source_code.html" class="wp_rp_title">AUL恢复Oracle索引结构?</a> (0)</li><li >2008/03/20 -- <a href="http://www.anysql.net/aulmydul/aul_data_recovery_mode.html" class="wp_rp_title">AUL恢复Oracle存贮过程</a> (0)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=xzzlsHjUruQ:CkHD6enNG2Y:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=xzzlsHjUruQ:CkHD6enNG2Y:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=xzzlsHjUruQ:CkHD6enNG2Y:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=xzzlsHjUruQ:CkHD6enNG2Y:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=xzzlsHjUruQ:CkHD6enNG2Y:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=xzzlsHjUruQ:CkHD6enNG2Y:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/xzzlsHjUruQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/aulmydul/oracle-asm-recovery-aulasm.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.anysql.net/aulmydul/oracle-asm-recovery-aulasm.html</feedburner:origLink></item>
		<item>
		<title>Oracle到MySQL的数据迁移工具</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/w216RDLp78o/oracle-mysql-data-migration-tool.html</link>
		<comments>http://www.anysql.net/tools/oracle-mysql-data-migration-tool.html#comments</comments>
		<pubDate>Sat, 02 Apr 2011 09:46:05 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Copy]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=790</guid>
		<description><![CDATA[&#160; &#160; 前段时间使用SQLULDR2和MySQL的Load Data命令迁移了大量数据, 操作步骤复杂一些, 但性能高, 但对于记录数较少的大量小表, 还是比较麻烦的, 刚好前几天想学习一下MySQL的C客户端编程, 于是就想写一个简洁的从Oracle迁移数据到MySQL的小程序, 作为练习题, 一直相信学什么可以用什么! &#160; &#160; 可以下载新工具ora2mysql进行测试, 目前请不要用于做正式迁移. 使用方法如下: D:\&#62;ora2mysql user1=scott/tiger user2=/@localhost:3306:test table=emp &#160; &#160; &#160; &#160; 0 rows processed at 2011-04-02 15:03:08. &#160; &#160; &#160; &#160; 2 rows processed at 2011-04-02 15:03:08. &#160; &#160; 在速度方面，由于不支持Array操作，因此速度比较慢，希望Oracle能让SQL * Plus也能连接MySQL库，或改造一下MySQL客户端，增加Array接口。 D:\&#62;ora2mysql user1=scott/tiger user2=/@::test table1=emp_bak table2=emp &#160; &#160; &#160; &#160; [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; 前段时间使用SQLULDR2和MySQL的Load Data命令迁移了大量数据, 操作步骤复杂一些, 但性能高, 但对于记录数较少的大量小表, 还是比较麻烦的, 刚好前几天想学习一下MySQL的C客户端编程, 于是就想写一个简洁的从Oracle迁移数据到MySQL的小程序, 作为练习题, 一直相信学什么可以用什么! </p>
<p>&nbsp; &nbsp; 可以下载新工具<a href="http://www.anysql.net/software/ora2mysql.zip">ora2mysql</a>进行测试, 目前请不要用于做正式迁移. 使用方法如下: </p>
<blockquote class="prefont"><p>
D:\&gt;ora2mysql user1=scott/tiger user2=/@localhost:3306:test table=emp<br />
&nbsp; &nbsp; &nbsp; &nbsp;  0 rows processed at 2011-04-02 15:03:08.<br />
&nbsp; &nbsp; &nbsp; &nbsp;  2 rows processed at 2011-04-02 15:03:08.
</p></blockquote>
<p>&nbsp; &nbsp; 在速度方面，由于不支持Array操作，因此速度比较慢，希望Oracle能让SQL * Plus也能连接MySQL库，或改造一下MySQL客户端，增加Array接口。</p>
<blockquote class="prefont"><p>
D:\&gt;ora2mysql user1=scott/tiger user2=/@::test table1=emp_bak table2=emp<br />
&nbsp; &nbsp; &nbsp; &nbsp;  0 rows processed at 2011-04-02 19:48:51.<br />
&nbsp; &nbsp; 100000 rows processed at 2011-04-02 19:49:17.<br />
&nbsp; &nbsp; 200000 rows processed at 2011-04-02 19:49:42.<br />
&nbsp; &nbsp; 300000 rows processed at 2011-04-02 19:50:07.<br />
&nbsp; &nbsp; 400000 rows processed at 2011-04-02 19:50:32.<br />
&nbsp; &nbsp; 500000 rows processed at 2011-04-02 19:50:57.<br />
&nbsp; &nbsp; 600000 rows processed at 2011-04-02 19:51:23.<br />
&nbsp; &nbsp; 700000 rows processed at 2011-04-02 19:51:48.<br />
&nbsp; &nbsp; 800000 rows processed at 2011-04-02 19:52:14.<br />
&nbsp; &nbsp; 900000 rows processed at 2011-04-02 19:52:39.<br />
&nbsp;  1000000 rows processed at 2011-04-02 19:53:03.<br />
&nbsp;  1100000 rows processed at 2011-04-02 19:53:29.<br />
&nbsp;  1200000 rows processed at 2011-04-02 19:53:56.<br />
&nbsp;  1300000 rows processed at 2011-04-02 19:54:24.<br />
&nbsp;  1400000 rows processed at 2011-04-02 19:54:53.
</p></blockquote>
<p>&nbsp; &nbsp; 目前还不支持BLOB类型, 也不支持字符集的设置, 请大家理解与支持. </p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2010/03/15 -- <a href="http://www.anysql.net/tools/datacopy-utility.html" class="wp_rp_title">学习OCI之DataCopy程序</a> (8)</li><li >2012/06/05 -- <a href="http://www.anysql.net/tools/mysqlcopy-delete-source.html" class="wp_rp_title">使用mysqlcopy来迁移MySQL历史数据 </a> (0)</li><li >2009/06/09 -- <a href="http://www.anysql.net/tools/copydata-perl-scripts.html" class="wp_rp_title">copydata异构数据拷贝</a> (6)</li><li >2011/03/28 -- <a href="http://www.anysql.net/tools/datacopy-300gb-data-test.html" class="wp_rp_title">DataCopy通过300GB的数据测试</a> (17)</li><li >2010/04/15 -- <a href="http://www.anysql.net/tools/parallel-datacopy-datasync.html" class="wp_rp_title">并行SQLULDR2和DataCopy操作</a> (4)</li><li >2010/04/16 -- <a href="http://www.anysql.net/tools/parallel-inside-datacopy.html" class="wp_rp_title">DataCopy : Parallel Inside Now!</a> (3)</li><li >2013/02/01 -- <a href="http://www.anysql.net/tools/mysql-oracle-data-copy.html" class="wp_rp_title">从MySQL迁移数据到Oracle库的工具</a> (0)</li><li >2007/03/14 -- <a href="http://www.anysql.net/tools/move_data_oracle_mysql.html" class="wp_rp_title">如何在不同类型的数据库间迁移数据?</a> (1)</li><li >2007/07/10 -- <a href="http://www.anysql.net/tools/dmp2utf8_download_increase.html" class="wp_rp_title">dmp2utf8的下载量骤增, 不知什么原因?</a> (5)</li><li >2006/12/11 -- <a href="http://www.anysql.net/tools/new_tool_dmp2utf8.html" class="wp_rp_title">更改dmp文件中的字符集 &#8212; dmp2utf8</a> (0)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=w216RDLp78o:fVXwVNkNHUo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=w216RDLp78o:fVXwVNkNHUo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=w216RDLp78o:fVXwVNkNHUo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=w216RDLp78o:fVXwVNkNHUo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=w216RDLp78o:fVXwVNkNHUo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=w216RDLp78o:fVXwVNkNHUo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/w216RDLp78o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/oracle-mysql-data-migration-tool.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/oracle-mysql-data-migration-tool.html</feedburner:origLink></item>
		<item>
		<title>DataCopy通过300GB的数据测试</title>
		<link>http://feedproxy.google.com/~r/AnySQL/~3/pnuuM2JfLjs/datacopy-300gb-data-test.html</link>
		<comments>http://www.anysql.net/tools/datacopy-300gb-data-test.html#comments</comments>
		<pubDate>Mon, 28 Mar 2011 11:50:24 +0000</pubDate>
		<dc:creator>anysql</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Export]]></category>
		<category><![CDATA[Import]]></category>

		<guid isPermaLink="false">http://www.anysql.net/?p=789</guid>
		<description><![CDATA[&#160; &#160; 网友使用DataCopy进行了数据迁移测试, 数据量有300GB的样子, 表有几百个, DataCopy表现不错, 单进程时也和Exp/Imp不相上下, 因为DataCopy可以很方便地自动并行处理, 这是他选择DataCopy的重要理由, 只需要加一个并行度就行了. datacopy user1=... user2=... table=... degree=4 &#160; &#160; Bug往往在大量测试或要正式使用时出现, 这次也不例外. 总共解决了两个程序缺限, 错误信息如下所示: ORA-01405: fetched column value is NULL ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column &#160; &#160; 第一个错误是因为使用回调函数处理Long或LOB类型时, 没有使用标志变量(Indicator Variable), 第二个错误是因为传绑定变量时没有将Long或LOB列放在最后. 以前居然没有理解这一点, 汗颜啊! ORA-24345: A Truncation or null fetch error [...]]]></description>
				<content:encoded><![CDATA[<p>&nbsp; &nbsp; 网友使用DataCopy进行了数据迁移测试, 数据量有300GB的样子, 表有几百个, DataCopy表现不错, 单进程时也和Exp/Imp不相上下, 因为DataCopy可以很方便地自动并行处理, 这是他选择DataCopy的重要理由, 只需要加一个并行度就行了. </p>
<blockquote class="prefont"><p>
datacopy user1=... user2=... table=... degree=4
</p></blockquote>
<p>&nbsp; &nbsp; Bug往往在大量测试或要正式使用时出现, 这次也不例外. 总共解决了两个程序缺限, 错误信息如下所示: </p>
<blockquote class="prefont"><p>
ORA-01405: fetched column value is NULL <br />
ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column
</p></blockquote>
<p>&nbsp; &nbsp; 第一个错误是因为使用回调函数处理Long或LOB类型时, 没有使用标志变量(Indicator Variable), 第二个错误是因为传绑定变量时没有将Long或LOB列放在最后. 以前居然没有理解这一点, 汗颜啊! </p>
<blockquote class="prefont"><p>
ORA-24345: A Truncation or null fetch error occurred
</p></blockquote>
<p>&nbsp; &nbsp; 另外还回答了两个问题, 第一个是上面的错误, 这是因为NLS_LANG中标明的字符集与数据库的字符集不一样, 发生了转换, 导致程序给的缓冲区不够用引起的. 另一个问题是, Direct Load方式迁移数据库出现乱码, 一般也是因为NLS_LANG中标明的字符集与数据库的字符集不一样. </p>
<p>&nbsp; &nbsp; 经过这一次的改进, DataCopy和DataSync应当是相当稳定了, 已编译好AIX的版本让大家选择. <strong>如果觉得好, 可以赞助个10元/5元的, 让我们技术人员知道技术环境正在逐步改善.</strong></p>

<div class="wp_rp_wrap  wp_rp_plain" ><div class="wp_rp_content"><h3 class="related_post_title">Relative Posts:</h3><ul class="related_post wp_rp" style="visibility: visible"><li >2010/03/15 -- <a href="http://www.anysql.net/tools/datacopy-utility.html" class="wp_rp_title">学习OCI之DataCopy程序</a> (8)</li><li >2011/04/02 -- <a href="http://www.anysql.net/tools/oracle-mysql-data-migration-tool.html" class="wp_rp_title">Oracle到MySQL的数据迁移工具</a> (6)</li><li >2009/03/31 -- <a href="http://www.anysql.net/tools/sqluldr2_simple_query.html" class="wp_rp_title">指定表名导出文本</a> (0)</li><li >2012/06/05 -- <a href="http://www.anysql.net/tools/mysqlcopy-delete-source.html" class="wp_rp_title">使用mysqlcopy来迁移MySQL历史数据 </a> (0)</li><li >2009/04/02 -- <a href="http://www.anysql.net/tools/sqluldr2_license.html" class="wp_rp_title">给SQLULDR2加上Key保护</a> (6)</li><li >2010/04/15 -- <a href="http://www.anysql.net/tools/parallel-datacopy-datasync.html" class="wp_rp_title">并行SQLULDR2和DataCopy操作</a> (4)</li><li >2010/04/18 -- <a href="http://www.anysql.net/tools/parallel-inside-sqluldr2.html" class="wp_rp_title">SQLULDR2 : Parallel Inside Now!</a> (12)</li><li >2006/11/15 -- <a href="http://www.anysql.net/dba/10g_expimp_9i.html" class="wp_rp_title">10g的EXP/IMP连到早期版本时的错误信息</a> (2)</li><li >2007/11/09 -- <a href="http://www.anysql.net/aulmydul/aul_robustdmp.html" class="wp_rp_title">AUL 5对恢复成DMP格式支持得更好了</a> (1)</li><li >2007/08/22 -- <a href="http://www.anysql.net/tools/ociuldr_option_array.html" class="wp_rp_title">ociuldr的更新, 为了更好的long类型支持</a> (1)</li></ul><div class="wp_rp_footer"><a class="wp_rp_backlink" target="_blank" rel="nofollow" href="http://www.zemanta.com/?wp-related-posts">Zemanta</a></div></div></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/AnySQL?a=pnuuM2JfLjs:BdoIk_ANhEA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=pnuuM2JfLjs:BdoIk_ANhEA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=pnuuM2JfLjs:BdoIk_ANhEA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/AnySQL?i=pnuuM2JfLjs:BdoIk_ANhEA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=pnuuM2JfLjs:BdoIk_ANhEA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/AnySQL?a=pnuuM2JfLjs:BdoIk_ANhEA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/AnySQL?d=dnMXMwOfBR0" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/AnySQL/~4/pnuuM2JfLjs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.anysql.net/tools/datacopy-300gb-data-test.html/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://www.anysql.net/tools/datacopy-300gb-data-test.html</feedburner:origLink></item>
	</channel>
</rss>
