Thanks a lot Steve.
Below is my locale settings in .bash_profile.
export NLS_LANG=american_america.UTF8
#export LANG=C
#export LC_ALL=C
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
But while running the script I'm not getting the clear message. Instead I'm getting messages like I previously got. Do I need to add any other variable to get clear messages?
I'm using multiple ODBC Operator using UNION ALL.
Now, I'm going back to little bit older question to make the extraction and write to file as parallel as possible and the suggestion was to use multiple instances of DataConnector Consumer operator and -C option to write the data in round robin method.
By multiple instances of Data Connector means LoadInst in tbuild command ? I used LoadInst=7. Or to achive multiple instances of Data Connector I need to change my tpt control file. Below is my tpt control file:
DEFINE JOB EXPORT_ORA_TABLE_TO_FILE
DESCRIPTION 'export EXPORT_ORA_TABLE_TO_FILE'
(
DEFINE SCHEMA SCHEMA_COL_BASE
(
C1 NUMBER(4),
C2 NUMBER(4),
C3 NUMBER(4),
C4 NUMBER(2),
C5 CHAR(3),
C6 VARCHAR(25),
C7 VARCHAR(19),
C8 VARCHAR(19),
C9 VARCHAR(19),
C10 NUMBER(3),
C11 NUMBER(3),
C12 VARCHAR(19),
C13 CHAR(16),
C14 VARCHAR(19),
C15 VARCHAR(19)
);
DEFINE OPERATOR o_ODBCOper
TYPE ODBC
SCHEMA SCHEMA_COL_BASE
ATTRIBUTES (
VARCHAR UserName = @UserName
,VARCHAR UserPassword = @UserPassword
,VARCHAR DSNName = @DSNName
,VARCHAR PrivateLogName = 'ODBCloadlog'
,VARCHAR SelectStmt = @SelectClause || @SourceSchema || @SourceTable
,VARCHAR TraceLevel = 'all'
,INTEGER DataBlockSize = 2048
);
DEFINE OPERATOR o_FileWritter
TYPE DATACONNECTOR CONSUMER
SCHEMA SCHEMA_COL_BASE
ATTRIBUTES (
VARCHAR FileName = @FileName
,VARCHAR Format = @Format
,VARCHAR TextDelimiter = @TextDelimiter
,VARCHAR IndicatorMode = 'N'
,VARCHAR OpenMode = 'Write'
,VARCHAR PrivateLogName = 'DataConnector'
,VARCHAR TraceLevel = 'all'
);
APPLY TO OPERATOR (o_FileWritter[@LoadInst])
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 0 and C2 < 2000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 2000 and C2 < 3000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 3000 and C2 < 4000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 4000 and C2 < 5000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 5000 and C2 < 6000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 6000 and C2 < 7000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 7000 and C2 < 9999;'));
)
;
Below is the tbuild command:
tbuild -C -h 100M -f /data/Sample/ctl/ora_table_export.tpt.ctl -v /data/Sample/logon/tpt.logon -u " UserName='User_Name' , UserPassword='****' , DSNName='DSN_Oracle' , load_op=o_ODBCOper , LoadInst=7 , ReadInst=7 , FileName='/data/Sample/tgtfile/ora_table_to_file.out' , LOAD_DTS='2016-06-24 08:21:34' , Format='DELIMITED' TextDelimiter='$^$' , SkipRows=0 , SourceSchema='Source_Schema' , SourceTable='Source_Table', SelectClause='SELECT C1 ,C2 ,C3 ,C4 ,C5 ,C6 ,TO_CHAR(C7,''YYYY-MM-DD HH24:MI:SS'') ,TO_CHAR(C8,''YYYY-MM-DD HH24:MI:SS'') ,TO_CHAR(C9,''YYYY-MM-DD HH24:MI:SS'') ,C10 ,C11 ,TO_CHAR(C12,''YYYY-MM-DD HH24:MI:SS'') ,C13 ,TO_CHAR(C14,''YYYY-MM-DD HH24:MI:SS'') ,TO_CHAR(C15,''YYYY-MM-DD HH24:MI:SS'') FROM '" COL_BASE
Please let me know whether this was the suggestion or I misunderstood.
Also, how to get the CPU secongs for log? Is it "o_ODBCOper: Total processor time used = '3.25 Second(s)'" ?
Thanks & Regards,
Arpan.
Thanks a lot Steve.
Below is my locale settings in .bash_profile.
But while running the script I'm not getting the clear message. Instead I'm getting messages like I previously got. Do I need to add any other variable to get clear messages?
I'm using multiple ODBC Operator using UNION ALL.
Now, I'm going back to little bit older question to make the extraction and write to file as parallel as possible and the suggestion was to use multiple instances of DataConnector Consumer operator and -C option to write the data in round robin method.
By multiple instances of Data Connector means LoadInst in tbuild command ? I used LoadInst=7. Or to achive multiple instances of Data Connector I need to change my tpt control file. Below is my tpt control file:
DEFINE JOB EXPORT_ORA_TABLE_TO_FILE
DESCRIPTION 'export EXPORT_ORA_TABLE_TO_FILE'
(
DEFINE SCHEMA SCHEMA_COL_BASE
(
C1 NUMBER(4),
C2 NUMBER(4),
C3 NUMBER(4),
C4 NUMBER(2),
C5 CHAR(3),
C6 VARCHAR(25),
C7 VARCHAR(19),
C8 VARCHAR(19),
C9 VARCHAR(19),
C10 NUMBER(3),
C11 NUMBER(3),
C12 VARCHAR(19),
C13 CHAR(16),
C14 VARCHAR(19),
C15 VARCHAR(19)
);
DEFINE OPERATOR o_ODBCOper
TYPE ODBC
SCHEMA SCHEMA_COL_BASE
ATTRIBUTES (
VARCHAR UserName = @UserName
,VARCHAR UserPassword = @UserPassword
,VARCHAR DSNName = @DSNName
,VARCHAR PrivateLogName = 'ODBCloadlog'
,VARCHAR SelectStmt = @SelectClause || @SourceSchema || @SourceTable
,VARCHAR TraceLevel = 'all'
,INTEGER DataBlockSize = 2048
);
DEFINE OPERATOR o_FileWritter
TYPE DATACONNECTOR CONSUMER
SCHEMA SCHEMA_COL_BASE
ATTRIBUTES (
VARCHAR FileName = @FileName
,VARCHAR Format = @Format
,VARCHAR TextDelimiter = @TextDelimiter
,VARCHAR IndicatorMode = 'N'
,VARCHAR OpenMode = 'Write'
,VARCHAR PrivateLogName = 'DataConnector'
,VARCHAR TraceLevel = 'all'
);
APPLY TO OPERATOR (o_FileWritter[@LoadInst])
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 0 and C2 < 2000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 2000 and C2 < 3000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 3000 and C2 < 4000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 4000 and C2 < 5000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 5000 and C2 < 6000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 6000 and C2 < 7000;'))
UNION ALL
SELECT * FROM OPERATOR (o_ODBCOper[@ReadInst] ATTRIBUTES (SelectStmt=@SelectClause || @SourceSchema || @SourceTable || ' WHERE C2 > = 7000 and C2 < 9999;'));
)
;
Below is the tbuild command:
Please let me know whether this was the suggestion or I misunderstood.
Also, how to get the CPU secongs for log? Is it "o_ODBCOper: Total processor time used = '3.25 Second(s)'" ?
Thanks & Regards,
Arpan.