导出oracle数据库

发布于 2024-08-27 01:48:09 字数 82 浏览 3 评论 0原文

我在 Windows Server 2003 上的 oracle 上有一个数据库。如何将其与所有数据一起导出并将其放入其他 Windows 服务器中?

I have a DB on oracle on Windows Server 2003. How do I export it with all the data and put it into other Windows server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一个人的夜不怕黑 2024-09-03 01:48:09

使用 RMAN 进行完整备份。然后在新服务器上恢复。

请参阅使用 RMAN 克隆文章

Use RMAN to take a full backup. Then restore it on the new server.

See Clone using RMAN Article

素食主义者 2024-09-03 01:48:09

您可以使用 Oracle Data Pump 用于导出和导入数据库。引用自文档:

Oracle Data Pump 是 Oracle Database 11g 第 2 版的一项功能,可在 Oracle 数据库之间实现非常快速的批量数据和元数据移动。

过程如下:

  1. 使用 expdp 实用程序导出现有数据库
  2. 在新的 Windows 服务器上安装 Oracle 数据库服务器
  3. 使用 impdp 实用程序在新服务器上导入数据库

检查此链接:Oracle 数据泵< /a>.在那里您将找到如何使用此实用程序的完整文档和示例。

You can use Oracle Data Pump to export and import database. Quote from documentation:

Oracle Data Pump is a feature of Oracle Database 11g Release 2 that enables very fast bulk data and metadata movement between Oracle databases.

Procedure is like this:

  1. Export existing database using expdp utility
  2. Install Oracle database server on new Windows server
  3. Import database on new server using impdp utility

Check this link: Oracle Data Pump. There you will find complete documentation and examples how to use this utility.

月隐月明月朦胧 2024-09-03 01:48:09

如果您想要在同一操作系统(尽管不一定是相同的操作系统版本)和相同的 Oracle 版本的新服务器上创建现有数据库的精确副本,最快且问题最少的方法是仅复制数据库文件。这通常称为数据库克隆,是 DBA 用于设置开发和测试数据库的常用方法,这些数据库旨在成为生产数据库的精确副本。

  1. 停止现有系统上数据库的所有实例。您可以使用 SQLPlus 以“sysdba”身份登录到每个实例,并运行“立即关闭”命令。您还可以停止实例的 Windows 服务。它们被命名为 OracleServicesid,其中“sid”是实例名称。通常,只有一个实例,但单个数据库可能有多个实例。为此过程必须停止所有实例。
  2. 找到数据库文件。在 Oracle 根文件夹下查找“oradata”文件夹,然后在其中找到数据库 sid 的文件夹。 (可能有多个 oradata 文件夹。您需要找到一个具有以数据库 SID 命名的文件夹的文件夹。)在 Admin 文件夹中还有该 sid 的文件以及 %ORACLE_HOME%/database 文件夹。如果使用 DBCA 创建数据库,则所有这些文件的位置会因 Oracle 版本而异。
  3. 一旦确定了数据库的所有文件,您就可以使用任何可用的方法将这些文件复制到新服务器上的相同位置。 (注意:数据库文件、控制文件和重做日志必须放置在与旧服务器上相同的位置(即文件系统路径)。否则,必须更改配置文件并运行命令来更改配置文件)数据库的内部文件路径。)参数文件(initSID.ora) 和服务器参数文件(spfileSID.ora) 必须放置在%ORACLE_HOME%/database 文件夹中。
  4. 在新服务器上,您必须运行 oradim 实用程序。 (注意:oradim 是特定于 Windows 的 Oracle 实用程序,用于创建、维护和删除实例服务。)以下是示例命令:

    oradim -new -sid yourdbsid -startmode 自动
    
  5. 使用 SQLPlus 启动数据库,然后您就可以开始工作了。< /p>

这是该过程的总体概述,但它应该可以帮助您快速轻松地完成工作。其他工具的问题是在通过任何方式加载数据之前需要在目标服务器上创建一个空数据库。如果目标服务器有不同版本的Oracle,则需要运行数据字典脚本来升级或降级数据库。 (注意:降级可能并不总是可能的。)如果新服务器具有不同的操作系统,则上述过程将需要额外的步骤,这将显着增加其复杂性。

还可以使用 RMAN 复制数据库。谷歌“使用 rman 克隆 Oracle 数据库”一词,可以找到一些关于如何使用该工具完成此操作的好网站。如果您尚未使用 RMAN,我上面描述的过程可能是正确的选择。

If you are wanting to create an exact copy of an existing database on a new sever of the same operating system (though not necessarily the same O/S version) and the same Oracle version, the quickest and least problematic method is to just copy the database files. This is often referred to as database cloning, and it is a common method DBAs use to setup development and test databases that are intended to be exact duplicates of production databases.

  1. Stop all instances of the database on the existing system. You could login to each instance "as sysdba" using SQLPlus and run the "shutdown immediate" command. You could also stop the Windows Services for the instances. They are named OracleServicesid where "sid" is the instance name. Usually, there is just one instance, but there could be multiple instances to a single database. All instances must be stopped for this procedure.
  2. Locate the database files. Look for an "oradata" folder somewhere below the Oracle root folder and then find the folder for the database sid in there. (There could be multiple oradata folders. You need to find the one that has the folder named for the SID of your database.) There are also the files in the Admin folder for the sid as well as the %ORACLE_HOME%/database folder. If DBCA had been used to create the database, then the location of all of these files varies by the Oracle version.
  3. Once you have identified all of the files for the database, you can use any method at your disposal to copy these files to the same locations on the new server. (Note: The database files, control files, and redo logs must be placed in the same locations (i.e., file system paths) where they exist on the old server. Otherwise, configuration files must be changed and commands must be run to alter the database's internal file paths.) The parameter file (initSID.ora) and server parameter file (spfileSID.ora) must be placed in the %ORACLE_HOME%/database folder.
  4. On the new sever, you must run the oradim utility. (Note: oradim is an Oracle utility that is specific to Windows and is used to create, maintain, and delete instance services.) Here is a sample command:

    oradim -new -sid yourdbsid -startmode automatic
    
  5. Startup the database with SQLPlus, and you should be in business.

This is a general overview of the process, but it should help you get the job done quickly and easily. The problem with other tools is the need to create an empty database on the target server before loading the data by whatever means. If the target server has a different version of Oracle, it will be necessary to run data dictionary scripts to upgrade or downgrade the database. (Note: A downgrade may not always be possible.) If the new server has a different O/S, then the above procedure would require additional steps that would significantly increase its complexity.

It also possible to duplicate a database using RMAN. Google the words "clone oracle database using rman" to get some good sites on how this is done using that tool. If you are not already using RMAN, the procedure I have described above would probably be the way to go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文