DtaStage--学习方法小结(转)
原文地址:
http://hi.baidu.com/swordmood/item/2185dcc2978beb62f7c95dd3
datastage怎样调用存储过程
1。可以选择编写一个自定义Routine然后通过Transformer去实现
或者建立存储过程,然后在Database组件里的Before After里用数据库语句去调用就可以了
还有一个选择就是运行自定的shell脚本去调用,这种方法要用到job sequence中的运行命令的组件
2。datastage有专门调用存储过程的stage
3.亦可在ODBC中调用存储过程
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
实现是日期加1
DateToString(DateFromDaysSince(1,StringToDate(DSLink4.sjrq,"%yyyy%mm%dd")),"%yyyy%mm%dd")
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Transfomer function to Left Pad a string ?
Not sure if there is one available. I think it is available in the server job using the FMT function.
But what we did was use the STR, LEN and concatenation operator(:) to achieve the desired result.
STR("0",10-LEN(Input_Column)):Input_Column
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DataStage 如何解决"job is being accessed by another user"错误
由于网络连接失败或客户端崩溃造成Job被锁定的解决方法
当某一个用户在DataStage Designer中打开一个job,该job就被锁定。当其他用户试图打开同一个job或者job sequence,在designer中会得到如下信息"job [job名称] is being accessed by another user"。顺便提一下,这点Informatica比DS作的更友好一些,当试图打开某一个正在被其他用户编辑的mapping的时候,除了警告信息,Informatica还会告知当前编辑该Job的IP和User。
如果正在编辑某个job,发生网络连接中断(不小心碰掉了网线),或者客户端崩溃(我用XP SP2+DS751,每个星期总要发生个两三回,尤其是在编辑复杂的job sequence时)。重新启动客户端,试图打开刚才被编辑的Job很可能就被提示" job is being accessed by another user"。
首先确定在DataStage Administrator中对该project 设置了权限"Enable job Administration in Director",否则Director中部分菜单按钮不能访问
打开DataStage Director,找到被锁定的Job, 菜单Job->Clear Status File。会得到提示" This will remove all job status information from [job名称]. Are you sure you want to continue?",选择"Yes"
菜单Job->Clean up resources,此时会有Job Resources对话框出现。下边list中卫当前锁,在Item Id列找到被锁定的job,记下PID/User#列对应的PID
Telnet到DataStage服务器,执行如下命令
ps -ef | grep dsapi_slave
注意输出的前三列是用户名, ID1, ID2格式
在ID1列找到前面记下的PID,执行如下命令
kill -9 ID2
有空研究下windows下如何定位,加以更新
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
If u are trying to open a Job in the Datastage Designer and it says: "th
job is accessed by another user", it cud be due to two reasons:
1.) Chk if you already have that job open in a different wDesigner Window.
2) If not, then the job is locked.
You can realse the lock in various different ways.
1.) Go to ->Manager-> tools->Release job (u shud have administrator prev )
2.) Use DS.TOOLS command in the DataStage Administrator to chk and releas
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Error in Link collector - Stage does not support in-process active-to-active inputs or outputs
To get rid of the error just go to the Job Properties -> Performance and select Enable row buffer.
Then select Inter process which will let the link collector run correctly.
Buffer size set to 128Kb should be fine, however it's a good idea to increase the timeout.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DataStage---日期的一些总结收藏 【转】
使用DataStage将数据源文件数据导入到DB2中时,发现有个别中文字缺失。
当时第一反应是DataStage中字符集设置不正确。然而先后将Source,TargetTable,Job Properties的NLS更改后(几乎用遍了里面所提供的字符集 其中能在viewData时正确显示的是 MS936,None是忽略字符集即原来是什么样就是什么样。这个的话有时候会照成分隔符识别错误。),但是问题依旧。
看来不是DataStage的问题,因为在选择MS936时 ViewData是可以正确显示哪些缺失的中文字的。由于项目中DataStage是装在AIX上的,怀疑是AIX字符集设置问题。或者是DB本身的字符集不支持。
作个试验,使用本地windows上的DataStage向同一个DB中插入相同的文本数据,ok,中文无缺失。那么就排除了DB不字符集不支持的情况。将该文本copy到AIX上,用vi打开。果然那些中文字无法正常显示。
经多方求教,得出结论。DataStage在将数据插入到DB前,先用其所在的机器上的DB Client进行字符集转换。而DBClient所用的字符集又是其所在操作系统上的。所以才会有AIX上插入时有中文缺失,而windows平台上往DB插入,无此类情况发生。
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2.oracle组件中的load
SQL*Loader-925: Error while uldlpim: OCIStmtExecute
ORA-00904: "MESSAGE_NUM": invalid identifier
oracle数据库本身有两种load方式:direct path和conventional path.前者直接格式化数据库块,后者会利用sql插入数据。因为direct path方式直接格式化数据库块,绕过了sql引擎和undo生成,所以direct path速度更快。默认情况下datastage中是直接采用direct path方式。在使用datastage中的oracle组件load方式时,有时候会报
SQL*Loader-925: Error while uldlpim: OCIStmtExecute
ORA-00904: "MESSAGE_NUM": invalid identifier
刚开始看到的时候觉得很摸不清头脑,不知道问题所在,后来查看了oracle的文档
才知道其实是oracle的一个bug。这种情况的发生往往是我们使用了较高版本的oracle
client去连接较低版本的oracle db所致,比如我们采用10g的客户端去连接9i的数据库,
当使用direct path load时就会报上面的错。在datastage中一种解决方案是重装oracle
client,一种是通过administrator修改oracle load option.

浙公网安备 33010602011771号