利用RMAN跨平台迁移数据库
如果多个平台使用的字节排序方案不同,则需要在RMAN中使用convert命令来将表空间转换为目标平台上所需的格式。可以通过以下查询确
1、数据文件字节排序
Oracle平台一般使用两种不同的字节排序方案(尾数格式)。
如果多个平台使用的字节排序方案不同,则需要在RMAN中使用convert命令来将表空间转换为目标平台上所需的格式。可以通过以下查询确定尾数格式:
select endian_format
from v$transportable_platform tp,v$database d
where tp.platform_name=d.platform_name;
2、使用RMAN转换表空间尾数格式
首先,创建保存转换文件副本的目录,接下来将希望转换的表空间设置为只读模式,,然后,启动RMAN并使用新的convert tablespace命令。
rman target /
convert tablespace users to platform='AIX-Based Systems(64-bit)' db_file_name_convert='c:\oracle\oradata\betatwo','c:\oracle\admin\transport_aix';
也可以转换目标站点上的数据文件
rman target /
convert datafile='c:\oracle\oradata\betatwo\*' from platform='AIX-Based Systems(64-bit)' db_file_name_convert='c:\oracle\oradata\betatwo','c:\oracle\admin\transport_aix';
使用的平台名来自于v$transportable_platform视图的platform_name列。
3、跨平台移动数据库
Oracle Database 10g中的RMAN提供了全新的功能以帮助在尾数字节格式相同的平台之间移动数据库。convert database命令结合DBMS_TDP包可以减少在平台之间移动数据库的整体工作负载。操作过程如下:
(1)以只读方式打开数据库
startup mount;
alter database open read only;
(2)使用dbms_tdb.check_db进程来检查数据库状态。该程序应该在打开serveroutput命令时运行:
set serveroutput on;
declare
db_ready boolean;
begin
db_ready:=dbms_tdb.check_db('Microsoft Windows IA (32-bit)',dbms_tdb.skip_readonly);
end;
/
(3)使用dbms_tdb.check_external进程来标识外部对象:
set serveroutput on;
declare
external boolean;
begin
external:=dbms_tdb.check_external;
end;
/
(4)当数据库可以传送时,就可以使用RMAN的convert database命令。RMAN创建数据库移动所需的脚本,但不真正执行移动操作,而是创建移动所需的文件:
CONVERT DATABASE NEW DATABASE 'copydb' transport script 'c:\oracle\copydb\copyscripts' to platform 'Microsoft Windows IA (32-bit)';
可选参数db_file_name_convert允许用户为需要转换的数据文件定义目录:
CONVERT DATABASE NEW DATABASE 'copydb' transport script 'c:\oracle\copydb\copyscripts' to platform 'Microsoft Windows IA (32-bit)' db_file_name_convert 'c:\oracle\product\10.2.0\oradata\rob10r2','c:\oracle\newdbdest';
推荐阅读:
RMAN 配置归档日志删除策略
Oracle基础教程之通过RMAN复制数据库
RMAN备份策略制定参考内容
RMAN备份学习笔记
Oracle数据库备份加密 RMAN加密
本文永久更新链接地址:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Django is a web development framework written in Python. It provides many convenient tools and modules to help developers quickly build websites and applications. One of the most important features is the database migration function, which can help us simply manage database schema changes. In this article, we will introduce some tips for using database migration in Django, including how to start a new database migration, how to detect database migration conflicts, how to view historical database migration records, etc.

Steps to implement database migrations (Migrations) using Zend framework Introduction: Database migration is an integral part of the software development process. Its function is to facilitate the team's modification and version control of the database structure during development. The Zend Framework provides a powerful set of database migration tools that can help us easily manage changes to the database structure. This article will introduce the steps of how to use the Zend framework to implement database migration, and attach corresponding code examples. Step 1: Install Zend Framework First

PHP and SQLite: How to perform database migration and upgrade Database migration and upgrade is a very common task when developing web applications. For developers using PHP and SQLite, this process may be more complicated. This article will introduce how to use PHP and SQLite for database migration and upgrade, and provide some code samples for reference. Create a SQLite database First, we need to create a SQLite database. Using SQLite database is very convenient, we

MySQL database migration refers to the process of migrating data and structures in one database to another database. In actual projects, you may encounter situations where you need to migrate the database to a new server, upgrade the database version, merge multiple databases, etc. The following will introduce how to migrate MySQL database and provide specific code examples. Export the original database. First, use the export tool on the server where the original database is located to export the data and structure into a SQL file. Commonly used export tools include the mysqldump command

How to use Flask-Migrate for database migration Introduction: Database migration is a very important link when developing web applications. When our applications require structural changes to the database, database migration can help us manage these changes conveniently and ensure the security of the data. In the Flask framework, we can use Flask-Migrate to perform database migration. This article will introduce how to use Flask-Migrate to perform database migration.

Laravel Middleware: Adding Database Migration and Version Management to Applications When developing and maintaining a web application, database migration and version management is a very important task. They allow us to easily manage the structure and data of the database without having to manually update or rebuild the database. The Laravel framework provides powerful and convenient database migration and version management functions. By using middleware, we can more easily integrate these functions into our applications. First we need to make sure our Lar

As applications continue to evolve and requirements change, we often need to modify, migrate, and update the database during the development process. However, in the process of updating the database, if it is not carefully considered and maintained, a series of problems such as data conflicts and data loss may occur. In order to effectively solve these problems, we need to use a professional database migration tool to complete these operations. ThinkPHP6 is a popular PHP framework for building web applications. It provides many useful features and tools, among which

CakePHP is a popular PHP framework that uses the MVC pattern (Model-View-Controller) to build web applications. CakePHP provides a powerful tool for database migration. Database migration refers to moving the database schema from one version to another during the application life cycle. In this article, we will learn how to perform database migration in CakePHP. 1. Why is database migration needed? During the life cycle of the application, as requirements change, the database
