简体   繁体   English

具有数据的Oracle 11g脚本数据库

[英]Oracle 11g Script database with data

Is there a way in Oracle 11g to dump database to sql script, that when run will perform database, users, tables and data creation? Oracle 11g中是否有一种将数据库转储到sql脚本的方法,该方法在运行时将执行数据库,用户,表和数据创建?

In Microsoft SQL Server there's SSMS Toolpack that is capable of such thing. 在Microsoft SQL Server中,有SSMS工具包可以执行此操作。 ( Script all data from SQL Server database ) I'm interested whether the same is possible in Oracle 11g. (用脚本编写SQL Server数据库中的所有数据 )我很感兴趣在Oracle 11g中是否也可以这样做。

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. 您将已经需要创建数据库,但是我不确定是否将其与Oracle模式混淆了。 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, eg from Toad or SQL Developer , or using the DBMS_METADATA package. 您可以提取脚本来创建用户/架构,例如从Toad或SQL Developer或使用DBMS_METADATA包。

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. 例如,在SQL Developer中,转到“工具”菜单,然后有一个“导出数据库”选项,您可以在其中选择要包括的内容,这几乎满足了您的所有情况。 You'll still need to pre-create the new database to run those scripts against. 您仍然需要预先创建新数据库来运行这些脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM