0
votes

Is there a way in Oracle 11g to dump database to sql script, that when run will perform database, users, tables and data creation?

In Microsoft SQL Server there's SSMS Toolpack that is capable of such thing. (Script all data from SQL Server database) I'm interested whether the same is possible in Oracle 11g.

1
Do you actually want a script where you can see all the individual statements, or just a mechanism to move the data? The Oracle server has tools to move everything (except the database creation part - but you might mean 'schema' in this context - and users), but in a proprietary format rather than a script. Client applications have tools to generate scripts. - Alex Poole
do you want to import and export your DB? - Thiyagu ATR

1 Answers

4
votes

To extract metadata and data you should look at data pump, specifically the export and import tools. This will be the simplest, fastest and most supported way to move everything.

You will need to already have created the database, but I'm not sure if you're confusing that with the Oracle schema. Which you will also have to create in advance by creating the user(s) that will own all the objects. You can extract a script to create the user/schema, e.g. from Toad or SQL Developer, or using the DBMS_METADATA package.

Most client applications also have options to export pretty much everything as scripts. In SQL Developer, for example, go to the Tools menu and there's an 'Export database' option where you can choose what you want to include, which will be pretty much everything in your case. You'll still need to pre-create the new database to run those scripts against.