Sunteți pe pagina 1din 8

BTEQ

EXPORT AND IMPORT- ROW LEVEL


MODES OF EXPORT
DATA INDICADATA REPORT DIF
.LOGON DEMOTDAT/dbc,dbc
.EXPORT DATA FILE = C:\Temp\Empdatafile.txt
Sel * from rmp_table
.EXPORT RESET
.QUIT
.LOGOFF
.LOGON DEMOTDAT/dbc,dbc
.EXPORT REPORT FILE = C:\Temp\Empdatafile.txt
Sel CAST(CUSTOMER_NUMBER AS VARCHAR(11)||,||
CAST(CUSTOMER_PHONE AS VARCHAR(16) )
FROM TABLE
.EXPORT RESET
.QUIT
.LOGOFF
IMPORT
.LOGON locatatd/dbc,apple123
.IMPORT VARTEXT , FILE= C:\temp\cust.txt
.QUIET ON
.REPAET *
USING (in_custmer VARCHAR(11),
IN_CUSTOMER_NAME varchar(30))
INSERT INTO
VALUES(:IN_CUSTOMER_NO,:IN_CUSTOMEER_NAME,:IN_CUST_
PHONE);
.QUIET OFF
.QUIT
.LOGOFF
.SET SESSION 20
.SET FOLDLINE ON
.SET SIDE TITLES OFF
.IF ERRORCODE=0 THEN .GOTO LABEL
MAXERROR-specify maximum allowbae error seerity level
ERRORLEVL- ASSIGN SEVERITY LEVEL TO any error numbers

FASTLOAD
NO SI,NO RI,NO TRIGGERS,NO AMP MAY GO OFFLINE
NO DUPLICAE ROWS ALLOWED
64 BLOCKS
30 FLOAD AND MLOAD
ACQUISTION:-TRANSFER 64 BLOCKS FROM THE HOST TO
TERADAR AMPS
EACH AMP HASES THE ROWS PI & SEND THEM TO WORK
TABLE
APPLICATION
SORST THE WORK TABLE BY ROW ID
WRITE DATA TO A TABLE
LOGOGN LOCATD/SQL,SQL01;
CREATE TABLE TABLENAME
(
)UPI(COL)NAME)
DEFINE EMP_NO (INTEGER)
,DEPT_NO
FILE=C:]TEM\XX.TXT;
BEGIN LOADING EMP_TABLE
ERRORFILES TBL1,TABL2
CHECKPOINT 20000;
INSERT INTO TABLE
VALUES
(
:EMP_NO,:DEPT_NO
);
EN LOADING;
LOGOFF;

Phase 1 halts prematurely; the


Data Acquisitionphase is incomplete. Resubmit
the FastLoad script. FastLoad will begin from
RECORD 1 or the first record past the last
checkpoint.
If the interruption occurs in Phase 2, the Data
Acquisition phase has already completed. We
know that the error is in the Application Phase.
In this case, resubmit the FastLoad script with
only the BEGIN and END LOADING Statements.
This will restart in Phase 2 with the building of
the target table.
the SLEEP command specifies the amount of
time in minutes to wait before retrying to logon
and establish all sessions
TENACITY specifies the amount of time, in
hours, to retry to obtain a loader slot or to
establish all requested sessions to logon. The
default for FastLoad is no tenacity, meaning
that it will not retry at all.

MULITLOAD
NO USI,BUT NUSI
NO RI,NO JI
64 BLOACK
UPTO 5 EMPTY OR TARGET TABKES
PHASESPRELIMENARY
DML TRANSATION
ACQUISTION
APPLOCATION
CLEAN UP
.BEGIN IMPRT MLOAD
TABLES EMP_TABLE
WORTABLES EMP_WT
ERRORTABLE EM_ET
EMP_UV;
.LAYOUT FILEDESC1;
.FILED EMP_NO * INTEGER;
.FILED SAL * DECIMALE(8,2);
.DML LABLE EMP_UPD;
UPDATE EMP_TABLE
SET SALARY=:SALARY WHERE
EMP_NO=:EMP_NO;
.IMPORT INFILE C:/TEMP/MLO_TXT
LAYOUT FILEDESC1
APPLY EMP_UPD;

.END MLOAD;
FORMAT
BINARY,FASTLOAD,TEXT,UNFORMAT,VARTE
XT
UPSERT
.DML LABLE UPSERT
DO INSERT FOR MISSING UPDATE ROWS;
MLOAD DELETE:
IMPRT MODE- MIX MATCH 20
INSEERT.DELET/UPADTE
DELETE MODE- ALL AMP OPERATION.IT
BYPASSES TRANSIENT JOURNEL
.BEGIN DELETE MLOAD
TABLES
EMP
WORKTABLES WT
ERROR TABLE UV
;
DELET FROM TABLE WHERE
SALDATE>20002;
.END MLOAD
If Teradata goes down the MultiLoad will restart
once Teradata is back up and continue where it

left off without any user intervention. Problem


solved.
If you as the client running the MultiLoad finds
problems you merely need to resubmit the
original script and let MultiLoad figure out where
to restart.
There is also a third choice that I have had to use
many times. It is the RELEASE MLOAD
command.
The actual command is RELEASE MLOAD
TableName ;
Sometimes the MultiLoad can be restarted and
sometimes it is in point of no return. Here are
some troubleshooting suggestions:
1. Make sure the MultiLoad is not running and
if it is still running you can ABORT the
MultiLoad (still restartable if ABORTED).
2. Enter RELEASE MLOAD TableName
3. If Successful, drop all the work and error
tables.
4. If not successful, restart MLOAD and let it
complete, or dropt target, work, and Error
Tables.

TPUMP
HAVE SI,TRIGGERS,REF INETETI,HAVE JOIN INDEX
NO SELECT STEMET
NO MORE THAN 4 IMPORT
CANT AGGRREGATE
.LOGTABLE EMP_LOG;
.LOGON LOCAL/;
.BEGIN LOAD
PACK 5
RATE 10
ERROR TABLE TP_ERRO;
.LAYOUT RECLAYOUT;
.FILED EMP_NP * INTGER;
.DML LABLE EMP_INS;
INSERTINTO EMP_ATBLE
(EMP_NO,DEPT_NO,LAST_NAME,FIRST_NAME)
VALIES(:EMP_NO,DEPT_NO);
.IMPORT INFILE C:/TEMP/TPMP/FILE.TXT
LAYOUT RECLAYOUR
APPKT EMP_INS;
.END LOAD;
.LOGOFF
MODESBINARY,FASTLOAD,TEXT,UNFORMA,VARTEXT

S-ar putea să vă placă și