Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create folder using sql

Status
Not open for further replies.

craigey

Technical User
Apr 18, 2002
510
GB
Hi all,

I'm trying to create a folder using either host mkdir or running a job which runs mkdir. The mkdir seems to work, but creates a folder called my_directory rather then using the value of the variable.

Code:
Declare
 my_Directory varchar2(100);
 
Begin
 
select p_value into My_Directory
from PART_CONFIG where p_name = 'TS_PATH' and p_group='CAP';
 
DBMS_SCHEDULER.CREATE_JOB (
job_name =>'create_dir',
job_type =>'executable',
job_action => 'c:\windows\system32\cmd.exe /c mkdir my_Directory',
enabled =>true,
auto_drop => true
);
commit;
end;
/

the ts_path does contain the value "c:\new"
I've also tried using:

HOST mkdir:my_Directory

I'd also like to check if the folder exists before creating the folder if possible.

Any help would be greatly apreciated.
 
Craigey,

I still have no solution for your original problem, i.e. creating folders on the fly. However, I can't help but making a few observations here.

one of the main benefits of partitioning, and putting partitions in their own tablespaces is that you can back up a time-expired tablespace once, make it read-only (since it can't meaningfully be written to ever again), and then never ever bother to back it up again.

There's absolutely nothing wrong that I can see with making folders for time-expired partitions, and moving files into them. Partitioning gracefully enables this. You should never get into the position where you have a vast number of files in a folder. Back 'em up, and then ship 'em out to near or off-line storage. Why clutter up valuable fast storage with reference material several years old?

Also that way, you can leave all your current partitions in the one folder, and not have to make 14 in anticipation of files arriving. Can some good housekeeping here not avoid the problem?

Regards

T

Grinding away at things Oracular
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top