当前位置:  数据库>oracle

Oracle 10g到11g的数据库迁移实验

    来源: 互联网  发布时间:2017-06-03

    本文导语: 用rman来实现,实现跨库跨服务器的迁移 10g服务器:192.168.182.133 Oracle 10.2.0.1.0 RHEL 4 32bit 11g服务器: 服务器192.168.182.131 OEL5.8_32 Oracle 11.2.0.1.0 32bit [oracle@oelr5u8-1 admin]$ uname -a Linux oelr5u8-1.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17...

用rman来实现,实现跨库跨服务器的迁移
 10g服务器:192.168.182.133 Oracle 10.2.0.1.0 RHEL 4 32bit

11g服务器:
 服务器192.168.182.131 OEL5.8_32 Oracle 11.2.0.1.0 32bit
 [oracle@oelr5u8-1 admin]$ uname -a
 Linux oelr5u8-1.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:22:40 EST 2012 i686 i686 i386 GNU/Linux
 
SYS@PROD>select * from v$version;

BANNER
 --------------------------------------------------------------------------------
 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
 PL/SQL Release 11.2.0.1.0 - Production
 CORE    11.2.0.1.0      Production
 TNS for Linux: Version 11.2.0.1.0 - Production
 NLSRTL Version 11.2.0.1.0 - Production

将服务器192.168.182.133上的10g库PROD2迁移至服务器192.168.182.131上的11g数据库PROD4

1. Preparations
 1.1 setup auxiliary instance
 1.1.1 orapwd
 on 131-源库服务器
 cd $ORACLE_HOME/dbs
 orapwd file=orapwPROD4 password=oracle

1.1.2 export ORACLE_SID=PROD4
 on 131

1.1.3 mkdir
 on 131
 mkdir -p /u01/app/oracle/admin/PROD4/{a,b,c,u}dump
 mkdir -p /u01/app/oracle/oradata/PROD4/

1.1.4 pfile
 on 133-目标库服务器
 cd $ORACLE_HOME/dbs
 sqlplus / as sysdba
create pfile from spfile;

scp initPROD2.ora oelr5u8-1:/u01/app/oracle/product/11.2.0/db_1/dbs/initPROD4.ora
 
on 131
 cd cd $ORACLE_HOME/dbs
 vi initPROD4.ora
 PROD2.__db_cache_size=167772160
 PROD2.__java_pool_size=4194304
 PROD2.__large_pool_size=4194304
 PROD2.__shared_pool_size=100663296
 PROD2.__streams_pool_size=0
 *.aq_tm_processes=1
 *.audit_file_dest='/u01/app/oracle/admin/PROD2/adump'
 *.background_dump_dest='/u01/app/oracle/admin/PROD2/bdump'
 *.compatible='10.2.0.1.0'
 *.control_files='/u01/app/oracle/oradata/PROD2/control01.ctl','/u01/app/oracle/oradata/PROD2/control02.ctl','/u01/app/oracle/oradata/PROD2/control03.ctl'
 *.core_dump_dest='/u01/app/oracle/admin/PROD2/cdump'
 *.db_block_size=8192
 *.db_domain=''
 *.db_file_multiblock_read_count=16
 *.db_name='PROD2'
 *.dispatchers=''
 *.job_queue_processes=10
 *.nls_language='SIMPLIFIED CHINESE'
 *.nls_territory='CHINA'
 *.open_cursors=300
 *.pga_aggregate_target=94371840
 *.processes=150
 *.remote_login_passwordfile='EXCLUSIVE'
 *.session_cached_cursors=200
 *.sga_target=285212672
 *.undo_management='AUTO'
 *.undo_tablespace='UNDOTBS1'
 *.user_dump_dest='/u01/app/oracle/admin/PROD2/udump'

改为符合辅助实例和11g数据库的要求

PROD4.__db_cache_size=167772160
 PROD4.__java_pool_size=4194304
 PROD4.__large_pool_size=4194304
 PROD4.__shared_pool_size=100663296
 PROD4.__streams_pool_size=0
 *.aq_tm_processes=1
 *.audit_file_dest='/u01/app/oracle/admin/PROD4/adump'
 *.control_files='/u01/app/oracle/oradata/PROD4/control01.ctl','/u01/app/oracle/oradata/PROD4/control02.ctl','/u01/app/oracle/oradata/PROD4/control03.ctl'
 *.db_block_size=8192
 *.db_domain=''
 *.db_file_multiblock_read_count=16
 *.db_name='PROD4'
 *.dispatchers=''
 *.job_queue_processes=10
 *.nls_language='SIMPLIFIED CHINESE'
 *.nls_territory='CHINA'
 *.open_cursors=300
 *.pga_aggregate_target=94371840
 *.processes=150
 *.remote_login_passwordfile='EXCLUSIVE'
 *.session_cached_cursors=200
 *.sga_target=285212672
 *.undo_management='AUTO'
 *.undo_tablespace='UNDOTBS1'
 ## for auxiliary instance
 DB_FILE_NAME_CONVERT='PROD2','PROD4'
 LOG_FILE_NAME_CONVERT='PROD2','PROD4'

1.1.5 startup nomount on auxiliary instance
 on 131

export ORACLE_SID=PROD4
 sqlplus / as sysdba
 create spfile from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initPROD4.ora';
 
1.1.6 setup listener and tnsnames
 on 133
 vi tnsnames.ora
 add:
 PROD4_oelr5u8-1=
  (description=
    (address=(protocol=tcp)(host=oelr5u8-1)(port=1521))
    (connect_data=
      (server=dedicated)
      (service_name=PROD4)
    )
  )
 
on 131
 vi listener.ora
 add into sid_list_listener:
 (sid_desc=
      (global_dbname=PROD4)
      (oracle_home=/u01/app/oracle/product/11.2.0/db_1)
      (sid_name=PROD4
    )
   
lsnrctl start

vi tnsnames.ora
 PROD2_odd-oelr4u8 =
  (description =
    (address = (protocol = tcp)(host = odd-oelr4u8)(port = 1521))
    (connect_data =
      (server = dedicated)
      (service_name = PROD2)
    )
  )
 
1.2 check target database's backup
 on 133
 ensure that archive log mode is on

rman target /
 list backup of database;
 note: cannot use backup as compressed backupset... errors will be reported when duplicating
 
2. duplicate

 rman target sys/oracle@PROD2 auxiliary sys/oracle@PROD4_oelr5u8-1

Recovery Manager: Release 10.2.0.1.0 - Production on Sat Apr 5 15:37:35 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: PROD2 (DBID=1490667694)
 connected to auxiliary database: PROD4 (not mounted)

RMAN> duplicate target database to PROD4;

Starting Duplicate Db at 05-APR-14
 using target database control file instead of recovery catalog
 allocated channel: ORA_AUX_DISK_1
 channel ORA_AUX_DISK_1: sid=9 devtype=DISK

contents of Memory Script:
 {
    set until scn  768912;
    set newname for datafile  1 to
 "/u01/app/oracle/oradata/PROD4/system01.dbf";
    set newname for datafile  2 to
 "/u01/app/oracle/oradata/PROD4/undotbs01.dbf";
    set newname for datafile  3 to
 "/u01/app/oracle/oradata/PROD4/sysaux01.dbf";
    set newname for datafile  4 to
 "/u01/app/oracle/oradata/PROD4/users01.dbf";
    set newname for datafile  5 to
 "/u01/app/oracle/oradata/PROD4/mgmt.dbf";
    set newname for datafile  6 to
 "/u01/app/oracle/oradata/PROD4/mgmt_ecm_depot1.dbf";
    set newname for datafile  7 to
 "/u01/app/oracle/oradata/PROD4/catalog_tbs01.dbf";
    restore
    check readonly
    clone database
    ;
 }
 executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 05-APR-14
 using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backupset restore
 channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
 restoring datafile 00001 to /u01/app/oracle/oradata/PROD4/system01.dbf
 restoring datafile 00002 to /u01/app/oracle/oradata/PROD4/undotbs01.dbf
 restoring datafile 00003 to /u01/app/oracle/oradata/PROD4/sysaux01.dbf
 restoring datafile 00004 to /u01/app/oracle/oradata/PROD4/users01.dbf
 restoring datafile 00005 to /u01/app/oracle/oradata/PROD4/mgmt.dbf
 restoring datafile 00006 to /u01/app/oracle/oradata/PROD4/mgmt_ecm_depot1.dbf
 restoring datafile 00007 to /u01/app/oracle/oradata/PROD4/catalog_tbs01.dbf
 channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/product/10.2.0/db_1/dbs/06p4vq2u_1_1
 ORA-19870: error while restoring backup piece /u01/app/oracle/product/10.2.0/db_1/dbs/06p4vq2u_1_1
 ORA-19505: failed to identify file "/u01/app/oracle/product/10.2.0/db_1/dbs/06p4vq2u_1_1"
 ORA-27037: unable to obtain file status
 Linux Error: 2: No such file or directory
 Additional information: 3
 failover to previous backup

RMAN-00571: ===========================================================
 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
 RMAN-00571: ===========================================================
 RMAN-03002: failure of Duplicate Db command at 04/05/2014 15:37:45
 RMAN-03015: error occurred in stored script Memory Script
 RMAN-06026: some targets not found - aborting restore
 RMAN-06023: no backup or copy of datafile 7 found to restore
 RMAN-06023: no backup or copy of datafile 6 found to restore
 RMAN-06023: no backup or copy of datafile 5 found to restore
 RMAN-06023: no backup or copy of datafile 4 found to restore
 RMAN-06023: no backup or copy of datafile 3 found to restore
 RMAN-06023: no backup or copy of datafile 2 found to restore
 RMAN-06023: no backup or copy of datafile 1 found to restore

我失败了,后面该怎么做暂时还不知道。

网上有这么说的:
 duplicate 不等于 可以用 11g 的DB software 直接打开10g的DB , 仍需要 Upgrade 操作。

至于做什么样的upgrade操作,还不得而知。


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • Oracle 数据库开发工具 Oracle SQL Developer
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • 关于JDBC连接Oracle数据库,是否必须有Oracle客户端
  • ORACLE数据库常用字段数据类型介绍
  • win2000+jbuilder6+oracle817编出的程序,在win2000下执行很好,在win98下却访问不了oracle数据库
  • oracle数据库导出和oracle导入数据的二种方法(oracle导入导出数据)
  • Oracle发布Oracle SQL Developer 1.2数据库开发工具 帮助用户简化开发工作
  • 怎样调出ORACLE数据库中的数据,该如何连接?
  • Oracle收购TimesTen 提高数据库软件性能
  • 卸载oracle数据库
  • Oracle数据库恢复后心得
  • linux上安装oracle 数据库后,是否能写shell程序实现数据库的自动启动。
  • Linux下如何用C语言操作Oracle数据库相关的图书推荐
  • Oracle数据库运行Oracle form时避免出现提示信息
  • Oracle欲收购开源数据库MySQL未果
  • 如何在JBuilder中连接Oracle数据库?
  • Oracle数据库访问参数文件的顺序
  • 循序渐进学习Oracle数据库
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle 10g和Oracle 11g网格技术介绍
  • Oracle EBS R12 支持 Oracle Database 11g
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • SCO unix下安装oracle,但没有光盘,请大家推荐一个oracle下载站点(unix版本的)。谢谢!!!!


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,