Basically, I am a MS-SQL developer,and relatively new to Oracle.
Even after great deal of research, I was unable to find any way of copying entire database from one server instance to another.
In MS-SQL this is usually done through "backup database" and "restore database" sql query. We can even use external tools such as Management studio to create scripts.
But, How this can be done in Oracle 11g express? Any ideas??
5 Answers 5
You do not state which version you use, so I assume you use version 10.x or 11.x.
Do a full export of your database using Oracle Data Pump, existing since Oracle 10: expdp
(export dump) and then re-import it into another database using impdb
(import dump).
Use expdp help=y
to get the full set of parameters. Parameters are given in the form param=value
, not --param=value
as one would expect.
-
expdp command is not recognized in SQL-Plus prompt. I am using Oracle 11g Express edition.Amit Mittal– Amit Mittal2012年01月03日 13:29:37 +00:00Commented Jan 3, 2012 at 13:29
-
1@AmitMittal: expdb is a separate tool (similar to
sqlplus
). It is not a SQL command (which is clearly explained in the manual that arnep linked to)user1822– user18222012年01月03日 15:10:37 +00:00Commented Jan 3, 2012 at 15:10 -
Thanks for the reply. Although I did read the manual that arnep linked, I might have overlooked it.Amit Mittal– Amit Mittal2012年01月03日 16:42:02 +00:00Commented Jan 3, 2012 at 16:42
If you are interested in copying all database files bit-by-bit, then use Recovery Manager (RMAN).
RMAN is used for backups and, much more importantly, restores. But it can also copy database to another server (or to another instance on the same server for that matter) - google for "auxiliary".
It operates on entire database, and not on the level of schema (where expdp/impdp is the tool of choice - it is slower but simpler to use).
-
Does Oracle Express support RMAN?user1822– user18222012年01月03日 15:09:23 +00:00Commented Jan 3, 2012 at 15:09
-
It seems to me like RMAN is implicitly included in XE license, isn't it? In terms of support, there is none for XE.kubanczyk– kubanczyk2012年01月03日 17:02:38 +00:00Commented Jan 3, 2012 at 17:02
One way, using Oracle SQL Developer Database Export. It creates sql statements file, you can use to recreate your database. Note that, this way is most similar to mysql developers but it can take a lot of time compared to other methods if your database is big.
0ToolsDatabaseExport 1SourceDestinationEmpty 1SourceDestinationFilled 2TypesToExport 3SpecifiyObjects1 3SpecifiyObjects2 3SpecifiyObjects3 4SpecifiyData1 4SpecifiyData2 4SpecifiyData3 5ExportSummary 6ExportRunning 7ExportingFinished
on unix i use to do this. for creating the dump:
exp <connection string> file=mydb.dmp
take this dump to the server you want to paste.
imp <connection string> file=mydb.dmp
Note:Both should be similar databases.i mean both should have same table,views,cursors....etc
Easiest option I've found is just to use the Enterprise Manager (EM), logged in as SYS. Navigate to Data Movement> Clone Database. It will use rman to copy the database files either from a running database or from backups.
imp/exp
or starting from Oracle 10,impdp/expdp
exp
andimp
. See this FAQ for information about exporting/importing.