Copying teradata table into another table
Moderators: chulett, rschirm, roy
Copying teradata table into another table
I am working in datastage and teradata . I have table for which datatype is varchar(20) .
I have nearly 4 billion records present in the table . There is a requirement to change the datatype from varchar20 to varchar40 .
we can use alter table even though there is data in the table . But for some unknown reason that is rejected .
Now we are planning to create another table ( table2) and copy the data from table1 and drop table1 .
I guess this can be done through multiple options
1) insert into table2 ..select * from table1 .But i am not sure of performance
2) Create a datastage job with source as table1 and target as table2 .Use Multiload to load the data . I think this will need lots of temp space and scratch space to do .
Can anyone please suggest which one approach is better and why ?
Thanks
I have nearly 4 billion records present in the table . There is a requirement to change the datatype from varchar20 to varchar40 .
we can use alter table even though there is data in the table . But for some unknown reason that is rejected .
Now we are planning to create another table ( table2) and copy the data from table1 and drop table1 .
I guess this can be done through multiple options
1) insert into table2 ..select * from table1 .But i am not sure of performance
2) Create a datastage job with source as table1 and target as table2 .Use Multiload to load the data . I think this will need lots of temp space and scratch space to do .
Can anyone please suggest which one approach is better and why ?
Thanks
Andy ,Thanks for your quick response .
Any idea how the performance will be to copy 4 billion records with 350 columns through an insert into select * statement . Please let me know what are the considerations I need to take before doing this . I believe I cannot use an MLOAD or Fastload to populate an empty table from another table .
I thought of using datastage first as it will use MLOAD and performance will be good . But temp & scractch space are big concerns in this approach
Any idea how the performance will be to copy 4 billion records with 350 columns through an insert into select * statement . Please let me know what are the considerations I need to take before doing this . I believe I cannot use an MLOAD or Fastload to populate an empty table from another table .
I thought of using datastage first as it will use MLOAD and performance will be good . But temp & scractch space are big concerns in this approach
I used
Table had 30 or 40 columns
Code: Select all
insert into select * statement
You are the creator of your destiny - Swami Vivekananda
Re: Copying teradata table into another table
Me, I would spend some time to figure out why it was "rejected", there's no reason a simple alter to increase a field size should involve copying billions of records.ds_teg wrote:we can use alter table even though there is data in the table. But for some unknown reason that is rejected.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers