Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recreating Sequences

Status
Not open for further replies.

toddyl

Technical User
Sep 26, 2005
102
US
Hi,

I've installed a product which utilises an Oracle DB.
The installation populates all the config tables but naturally all the data tables are empty.

I've gotten an export of the data tables from a friend and I now wish to import this data into the Oracle tables.

I've identified the constraints and built a script to disable/enable them but I've now noticed that the system has a lot of sequences created -- all of which are at a value of 1.

In order to keep consistency with my friends DB I would like to drop the sequences, import the data and rebuild the sequences with the appropriate numbers.

I can identify the sequences but I cannot identify the column/table on which they are used for populating.

Does anyone know how to do this?

Thanks,

toddyl
 
You will need to find all of the code that populates the tables - that is where the sequences will be referenced. Assuming only stored procedures are being used, the easiest way to do this would probably something like:
Code:
SELECT owner, type, name, referenced_owner, referenced_name
  FROM dba_dependencies
 WHERE referenced_type = 'SEQUENCE'
ORDER BY 1,3;
 
Thanks for the reply but unfortunately the procedures are wrapped so I cannot see what they are referencing.

Is there any other way to do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top