Call for Oracle support & training (800) 766-1884
Free Oracle Tips

Home
Corporate Oracle Training
Custom Oracle Training
Oracle New Features Training
Advanced Oracle DBA Classes
Oracle Tuning Courses
Oracle Tips & Tricks
Oracle Training Links
Oracle Training Links
Oracle Training Links

We are top for USA Oracle Training Clients

 

Free Oracle Tips


 
HTML Text AOL

Free Oracle App Server Tips


 
HTML Text

Oracle support

Oracle training

Oracle tuning

Rednecks!

Remote Oracle

Custom Oracle Training

 

   
  Oracle Tips by Burleson

Oracle 10g BFILE Datatypes

The BFILE datatype is unique, in that it has two pieces of information stored in it: the directory object for the file and the name of the file within that directory object.

The method of unloading BFILE columns using the oracle_datapump access driver consists of storing the directory object name and the file name in two separate columns in the external table. You use the procedure dbms_lob.filegetname to return both parts of the name.

However, because dbms_lob.filegetname is a procedure, it cannot be used directly in a SELECT statement. Instead, you need to create two functions. The first returns the name of the directory object and the second returns the name of the file.

The steps in the following example demonstrate the unloading of BFILE datatypes.

  1. First you must create a function to extract the directory object for a BFILE column. Note that when the column is NULL, then NULL is returned.

SQL> CREATE FUNCTION get_dir_name (bf BFILE) RETURN VARCHAR2 IS
2 DIR_ALIAS VARCHAR2(255);
3 FILE_NAME VARCHAR2(255);
4 BEGIN
5 IF bf is NULL
6 THEN
7 RETURN NULL;
8 ELSE
9 DBMS_LOB.FILEGETNAME (bf, dir_alias, file_name);
10 RETURN dir_alias;
11 END IF;
12 END;
13 /

Function created.

  1. Next create a function to extract the file name for the BFILE column.

SQL> CREATE FUNCTION get_file_name (bf BFILE) RETURN VARCHAR2 is
2 dir_alias VARCHAR2(255);
3 file_name VARCHAR2(255);
4 BEGIN
5 IF bf is NULL
6 THEN
7 RETURN NULL;


Get the complete story:

The above text is an excerpt from "Oracle Database 10g New Features: Reference for Advanced Tuning and Administration", by Rampant TechPress.  Written by top Oracle experts, this book has a complete online code deport with ready to use scripts. 

To get the code instantly, click here:

http://rampant-books.com/book_2003_2_oracle10g.htm


Need an Oracle Mentor?

BEI is now offering personal mentors for Oracle DBAs where you can have an Oracle expert right at your fingertips, anytime day or night. We work with hundreds of Oracle databases every year, so we know exactly how to quickly assist you with any Oracle question.

Why risk an unplanned outage? You can now get telephone access to Don Burleson or any of his Oracle Certified DBAs with more than 20 years of full-time IT experience. Click here for details:

http://www.dba-oracle.com/service_oracle_backup.htm

 
 
 

Oracle performance tuning book

 

 

Oracle performance tuning software

 
Oracle performance tuning software
 
Oracle performance Tuning 10g reference poster
 
Oracle training in Linux commands
 
Oracle training Excel
 
 
 
 

 

email BC:


Copyright © 1996 -  2014 by Burleson Inc. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.