Solved

How can I get my data in .dbf file?

Posted on 2004-09-11
6
6,365 Views
Last Modified: 2012-05-05
Hi all
Unfortunately, I deleted all my files in /opt/app/oracle where I installed Oracle.But all my datafiles(.dbf files),system datafiles and control files(.ctl files)  were still in /u01,/u02,/u03 directory and I still have a full-exported dump file with old data.Please help me how I can get all my data placed in my datafiles.May I recover all my data?
Sincerely yours.
0
Comment
Question by:KtmVdc2
6 Comments
 
LVL 13

Expert Comment

by:riazpk
Comment Utility
You can recover data upto that time when you exported that data using:

imp file=YourFileNameWithPath full=y
0
 
LVL 23

Expert Comment

by:seazodiac
Comment Utility
Tell me that you Have tape backup for the Oracle_HOME /opt/app/oracle.

0
 
LVL 1

Expert Comment

by:sambridge
Comment Utility
If you've only deleted only the Oracle binaries and haven't touched the database files then you can easily recover by first re-installing oracle and then creating an empty database into which you can import your export dump file.

If your export is out of date you can instead use the database files that are still on /u0* - you'll need to create the necessary admin directories and TNS entries but it's not too complicated. You can take the 'create sample database' option when yoiu install Oracle and use it as an example.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:KtmVdc2
Comment Utility
I don't have any tape backup,but I only have an export dump file with out of date data and .dbf files in /u0*.How can I get my data in.dbf files in /u0*?
It's not simple when you create an empty DB, copy all those .dbf files into it.Because new DB can't recognize .dbf files of deleted DB.
0
 
LVL 1

Accepted Solution

by:
sambridge earned 250 total points
Comment Utility
You need to rebuild your database using a starter or empty database as an example to work from.

At this stage you want to do the bare minumum to get your database up and running. You could then do an export and import it into your new empty database.

Before you do anything else you should backup the db files that you have so anything you do here doesn't break them completely. Backup all the dbf's, ctl's etc. Then you can copy from the backed up copies if you need to retry something.

You need to create a configuration file to start your old database  so cd to your $ORACLE_HOME/dbs directory.
In there you should find the configuration file for the starter database that was created when you re-installed Oracle. It will be called init<SID>.ora - copy this to init<your old database name>.ora

e.g. cp initORCL.ora initPROD.ora (where PROD might be the name of your old database)

Now edit the new file - change any reference to the old database name. Change control file locations to point to the location of your old database control files. Alter any other filesystem locations (e.g. user_dump_dest) by creating a set of directories to use for this excercise and pointing to them. Nothing should point to the a location used by the new starter/empty database.

Once the editing is done save the file back to $ORACLE_HOME/dbs

If you're running Oracle 8 then run:
svrmgrl
connect internal
startup pfile=$ORACLE_HOME/dbs/init<your db name>.ora

If Oracle 9 then run:
sqlplus /nolog
connect / as sysdba
startup pfile=$ORACLE_HOME/dbs/init<your db name>.ora

If all is well you database should mount and start.
0
 
LVL 9

Expert Comment

by:konektor
Comment Utility
create new database instance
startup in mount mode
change controlfiles to point to your .dbf files (using command alter database reuse controlfile ...)
alter database open
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious sideā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now