views:

52

answers:

3

Hello, we get problem, while trying to export Oracle DB. OS: CentOS ~ 5.2 DB: Oracle 10g.

Exp command exports db files only in location:

/home/oracle/OraHome_1/oradata/master/xxx.dbf

, but tool can't export files in different location (we know about this files after getting trace) like this:

'/disk1/dblog06.dbf', '/home/disk2/system01.dbf',

Please, advice me, how to get dump file. or buckup it.

Thanks.

+1  A: 

I am not sure if that is the question, but the exp command will export database objects according to their logical schema (user name, table name). It does not matter which physical database file the data is coming from.

exp works through an Oracle instance, which needs to have mounted the datafiles.

Are these other files part of the Oracle database? Maybe another database? You need to find out which Oracle server uses them, and then run exp against that instance.

Thilo
all datafiles belongs to one Oracle instance and to one Oracle Database, as I understand (in trace file all locations belongs to Master - [Master is database name]. I'm trying to analyze it. Thanks for answer.
loviji
+1  A: 

EXPORT is not a backup tool. It is meant for transferring data from one database to another, or perhaps from one schema to another.

If you want to recover your data in the event of a database crash or corruption then you need to use the appropriate tool. There are OS solutions to this, but Oracle comes with a sophisticated backup and recovery tool: RMAN. Find out more.

APC
+1  A: 

You appear to have misunderstood what exp does, and particularly what the file parameter is for. The file is the output dump file, normally given a .dmp extension. Export takes data out of the database instance, it does not work under the hood on the datafiles - you have to tell it which data you want (full, user, tables, or tablespaces) and where to put it, not where it comes from.

If you really did try to exp file=/home/disk2/system01.dbf then what you actually asked it to do was trash your database; you're lucky that it did not overwrite the datafile and cause a catastrophic failure. Oracle seems to have saved you from yourself there, though possibly only thanks to having exclusive locks on the files at the time.

You need to read up on how it works and see if it actually does what you want - as APC notes it's not a backup tool. Looks at the Oracle documentation for your version, or somewhere like http://www.orafaq.com/wiki/Import_Export_FAQ, and also look at using data pump instead of exp.

Alex Poole
Please, I think right or not: If I run the command exp file = folderName/fileName.dbf, then I can start up this dmp files in another server?Thanks.
loviji
No. If you export the data with `exp` (or data pump) to a `.dmp` file, then you can *import* that data back into another database. You cannot 'start up' from a dump. You can either create a new database on another server and them import the data into it; or look at another mechanism entirely. It's not clear quite what you're trying to achieve.
Alex Poole
One moment, as I anderstand, I can 'exp' each datafile in order, then 'imp' it in previous order into another server?
loviji
No, you do not export data *files*, those are part of the underlying database structure. You export *data* - schemas, tablespaces or tables depending on what you need - from the instance. You can them import that *data* into another database instance. The target DB can be on another platform or have a different data file structure, but it has to already exist. It might help to consider that `exp`/`imp` can be used by unprivileged users with no knowledge of the file structures, not just by DBAs.
Alex Poole