Vous êtes sur la page 1sur 18

SLJM

SIMPLE LOAD JOB


MANAGEMENT
SIMPLE LOAD JOB MANAGEMENT

Cron
Jobs

SLJM is a basic
Utility Which lets
BTEQ SLJM Shell
Script
you manage
Loading jobs and
schedule them
according to your
business needs.
1. Cron Jobs
Fastload 2. Shell Scripting
3. BTEQ
4. FASTLOAD
CronJobs
• "Cron" is a time-based job scheduler in Unix-like operating
systems (Linux, FreeBSD, Mac OS etc...). And these jobs or
tasks are referred to as "Cron Jobs".
• There is a cron "daemon" that runs on these systems. A
daemon is a program that runs in the background all the
time, usually initiated by the system. This cron daemon is
responsible for launching these cron jobs on schedule.
• The schedule resides in a configuration file named
"crontab". That's where all the tasks and their timers are
listed.
Why use Cron Jobs

• If you have a membership site, where accounts have expiration dates, you can schedule cron jobs to
regularly deactivate or delete accounts that are past their expiration dates.
• You can send out daily newsletter e-mails.
• If you have summary tables (or materialized views) in your database, they can be regularly updated with a
cron job. For example you may store every web page hit in a table, but another summary table may contain
daily traffic summaries.
• You can expire and erase cached data files in a certain interval.
• You can auto-check your website content for broken links and have a report e-mailed to yourself regularly.
• You can schedule long-running tasks to run from a command line script, rather than running it from a web
script. Like encoding videos, or sending out mass e-mails.
• You can even perform something as simple as fetching your most recent Tweets, to be cached in a text file.
GUI and command based Syntax
Cronjobs Syntax: GUI Cron jobs
10 * * * * /usr/bin/php
/www/virtual/username/cron.php > /dev/null 2>&1
BTEQ
BTEQ utility is a powerful utility in Teradata that can be used in both batch and interactive mode.
It can be used to run any DDL statement, DML statement, create Macros and stored procedures.
BTEQ can be used to import data into Teradata tables from flat file and it can also be used to
extract data from tables into files or reports.
BTEQ TERMS AND RUN COMMAND

BTEQ < abc.sql >out 1


BTEQ Terms
• LOGON − Used to log into Teradata system.
• ACTIVITYCOUNT − Returns the number of rows affected by the previous
query.
• ERRORCODE − Returns the status code of the previous query.
• DATABASE − Sets the default database.
• LABEL − Assigns a label to a set of SQL commands.
• RUN FILE − Executes the query contained in a file.
• GOTO − Transfers control to a label.
• LOGOFF − Logs off from database and terminates all sessions.
• IMPORT − Specifies the input file path.
• EXPORT − Specifies the output file path and initiates the export.
BTEQ SYNTAX
Shell Script

A shell script is a text file that contains a sequence of commands for a


UNIX-based operating system. It's called a shell script because it
combines into a "script" in a single file a sequence of commands that
would otherwise have to be presented to the system from a keyboard
one at a time.
Shell Script Basic Syntax
FASTLOAD < Production/Production.fld > ALL_LOGS/LOG_Production.log
FASTLOAD < Production/UnitMeasure.fld > ALL_LOGS/LOG_UnitMeasure.log
FASTLOAD < Production/ScrapReason.fld > ALL_LOGS/LOG_ScrapReason.log
FASTLOAD < Production/BillOfMaterials.fld > ALL_LOGS/LOG_BillOfMaterials.log
FASTLOAD < Production/WorkOrder.fld > ALL_LOGS/LOG_WorkOrder.log
FASTLOAD < Production/WorkOrderRouting.fld >
ALL_LOGS/LOG_WorkOrderRouting.log
BTEQ < Production/Production_schema.sql > ALL_LOGS/LOG_Production_schema.log
BTEQ < Production/Production_data_dumps.sql >
ALL_LOGS/LOG_Production_data_dumps.log
Steps to perform Shell Scripting

• Write your fast loads, bteqs & trigger Commands in notepad


• Save it as .sh //SHELLSCRIPT file format
• Run it in command prompt//BTEQ <ABC.sql>out1
• Triggers can be set to manipulate the base files executions// IF ELSE STATEMENTS
FastLoad Restrictions
Fast Load Phases
Teradata Parallel Transport
TPT
Difference Between ‘Teradata Parallel Transporter’ and
‘SHELL SCRIPTING’
• Single Source code • Shell script just
• Tpt is a single code consists of
file and combines commands related to
the functionality each of files
of MultiLoad, • Multiple Source
Fastload, Bteqs, Codes
Fastexport, Tpump • For sequential jobs
• Sequential jobs different shells need
can be done easily to be made or
without loosing Triggers needs to be
the other sources added.
• Faster Processing • Comparatively Slower
Processing
T PUMP

TPump is the shortened name for the load


utility Teradata Parallel Data Pump.To
understand this, you must know how the
load utilities move the data. Both FastLoad
and MultiLoad assemble massive volumes
of data rows into 64K blocks and then
moves those blocks. Picture in your mind
the way that huge ice blocks used to be
floated down long rivers to large cities
prior to the advent of refrigeration. There
they were cut up and distributed to the
people. TPump does NOT move data in the
large blocks. Instead, it loads data one row
at a time, using row hash locks. Because it
locks at this level, and not at the table
level like MultiLoad, TPump can make
many simultaneous, or concurrent,
updates on a table.
T Pump Script

Vous aimerez peut-être aussi