客户32位置oracle数据库系统的磁盘损坏,幸运的是,oracle数据库完美无损。客户数据库迁移到新购设备。新设备的内存64G,制REDHAT 6.2 64位置,直接拷贝数据文件肯定是不。由于oracle 的存储过程在32位和64位平台下的wordsize不同。尽管用户的存储过程能够在使用时自行完毕又一次编译,但oracle的系统存储过程确须要我们来手工转换。

总结,迁移步骤例如以下:

1:备份oracle数据库

2:备份控制文件到trace(以备须要新建控制文件)

SQL> alter database backup controlfile to trace;

Database altered.

SQL> oradebug setmypid
Statement processed.
SQL> oradebug tracefile_name
/u01/app/admin/easy/udump/easy_ora_18830.trc
SQL> host cat /u01/app/admin/easy/udump/easy_ora_18830.trc
......
--
-- Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "EASY" NORESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/oradata/easy/redo01.log' SIZE 11200K,
GROUP 2 '/oradata/easy/redo02.log' SIZE 11200K
-- STANDBY LOGFILE
DATAFILE
'/oradata/easy/system01.dbf',
'/oradata/easy/undotbs01.dbf',
'/oradata/easy/sysaux01.dbf',
'/oradata/easy/users01.dbf'
CHARACTER SET ZHS16GBK
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/flash_recovery_area/EASY/archivelog/2014_11_05/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/flash_recovery_area/EASY/archivelog/2014_11_05/o1_mf_1_1_%u_.arc';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/easy/temp01.dbf'
SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
-- End of tempfile additions.
--
-- Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
-- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "EASY" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 '/oradata/easy/redo01.log' SIZE 11200K,
GROUP 2 '/oradata/easy/redo02.log' SIZE 11200K
-- STANDBY LOGFILE
DATAFILE
'/oradata/easy/system01.dbf',
'/oradata/easy/undotbs01.dbf',
'/oradata/easy/sysaux01.dbf',
'/oradata/easy/users01.dbf'
CHARACTER SET ZHS16GBK
;
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/flash_recovery_area/EASY/archivelog/2014_11_05/o1_mf_1_1_%u_.arc';
-- ALTER DATABASE REGISTER LOGFILE '/u01/app/flash_recovery_area/EASY/archivelog/2014_11_05/o1_mf_1_1_%u_.arc';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE
-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '/oradata/easy/temp01.dbf'
SIZE 20971520 REUSE AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
-- End of tempfile additions.
--

3: 查看当前的数据库状态

SQL> select count(*) from dba_objects where status ='INVALID';

  COUNT(*)
----------
0 SQL> select comp_name,status from dba_registry; COMP_NAME STATUS
---------------------------------------- ----------------------
Oracle Database Catalog Views VALID
Oracle Database Packages and Types VALID
Oracle Workspace Manager VALID
JServer JAVA Virtual Machine VALID
Oracle XDK VALID
Oracle Database Java Packages VALID
Oracle Expression Filter VALID
Oracle Data Mining VALID
Oracle Text VALID
Oracle XML Database VALID
Oracle Rules Manager VALID COMP_NAME STATUS
---------------------------------------- ----------------------
Oracle interMedia VALID
OLAP Analytic Workspace VALID
Oracle OLAP API VALID
OLAP Catalog VALID
Spatial VALID
Oracle Enterprise Manager VALID 17 rows selected.

4:拷贝參数文件。控制文件,数据文件。日志文件到64位数据库

5:在64位系统上创建对应文件夹,如udmp  adump等,要和32位系统一致

6:假设数据库的数据文件文件夹发生变化。则须要新建控制文件,(最好保持源库和目标库的一致。降低工作量和发生错误率)

7:将数据库中的存储过程等置为失效,UTLIRP脚本会将存储过程等置为失效

<span style="white-space:pre">	</span>--假设迁移的是oracle9i的数据库。运行例如以下命令:
SQL> STARTUP MIGRATE --假设是Oracle10g或11g,运行例如以下命令:
SQL> STARTUP UPGRADE SQL> SPOOL EASY.log;
SQL> @$ORACLE_HOME/rdbms/admin/utlirp.sql
SQL> SPOOL OFF;

8: 又一次启动数据库,

9: 假设数据库有OLAP组件,则删除OLAP,以sys用户运行例如以下脚本

SQL> conn / as sysdba

----> Remove OLAP Catalog
SQL> @?/olap/admin/catnoamd.sql ----> Remove OLAP API
SQL> @?/olap/admin/olapidrp.plb
SQL> @?/olap/admin/catnoxoq.sql ----> Deinstall APS - OLAP AW component
SQL> @?/olap/admin/catnoaps.sql
SQL> @? /olap/admin/cwm2drop.sql ---仅仅须要在11g中运行。在10g中。catnoamd.sql 脚本中已经包括了该脚本,所以不用运行 You could getsome invalid objects under SYS and PUBLIC owner, and they are the old duplicate OLAPSYS objects copied under these schemas when Olap has been installedpreviously.
Generally, theOlap objects are named with context like %OLAP%, %AWM%, or other Olap word keys intheir "object_name" field, however, if it needs a help to recognizethem, then please contact Oracle Support and create a Service Request toget assistance for this question. Note that catnoadm.sql could fail from 10.1.0.5 to 11.1.0.7release. Due to the factthat it refers to three scripts which don't get shipped until 11.2 this scriptwill fail.
Besides that itwill error on 7 non-existing synonyms to drop. Prior 11.2, execute these three dropsynonym statements: SQL> drop public synonym OlapFactView;
SQL> drop public synonym OlapDimView;
SQL> drop public synonym DBMS_ODM;

10:编译失效对象

SQL> @?/rdbms/admin/utlrp.sql

此时会有错误,这是由于olap没有安装,以下安装olap,然后又一次编译

11:加入OLAP

SQL> @?/olap/admin/olap.sql SYSAUX TEMP;
<pre name="code" class="sql">SQL> @?/rdbms/admin/utlrp.sql    --这次会很快

12.  验证无效对象和组件状态

SQL> l
1* select count(*) from dba_objects where status<>'VALID'
SQL> col comp_name for a40
SQL> select comp_name,status from dba_registry; COMP_NAME STATUS
---------------------------------------- ----------------------
Oracle Database Catalog Views VALID
Oracle Database Packages and Types VALID
Oracle Workspace Manager VALID
JServer JAVA Virtual Machine VALID
Oracle XDK VALID
Oracle Database Java Packages VALID
Oracle Expression Filter VALID
Oracle Data Mining VALID
Oracle Text VALID
Oracle XML Database VALID
Oracle Rules Manager VALID COMP_NAME STATUS
---------------------------------------- ----------------------
Oracle interMedia VALID
OLAP Analytic Workspace VALID
Oracle OLAP API VALID
OLAP Catalog VALID
Spatial VALID
Oracle Enterprise Manager VALID

11:又一次编译java对象

<pre name="code" class="sql">begin
update obj$ set status=5 where obj#=(select obj# from obj$,javasnm$ where owner#=0 and type#=29 and short(+)=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 where o.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
select count(*) into iterations from obj$ where type#=56;
exit when iterations=0 or iterations >= previous_iterations;
previous_iterations := iterations;
loop_count := 0;
open C1;
loop
begin
fetch C1 into ddl_statement;
exit when C1%NOTFOUND or loop_count > iterations;
exception when others then
my_err := sqlcode;
if my_err = -1555 then
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 from java$policy$shared$table');
update obj$ set status=1 where obj#=(select obj# from obj$,javasnm$ where owner#=0 and type#=29 and short(+)=name and nvl(longdbcs,name)='oracle/aurora/rdbms/Compiler');
commit;
end;
/

create or replace java system
/

It may be necessary to recompilethe Java objects with ncomp:i.e.   % ncomp-user scott/tiger Hello.class

迁移过程中。最好不要有ddl操作。以免造成死锁

版权声明:本文博主原创文章,博客,未经同意不得转载。

将oracle从数据库32位平台迁移到64位置的更多相关文章

  1. Oracle 11g oracle客户端(32位)PL/SQL develepment的安装配置

    Oracle 11g+oracle客户端(32位)+PL/SQL develepment的安装配置 之前一直想学Oracle,可是就是安装配置Oracle一直未成功,让人很苦恼,特别是什么监听器什么的 ...

  2. 错误: 未能完成程序集的安装(hr = 0x8007000b),.net程序关于使用Oracle.DataAccess.dll不同版本x86和x64问题,即oracle odp.net 32位/64位版本的问题

    如果你的机器上安装了odp.net,且确信machine.config也有类似以下结节:(64位+.net 4.0环境下,machine.config可能会有4份,分别对应于.net2.0/4.0的3 ...

  3. Oracle 11g R2 32位 & Oracle 11g R2 64位 -百度云下载

    Oracle 11g R2 32位 & Oracle 11g R2 64位 -百度云下载 https://pan.baidu.com/s/1fuzy67Olfxzsy3WJMCrCnQ 提取码 ...

  4. win7 64位平台编译的程序在XP 32位平台无法运行的解决方法

    win7 64位平台编译的程序在XP 32位平台无法运行的解决方法 vs2010的开发环境,制作了一个DLL库.但DLL在XP 32位平台一直无法使用.解决方法如下: 右键项目,属性->配置属性 ...

  5. 模块XXXX可能与您正在运行的Windows版本不兼容。检查该模块是否与regsvr32.exe的x86(32位)x64(64位)版本兼容。

    最近自己在编写ActiveX控件.遇到的麻烦事不少. 今天遇到了这个问题“模块XXXX可能与您正在运行的Windows版本不兼容.检查该模块是否与regsvr32.exe的x86(32位)x64(64 ...

  6. C# oracle odp.net 32位/64位版本的问题

    问题如下: 系统是win7 64位,技术 asp.net mvc 4, 数据库 oracle 11g. 由于某些原因只能使用 32的 ODP.NET ( Oracle Data Provider ), ...

  7. Ubuntu 14.04(32位)安装Oracle 11g(32位)全过程

    1.将系统更新到最新:sudo apt-get updatesudo apt-get dist-upgrade2.安装Oracle所需的依赖包:sudo apt-get install automak ...

  8. [转]oracle odp.net 32位/64位版本的问题

    本文转自:http://www.cnblogs.com/yjmyzz/archive/2011/04/19/2020793.html 如果你的机器上安装了odp.net,且确信machine.conf ...

  9. 在已安装64位oracle的服务器安装32位客户端

    应用场景:服务器操作系统是win2012 64位,原先安装了64位oracle12,后来系统增加导入excel的功能,网站必须启用32位兼容模式,这时候发现原有的页面打不开,提示: 试图加载格式不正确 ...

随机推荐

  1. js进阶 13-11/12 jquery如何实现折叠导航

    js进阶 13-11/12 jquery如何实现折叠导航 一.总结 一句话总结:还是用的slideToggle滑动效果,并且这一个展开时,所有兄弟都关闭. 1.文字缩进怎么设置? 感觉设置margin ...

  2. Codeforces Round #450 (Div. 2) D.Unusual Sequences (数学)

    题目链接: http://codeforces.com/contest/900/problem/D 题意: 给你 \(x\) 和 \(y\),让你求同时满足这两个条件的序列的个数: \(a_1, a_ ...

  3. 推荐一款稳定快速免费的前端开源项目 CDN 加速服务

    前面学习到什么是CDN,全称是Content Delivery Network,即内容分发网络.CDN的通俗理解就是网站加速,CPU均衡负载. CDN的基本思路是尽可能避开互联网上有可能影响数据传输速 ...

  4. js进阶 12-18 jquery如何实现自定义右键菜单(把问题分细)

    js进阶 12-18  jquery如何实现自定义右键菜单(把问题分细) 一.总结 一句话总结:用鼠标右键事件contextmenu,阻止系统默认事件,让做好的右键菜单显示出来,并且显示在我们出现的位 ...

  5. UVA 11090 - Going in Cycle!! SPFA

    http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&p ...

  6. [转载]Surging 分布式微服务框架使用入门

    前言 本文非 Surging 官方教程,只是自己学习的总结.如有哪里不对,还望指正. 我对 surging 的看法 我目前所在的公司采用架构就是类似与Surging的RPC框架,在.NET 4.0框架 ...

  7. disabled的值无法传递到action层

    假设想让表单不可输入的状态,我将表单设置为了: style="cursor:not-allowed;" disabled 可是这样设置之后就发现,在后台的action怎么都没有办法 ...

  8. 自定义 matplotlib 设置

    Customizing plots with style sheets import matplotlib as mpl 查看配置文件所在的目录:mpl.get_configdir() 1. 自定义 ...

  9. Linux下交叉编译gdb,gdbserver+gdb的使用以及通过gdb调试core文件

    交叉编译gdb和gdbserver 1.下载gdb:下载地址为:http://ftp.gnu.org/gnu/gdb/按照一般的想法,最新版本越好,因此下载7.2这个版本.当然,凡事无绝对.我们以gd ...

  10. static 静态

    摘自:https://blog.csdn.net/Kendiv/article/details/675941 关于static的  ""记忆性"" 我们可以用做 ...