Oracle convert a 32-bit database to 64-bit database (32-bit to 64-bit) Description

Source: Internet
Author: User

 

Oracle Data is divided into 32-bit and 64-bit, which correspond to different platforms. For details about how to check whether the database is 32 or 64-bit, refer:

Check whether oracle is 32-bit or 64-bit

Http://blog.csdn.net/tianlesoftware/article/details/6818709

 

The 32-bit and 64-bit are wordsize. In some cases, for example, to migrate data from a 32-bit Oracle database to a 64-bit Oracle database, you need to modify the wordsize to ensure consistency.

Here we assume that the Migration platform has the same endian format, and the corresponding endian varies with operating systems. Here, we will not describe too much. This part is part of cross-operating system migration and will be described separately.

 

There are several articles about wordsize modification on MOS:

Changing between 32-bit and 64-bit wordsizes [ID 62290.1]

How to change Oracle 11g wordsize from32-bit to 64-bit. [ID 548978.1]

How to convert a 32-bit database to 64-bitdatabase on Linux? [ID 341880.1]

 

Here we will take a look at [341880.1].

Use thefollowing procedure to change wordsize of an Oracle9i Release 2 (9.2) ororacle10g (10.1 & 10.2) or 11G Single Instance database from Linux x86 tolinux x86-64 in same release:

-- The following procedures support the conversion from 32 to 64 for a single oracle 9ir2, 10g, and 11g instance in Linux. Note that the database versions must be consistent here, and only wordsize is different.

 

1. Perform cold backups of theexisting Oracle9i or Oracle10g (10.1.x & 10.2.x) or 11g Database on theLinux x86 system to protect against any failures during the wordsize change.

-- Cold backup of the entire dB to prevent wordsize modification failure.

 

2. Note: This steps is required ifthe target system has different directory structure for database files. Otherwise this step can be skipped.

-- This step is skipped only when the directory structure of the target system is different from that of the source.

 

To help withcreating the control file after the wordsize change, enter the following sqlcommand:

SQL> alterdatabase backup controlfile to trace;

 

-- Dumps the control file to the trace file to facilitate subsequent modifications.

Oracle Control File

Http://blog.csdn.net/tianlesoftware/article/details/4974440

 

This command saves the control file information to a trace file in the udump directory (typeshow parameter user_dump_dest in sqlplus as sys/system user). The control fileinformation is similar to the following:

 

Createcontrolfile reuse Database "sample" noresetlogs
Noarchivelog
Maxlogfiles 32
Maxlogmembers 2
Maxdatafiles 32
Maxinstances 1
# Maxloghistory 112
Logfile
Group1'/ia32lnx_path/Oracle/dbs/t_log1.f' size 25 m,
Group2 '/ia32lnx_path/Oracle/dbs/t_log2.f' size 25 m
Datafile '/ia32lnx_path/Oracle/dbs/t_db1.f'
Character Set we8dec;

 

3. in a new Oracle Home, INSTALLThe 64-bit release of Oracle9i Release 2 (9.2.x), oracle10.1.x, Oracle 10.2.x, Oracle 11.1.x, 11.2.x software for Linux x86-64. it is recommended to usethe same version on as on the 32-bit box.

-- Install the 64-bit Oracle software on the new system. We recommend that you use the same version as the previous 32-bit oracle.

 

4. Perform a clean databaseshudown for Oracle-32 bit Database

-- Clean shutdown 32-bit oracle.

 

When clean shutdown is enabled, the checkpoint is executed, and the Stop SCN of datafile is the same as the start SCN in the control file. When the database is open, Oracle checks whether the start scn in the datafile header is the same as the scn in the datafile stored in the control file. If the two are the same, it checks whether the start SCN and stop SCN are the same. If the two are still the same, the database is enabled normally. Otherwise, a recovery is required.

When the database is enabled, the Stop SCN stored in the control file will be restored to the null value, indicating that datafile is open in normal mode.

 

For more information, see:

Roll Forward

Http://blog.csdn.net/tianlesoftware/article/details/6286330

 

5. Copy the database files fromLinux-x86 to the Linux x86-64 system.

-- Copy all datafiles from 32-bit to 64-bit.

 

6. Copy your existing oracleinitialization parameter file (initsid. ora) to the new Oracle Home.

-- Copy the initialization parameter (pfile) to the directory corresponding to the 64-bit system. The default value is $ ORACLE_HOME/DBS.

 

7. Edit the parameter file topoint to the controlfiles if the location has change from the source machine.

-- Edit the pfile and modify the storage location of the control file.

 

8. Change any Oracle Home pathreferences to use the new Oracle Home path on the Linux x86-64 system. likeuser_dump_dest, background_dump_dest, core_dump_dest etc

-- Modify other parameters in pfile, such as user_dump_dest, background_dump_dest, and core_dump_dest.

 

9. Note: This steps is required ifthe target system has different directory structure for database files whichcauses controlfile recreation otherwise this step can be skipped.

-- This step is optional. If our file directory structure on a 64-bit system is the same as that on a 32-bit system, skip this step.

 

Start up the database using SQL commandssimilar to the following

Example:
SQL> startup nomount;
Create controlfile reuse Database "sample" noresetlogs
Maxlogfiles 32
Maxlogmembers 2
Maxdatafiles 32
Maxinstances 1
# Maxloghistory 112
Logfile
Group 1'/lnx_x86-64_path/Oracle/dbs/t_log1.f' size 25 m
Group 2'/lnx_x86-64_path/Oracle/dbs/t_log2.f' size 25 m
Datafile '/lnx_x86-64_path/Oracle/dbs/t_db1.f'
Character Set we8dec
Alter database open

Note: In the previous example, the path values will vary depending on yoursystem.

-- The above step is to re-build the control file. In the control file, we have modified the location of datafile and other parameters, so if the directory is the same, you do not need to re-build it.

 

10. To change the word size of your release, enter the followingcommand:

-- Use the following command to modify the wordsize

 

If you are migrating an Oracle9i 9.2.0.xdatabase, run startup migrate:

-- If the database is migrated to Oracle9i, run the following command:

SQL> startup migrate

 

If you are migrating an Oracle10g or 11 gdatabase, run startup upgrade:

-- If it is Oracle10g or 11g, run the following command:

SQL> startup upgrade

 

11. recompile existing PL/SQL modules in the format required by the64-bit Oracle database:

-- Recompile the existing PL/SQL Module in 64-bit Oracle format:

SQL> spool mig32-64.log;
SQL> @ $ ORACLE_HOME/rdbms/admin/utlirp. SQL
SQL> spool off;

Check the spoolfile and verify that the packages and procedures compiled successfully. correctany problems you find in this file.

-- Check spool file to verify that all objects have been compiled successfully.

 

Handling instructions for JVM during upgrade

When migrating adatabase from 32 to 64bit (or vice versa) additional actions are required forjava. in theory the format of stored hared Data Objects (SRO) is not compatible between 32 and 64 bit and so theseobjects need to be dropped and regenerated. in practice it may be the case prior to release 11 such objects couldinteroperate but if so this wowould only be by chance and shocould not be reliedon.

-- When we migrate from 32-bit to 64-bit, or from 64-bit to 32-bit, we need to perform operations on java. Theoretically, the Java SRO format is not compatible with 32-bit and 64-bit. Therefore, all objects need to be droped and regenerated. But in fact, the SRO can operate on each other before the Oracle 11g, but this is also an accident, so we still need to recreate these Java SRO objects.

 

 

The steps to dothe regeneration are as follows. theymay take several minutes to complete. They must be done connected as sys.

-- Re-generate the Java SRO script as follows, which needs to be executed by the Sys user. It takes some time to execute this script.

 

Begin
Update OBJ $ set status = 5 whereobj # = (select OBJ # From OBJ $, running nm $
Where owner # = 0 and type # = 29 andshort (+) = Name and
Nvl (longdbcs, name) = 'oracle/Aurora/rdbms/compiler ');
Commit;
Declare
Cursor C1 is select
'Drop Java data "'| U. Name |'". "'| O. Name | '"'
From OBJ $ o, user $ U whereo. Type # = 56 and U. User # = O. Owner #;

Ddl_statement varchar2 (200 );
Iterations number;
Previus_iterations number;
Loop_count number;
My_err number;
Begin
Previus_iterations: = 10000000;
Loop
-- To make sure we eventually stop, pick a Max number of iterations
Select count (*) into iterationsfrom OBJ $ where type # = 56;
Exit when iterations = 0 oriterations> = previus_iterations;
Previus_iterations: = iterations;
Loop_count: = 0;
Open C1;
Loop
Begin
Fetch C1 into ddl_statement;
Exit when C1 % notfound orloop_count> iterations;
Exception when others then
My_err: = sqlcode;
If my_err =-1555 then -- snapshot too old, re-Execute fetch Query
Exit;
Else
Raise;
End if;
End;
Initjvmaux.exe C (ddl_statement );
Loop_count: = loop_count + 1;
End loop;
Close C1;
End loop;
End;
Commit;
Initjvmaux. DRP ('delete fromjava $ policy $ shared $ table ');
Update OBJ $ set status = 1 whereobj # = (select OBJ # From OBJ $, running nm $
Where owner # = 0 and type # = 29 andshort (+) = Name and
Nvl (longdbcs, name) = 'oracle/Aurora/rdbms/compiler ');
Commit;
End;
/

Create or replace Java System
/

 

Oracle recommends that you run the utlrp. SQL script after running the utlirp. sqlscript. the utlrp. SQL script recompiles all PL/SQL modules that might be in aninvalid state, including packages, procedures, and types. this is optional butoracle recommends that you do it during installation and not at a later date. to run the utlrp. SQL script, enter the following command:

-- Execute the utlrp. SQL script to re-compile objects that may be invalid. We recommend that you execute this step. The script is as follows:

 

SQL> shutdown immediate;
SQL> startup (Use appropriate command; outlined above, depending on yourversion)
SQL> @ $ ORACLE_HOME/rdbms/admin/utlrp. SQL

 

Note: If you arechanging wordsize for Oracle release10.1.x/10.2.x/11.1/11.2 32-bit to 64-bitwith OLAP enabled for DB then you may likely to see the error

-- Note: If OLAP is enabled, you may encounter the following errors when switching from 32-bit to 64-bit:

 

On console:
<> ORA-06544: PL/SQL: Internal error, arguments: [56319], [], [], [], [], [], [], [], [] <>

On alert. log:
ORA-07445: exception encountered: core dump [_ intel_fast_memcpy.a () + 10] [SIGSEGV] <>

Or

ORA-07445: exception encountered: core dump [_ intel_new_memcpy () + 2132] [SIGSEGV]

 

(On 11g)

Or

ORA-07445: exception encountered: core dump [_ intel_fast_memcpy.a () + 10] [SIGSEGV] <style = "font-family: arialunicode MS;"> (run the following query to check OLAP componentinstalled

Select comp_name, status from dba_registry where comp_name like '% OLAP % ')

Please refer the document to solve thisissue

-- If you encounter this problem, refer to the following documents to solve it:

Note: 352306.1 upgrading OLAP from 32 to 64 bits
Note: 332351.1 how to remove or to reinstall the OLAP Option

Note: At thispoint, The natively compiled Java objects in the new [wordsize changed] databaseare invalid. refer to the section "steps to update natively compiled javaobjects in the Database" for the procedure to revalidate these objects.

-- Note: If the Java object is still invalid at this time, refer to the following method to revalidate these objects:

Steps to update nativelycompiled Java objects in the database

To use nativelycompiled Java objects for Linux x86-64, use the following procedure to updatecompiled Java objects in the database:

(1) connect to the database as usersys or system as sysdba [you may get error ORA-1031 while running followingcommand if you are not connected as sysdba]
(2) enter the following command:
(3) SQL> Create or replace policystem;

/

(4) it may be necessary to recompilethe Java objects with ncomp:

I. e. % ncomp-user Scott/tiger hello. Class

 

 

12. Perform a clean shutdown of the database.

-- Clean shutdown DB

 

13. Perform a complete backup of the new 64-bit Oracle9i Release 2 (9.2) or oracle10gr1/10gr2/11gr1 Database

-- Back up the 64-bit dB and the migration is complete.

 

 

Summary:

In this blog, the method is cold copy, which copies the entire datafiles to the new environment, modifies the relevant information, reconstructs the control file, and other operations. This is only one method for 32-bit to 64-bit conversion. There are two ways to achieve this operation:

(1) Use RMAN revoer. For details, refer:

RMAN restoring A32 BIT database to 64 bit-an example [ID 467676.1]

(2) Use expdp and impdp. refer:

How to useexport and import when transferring data into SS platforms or into ss 32-bit and64-bit servers [ID 277650.1]

 

The following describes how to use these methods.

 

 

 

 

 

Bytes -------------------------------------------------------------------------------------------------------

All rights reserved. reprinted articles are allowed, but source addresses must be indicated by links. Otherwise, the documents will be held legally responsible!

Skype: tianlesoftware

Email: tianlesoftware@gmail.com

Blog: http://www.tianlesoftware.com

WEAVER: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

LinkedIn: http://cn.linkedin.com/in/tianlesoftware

 

------- Add a group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, reject the application ----

Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)

Super DBA group: 63306533 (full); dba4 group: 83829929 dba5 group: 142216823

Dba6 group: 158654907 dba7 group: 172855474 DBA group: 104207940

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.