当前所在位置:珠峰网资料 >> 计算机 >> Oracle认证 >> 正文
Oracle10g同字节序跨平台迁移(三)
发布时间:2010/9/14 9:41:49 来源:www.xue.net 编辑:城市总裁吧

  3. 检查外部对象

  使用DBMS_TDB.CHECK_EXTERNAL来识别外部表、Directories或BFILES等,这些对象所指向的外部数据不能被RMAN自动转移。

  SQL> set serveroutput on

  SQL> declare

  2 external boolean;

  3 begin

  4 external := dbms_tdb.check_external;

  5 end;

  6 /

  The following directories exist in the database:

  SYS.DATA_PUMP_DIR

  PL/SQL procedure successfully completed.

  如果数据库中存在外部表、DIRECTORIES等,则以上过程执行后的输出与以上类似。

  4. 使用RMAN进行跨平台文件迁移

  执行跨平台迁移首先要通过RMAN对数据文件进行转换,RMAN执行过程如下:

  [oracle@danaly eygle]$ rman target /

  Recovery Manager: Release 10.2.0.1.0 - Production on Sat Jun 23 23:06:52 2007

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

  connected to target database: EYGLE (DBID=1445136501)

  RMAN> CONVERT DATABASE NEW DATABASE 'JULIA'

  2> TRANSPORT SCRIPT '/opt/oracle/oradata/transport/transport.sql'

  3> TO PLATFORM 'Microsoft Windows IA (32-bit)'

  4> DB_FILE_NAME_CONVERT '/opt/oracle/oradata/eygle/EYGLE/datafile' '/opt/oracle/oradata/transport';

  Starting convert at 23-JUN-07

  using target database control file instead of recovery catalog

  allocated channel: ORA_DISK_1

  channel ORA_DISK_1: sid=159 devtype=DISK

  Directory SYS.DATA_PUMP_DIR found in the database

  User SYS with SYSDBA and SYSOPER privilege found in password file

  channel ORA_DISK_1: starting datafile conversion

  input datafile

  fno=00001 name=/opt/oracle/oradata/eygle/EYGLE/datafile/o1_mf_system_37tc1xns_.dbf

  converted datafile=/opt/oracle/oradata/transport/o1_mf_system_37tc1xns_.dbf

  channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15

  channel ORA_DISK_1: starting datafile conversion

  input datafile

  fno=00002 name=/opt/oracle/oradata/eygle/EYGLE/datafile/o1_mf_undotbs1_37tc29mb_.dbf

  converted datafile=/opt/oracle/oradata/transport/o1_mf_undotbs1_37tc29mb_.dbf

  channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07

  channel ORA_DISK_1: starting datafile conversion

  input datafile

  fno=00003 name=/opt/oracle/oradata/eygle/EYGLE/datafile/o1_mf_sysaux_37tc2gqc_.dbf

  converted datafile=/opt/oracle/oradata/transport/o1_mf_sysaux_37tc2gqc_.dbf

  channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07

  channel ORA_DISK_1: starting datafile conversion

  input datafile

  fno=00004 name=/opt/oracle/oradata/eygle/EYGLE/datafile/o1_mf_users_37tc2tth_.dbf

  converted datafile=/opt/oracle/oradata/transport/o1_mf_users_37tc2tth_.dbf

  channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01

  Run SQL script /opt/oracle/oradata/transport/transport.sql on the target platform to create database

  Edit init.ora file /opt/oracle/product/10.2.0/dbs/init_00il1i4r_1_0.ora. This PFILE will be used to create the database on the target platform

  To recompile all PL/SQL modules, run utlirp.sql and utlrp.sql on the target platform

  To change the internal database identifier, use DBNEWID Utility

  Finished backup at 23-JUN-07

  RMAN的转换语句中指定生成一个转换脚本transport.sql用于参考,转换的目标平台是Microsoft Windows IA (32-bit),所有的数据文件转换后存放在一个新的目录下。

  最后RMAN还自动生成一个参数文件,这个文件是init_00il1i4r_1_0.ora,这个参数文件里包含了一些重要的初始化参数,可以根据需要进行相应的更改,由于平台以及路径的不同,很多涉及路径的参数都需要进行变更,这个参数文件的内容大致分为三个部分。

  第一部分列出需要修改的参数:

  # Please change the values of the following parameters:

  control_files = "/opt/oracle/product/10.2.0/dbs/cf_D-JULIA_id-1445136501_00il1i4r"

  db_create_file_dest = "/opt/oracle/product/10.2.0/dbs/eygle"

  db_recovery_file_dest = "/opt/oracle/product/10.2.0/dbs/flash_recovery_area"

  db_recovery_file_dest_size= 2147483648

  background_dump_dest = "/opt/oracle/product/10.2.0/dbs/bdump"

  user_dump_dest = "/opt/oracle/product/10.2.0/dbs/udump"

  core_dump_dest = "/opt/oracle/product/10.2.0/dbs/cdump"

  audit_file_dest = "/opt/oracle/product/10.2.0/dbs/adump"

  db_name = "JULIA"

  第二部分列出了建议Review的参数:

  # Please review the values of the following parameters:

  remote_login_passwordfile= "EXCLUSIVE"

  db_domain = ""

  dispatchers = "(PROTOCOL=TCP) (SERVICE=eygleXDB)"

  第三部分列出了来自于源数据库的一些特殊设置,这些参数可以酌情修改:

  # The values of the following parameters are from source database:

  processes = 150

  sga_target = 943718400

  db_block_size = 8192

  compatible = "10.2.0.1.0"

  db_file_multiblock_read_count= 16

  undo_management = "AUTO"

  undo_tablespace = "UNDOTBS1"

  job_queue_processes = 10

  open_cursors = 300

  pga_aggregate_target = 314572800

  参数文件的内容我们可以在新的平台上重新创建,这个参数文件可以作为参考。

广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved