DieHard345
DieHard345

Reputation: 13

Retrieve Script used in "Create Table As" Statement

We have a table in our Oracle Database that was created from an actual script. Ex: Create Table AS (Select * from table).

I was hoping to recover the original script the table was created from as the data is quite old in the table, but needs this created table needs to be refreshed. This table is created with data from another live table in our database, so if there is a way to refresh this without the original query - I'm open ears. Any solutions are welcomed!

Thanks!

Upvotes: 1

Views: 83

Answers (2)

Roger Cornejo
Roger Cornejo

Reputation: 1547

I suppose you could also do a column by column comparison of this table against all others to see which one (if any) matches it. Of course, this would only be a guess.

Upvotes: 1

Kamil Gosciminski
Kamil Gosciminski

Reputation: 17177

It would require that object to actually be a materialized view instead of a table. Otherwise you are probably left off with exploring logs. Beyond that I doubt there is any way to recover the original select statement used to create that table.

Upvotes: 0

Related Questions