Book Image

Oracle 10g/11g Data and Database Management Utilities

Book Image

Oracle 10g/11g Data and Database Management Utilities

Overview of this book

Does your database look complicated? Are you finding it difficult to interact with it? Database interaction is a part of the daily routine for all database professionals. Using Oracle Utilities the user can benefit from improved maintenance windows, optimized backups, faster data transfers, and more reliable security and in general can do more with the same time and resources.
Table of Contents (18 chapters)
Oracle 10g/11g Data and Database Management Utilities
Credits
About the Author
About the Reviewer
Preface

Let's setup the environment


Let's create the demonstration user, and prepare its environment to create an External Table. The example that will be developed first refers to the External Table using the ORACLE_LOADER driver.

create user EXTTABDEMO
identified by ORACLE
default tablespace USERS;
alter user exttabdemo
quota unlimited on users;
grant CREATE SESSION,
CREATE TABLE,
CREATE PROCEDURE,
CREATE MATERIALIZED VIEW,
ALTER SESSION,
CREATE VIEW,
CREATE ANY DIRECTORY
to EXTTABDEMO;

A simple formatted spool from this query will generate the required external table demonstration data. The original source table is the demonstration HR.EMPLOYEES table.

select
EMPLOYEE_ID ||','||
DEPARTMENT_ID ||','||
FIRST_NAME ||','||
LAST_NAME ||','||
PHONE_NUMBER ||','||
HIRE_DATE ||','||
JOB_ID ||','||
SALARY ||','||
COMMISSION_PCT ||','||
MANAGER_ID ||','||
EMAIL
from HR.EMPLOYEES
order by EMPLOYEE_ID

The above query will produce the following sample data:

Note

The External Table directory is defined inside...