dbTalk Databases Forums  

External Tables

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss External Tables in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Magnet
 
Posts: n/a

Default External Tables - 07-29-2009 , 09:12 PM






Hi,

When you export a schema, are external tables and directory
definitions exported also? So, when I import, it will create the
directory definition and the external table?

Reply With Quote
  #2  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: External Tables - 07-30-2009 , 01:02 AM






On Wed, 29 Jul 2009 19:12:21 -0700 (PDT), The Magnet <art (AT) unsu (DOT) com>
wrote:

Quote:
Hi,

When you export a schema, are external tables and directory
definitions exported also? So, when I import, it will create the
directory definition and the external table?

Did you try?

-----------
Sybrand Bakker
Senior Oracle DBA

Reply With Quote
  #3  
Old   
The Magnet
 
Posts: n/a

Default Re: External Tables - 07-30-2009 , 08:14 AM



On Jul 30, 1:02*am, sybra... (AT) hccnet (DOT) nl wrote:
Quote:
On Wed, 29 Jul 2009 19:12:21 -0700 (PDT), The Magnet <a... (AT) unsu (DOT) com
wrote:



Hi,

When you export a schema, are external tables and directory
definitions exported also? *So, when I import, it will create the
directory definition and the external table?

Did you try?

-----------
Sybrand Bakker
Senior Oracle DBA
Did try and did not get it to work. So, thought there might be some
convoluted way of doing it. I mean, if a company has 300 external
table definitions, it would be meaningless if you cannot re-import
those definitions.....and have to re-create those tables again...

Reply With Quote
  #4  
Old   
ddf
 
Posts: n/a

Default Re: External Tables - 07-30-2009 , 08:30 AM



On Jul 30, 8:14*am, The Magnet <a... (AT) unsu (DOT) com> wrote:
Quote:
On Jul 30, 1:02*am, sybra... (AT) hccnet (DOT) nl wrote:





On Wed, 29 Jul 2009 19:12:21 -0700 (PDT), The Magnet <a... (AT) unsu (DOT) com
wrote:

Hi,

When you export a schema, are external tables and directory
definitions exported also? *So, when I import, it will create the
directory definition and the external table?

Did you try?

-----------
Sybrand Bakker
Senior Oracle DBA

Did try and did not get it to work. *So, thought there might be some
convoluted way of doing it. *I mean, if a company has 300 external
table definitions, it would be meaningless if *you cannot re-import
those definitions.....and have to re-create those tables again...- Hide quoted text -

- Show quoted text -
External tables are built upon flat files and neither exp nor expdp
export such files. Exporting the definitions, then, would be a
useless undertaking. This is why one uses scripts to create such
objects, so they can be recreated in another database (or in this same
database) provided the source files exist. It should not be a major
effort to run a series of scripts to recreate such tables.


David Fitzjarrell

Reply With Quote
  #5  
Old   
Mark D Powell
 
Posts: n/a

Default Re: External Tables - 07-30-2009 , 03:07 PM



On Jul 30, 9:30*am, ddf <orat... (AT) msn (DOT) com> wrote:
Quote:
On Jul 30, 8:14*am, The Magnet <a... (AT) unsu (DOT) com> wrote:





On Jul 30, 1:02*am, sybra... (AT) hccnet (DOT) nl wrote:

On Wed, 29 Jul 2009 19:12:21 -0700 (PDT), The Magnet <a... (AT) unsu (DOT) com
wrote:

Hi,

When you export a schema, are external tables and directory
definitions exported also? *So, when I import, it will create the
directory definition and the external table?

Did you try?

-----------
Sybrand Bakker
Senior Oracle DBA

Did try and did not get it to work. *So, thought there might be some
convoluted way of doing it. *I mean, if a company has 300 external
table definitions, it would be meaningless if *you cannot re-import
those definitions.....and have to re-create those tables again...- Hidequoted text -

- Show quoted text -

External tables are built upon flat files and neither exp nor expdp
export such files. *Exporting the definitions, then, would be a
useless undertaking. *This is why one uses scripts to create such
objects, so they can be recreated in another database (or in this same
database) provided the source files exist. *It should not be a major
effort to run a series of scripts to recreate such tables.

David Fitzjarrell- Hide quoted text -

- Show quoted text -
The definitions for extenal tables and directorys export and import;
however, the definitions may need repair if the file system does not
match what was specified in the definitions.

UT1 > select owner, table_name from dba_external_tables;

OWNER TABLE_NAME
------------------------------ ------------------------------
MPOWEL01 LOADTEXT2


From an export log
<snip>
exporting sequence numbers
.. exporting directory aliases
.. exporting context namespaces
<snip>
.. . exporting table INV_PRICE_HEADER 0 rows
exported
.. . exporting table
LOADTEXT2
.. . exporting table MARKEST2 3 rows
exported
<snip>
-- notice no row count

HTH -- Mark D Powell --

Reply With Quote
  #6  
Old   
joel garry
 
Posts: n/a

Default Re: External Tables - 07-30-2009 , 04:48 PM



On Jul 30, 1:07*pm, Mark D Powell <Mark.Pow... (AT) eds (DOT) com> wrote:
Quote:
On Jul 30, 9:30*am, ddf <orat... (AT) msn (DOT) com> wrote:



On Jul 30, 8:14*am, The Magnet <a... (AT) unsu (DOT) com> wrote:

On Jul 30, 1:02*am, sybra... (AT) hccnet (DOT) nl wrote:

On Wed, 29 Jul 2009 19:12:21 -0700 (PDT), The Magnet <a... (AT) unsu (DOT) com
wrote:

Hi,

When you export a schema, are external tables and directory
definitions exported also? *So, when I import, it will create the
directory definition and the external table?

Did you try?

-----------
Sybrand Bakker
Senior Oracle DBA

Did try and did not get it to work. *So, thought there might be some
convoluted way of doing it. *I mean, if a company has 300 external
table definitions, it would be meaningless if *you cannot re-import
those definitions.....and have to re-create those tables again...- Hide quoted text -

- Show quoted text -

External tables are built upon flat files and neither exp nor expdp
export such files. *Exporting the definitions, then, would be a
useless undertaking. *This is why one uses scripts to create such
objects, so they can be recreated in another database (or in this same
database) provided the source files exist. *It should not be a major
effort to run a series of scripts to recreate such tables.

David Fitzjarrell- Hide quoted text -

- Show quoted text -

The definitions for extenal tables and directorys export and import;
however, the definitions may need repair if the file system does not
match what was specified in the definitions.

UT1 > select owner, table_name from dba_external_tables;

OWNER * * * * * * * * * * * * *TABLE_NAME
------------------------------ ------------------------------
MPOWEL01 * * * * * * * * * * * LOADTEXT2

From an export log
snip
*exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
snip
. . exporting table * * * * * * * INV_PRICE_HEADER * * * * *0 rows
exported
. . exporting table
LOADTEXT2
. . exporting table * * * * * * * * * * * MARKEST2 * * * * *3 rows
exported
snip
-- notice no row count

HTH -- Mark D Powell --
Too bad the indexfile option doesn't work with imp here (at least on
my 10.2.0.4). Haven't tried expdp.

However, if you have unix like tools, you can grep the export file for
the "CREATE EXTERNAL TABLE" statement. Well, almost, the access
parameters are in a clob, as a desc dba_external_tables will show.
Looks like that winds up in the exp file on the line after the create
with a couple of special characters followed by the parameters on
several lines. Maybe somehow with perl, awk or sed grab all the lines
up to the one with REJECT LIMIT in it, and clean.

Or just use some tool that understands clobs on the [dba|user]
_external_tables (set long 32000 for sqlplus).

I agree with David, find the original scripts. Maybe they'll have
additional explanations of strange things that need to be accounted
for in messy real world data.

jg
--
@home.com is bogus.
Now there's a misleading url:
http://www3.signonsandiego.com/stori...-me/?uniontrib

Reply With Quote
  #7  
Old   
Mark D Powell
 
Posts: n/a

Default Re: External Tables - 08-01-2009 , 09:28 AM



On Jul 30, 5:48*pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:
Quote:
On Jul 30, 1:07*pm, Mark D Powell <Mark.Pow... (AT) eds (DOT) com> wrote:





On Jul 30, 9:30*am, ddf <orat... (AT) msn (DOT) com> wrote:

On Jul 30, 8:14*am, The Magnet <a... (AT) unsu (DOT) com> wrote:

On Jul 30, 1:02*am, sybra... (AT) hccnet (DOT) nl wrote:

On Wed, 29 Jul 2009 19:12:21 -0700 (PDT), The Magnet <a... (AT) unsu (DOT) com
wrote:

Hi,

When you export a schema, are external tables and directory
definitions exported also? *So, when I import, it will create the
directory definition and the external table?

Did you try?

-----------
Sybrand Bakker
Senior Oracle DBA

Did try and did not get it to work. *So, thought there might be some
convoluted way of doing it. *I mean, if a company has 300 external
table definitions, it would be meaningless if *you cannot re-import
those definitions.....and have to re-create those tables again...- Hide quoted text -

- Show quoted text -

External tables are built upon flat files and neither exp nor expdp
export such files. *Exporting the definitions, then, would be a
useless undertaking. *This is why one uses scripts to create such
objects, so they can be recreated in another database (or in this same
database) provided the source files exist. *It should not be a major
effort to run a series of scripts to recreate such tables.

David Fitzjarrell- Hide quoted text -

- Show quoted text -

The definitions for extenal tables and directorys export and import;
however, the definitions may need repair if the file system does not
match what was specified in the definitions.

UT1 > select owner, table_name from dba_external_tables;

OWNER * * * * * * * * * * * * *TABLE_NAME
------------------------------ ------------------------------
MPOWEL01 * * * * * * * * * * * LOADTEXT2

From an export log
snip
*exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
snip
. . exporting table * * * * * * * INV_PRICE_HEADER * * * * *0 rows
exported
. . exporting table
LOADTEXT2
. . exporting table * * * * * * * * * * * MARKEST2 * * * * *3 rows
exported
snip
-- notice no row count

HTH -- Mark D Powell --

Too bad the indexfile option doesn't work with imp here (at least on
my 10.2.0.4). *Haven't tried expdp.

However, if you have unix like tools, you can grep the export file for
the "CREATE EXTERNAL TABLE" statement. *Well, almost, the access
parameters are in a clob, as a desc dba_external_tables will show.
Looks like that winds up in the exp file on the line after the create
with a couple of special characters followed by the parameters on
several lines. *Maybe somehow with perl, awk or sed grab all the lines
up to the one with REJECT LIMIT in it, and clean.

Or just use some tool that understands clobs on the [dba|user]
_external_tables (set long 32000 for sqlplus).

I agree with David, find the original scripts. *Maybe they'll have
additional explanations of strange things that need to be accounted
for in messy real world data.

jg
--
@home.com is bogus.
Now there's a misleading url:http://www3.signonsandiego.com/stori...d21513-doz...- Hide quoted text -

- Show quoted text -
Being that both objects export and import I am not sure what real
issue the OP has, but as far as imp goes you should be able to use the
show= option to generate the DDL for both objects. Some editing would
be required.

On a recent version of Oracle the dbms_metadata package is also
available to extract the source with.

HTH -- Mark D Powell --

Reply With Quote
  #8  
Old   
joel garry
 
Posts: n/a

Default Re: External Tables - 08-03-2009 , 12:13 PM



On Aug 1, 7:28*am, Mark D Powell <Mark.Pow... (AT) eds (DOT) com> wrote:
Quote:
On Jul 30, 5:48*pm, joel garry <joel-ga... (AT) home (DOT) com> wrote:



On Jul 30, 1:07*pm, Mark D Powell <Mark.Pow... (AT) eds (DOT) com> wrote:

On Jul 30, 9:30*am, ddf <orat... (AT) msn (DOT) com> wrote:

On Jul 30, 8:14*am, The Magnet <a... (AT) unsu (DOT) com> wrote:

On Jul 30, 1:02*am, sybra... (AT) hccnet (DOT) nl wrote:

On Wed, 29 Jul 2009 19:12:21 -0700 (PDT), The Magnet <a... (AT) unsu (DOT) .com
wrote:

Hi,

When you export a schema, are external tables and directory
definitions exported also? *So, when I import, it will create the
directory definition and the external table?

Did you try?

-----------
Sybrand Bakker
Senior Oracle DBA

Did try and did not get it to work. *So, thought there might besome
convoluted way of doing it. *I mean, if a company has 300 external
table definitions, it would be meaningless if *you cannot re-import
those definitions.....and have to re-create those tables again...- Hide quoted text -

- Show quoted text -

External tables are built upon flat files and neither exp nor expdp
export such files. *Exporting the definitions, then, would be a
useless undertaking. *This is why one uses scripts to create such
objects, so they can be recreated in another database (or in this same
database) provided the source files exist. *It should not be a major
effort to run a series of scripts to recreate such tables.

David Fitzjarrell- Hide quoted text -

- Show quoted text -

The definitions for extenal tables and directorys export and import;
however, the definitions may need repair if the file system does not
match what was specified in the definitions.

UT1 > select owner, table_name from dba_external_tables;

OWNER * * * * * * * * * * * * *TABLE_NAME
------------------------------ ------------------------------
MPOWEL01 * * * * * * * * * * * LOADTEXT2

From an export log
snip
*exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
snip
. . exporting table * * * * * * * INV_PRICE_HEADER * * * * *0 rows
exported
. . exporting table
LOADTEXT2
. . exporting table * * * * * * * * * * * MARKEST2 * * * * *3 rows
exported
snip
-- notice no row count

HTH -- Mark D Powell --

Too bad the indexfile option doesn't work with imp here (at least on
my 10.2.0.4). *Haven't tried expdp.

However, if you have unix like tools, you can grep the export file for
the "CREATE EXTERNAL TABLE" statement. *Well, almost, the access
parameters are in a clob, as a desc dba_external_tables will show.
Looks like that winds up in the exp file on the line after the create
with a couple of special characters followed by the parameters on
several lines. *Maybe somehow with perl, awk or sed grab all the lines
up to the one with REJECT LIMIT in it, and clean.

Or just use some tool that understands clobs on the [dba|user]
_external_tables (set long 32000 for sqlplus).

I agree with David, find the original scripts. *Maybe they'll have
additional explanations of strange things that need to be accounted
for in messy real world data.

jg
--
@home.com is bogus.
Now there's a misleading url:http://www3.signonsandiego.com/stori...513-doz...Hide quoted text -

- Show quoted text -

Being that both objects export and import I am not sure what real
issue the OP has, but as far as imp goes you should be able to use the
show= option to generate the DDL for both objects. *Some editing would
be required.
D'oh! Of course, no index, no indexfile, nothing shows. It works
with the show=y option and no indexfile parameter. I plead brain
overload.

Quote:
On a recent version of Oracle the dbms_metadata package is also
available to extract the source with.

HTH -- Mark D Powell --
jg
--
@home.com is bogus.
http://money.cnn.com/2009/08/03/tech...ney_topstories

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.