将Oracle数据库还原到Windows Server 2012中的另一个磁盘驱动器 [英] Restore an Oracle database to another disk drive in Windows Server 2012

查看:135
本文介绍了将Oracle数据库还原到Windows Server 2012中的另一个磁盘驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题与以下内容有关,需要将Oracle Database 10g Express Edition的数据库传递给11g.我在pendrive上得到了备份,它是一个扩展名为.dmp的文件(转储文件).

My question is about the following, it is required to pass a database of Oracle Database 10g Express Edition to 11g. I was given the backup on a pendrive, it is a file with extension .dmp (Dump file).

我在新服务器上安装了11g Express Edition,但还安装了此(XE)随附的数据库.

I installed the 11g Express Edition on a new server but also installed the database that comes with this (XE).

我想将数据库从10g还原到C以外的另一个单元,C是安装Oracle 11g数据库的位置.我还希望这个新数据库替换" XE(我不知道这是否是正确的说法).

I want to restore the database from the 10g to another unit other than C, which is where the Oracle 11g database is installed. I also want this new database to "replace" the XE (I do not know if it is the correct way to say it).

我只发现调整和位置更改,但仅在同一单位内.

I have only found adjustments and location changes but only within the same unit.

任何范围都将非常有用.

Any scope would be very useful.

谢谢.

推荐答案

从注释来看,听起来您已经从笔式驱动器上的数据库中获得了数据库转储文件(.dmp),您需要确定出来如何将文件放入数据库,对吗?

Judging from the comments, it sounds like you have been given a Database Dump file (.dmp) from a database on a pendrive, and you need to figure out how to get that file into a database, correct?

首先,让我们回顾一下背景.什么是转储文件(.dmp)?来自 Oracle :

First, let's go over some background. What is a dump file (.dmp)? From Oracle:

转储文件集由一个或多个包含以下内容的磁盘文件组成 表数据,数据库对象元数据和控制信息.这 文件以专有的二进制格式写入.导入期间 操作,数据泵导入"实用程序使用这些文件来查找 转储文件集中的每个数据库对象.

The dump file set is made up of one or more disk files that contain table data, database object metadata, and control information. The files are written in a proprietary, binary format. During an import operation, the Data Pump Import utility uses these files to locate each database object in the dump file set.

在较高的层次上,该.dmp文件是DDLDML语句的集合,这些语句将重新创建导出的任何数据和对象. .dmp文件使使用数据泵在数据库之间更轻松地传输和移动大量数据.但是数据泵是什么?同样,来自Oracle:

At a high level, that .dmp file is a collection of DDL and DML statements that will recreate whatever data and objects that were exported. .dmp files make it easier to transport and move large amounts of data between databases using Data Pump. But what is Data Pump? Again, from Oracle:

Oracle数据泵技术可将数据和元数据从一个数据库高速移动到另一个数据库.

Oracle Data Pump technology enables very high-speed movement of data and metadata from one database to another.

基本上,数据泵是一组实用程序(EXPDPIMPDP),用于在数据库之间移动数据.您拥有的.dmp文件很可能是使用EXPDP创建的.您将需要使用IMPDP将该.dmp文件导入数据库.

Basically, Data Pump is a set of utilities (EXPDP & IMPDP) that are used to move data between databases. The .dmp file you have was likely created using EXPDP. You will need to use IMPDP to import that .dmp file into a database.

这变得很有趣-您说您已经有一个11g数据库,对吗?如果需要,应该可以将10g转储文件直接导入到11g数据库中,而不会出现任何问题.原因是Oracle倾向于向后兼容,并且 通常 说,,您使用一个版本的Oracle所做的任何事情都将与紧随其后的版本兼容.从Oracle 8i跳到11g是行不通的,但是您总是可以从8i跳到9i,从9i跳到10g,依此类推.

Here's were it gets interesting - you say that you already have an 11g database, correct? If you want to, you should be able to import the 10g dump file directly into your 11g database without any issues. The reason is that Oracle tends to be backwards compatible, and typically speaking, anything that you do with one version of Oracle will be compatible with the version that immediately succeeds it. Jumping from something like Oracle 8i to 11g won't work, but you can always go from 8i to 9i, from 9i to 10g, and so on.

如果您要将转储文件导入到11g数据库中,则需要执行以下操作:

If you want to import that dump file into your 11g database, here's what you'll need to do:

  1. 创建一个DBA帐户,或者拥有一个已被明确授予数据泵特权的帐户.
  2. 将.dmp文件移动到11g数据库所在的服务器.如果您想使自己更轻松,可以将.dmp文件移动到数据库的datapump目录中.如果您不知道它在哪里,请对数据库执行以下查询:select * from all_directories where directory_name = 'DATA_PUMP_DIR';此查询将返回目录.您不必使用此目录,它只会使它更容易.
  3. 一旦有了转储文件,并且拥有所有必需的数据库和操作系统特权,就可以导入dmp文件了.打开一个新的命令行窗口,设置Oracle主目录(如果尚未设置),然后导航到放置.dmp文件的目录.您的导入命令将如下所示:

  1. Create a DBA account, or have an account that has been granted Data Pump privileges explicitly.
  2. Move the .dmp file to the server where your 11g database lives. If you want to make it even easier for yourself, you can move the .dmp file to your database's datapump directory. If you don't know where that is, execute the following query on your database: select * from all_directories where directory_name = 'DATA_PUMP_DIR'; This query will return a directory. You don't have to use this directory, it will just make it easier.
  3. Once you have the dump file in place and you have all of the necessary database and operating system privileges, you are ready to import the dmp file. Open a new command line window, set your Oracle home if it is not already set, and then navigate to the directory where you placed the .dmp file. Your import command will look something like this:

impdp [用户名]/[密码] @ [数据库]目录= [目录]转储文件= [文件名] .dmp日志文件= [LOGFILE] .log

impdp [USERNAME]/[PASSWORD]@[DATABASE] directory=[DIRECTORY] dumpfile=[FILENAME].dmp logfile=[LOGFILE].log

其中[USERNAME]/[PASSWORD]是您的凭据,[DATABASE]是要将转储文件导入到的数据库的名称,[DIRECTORY]是您将转储文件放置在的目录中,[FILENAME]是.dmp文件的名称,[LOGFILE]是您为日志文件选择的任何名称.

Where [USERNAME]/[PASSWORD] are your credentials, [DATABASE] is the name of the database you're importing the dump file into, [DIRECTORY] is whatever directory you placed the dump file in, [FILENAME] is the name of the .dmp file, and [LOGFILE] is whatever name you chose for your log file.

假设您的数据库具有.dmp文件所需的所有内容,则导入应该开始,您将开始看到类似于以下内容的状态更新:

Assuming your database has everything necessary for the .dmp file, the import should begin and you will start seeing status updates that look similar to this:

Starting [USERNAME]."SYS_IMPORT_FULL_01":  [USERNAME]/******** directory=DATA_PUMP_DIR dumpfile=[FILENAME].dmp logfile=[LOGFILE].log 
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/TABLE/TABLE

请注意,这只是一个示例,您的结果可能会有所不同.假设一切顺利,您将在最后看到这样的消息:

Note that this is just an example, your results may look different. Assuming all goes well, you will see a message like this at the end:

Job [USERNAME]."SYS_IMPORT_FULL_01" completed

如果您不想将其导入到现有的11g数据库中,则可以始终使用相同的准则启动一个新数据库并将.dmp文件导入到该数据库中.

If you don't want to import it into your existing 11g database, you could always spin up a new database and import the .dmp file to that one using these same guidelines.

这足以让您踏上正确的道路,希望这对您有所帮助,并祝您好运!

That should be enough to get you started down the right path, hope this helps and good luck!

P.S.这也是有关数据泵实用程序的很好的常见问题解答: http://www.orafaq.com/wiki /Import_Export_FAQ

P.S. Here is a great FAQ on the Data Pump utilities as well: http://www.orafaq.com/wiki/Import_Export_FAQ

这篇关于将Oracle数据库还原到Windows Server 2012中的另一个磁盘驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆