On CNET: Mozilla gets more Google money

Convert databases to different platforms using RMAN

Tags: Databases, database, CONVERT DATAFILE, Bob Watkins, Convert Database, CONVERT TABLESPACE, Oracle Corp., tablespace, RMAN, Oracle Tips Newsletter

  • Save
  • Print
  • Digg This
  • 0

Takeaway: The Oracle Database supports the direct movement of tablespaces from one instance of Oracle to another. In the past, the destination was required to use the same operating system platform as the original. Oracle 10g contains tools in the Recovery Manager (RMAN) to extend these moves to other platforms.

The transportable tablespace feature—copying datafiles directly between Oracle instances instead of unloading and loading data—was introduced in Oracle 8i and has grown in functionality ever since. At first, the tablespace to be moved had to have the same block size as the destination database. The addition of multiple block size support in Oracle 9i removed that limitation. Now, in Oracle 10g, the platform limitation has been largely removed as well.

The Recovery Manager (RMAN) program contains a new CONVERT command that you can use as part of a cross-platform migration. As little as one datafile, up to the entire database, can be transported with the help of this command.

Weekly Oracle tips in your inbox
TechRepublic's free Oracle newsletter, delivered each Wednesday, covers automating Oracle utilities, generating database alerts, solving directed graph problems, and more.
Automatically sign up today!

The reason that a conversion is often necessary when moving across platforms is that computers store multi-byte numbers in different ways. The technical term endianness describes this, and the two main schemes are big-endian (high values to low as memory addresses increase) and little-endian (low values to high as memory addresses increase). To properly interpret the data in a tablespace, the bytes have to be ordered correctly for the operating system platform in use.

The view V$TRANSPORTABLE_PLATFORM lists the platforms that RMAN can convert. Each has a platform name and an endian format. By selecting from this view, you can see if the source and destination instances are using the same endianness.

The CONVERT command copies the files instead of working on them in-place, which is much safer but requires enough additional disk space to hold both versions.

There are three main forms of the CONVERT command:

  • CONVERT TABLESPACE is only used on the source system and converts all the datafiles in the requested tablespace(s) to the target platform's format.
  • CONVERT DATAFILE is only used on the destination system if CONVERT TABLESPACE was not used on the source (or if file name conversion is desired). Because the transported datafiles are not yet associated with a tablespace, they must be converted as datafiles.
  • CONVERT DATABASE converts other structures, such as undo segments and parameter files in addition to all the permanent tablespaces. Control files and redo log files are rebuilt. For this option only, both source and destination must have the same endianness.

Even if the two systems use the same endianness, you can still benefit from the CONVERT command. The FORMAT clause enables you to convert pathnames, and one use is to copy datafiles into and out of ASM disk groups.

Listing A shows an example RMAN session on a Windows platform source system (little-endian), converting the USERS tablespace to an IBM zSeries destination system (big-endian). First the tablespace is made read only, using the RMAN SQL command. Then the CONVERT statement copies the files to the flash recovery area, converting them. Finally, the source tablespace is returned to read/write status. The copied files are now available to be copied to the destination server.

Miss a tip?

Check out the Oracle archive, and catch up on our most recent Oracle tips.

Bob Watkins (OCP, MCDBA, MCSE, MCT) is a computer professional with 25 years of experience as a technical trainer, consultant, and database administrator. Visit Bob's site.

  • Save
  • Print
  • Digg This
  • 0

Print/View all Posts Comments on this article

actually i want to restore database with incremental in diff databaseer.bibhuranjan@...  | 01/29/08
is this easier?Jaqui  | 01/30/08

What do you think?

Article Categories

Security
Security Solutions, IT Locksmith
Networking and Communications
E-mail Administration NetNote, Cisco Routers and Switches
CIO and IT Management
Project Management, CIO Issues, Strategies that Scale
Desktops, Laptops & OS
Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
Data Management
Oracle, SQL Server
Servers
Windows NT, Linux NetNote, Windows Server 2003
Career Development
Geek Trivia
Software/Web Development
Web Development Zone, Visual Basic, .NET
advertisement
Click Here