马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
批处理操作informatica、Oracle、Essbase数据导出
引用官方帮助:
如何在pmcmcd,pmrep命令行中使用加密的用户名密码
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
用命令行调workflow的命令中需要输入访问informatica的用户名密码,直接写上密码又有安全隐患,这里提供一种在pmcmd,pmrep命令行中使用加密的用户名密码的方法。
windows: - 为Repository 用户创建一个环境变量(例如:PMUSER)
依次进入:开始,设置,控制面板,系统,高级,环境变量,在系统环境变量中新建一个变量,变量名”PMUSER”,变量值”Administrator”. 点”OK”完成。 - 用下面命令为Adminitrator用户创建一个加密的密码:
pmpasswd Administrator
这条命令将会把字符串”Administrator”转换成一个加密的字符串,如”ae456=GHY&|3f7″
- 为密码创建一个环境变量
依次进入:开始,设置,控制面板,系统,高级,环境变量,在系统环境变量中新建一个变量,变量名”PMPASS”,变量值为刚才加密的字符串,如:”ae456=GHY&|3f7″. 点”OK”完成。
Unix - 创建用户名环境变量:setenv PMUSER Administrator
- 创建加密的密码:pmpasswd Administrator
c shell:setenv PMPASS encrypted_password
b shell:
PMPASS = encrypted password
export PMPASS
确认环境变量:env
应用: - 在PMCMD命令中使用加密的用户名密码启动一个workflow:
pmcmd startworkflow -sv service -uv PMUSER -pv PMPASS workflow - 在PMREP命令中使用加密的用户名密码连接到Repository:
pmrep connect -r repository_name -d domain_name -n Administrator -X PMPASS
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
附:PMCMD命令格式:
D:\Informatica\PowerCenter8.1.1\server\bin>pmcmd -help
Informatica(r) PMCMD, version [8.1.1], build [600.0831], Windows 32-bit
Copyright (c) Informatica Corporation 1994 - 2006
All Rights Reserved.
Invoked at Wed Apr 02 16:30:52 2008
Usage: pmcmd help [command]
Usage: pmcmd version
Usage: pmcmd pingservice
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
Usage: pmcmd getserviceproperties
<<-service|-sv> service [<-domain|-d> domain]
[<-timeout|-t> timeout]>
Usage: pmcmd getservicedetails
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[-all|-running|-scheduled]
Usage: pmcmd getrunningsessionsdetails
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
Usage: pmcmd startworkflow
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder]
[<-startfrom> taskInstancePath [<-recovery>]]
[<-paramfile> paramfile]
[<-localparamfile|-lpf> localparamfile]
[-wait|-nowait] workflow
Usage: pmcmd stopworkflow
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] [-wait|-nowait] workflow
Usage: pmcmd abortworkflow
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] [-wait|-nowait] workflow
Usage: pmcmd waitworkflow
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] workflow
Usage: pmcmd recoverworkflow
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] [<-paramfile> paramfile]
[<-localparamfile|-lpf> localparamfile]
[-wait|-nowait] workflow
Usage: pmcmd scheduleworkflow
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] workflow
Usage: pmcmd unscheduleworkflow
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] workflow
Usage: pmcmd getworkflowdetails
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] workflow
Usage: pmcmd starttask
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] <-workflow|-w> workflow
[<-paramfile> paramfile] [-wait|-nowait] [<-recovery>]
taskInstancePath
Usage: pmcmd stoptask
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] <-workflow|-w> workflow
[-wait|-nowait] taskInstancePath
Usage: pmcmd aborttask
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] <-workflow|-w> workflow
[-wait|-nowait] taskInstancePath
Usage: pmcmd waittask
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] <-workflow|-w> workflow
taskInstancePath
Usage: pmcmd gettaskdetails
<<-service|-sv> service [<-domain|-d> domain] [<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] <-workflow|-w> workflow
taskInstancePath
Usage: pmcmd getsessionstatistics
<<-service|-sv> service [<-domain|-d> domain][<-timeout|-t> timeout]>
<<-user|-u> username|<-uservar|-uv> userEnvVar>
<<-password|-p> password|<-passwordvar|-pv> passwordEnvVar>
[<-folder|-f> folder] <-workflow|-w> workflow
taskInstancePath
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
批处理直接启动workflow:
示例:@echo on
REM 批处理操作Oracle数据库
sqlplus apps/apps@test @c:\truncatetable.sql
d:
cd d:\informatica\PowerCenter8.1.1\server\bin\
call d:\informatica\PowerCenter8.1.1\server\bin\pmcmd.exe startworkflow -service PowerCenter_Integration_Service -d Domain_Hyperion -u Administrator -p Administrator wf_M_EBS_TO_SQL_GL_AMOUNT
ping -n 10 127.0.0.1>nul
exit /B
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
批处理从Essbase中倒出数据至关系库
计算脚本示例:
SET UPDATECALC OFF;
SET DATAEXPORTOPTIONS
{
DataExportLevel "ALL";
DATAEXPORTOVERWRITEFILE ON;
DataExportRelationalFile ON;
DataExportDimHeader ON;
/*DataExportColHeader "PERIOD";*/
};
FIX("Jan")
fix("内部预算")
fix("版本5")
FIX(&NextYear) /*定义替代变量*/
DATAEXPORT "DSN" "ODBC_HPTEST" "XZ_HP_ESSBASE_BDGDATA" "apps" "apps";
/*下行命令为导出到文件*/
/*DATAEXPORT "FILE" "," "D:\Informatica\PowerCenter8.1.1\server\infa_shared\SrcFiles\ESSBDGTOEBS.TXT";*/
ENDFIX
ENDFIX
endfix
endfix
批处理运行计算脚本:
在C盘新建testExport文件夹,在文件夹下新建export.txt,内容示例如下:
LOGIN "10.136.2.69" "htadmin" "htplnserver";
SELECT "httest" "Budget";
RUNCALC 2 "导预算1";
EXIT;
同时新建export.cmd,示例内容如下:
ESSCMD Export.txt
PAUSE
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |