1. Kettle is used across platforms.
For example, in Aix (Aix is an IBM commercial UNIX operating system, which is also applicable in Linux/Unix), the following steps are taken to run kettle:
1) enter the kettle deployment path
2) Run chmod *. Sh to add executable permissions to all shell files.
3) in the kettle path, if you want to execute transformation, run./PAN. Sh-file = ?. Ktr-DEBUG = debug-log = log. Log
. -File indicates the path of the transformation file to be run.-Debug indicates the log output level.-log indicates the log output path.
4) Similarly, for job execution, replace./PAN. Sh with./kitchen. Sh. The other parts do not change.
2. Kettle environment variables are used.
In transformation, core objects --> job --> set variables can be used to set environment variables, which is helpful for converting absolute paths and relative paths. Kettle's cross-platform relies heavily on it.
3. Use of other functions.
Other functions include dB stored procedure calling, stream query, value ing, and aggregate records.
4. Kettle timing function.
In the start module of a job, there is a timer function that can be scheduled on a daily or weekly basis, which is very helpful for periodic ETL.
A. The default user name and password are admin/admin when you log on using the resource library (repository.
B. When a job is stored in a resource library (generally a resource library uses a database), run the job using kitchen. bat with the following command line:
Kitchen. BAT/REP kettle/user admin/pass admin/job name
C. When the job is not stored in the resource library but in the file system, run the job using kitchen. bat with the following command line:
Kitchen. BAT/norep/file user-transfer-job.kjb
D. You can use the command line to execute a job, and then use the windows or Linux job scheduling to regularly execute the job.
E. If an exception occurs,
Unexpected error during transformation Metadata Load
No repository defined!
Follow the above operations to exclude.
5. Kettle experience logs.
Kettle has a bug in log processing. The person who has read the previous article may have seen my message. kettle has a bug in log processing. When the number of logs exceeds 49 MB (not 50 MB, it is not 49 MB), kettle will automatically stop, and I did not find the corresponding settings and constraints in the source code, because the log is not written, therefore, it is difficult to track the specific causes.
6. Kettle improves efficiency.
As an ETL tool, kettle cannot avoid efficiency problems. When a large data source is input, kettle may encounter efficiency problems. There are several solutions:
1) Create an index on the database. Creating indexes for the database fields to be queried can greatly improve the query efficiency. At most, I do not create indexes and query four records on average in one second, after creating an index, You can query 1300 records in one second.
2) Pay attention to the environment for database query and stream query. Because a database query input a record at the data input end, a query is performed on the target table, while a stream query reads the target table to the memory. When data input at the data input end, for internal queries, when the input end is large data volume and the queried table has a small amount of data (several hundred records), you can use stream queries. After all, read the target table to the memory, the query speed will be greatly improved (the read/write speed of the memory is several hundred times that of the hard disk, coupled with the constraints of the database itself, the speed will be more affected ). Similarly, if the target table contains a large amount of data, we recommend that you use a database to query the data. Otherwise, the memory size of several hundred MB will suddenly be exhausted.
3) be cautious when using JavaScript scripts because JavaScript itself is inefficient. When using JavaScript, you need to consider the time required to execute each record.
4) The number of database commit times. The impact of one record and one hundred record commit on efficiency is definitely different.
5) write the SQL statement entered in the table. Some people like to write all the associations when entering a table, either from N multiple tables or from in. In this way, we have to face 2) note the problems mentioned in.
6) Pay attention to log output. For example, if you select the database update mode and the log level is debug, the background will output logs desperately, which will greatly affect the speed, pay attention to this.
7. common debugging bugs.
Kettle provides many debugging solutions, but it can avoid common debugging bugs.
1) path problems. The most common problem I encountered was that the debugging was successful in windows, but there was a problem with the deployment to Unix. I forgot to change the path in Windows to Unix, which often caused problems.
2) at the output end, the database insertion and update options are incorrect. The output end provides three database Output Methods: Database output, insert/update, and update. These three methods have their own advantages and disadvantages. If you know the database output, they are completely inserted. If there is repeated data, an error is reported. when data is updated, many logs are output in the background, resulting in low efficiency.
8 execution example:
./Kitchen. Sh-file/home/ETL/Oracle/renbaojobs. kjb
9 common problems and solutions if memory overflow occurs, modify the file currently started, such as Linux./PAN. Sh, when a single script is run or the job is executed./kitchen. Sh
Modify the search for the two files.
If [-z "$ javamaxmem"]; then
Javamaxmem = "512"
Fi
Change 512 to 1890 or greater