Loadblobs
Upcoming SlideShare
Loading in...5
×
 

Loadblobs

on

  • 229 views

oracle foreign key primary key constraints performance tuning MTS IOT 9i block size backup rman corrupted column drop rename recovery controlfile backup clone architecture database archives export ...

oracle foreign key primary key constraints performance tuning MTS IOT 9i block size backup rman corrupted column drop rename recovery controlfile backup clone architecture database archives export dump dmp duplicate rows extents segments fragmentation hot cold blobs migration tablespace locally managed redo undo new features rollback ora-1555 shrink free space user password link TNS tnsnames.ora listener java shutdown sequence

Statistics

Views

Total Views
229
Views on SlideShare
229
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Loadblobs Loadblobs Document Transcript

    • Performing a mass-load of BLOBS Administration TipsMass-loading BLOBS into a tableHeres a real issue I had to deal with recently, and thanks to Anurag Varma(avdbi@hotmail.com) whos a regular poster on the comp.databases.oracle.servernewsgroup and who proffered these techniques in response to my own pleas for help, I cannow share them with you.My table was constructed thus:CREATE TABLE ALBUM (PHOTOID NUMBER CONSTRAINT PHOTOID_PK PRIMARY KEY,PHOTO BLOB);...with a sequence and trigger to generate a unique number for each photo to be loaded:CREATE SEQUENCE PHOTONUM;CREATE OR REPLACE TRIGGER IDPHOTOBEFORE INSERT ON ALBUMFOR EACH ROWBEGIN SELECT PHOTONUM.NEXTVAL INTO :NEW.PHOTOID FROM DUAL;END;10So how best to load all 10000+ photos into the album table?First, get a listing of all the files, and store it in a text file which well call photos.lst. Easyenough: just type DIR /B /S D:PHOTOALBUM*.* > PHOTOS.LST in a DOS window.Second, create a SQL Loader control file, which well call loadalbum.ctl, containing thefollowing lines:LOAD DATAINFILE PHOTOS.LSTINTO TABLE ALBUM(EXT_FNAME FILLER CHAR(200),PHOTO LOBFILE(EXT_FNAME) TERMINATED BY EOF)Finally, run SQL Loader by typing the following command:SQLLDR USERID=USERNAME/PASSWOIRD@TNSNAMES_ALIAS CONTROL=LOADALBUM.CTLCopyright © Howard Rogers 2001 10/18/2001 Page 1 of 2
    • Performing a mass-load of BLOBS Administration TipsYou should find the thing now proceeds apace, and at the end of it, you should check theSQL Loader log file for any errors that might have been encountered. That will be locatedin a file called (in this case) loadalbum.log, located in the directory from which youlaunched SQL Loader in the first place.The principle lesson to be learned here is that SQL Loader is a fine tool for mass-loadingblobs into Oracle -a fact which Id forgotten, and of which Anurag kindly reminded me.Copyright © Howard Rogers 2001 10/18/2001 Page 2 of 2