473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Dumb story short- need to recreate foreign keys in oracle db

D
Database 1 is corrupted. Database 2 was created by dba but none of
the primary or foreign key constraints were ported over. TOAD won't
let me export. I will try ErWin next. What is the best way to
recover this information if the views are corrupted and through
errors?

thanks,

Lowly developer
Jul 19 '05 #1
3 3823

"D" <bb*****@hotmail.com> wrote in message
news:22**************************@posting.google.c om...
| Database 1 is corrupted. Database 2 was created by dba but none of
| the primary or foreign key constraints were ported over. TOAD won't
| let me export. I will try ErWin next. What is the best way to
| recover this information if the views are corrupted and through
| errors?
|
| thanks,
|
| Lowly developer

sad story, but a few more details would help...

database versions?
how did the DBA create database 2? is there an EXP file? was it take at the
system, user, or table level? does it contain any constraints or unique
indexes?
can database 1 be opened?
can data dictionary views be read?
can sys tables be read if the data dictionary views cannot be?
how many schemas are involved?
which schemas cannot have object definitions read from the data dictionary?
is your resume up to date?

;-{ mcs
Jul 19 '05 #2
D
Oracle 8.1.7 on solaris.

This involves one schema. The data dictionary can be read, but there
are other sys tables and views that have problems. Some of the errors
come from the previous, now fired, dba screwing up the transfer from
the 32-bit version to the 64-bit version- those are the errors I'm
getting. I am not a maintenance dba- I'm a programmer who designs his
own databases. It would not surprise me that I missed something
obvious you can do with system files in oracle, but not sqlserver or
DB2, etc.

DBA created new database by creating a script written in perl that
pulled out the structure of the db only and not the constraints. also
pulled out the data and inserted the data. The scripts I have to
generate the table are not up to date enough to recreated the
database- too many changes in this development system.

So I have the correct structure and the correct data but no
constraints. I can view all the constraints in TOAD which probably
means if I could write or better yet find, a statement to select what
I need from the system table that manages constraints then that is
what I need to find.

thanks,

Don
"Mark C. Stock" <mcstockX@Xenquery .com> wrote in message news:<1u********************@comcast.com>...
"D" <bb*****@hotmail.com> wrote in message
news:22**************************@posting.google.c om...
| Database 1 is corrupted. Database 2 was created by dba but none of
| the primary or foreign key constraints were ported over. TOAD won't
| let me export. I will try ErWin next. What is the best way to
| recover this information if the views are corrupted and through
| errors?
|
| thanks,
|
| Lowly developer

sad story, but a few more details would help...

database versions?
how did the DBA create database 2? is there an EXP file? was it take at the
system, user, or table level? does it contain any constraints or unique
indexes?
can database 1 be opened?
can data dictionary views be read?
can sys tables be read if the data dictionary views cannot be?
how many schemas are involved?
which schemas cannot have object definitions read from the data dictionary?
is your resume up to date?

;-{ mcs

Jul 19 '05 #3
D wrote:
Oracle 8.1.7 on solaris.

This involves one schema. The data dictionary can be read, but there
are other sys tables and views that have problems. Some of the errors
come from the previous, now fired, dba screwing up the transfer from
the 32-bit version to the 64-bit version- those are the errors I'm
getting. I am not a maintenance dba- I'm a programmer who designs his
own databases. It would not surprise me that I missed something
obvious you can do with system files in oracle, but not sqlserver or
DB2, etc.

DBA created new database by creating a script written in perl that
pulled out the structure of the db only and not the constraints. also
pulled out the data and inserted the data. The scripts I have to
generate the table are not up to date enough to recreated the
database- too many changes in this development system.

So I have the correct structure and the correct data but no
constraints. I can view all the constraints in TOAD which probably
means if I could write or better yet find, a statement to select what
I need from the system table that manages constraints then that is
what I need to find.


Oracle uses views such as DBA_TABLES, DBA_CONSTRAINTS and so on to make the
dictionary available.

The scripts to (re)create these views should be found in
$ORACLE_HOME/rdbms/admin - usually catalog.sql

It's not unusual for DBAs to miss running the script after an upgrade, or
fail to look at the result file after running the script or even missing
legit errors when looking at the output. (The output frequently has many
errors listed, mainly "failed to drop non-existant objects")

Sounds like the upgraded source DB is only mildly insane - you may want to
check some of the DBA_ views against the catalog.sql script, esp. those
related to the constraints. If not in sync, then consider rerunning
catalog.sql

/Hans
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Max M | last post by:
There is a story today on Slashdot Open Source Project Management Lessons ======================================...
0
by: googlegroups111 | last post by:
This is an EXCERPT from the story of the Philip Bartlett the Knight in Shining Armour from the days of hoary olde England, a story adapted by an author who shall remain nameless..... One day...
10
by: Robert Stearns | last post by:
In a table which has an animal id, its dam id and sire id, I want to see a combined list of all animal ids. I tried the following, which did not work, but did not give any error messages: select...
16
by: CMM | last post by:
Is it me or has anyone noticed that F1 is really dumb in VS2005. Since VB3 I have been able to click F1 on an ambiguous method in code and the IDE automatically determines the type based on the...
0
by: mgtimelogger | last post by:
The Canadian government would rather program peoples minds than in C. See below. Shocking New Book Published "Canada's Spies Attacked Me: A True Story of CSIS Terrorizing a Canadian Abroad" ...
15
by: greg.landrum | last post by:
After using numeric for almost ten years, I decided to attempt to switch a large codebase (python and C++) to using numpy. Here's are some comments about how that went. - The code to...
3
by: joshua | last post by:
Ok - so I havn't posted on here for a very long time. Hope everyone is ok and I'm glad to see this place still exists outside the MS web-news reader. Usenet for the win and all that. The...
1
by: Robert Dufour | last post by:
I got a loginstatus control. when user clicks it when its on lougout I would simply like to close the browser after going to a page that asks do you really want to close the application. If No he...
10
by: Dick Moores | last post by:
I'm still trying to understand classes. I've made some progress, I think, but I don't understand how to use this one. How do I call it, or any of its functions? It's from the Cookbook, at...
5
by: Michael Starberg | last post by:
cat, I wouldn't be worried about linq nor IDisposable. http://www.youtube.com/watch?v=MQ4vmSvCVbc Enjoy, and if you hate silly cats, at least the music is great! =) - Michael Starberg
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.