I have an Oracle 7.3.4 database on NT that I am migrating to Oracle 8.1.7. I am also using this chance to improve upon the design and process of the whole system. I have rebuilt my main table (2 weeks data, 6 million rows avg.) to be partitioned.
I currently have a batch file that does the following steps that I want to change over to stored procedures/functions and to schedule through DBMS_JOB:
- Delete old data from table
- Drop Indexes
- Load new data via SQL*Loader
- Recreate Indexes
- Create summary data into summary table
...
I have written a stored procedure and a function that handles the truncating of a partitions (one day) worth of data and this appears to work really well. The only thing I noticed when I was testing it was that the index was put into an unusable state after the truncation was completed. Not sure if it was still rebuilding the index or not, but I tried to add some data back in and it errored. Any ideas on this?
I can write the SQL to drop and recreate the indexes. Not really sure I need this if the truncation/index unusable issue gets resolved.
The next major step is SQL*Loader. I would like to verify that the file exists in the appropriate location and if so, call SQL*Loader to load it. The procedure would need to wait for it to complete as there are a total of three files I need to load and then the summary data is created based on this new data. Can someone give me a kick in the right direction as to any packages, procedures, functions that I should use for this?
Also, any other suggestions would be greatly appreciated... Terry M. Hoey
I currently have a batch file that does the following steps that I want to change over to stored procedures/functions and to schedule through DBMS_JOB:
- Delete old data from table
- Drop Indexes
- Load new data via SQL*Loader
- Recreate Indexes
- Create summary data into summary table
...
I have written a stored procedure and a function that handles the truncating of a partitions (one day) worth of data and this appears to work really well. The only thing I noticed when I was testing it was that the index was put into an unusable state after the truncation was completed. Not sure if it was still rebuilding the index or not, but I tried to add some data back in and it errored. Any ideas on this?
I can write the SQL to drop and recreate the indexes. Not really sure I need this if the truncation/index unusable issue gets resolved.
The next major step is SQL*Loader. I would like to verify that the file exists in the appropriate location and if so, call SQL*Loader to load it. The procedure would need to wait for it to complete as there are a total of three files I need to load and then the summary data is created based on this new data. Can someone give me a kick in the right direction as to any packages, procedures, functions that I should use for this?
Also, any other suggestions would be greatly appreciated... Terry M. Hoey