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.
--这一步是可选的操作,如果在64位系统上我们的文件目录结构和32位系统上的相同,那么可以跳过这个步骤。
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 25M
GROUP 2 '/lnx_x86-64_path/oracle/dbs/t_log2.f' size 25M
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.
--以上步骤就是重建控制文件,在控制文件里,我们修改了datafile 等参数的位置,所以如果目录相同,可以不用重建。
10. To change the word size of your release, enter the followingcommand:
--使用如下命令修改wordsize
If you are migrating an Oracle9i 9.2.0.xdatabase, run STARTUP MIGRATE:
--如果迁移的是oracle9i的数据库,执行如下命令:
SQL> STARTUP MIGRATE
If you are migrating an Oracle10g or 11gdatabase, run STARTUP UPGRADE:
--如果是Oracle10g或11g,执行如下命令:
SQL> STARTUP UPGRADE
11. Recompile existing PL/SQL modules in the format required by the64-bit Oracle Database:
--按照64位Oracle的格式,重新编译已经存在的PL/SQL 模块:
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.
--检查spool file,验证所有对象是否编译成功。
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 javashared 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 would only be by chance and should not be reliedon.
--当我们从32位迁移到64位时,或者从64到32位,需要对Java进行操作。 理论上Java SRO的格式在32位和64位上不兼容,所以所有的对象需要先droped,在重新生成。 但实际上,在Oracle 11g之前这些SRO 是可以相互操作的,但这也是偶然情况,所以还是需要重建这些Java SRO对象。
The steps to dothe regeneration are as follows. Theymay take several minutes to complete. They must be done connected as SYS.
--重新生成Java SRO的脚本如下,需要使用SYS 用户来执行,执行这个脚本需要一定的时间。
begin
update obj$ set status=5 whereobj#=(select obj# from obj$,javasnm$
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;
previous_iterations number;
loop_count number;
my_err number;
begin
previous_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 >= previous_iterations;
previous_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.exec(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$,javasnm$
where owner#=0 and type#=29 andshort(+)=name and
nvl(longdbcs,name)='oracle/aurora/rdbms/Compiler');
commit;
end;
/
create or replace java system
/
