HSQLDb倒数据到Mysql
来源:互联网 发布:linux运维最佳实践pdf 编辑:程序博客网 时间:2024/06/05 21:56
文章http://wiki.pentaho.com/display/COM/Use+Kettle+to+Migrate+Sample+Data+to+MySQL 给出了解决方案,
就是采用kettle将完成数据转换。
具体如下:
1> 保证已经安装好了kettle,并且已经安装步骤一中启动了pentaho
2> 将转换文件hprsnic-mysql-sampledata.ktr 放到kettle的repository目录
3> 在mysql里创建数据库sampledata并赋予权限:
create database sampledata;
grant all on sampledata.* to 'pentaho_user'@'localhost' identified by 'password'
4> 点击“产生需要运行这个转换的SQL”,会弹出SQL语句的对话框,点击执行,会在mysql里创建DEPARTMENT_MANAGERS 与QUADRANT_ACTUALS两张表
5> 在kettle里点击运行按钮,会把数据从hsql中导入到mysql
############ 附录 hprsnic-mysql-sampledata.ktr ############
<?xml version="1.0" encoding="UTF-8"?><transformation> <info> <name/> <directory>/</directory> <log> <read/> <write/> <input/> <output/> <update/> <connection/> <table/> <use_batchid>Y</use_batchid> <use_logfield>N</use_logfield> </log> <maxdate> <connection/> <table/> <field/> <offset>0.0</offset> <maxdiff>0.0</maxdiff> </maxdate> <size_rowset>350</size_rowset> <sleep_time_empty>1</sleep_time_empty> <sleep_time_full>1</sleep_time_full> <dependencies> </dependencies> </info> <notepads> </notepads> <connection> <name>mysql-sampledata</name> <server>localhost</server> <type>MYSQL</type> <access>Native</access> <database>sampledata</database> <port>3306</port> <username>pentaho_user</username> <password>Encrypted 2be98afc86aa7f2e4bb18bd63c99dbdde</password> <servername/> <data_tablespace/> <index_tablespace/> <attributes> <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute> </attributes> </connection> <connection> <name>hpsnc-sampledata</name> <server>localhost</server> <type>HYPERSONIC</type> <access>Native</access> <database>sampledata</database> <port>9001</port> <username>pentaho_user</username> <password>Encrypted 2be98afc86aa7f2e4bb18bd63c99dbdde</password> <servername/> <data_tablespace/> <index_tablespace/> <attributes> <attribute><code>PORT_NUMBER</code><attribute>9001</attribute></attribute> </attributes> </connection> <order> <hop> <from>hprsnc-dm</from><to>my-dm</to><enabled>Y</enabled> </hop> <hop> <from>hprsnc-QA</from><to>my-qa</to><enabled>Y</enabled> </hop> </order> <step> <name>hprsnc-QA</name> <type>TableInput</type> <description/> <distribute>Y</distribute> <copies>1</copies> <connection>hpsnc-sampledata</connection> <sql>SELECT REGION, DEPARTMENT, POSITIONTITLE, ACTUAL, BUDGET, VARIANCEFROM QUADRANT_ACTUALS</sql> <limit>0</limit> <lookup/> <execute_each_row>N</execute_each_row> <variables_active>N</variables_active> <GUI> <xloc>94</xloc> <yloc>198</yloc> <draw>Y</draw> </GUI> </step> <step> <name>hprsnc-dm</name> <type>TableInput</type> <description/> <distribute>Y</distribute> <copies>1</copies> <connection>hpsnc-sampledata</connection> <sql>SELECT REGION, MANAGER_NAME, EMAILFROM DEPARTMENT_MANAGERS</sql> <limit>0</limit> <lookup/> <execute_each_row>N</execute_each_row> <variables_active>N</variables_active> <GUI> <xloc>95</xloc> <yloc>106</yloc> <draw>Y</draw> </GUI> </step> <step> <name>my-dm</name> <type>InsertUpdate</type> <description/> <distribute>Y</distribute> <copies>1</copies> <connection>mysql-sampledata</connection> <commit>100</commit> <update_bypassed>Y</update_bypassed> <lookup> <table>DEPARTMENT_MANAGERS</table> <key> <name>REGION</name> <field>REGION</field> <condition>=</condition> <name2/> </key> <key> <name>MANAGER_NAME</name> <field>MANAGER_NAME</field> <condition>=</condition> <name2/> </key> <key> <name>EMAIL</name> <field>EMAIL</field> <condition>=</condition> <name2/> </key> <value> <name>REGION</name> <rename>REGION</rename> <update>N</update> </value> <value> <name>MANAGER_NAME</name> <rename>MANAGER_NAME</rename> <update>N</update> </value> <value> <name>EMAIL</name> <rename>EMAIL</rename> <update>N</update> </value> </lookup> <GUI> <xloc>223</xloc> <yloc>112</yloc> <draw>Y</draw> </GUI> </step> <step> <name>my-qa</name> <type>InsertUpdate</type> <description/> <distribute>Y</distribute> <copies>1</copies> <connection>mysql-sampledata</connection> <commit>100</commit> <update_bypassed>Y</update_bypassed> <lookup> <table>QUADRANT_ACTUALS</table> <key> <name>REGION</name> <field>REGION</field> <condition>=</condition> <name2/> </key> <key> <name>DEPARTMENT</name> <field>DEPARTMENT</field> <condition>=</condition> <name2/> </key> <key> <name>POSITIONTITLE</name> <field>POSITIONTITLE</field> <condition>=</condition> <name2/> </key> <key> <name>ACTUAL</name> <field>ACTUAL</field> <condition>=</condition> <name2/> </key> <key> <name>BUDGET</name> <field>BUDGET</field> <condition>=</condition> <name2/> </key> <key> <name>VARIANCE</name> <field>VARIANCE</field> <condition>=</condition> <name2/> </key> <value> <name>REGION</name> <rename>REGION</rename> <update>N</update> </value> <value> <name>DEPARTMENT</name> <rename>DEPARTMENT</rename> <update>N</update> </value> <value> <name>POSITIONTITLE</name> <rename>POSITIONTITLE</rename> <update>N</update> </value> <value> <name>ACTUAL</name> <rename>ACTUAL</rename> <update>N</update> </value> <value> <name>BUDGET</name> <rename>BUDGET</rename> <update>N</update> </value> <value> <name>VARIANCE</name> <rename>VARIANCE</rename> <update>N</update> </value> </lookup> <GUI> <xloc>232</xloc> <yloc>206</yloc> <draw>Y</draw> </GUI> </step></transformation>
- HSQLDb倒数据到Mysql
- Mysql倒数据问题
- 如何将openCRX数据从HSQLDB迁移到其他数据库
- 将openfire内置数据库hsqldb的数据备份迁移置mysql
- 使用sqoop做Mysql与Hive数据互倒操作
- hsqldb
- HSQLDB
- HSQLDB
- hsqldb
- hsqlDB
- hsqldb
- hsqldb
- HSQLDB
- HSQLDB
- HSQLDB
- excel中倒数据到sql server2000中部分数据为空的问题的解决方法
- HSQLDB如何备份和还原数据
- 倒数据常用语句
- 堆 和 栈的 区别(经典)
- MyEclipse快捷键大全
- 赛普拉斯 cypress Cyapi使用心得
- Qt调用dll中的功能函数
- Java计算时间差
- HSQLDb倒数据到Mysql
- GDI+编程基础1
- Ubuntu for Android
- 【联邦大会】看点4:动态影像服务能力
- 1027. Colors in Mars
- ASP.Net 常用缓存更新(转)
- hrsp命令
- OTT
- 【联邦大会】看点5:3D Web Scene功能增强