Here is the entire script I used to produce the trace from. I pulled the query the original script was running and put it in a much smaller script to rule out anything add going on. It has a few things at the end commented out from when I was trying to figure out what was going on.
#!/usr/bin/perl
use DBI;
use Carp;
use Data::Dumper;
use Storable;
my $db_sid = "veradb";
my $db_user = "DEV_DM_BUILD";
my $db_pass = "asc#Helper9asc#Helper9";
print("Connecting to the DM_BUILD\n");
my $dbh = DBI->connect(sprintf("dbi:%s:%s", 'Oracle', $db_sid),
$db_user,
$db_pass,
{ PrintError => 0, RaiseError => 1, AutoCommi
+t => 0}) or confess "could not connect" . $DBI::errstr;
my $sth = $dbh->prepare("drop TABLE CONTACT_HISTORY_CHG_pfay");
$sth->execute();
print ("dropped table\n");
$sth->finish();
my $sql = qq{CREATE TABLE CONTACT_HISTORY_CHG_pfay
TABLESPACE TS_PROC
PCTUSED 99
PCTFREE 0
STORAGE ( INITIAL 10M NEXT 1M PCTINCREASE 0)
PARALLEL ( DEGREE 4)
NOLOGGING
NOCOMPRESS
as
select * FROM (
SELECT CAST(CONTACT_HISTORY.CONTACT_URN as NUMBER(12)) as CONTACT_
+URN
,CAST(MDM_CHG_PERM_ID.INDIV_ID as NUMBER(13)) as INDIV_ID
,CAST(CONTACT_HISTORY.CONTACT_POINT_TYP_CD as VARCHAR2(3)) a
+s CONTACT_POINT_TYP_CD
,CAST(CONTACT_HISTORY.CONTACT_POINT_ID as NUMBER) as CONTACT
+_POINT_ID
,CAST(CONTACT_HISTORY.CELL_KEY as VARCHAR2(63)) as CELL_KEY
,CAST(CONTACT_HISTORY.CAMPAIGN_KEY as VARCHAR2(63)) as CAMPA
+IGN_KEY
,CAST(CONTACT_HISTORY.SEGMENT_KEY as VARCHAR2(63)) as SEGMEN
+T_KEY
,CAST(CONTACT_HISTORY.LIST_SELECT_ID as NUMBER(18)) as LIST_
+SELECT_ID
,CAST(CONTACT_HISTORY.MESSAGE_ID as NUMBER(10)) as MESSAGE_I
+D
,CAST(CONTACT_HISTORY.OUTPUT_DT as DATE) as OUTPUT_DT
,CAST(CELL.CELL_DEPLOYMENT_DT as DATE) as MAILED_DT
,CAST(RESPONSE_AGG_CHG.OPENED_DT as DATE) as OPENED_DT
,CAST(RESPONSE_AGG_CHG.DELIVERED_FLG as VARCHAR2(1)) as DELI
+VERED_FLG
,CAST(RESPONSE_AGG_CHG.DELIVERY_CD as VARCHAR2(2)) as DELIVE
+RY_CD
,CAST(CONTACT_HISTORY.VENDOR_SUPPRESS_RSN as VARCHAR2(3)) as
+ VENDOR_SUPR_RSN_CD
,CAST(RESPONSE_AGG_CHG.FST_CLICK_DT as DATE) as FST_CLICK_DT
,CAST(RESPONSE_AGG_CHG.LST_CLICK_DT as DATE) as LST_CLICK_DT
,CAST(RESPONSE_AGG_CHG.CLICK_CNT as NUMBER) as CLICK_CNT
,CAST(RESPONSE_AGG_CHG.OPTED_OUT_DT as DATE) as OPTED_OUT_DT
,CAST(MDM_CHG_PERM_ID.PERM_ID as NUMBER(13)) as PERM_ID
,CAST(null as VARCHAR2(15)) as BRAND_CD
,CAST('GENR' as VARCHAR2(15)) as MSG_PURPOSE_TYP_CD
,CAST(CONTACT_HISTORY.SELECTION_LEVEL_URN as NUMBER(13)) as
+SELECTION_LEVEL_URN
,CAST(CONTACT_HISTORY.SELECTION_LEVEL_CD as VARCHAR2(5)) as
+SELECTION_LEVEL_CD
,CAST(CONTACT_HISTORY.FUSE_FILE_ID as NUMBER) as FUSE_FILE_I
+D
,CAST(CONTACT_HISTORY.CONTROL_FLG as VARCHAR2(1)) as CONTROL
+_FLG
FROM DEV_WAREHOUSE.CONTACT_HISTORY CONTACT_HISTORY
Inner Join MDM_CHG_PERM_ID_11266 MDM_CHG_PERM_ID on CONTACT
+_HISTORY.PERM_ID=MDM_CHG_PERM_ID.PERM_ID
Left Outer Join CELL CELL on CONTACT_HISTORY.CELL_KEY = CEL
+L.CELL_KEY
Left Outer Join RESPONSE_AGG_CHG_11266 RESPONSE_AGG_CHG on
+CONTACT_HISTORY.CONTACT_URN=RESPONSE_AGG_CHG.CONTACT_URN
) foo
};
print("prepearing sql\n");
# Prepare the SQL query
$sth = $dbh->prepare($sql)
or confess "ERROR:$0: Error in SQL prepare:\n" . $sth->errstr
+;
$sth->trace( 30, 'trace30.txt' );
print("executing sql\n");
# Execute the SQL Query
$sth->execute();
# or do {
# print("Return Value $rv\n");
# print("-------------------------------------\n\n");
# print Dumper tied %$dbh;
#print(Dumper($dbh->errstr));
#print(Dumper($DBI::errstr));
#$store \%$dbh, 'STH_VALUE.txt';
#store \$dbh, 'DBH_VALUE.txt';
#store \$DBI, 'DBI_VALUE.txt';
# };
#or do {
# $msg = "Can't execute SQL statement:" . $DBI::errstr;
# confess "$msg";
# };
print("finshed sql\n");
$sth->finish();
print("disconnect\n");
$dbh->disconnect();
|