Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to get procedure to use no logging

518702Aug 28 2008 — edited Aug 29 2008
We currently have a table build procedure that runs nightly to create our data warehouse. This procedure is spinning off too many archive/logging files.

The procedure does a truncate/replace nightly

eg -

truncate table lifcdw_staging.tablename;

insert into lifcdw_staging.tablename
select a.name, a.territory
from sales_reps a
where a.territory_region='east'


we tried to add the following hint:

INSERT /*+ append nologging */ into lifcdw_staging.tablename

this seems to work ok when individual parts of the script are run but if i execute the procedure via toad, the whole thing finishes in about 3 seconds (normally takes over an hour). Obviously it is not running correctly as a procedure with the hint in each insert statement. I have compiled with debug and found no errors.

any help is appreciated.

Jason

Comments

aJohny

Inside you loop you could get the file name using

textfiles.getName();

You could filter with the file extension.

Cheers

AJ

2801625

Can you explain what you mean by filter with the file extension.

aJohny
Answer

You have mentioned you want to read only text files.

If you are referring to some specific set of extentions, you can filter based on that.

ex: you want to read only .txt files, you can add an if condition as below :

          if(textfiles.getName().endsWith(".txt")) {

              // Add your code here

          }

Cheers

AJ

Marked as Answer by 2801625 · Sep 27 2020
2801625

I was able to read only the text files in the directory checking the extension using textfiles.getname and textfiles.endswith.

Thanks for the help AJ.

     for (File textfiles : files) {

     if (textfiles.isFile() && textfiles.getName().endsWith("txt")) {

aJohny

If all good, Please close the thread by marking the helpful and correct answers.

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 26 2008
Added on Aug 28 2008
11 comments
776 views