﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-数据仓库 Or SOA</title><link>http://www.blogjava.net/xichengmylove/</link><description>SOA、DataStage、Unix、Java EE、Oracle、Data Migration、Data Integration</description><language>zh-cn</language><lastBuildDate>Sun, 03 May 2026 13:38:37 GMT</lastBuildDate><pubDate>Sun, 03 May 2026 13:38:37 GMT</pubDate><ttl>60</ttl><item><title>Sql_Trace File Identifier和Sample Block（抽样表扫描）</title><link>http://www.blogjava.net/xichengmylove/archive/2009/08/25/292517.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Tue, 25 Aug 2009 08:01:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2009/08/25/292517.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/292517.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2009/08/25/292517.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/292517.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/292517.html</trackback:ping><description><![CDATA[<p><span style="font-size: 18pt; color: #800080; font-family: Arial"><strong>Sql_Trace File Identifier<br />
</strong></span><br />
我们设置了sql_trace为true之后，trace file会dump到udump中，但是该目录下也许已经有很多trace file了，或者其他session也设置了sql_trace为true，也在产生trace file。如何能迅速找到你的session产生的trace file呢？我们可以通过如下语句设置Sql_Trace File Identifier：<br />
</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">ALTER</span><span style="color: #000000">&nbsp;SESSION&nbsp;</span><span style="color: #0000ff">SET</span><span style="color: #000000">&nbsp;TRACEFILE_IDENTIFIER&nbsp;</span><span style="color: #808080">=</span><span style="color: #000000">&nbsp;</span><span style="color: #ff0000">'</span><span style="color: #ff0000">my_trace_id</span><span style="color: #ff0000">'</span><span style="color: #000000">;</span></div>
<p><br />
这样你的session产生的trace file就会以设置的identifier为后缀。</p>
<p>&nbsp;</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="color: #000000">SQL</span><span style="color: #808080">&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">alter</span><span style="color: #000000">&nbsp;session&nbsp;</span><span style="color: #0000ff">set</span><span style="color: #000000">&nbsp;tracefile_identifier</span><span style="color: #808080">=</span><span style="color: #ff0000">'</span><span style="color: #ff0000">test_identifier</span><span style="color: #ff0000">'</span><span style="color: #000000">;<br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />Session&nbsp;altered.<br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />SQL</span><span style="color: #808080">&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">alter</span><span style="color: #000000">&nbsp;session&nbsp;</span><span style="color: #0000ff">set</span><span style="color: #000000">&nbsp;sql_trace</span><span style="color: #808080">=</span><span style="color: #000000">true;<br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />Session&nbsp;altered.<br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />SQL</span><span style="color: #808080">&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">select</span><span style="color: #000000">&nbsp;</span><span style="color: #808080">*</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">from</span><span style="color: #000000">&nbsp;dual;<br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />D<br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #808080">-</span><span style="color: #000000"><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />X<br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />SQL</span><span style="color: #808080">&gt;</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">alter</span><span style="color: #000000">&nbsp;session&nbsp;</span><span style="color: #0000ff">set</span><span style="color: #000000">&nbsp;sql_trace</span><span style="color: #808080">=</span><span style="color: #000000">false;<br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br />
<img alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />Session&nbsp;altered.</span></div>
<p>然后我们可以看到udump下生成的trace file文件名为：test_ora_4168_test_identifier.trc<br />
<br />
<strong style="font-size: 18pt; color: #800080; font-family: Arial">Sample Block<br />
</strong><br />
抽样表扫描（sample table scan）只读取一个表的部分数据。其实我们只选择表的部分数据的话，可以用rownum来限制也很方便。但是考虑如下情况：<br />
A表和B表join，我只想A表的部分数据去连接B表，此时用sample就方便的多。如果用rownum就需要用一个subquery。<br />
</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #008080">--</span><span style="color: #008080">用Sample：</span><span style="color: #008080"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">select</span><span style="color: #000000">&nbsp;A.id,A.name&nbsp;</span><span style="color: #0000ff">from</span><span style="color: #000000">&nbsp;A&nbsp;sample&nbsp;block(</span><span style="font-weight: bold; color: #800000">20</span><span style="color: #000000">),B&nbsp;<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">where</span><span style="color: #000000">&nbsp;A.id</span><span style="color: #808080">=</span><span style="color: #000000">B.id<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #008080">--</span><span style="color: #008080">用Rownum：</span><span style="color: #008080"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">select</span><span style="color: #000000">&nbsp;A.id,A.name&nbsp;</span><span style="color: #0000ff">from</span><span style="color: #000000">&nbsp;(</span><span style="color: #0000ff">select</span><span style="color: #000000">&nbsp;a.id,a.name&nbsp;</span><span style="color: #0000ff">from</span><span style="color: #000000">&nbsp;a&nbsp;</span><span style="color: #0000ff">where</span><span style="color: #000000">&nbsp;rownum</span><span style="color: #808080">&lt;</span><span style="font-weight: bold; color: #800000">100</span><span style="color: #000000">)&nbsp;A,B&nbsp;<br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">where</span><span style="color: #000000">&nbsp;A.id</span><span style="color: #808080">=</span><span style="color: #000000">B.id</span></div>
<p><br />
抽样表扫描有两种形式，一种是抽样表中行数的一个百分比，一个是抽样表中块数的一个百分比。注意都是百分比。语法如下：<br />
</p>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /><span style="color: #0000ff">SELECT</span><span style="color: #000000">&nbsp;</span><span style="color: #808080">*</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">FROM</span><span style="color: #000000">&nbsp;employees&nbsp;SAMPLE&nbsp;(</span><span style="font-weight: bold; color: #800000">1</span><span style="color: #000000">);</span><span style="color: #008080">--</span><span style="color: #008080">返回行数乘以1%</span><span style="color: #008080"><br />
<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top"  alt="" /></span><span style="color: #0000ff">SELECT</span><span style="color: #000000">&nbsp;</span><span style="color: #808080">*</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">FROM</span><span style="color: #000000">&nbsp;employees&nbsp;SAMPLE&nbsp;BLOCK&nbsp;(</span><span style="font-weight: bold; color: #800000">1</span><span style="color: #000000">);</span><span style="color: #008080">--</span><span style="color: #008080">返回块数乘以1%</span></div>
<p><br />
也可以在视图上使用SAMPLE。<br />
<br />
<br />
</p>
  <img src ="http://www.blogjava.net/xichengmylove/aggbug/292517.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2009-08-25 16:01 <a href="http://www.blogjava.net/xichengmylove/archive/2009/08/25/292517.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ETL时先disable外键约束再load数据</title><link>http://www.blogjava.net/xichengmylove/archive/2008/01/15/175486.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Tue, 15 Jan 2008 08:12:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2008/01/15/175486.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/175486.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2008/01/15/175486.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/175486.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/175486.html</trackback:ping><description><![CDATA[Kimball在他的ETL Toolkit一书中，一直强调：对于有外键约束的表，为了提高load的速度，可以先将外键约束disable，加载完成后再enable（当然另外一个原因是进入数据仓库的数据都是规范的，甚至可以考虑不使用外键约束，即违反约束的数据在Transformation部分就应该解决掉，当然这是设计问题了）。ps:另外两个提高load速度的方法分别为使用sql loader和insert、update分离。当时还不是明白这个过程怎么具体实现，今天看《oracle concept》看到下面话终于明白了一些：<br />
<strong>Flexibility for Data Loads and Identification of Integrity Violations<br />
</strong>You can disable integrity constraints temporarily so that large amounts of data can be loaded without the overhead of constraint checking. When the data load is complete,you can easily enable the integrity constraints, and you can automatically report any new rows that violate integrity constraints to a separate exceptions table.<br />
看来oracle这点上做的比较完善，还可以将违反完整性约束的数据自动记录到一个exception表中。 
<img src ="http://www.blogjava.net/xichengmylove/aggbug/175486.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2008-01-15 16:12 <a href="http://www.blogjava.net/xichengmylove/archive/2008/01/15/175486.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>删除重复数据的3种方法</title><link>http://www.blogjava.net/xichengmylove/archive/2008/01/08/173544.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Tue, 08 Jan 2008 02:04:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2008/01/08/173544.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/173544.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2008/01/08/173544.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/173544.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/173544.html</trackback:ping><description><![CDATA[<p>今天google分析函数row_number()的时候发现的，觉得很好：<br />
<br />
<span style="font-family: Arial; background-color: #ffff99">表demo是重复拷贝自dba_objects，有88万左右，不重复的是27323，没有索引<br style="font-family: " />
方法一：delete from demo a where a.rowid &lt;&gt; (select max(rowid) from demo b where<br style="font-family: " />
b.object_id=a.object_id);<br style="font-family: " />
耗时：几个小时以上 <br style="font-family: " />
方法二： delete from demo where rowid in <br style="font-family: " />
(select rid from <br style="font-family: " />
(select rowid rid,row_number() over(partition by object_id order by rowid) rn<br style="font-family: " />
from demo)<br style="font-family: " />
where rn &lt;&gt; 1 );<br style="font-family: " />
耗时：30秒<br style="font-family: " />
方法三： create table demo2 as <br style="font-family: " />
select object_id,owner... from<br style="font-family: " />
(select demo.*,row_number() over(partition by object_id order by rowid) rn from demo)<br style="font-family: " />
where rn = 1;<br style="font-family: " />
truncate table demo; insert into demo select * from demo2; drop table demo2;<br style="font-family: " />
共耗时： 10秒，适合大数据量的情况，产生更少回滚量；</span><br />
<br />
学到了分析函数row_number(),对于object_id和rowid也有了一些认识。oracle要学的东西太多了，什么时候是个头啊<img alt="" src="/CuteSoft_Client/CuteEditor/images/emteeth.gif" align="absMiddle" border="0" />。上面的方法不是很难理解，但也还没有完全理解，有机会实际试试。</p>
<img src ="http://www.blogjava.net/xichengmylove/aggbug/173544.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2008-01-08 10:04 <a href="http://www.blogjava.net/xichengmylove/archive/2008/01/08/173544.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在load的时候去掉sequential file的header和footer</title><link>http://www.blogjava.net/xichengmylove/archive/2007/08/13/136494.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Mon, 13 Aug 2007 11:37:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2007/08/13/136494.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/136494.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2007/08/13/136494.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/136494.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/136494.html</trackback:ping><description><![CDATA[今天在论坛看到的方法，先记录下来：<br><span style="COLOR: #cc99ff">方法一：</span><br>在sequential file stage中有个属性可以ignore第一行。对于footer，如果footer使用了与正文不同的格式，可以用使用transformer stage和 @INROWNUM stage来将footer去掉。<br><span style="COLOR: #cc99ff">方法二：<br></span>在sequential file的filter option中使用sed -e '$d' -e '1d'来讲header和footer去掉。<br><span style="COLOR: #cc99ff">方法三：</span><br>写个before job subroutine，可以先对这个文件做各种处理，不过我想也是subroutine中调用DSExecute sed -e '$d' -e '1d'。当然Basic中也有专门对sequential file处理的函数。<br>
<img src ="http://www.blogjava.net/xichengmylove/aggbug/136494.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2007-08-13 19:37 <a href="http://www.blogjava.net/xichengmylove/archive/2007/08/13/136494.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>datastage中Orchadmin命令的使用（转） </title><link>http://www.blogjava.net/xichengmylove/archive/2007/08/08/135256.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Wed, 08 Aug 2007 07:37:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2007/08/08/135256.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/135256.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2007/08/08/135256.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/135256.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/135256.html</trackback:ping><description><![CDATA[<p>Orchadmin is a command line utility provided by datastage to research on data sets.<br>The general callable format is : $orchadmin [options] [descriptor file]<br><br>1. Before using orchadmin, you should make sure that either the working directory or the $APT_ORCHHOME/etc contains the file &#8220;config.apt&#8221; OR<br><br>The environment variable $APT_CONFIG_FILE should be defined for your session.<br>Orchadmin commands<br><br>The various commands available with orchadmin are<br>1. CHECK: $orchadmin check<br><br>Validates the configuration file contents like , accesibility of all nodes defined in the configuration file, scratch disk definitions and accesibility of all the nodes etc. Throws an error when config file is not found or not defined properly<br><br>2. COPY : $orchadmin copy<br>Makes a complete copy of the datasets of source with new destination descriptor file name. Please not that<br><br>a. You cannot use UNIX cp command as it justs copies the config file to a new name. The data is not copied.<br><br>b. The new datasets will be arranged in the form of the config file that is in use but not according to the old confing file that was in use with the source.<br><br>3. DELETE : $orchadmin &lt;&gt; [-f -x] descriptorfiles&#8230;.<br>The unix rm utility cannot be used to delete the datasets. The orchadmin delete or rm command should be used to delete one or more persistent data sets.<br>-f options makes a force delete. If some nodes are not accesible then -f forces to delete the dataset partitions from accessible nodes and leave the other partitions in inaccesible nodes as orphans.<br>-x forces to use the current config file to be used while deleting than the one stored in data set.<br><br>4. DESCRIBE: $orchadmin describe [options] descriptorfile.ds<br>This is the single most important command.<br>1. Without any option lists the no.of.partitions, no.of.segments, valid segments, and preserve partitioning flag details of the persistent dataset.<br>-c : Print the configuration file that is written in the dataset if any<br>-p: Lists down the partition level information.<br>-f: Lists down the file level information in each partition<br>-e: List down the segment level information .<br>-s: List down the meta-data schema of the information.<br>-v: Lists all segemnts , valid or otherwise<br>-l : Long listing. Equivalent to -f -p -s -v -e<br><br>5. DUMP: $orchadmin dump [options] descriptorfile.ds<br>The dump command is used to dump(extract) the records from the dataset.<br>Without any options the dump command lists down all the records starting from first record from first partition till last record in last partition.<br>-delim &#8216;&#8217; : Uses the given string as delimtor for fields instead of space.<br>-field : Lists only the given field instead of all fields.<br>-name : List all the values preceded by field name and a colon<br>-n numrecs : List only the given number of records per partition.<br>-p period(N) : Lists every Nth record from each partition starting from first record.<br>-skip N: Skip the first N records from each partition.<br>-x : Use the current system configuration file rather than the one stored in dataset.<br><br>6. TRUNCATE: $orchadmin truncate [options] descriptorfile.ds<br>Without options deletes all the data(ie Segments) from the dataset.<br>-f: Uses force truncate. Truncate accessible segments and leave the inaccesible ones.<br>-x: Uses current system config file rather than the default one stored in the dataset.<br>-n N: Leaves the first N segments in each partition and truncates the remaining.<br><br>7. HELP: $orchadmin -help OR $orchadmin -help<br>Help manual about the usage of orchadmin or orchadmin commands</p>
<img src ="http://www.blogjava.net/xichengmylove/aggbug/135256.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2007-08-08 15:37 <a href="http://www.blogjava.net/xichengmylove/archive/2007/08/08/135256.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>trim会drop掉记录</title><link>http://www.blogjava.net/xichengmylove/archive/2007/08/02/134104.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Thu, 02 Aug 2007 13:01:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2007/08/02/134104.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/134104.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2007/08/02/134104.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/134104.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/134104.html</trackback:ping><description><![CDATA[当一条记录过来，某个字段为空，而在transformer中又对该字段trim了，由于该字段为空，不能trim，所以DataStage会认为这是个错误，从而把这个记录drop了，这与实际业务不符合，非主键字段为空并不能就把这条记录drop了。我们可以通过写一个判断来解决该问题：if LK_1.EMAIL &lt;&gt; '' then trim(LK_1.EMAIL) else LK_1.EMAIL
<img src ="http://www.blogjava.net/xichengmylove/aggbug/134104.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2007-08-02 21:01 <a href="http://www.blogjava.net/xichengmylove/archive/2007/08/02/134104.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DataStage中可以执行routine，命令行以控制的地方</title><link>http://www.blogjava.net/xichengmylove/archive/2007/08/02/134095.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Thu, 02 Aug 2007 11:29:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2007/08/02/134095.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/134095.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2007/08/02/134095.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/134095.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/134095.html</trackback:ping><description><![CDATA[1 before/after job和before/after stage,可以执行shell，命令行以及一些DataStage API，如DSJobReport<br>2 job sequence中有个stage，可以在里面写控制job调度的地方<br>3 每个job的properties中有个job control tab<br>4 命令行可以执行、导入job等，它通过dsjob实现，在DS Manager的文档中还讲了有专门的命令行来导入job<br>5 可以编写shell来控制job，对dsjob命令做封装，可以传入参数等。<br>对于上面这些概念还是很模糊，先记录在此。
<img src ="http://www.blogjava.net/xichengmylove/aggbug/134095.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2007-08-02 19:29 <a href="http://www.blogjava.net/xichengmylove/archive/2007/08/02/134095.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>trim全为null的某个字段之后，输出为0</title><link>http://www.blogjava.net/xichengmylove/archive/2007/08/02/133997.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Thu, 02 Aug 2007 07:21:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2007/08/02/133997.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/133997.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2007/08/02/133997.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/133997.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/133997.html</trackback:ping><description><![CDATA[今天又碰到新问题，在transformer中，进去是有很多record，出来之后为0条record，用peek，看了一下，进去的数据的某个字段数据全为null，而在transformer中对此字段trim了，改为不trim就可以了。
<img src ="http://www.blogjava.net/xichengmylove/aggbug/133997.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2007-08-02 15:21 <a href="http://www.blogjava.net/xichengmylove/archive/2007/08/02/133997.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>job一直运行，数据不能插入数据库</title><link>http://www.blogjava.net/xichengmylove/archive/2007/08/01/133839.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Wed, 01 Aug 2007 09:33:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2007/08/01/133839.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/133839.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2007/08/01/133839.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/133839.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/133839.html</trackback:ping><description><![CDATA[今天遇到一个问题，job不停的在那里运行，然后link上的数据显示各个环节都是正确的，包括最后插入数据库的link上也显示了数据，但是最后数据库里并没有数据。在Director的log中，日志在从两个源文件把所有数据load出来完之后，日志就死在那里了。<br>以前这个job是正确的，昨天由于重新load其中一个源文件的元数据，所以出现了上述问题。所以先前以为是由于load的新的源数据有问题，就从此处来找问题的原因，并且认为可能是改了元数据，在其他地方映射的时候有位置不对的地方，所以整了很久。因为以前是好好的，然后又以为是服务器的问题。<br><br><span style="FONT-SIZE: 18pt; COLOR: #800080">这都是定势思维的错误，然后又一急，所以浪费了很多时间，其实很多时候都是这样，出了问题我们不能理性的好好思考。</span><br><br>其实问题很简单：<br>如果我们按照正常逻辑来分析的话，既然不能读入数据库，肯定是数据不符合数据库对数据的约束，包括主键啊，非空啊，本问题就是由于在stage的不断流转中产生了很多空格，使得最后待插入的数据长度远远大于数据库中定义的字段长度。由于在那里不断reject，所以影响了速度，job一直在那里运行。最后用APT_STRING_PADDER,将其设为0x0（用null代替空格）搞定。<br>ps：在插入数据库时使用一个reject文件对查错有好处，这样能看到reject是些什么数据，然后就能知道为什么被reject了。<br><span style="FONT-SIZE: 18pt; COLOR: #800080">同时我们可以得出如果最后插入数据库时很多数据被reject，但是你并没有用一个reject文件来接收这些reject掉的数据，将使得job基本处于停滞状态。</span>
<img src ="http://www.blogjava.net/xichengmylove/aggbug/133839.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2007-08-01 17:33 <a href="http://www.blogjava.net/xichengmylove/archive/2007/08/01/133839.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DataStage Job重置的三种方法</title><link>http://www.blogjava.net/xichengmylove/archive/2007/08/01/133747.html</link><dc:creator>羽翼渐丰</dc:creator><author>羽翼渐丰</author><pubDate>Wed, 01 Aug 2007 02:17:00 GMT</pubDate><guid>http://www.blogjava.net/xichengmylove/archive/2007/08/01/133747.html</guid><wfw:comment>http://www.blogjava.net/xichengmylove/comments/133747.html</wfw:comment><comments>http://www.blogjava.net/xichengmylove/archive/2007/08/01/133747.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/xichengmylove/comments/commentRss/133747.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/xichengmylove/services/trackbacks/133747.html</trackback:ping><description><![CDATA[<p>当一个Job跑到一半终止了要还原，在DS Director中主要有三种方法来还原：<br>1 Job-----Reset<br>2 Job-----Clear Status File<br>3 Job-----Cleanup Resource<br>具体细节也不懂，有时间慢慢研究</p>
<img src ="http://www.blogjava.net/xichengmylove/aggbug/133747.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/xichengmylove/" target="_blank">羽翼渐丰</a> 2007-08-01 10:17 <a href="http://www.blogjava.net/xichengmylove/archive/2007/08/01/133747.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>