rman convert 迁移win64位oracle 到linux oracle+asm 手稿

startup mount

alter database open read only;

select open_mode from v$database;

set serveroutput on

declare
    v_check boolean;
    begin
    v_check:=dbms_tdb.check_db('Linux x86 64-bit',dbms_tdb.skip_none);
    end;
    /


 declare
    v_ext boolean;
    begin
    v_ext:=dbms_tdb.check_external;
    end;
    /


select name from v$database;

rman target /

convert database new database 'lixora'
transport script 'c:\bak\trans.sql' to platform 'Linux x86 64-bit'
db_file_name_convert 'C:\APP\ADMINISTRATOR\ORADATA\LIXORA\' 'c:\bak\'
log_file_name_convert 'C:\APP\ADMINISTRATOR\ORADATA\LIXORA\' 'c:\bak\';


+++++++++++++++++++++++++++
C:\Users\Administrator>rman target /


恢复管理器: Release 11.2.0.1.0 - Production on 星期三 8月 5 16:08:23 2015


Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


连接到目标数据库: LIXORA (DBID=3300564341)


RMAN> convert database new database 'LIXORA'
2> transport script 'c:\bak\trans.sql' to platform 'Linux x86 64-bit'
3> db_file_name_convert 'C:\APP\ADMINISTRATOR\ORADATA\LIXORA\' 'c:\bak';


启动 conversion at source 于 05-8月 -15
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=17 设备类型=DISK


在数据库中找到外部表 SH.SALES_TRANSACTIONS_EXT


在数据库中找到目录 SYS.ORACLE_OCM_CONFIG_DIR
在数据库中找到目录 SYS.DATA_PUMP_DIR
在数据库中找到目录 SYS.XMLDIR
在数据库中找到目录 SYS.DATA_FILE_DIR
在数据库中找到目录 SYS.LOG_FILE_DIR
在数据库中找到目录 SYS.MEDIA_DIR
在数据库中找到目录 SYS.SS_OE_XMLDIR
在数据库中找到目录 SYS.SUBDIR


在数据库中找到 BFILE PM.PRINT_MEDIA


在口令文件中找到用户 SYS (具有 SYSDBA and SYSOPER 权限)
通道 ORA_DISK_1: 启动数据文件转换
输入数据文件: 文件号=00001 名称=C:\APP\ADMINISTRATOR\ORADATA\LIXORA\SYSTEM01.DBF


已转换的数据文件 = C:\BAKSYSTEM01.DBF
通道 ORA_DISK_1: 数据文件转换完毕, 经过时间: 00:00:45
通道 ORA_DISK_1: 启动数据文件转换
输入数据文件: 文件号=00002 名称=C:\APP\ADMINISTRATOR\ORADATA\LIXORA\SYSAUX01.DBF


已转换的数据文件 = C:\BAKSYSAUX01.DBF
通道 ORA_DISK_1: 数据文件转换完毕, 经过时间: 00:00:25
通道 ORA_DISK_1: 启动数据文件转换
输入数据文件: 文件号=00005 名称=C:\APP\ADMINISTRATOR\ORADATA\LIXORA\EXAMPLE01.DB
F
已转换的数据文件 = C:\BAKEXAMPLE01.DBF
通道 ORA_DISK_1: 数据文件转换完毕, 经过时间: 00:00:07
通道 ORA_DISK_1: 启动数据文件转换
输入数据文件: 文件号=00003 名称=C:\APP\ADMINISTRATOR\ORADATA\LIXORA\UNDOTBS01.DB
F
已转换的数据文件 = C:\BAKUNDOTBS01.DBF
通道 ORA_DISK_1: 数据文件转换完毕, 经过时间: 00:00:03
通道 ORA_DISK_1: 启动数据文件转换
输入数据文件: 文件号=00004 名称=C:\APP\ADMINISTRATOR\ORADATA\LIXORA\USERS01.DBF
已转换的数据文件 = C:\BAKUSERS01.DBF
通道 ORA_DISK_1: 数据文件转换完毕, 经过时间: 00:00:01
编辑 init.ora 文件 C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\INIT_00
QDRM4I_1_0.ORA。此 PFILE 将用于在目标平台上创建数据库据
在目标平台上运行 SQL 脚本 C:\BAK\TRANS.SQL 以创建数据库
要重新编译所有 PL/SQL 模块, 请在目标平台上运行 utlirp.sql 和 utlrp.sql
要更改内部数据库标识符, 请使用 DBNEWID 实用程序
完成 conversion at source 于 05-8月 -15

RMAN>
+++++++++++++++++++++++++++

目标生产环境为 asm 存储
需要拷贝文件到asm上;


export ORACLE_SID=LIXORA
rman target /
copy datafile '' to  '+data/lixora/datafile';
copy datafile '' to  '+data/lixora/datafile';


根据trans.sql 内容修改控制文件创建脚本,控制文件中相应数据文件名需要和asm 中实际位置对应:
 
-以下为trans.sql 文本内容:
-- 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 PFILE='C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\INIT_00QDRM4I_1_0.ORA'


CREATE CONTROLFILE REUSE SET DATABASE "LIXORA" RESETLOGS  NOARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 'C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\ARCH_D-LIXORA_ID-3300564341_S-4_T-1_A-886951607_03QDRM4I'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 'C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\ARCH_D-LIXORA_ID-3300564341_S-5_T-1_A-886951607_04QDRM4I'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 'C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\ARCH_D-LIXORA_ID-3300564341_S-6_T-1_A-886951607_05QDRM4I'  SIZE 50M BLOCKSIZE 512
DATAFILE
  'C:\BAKSYSTEM01.DBF',
  'C:\BAKSYSAUX01.DBF',
  'C:\BAKUNDOTBS01.DBF',
  'C:\BAKUSERS01.DBF',
  'C:\BAKEXAMPLE01.DBF'
CHARACTER SET ZHS16GBK
;


-- 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 'C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\DATA_D-LIXORA_I-3300564341_TS-TEMP_FNO-1_06QDRM4I'
     SIZE 30408704  AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--


set echo off
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prompt * Your database has been created successfully!
prompt * There are many things to think about for the new database. Here
prompt * is a checklist to help you stay on track:
prompt * 1. You may want to redefine the location of the directory objects.
prompt * 2. You may want to change the internal database identifier (DBID) 
prompt *    or the global database name for this database. Use the 
prompt *    NEWDBID Utility (nid).
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SHUTDOWN IMMEDIATE 

STARTUP UPGRADE PFILE='C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\INIT_00QDRM4I_1_0.ORA'

@@ ?/rdbms/admin/utlirp.sql 

SHUTDOWN IMMEDIATE 

STARTUP PFILE='C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\INIT_00QDRM4I_1_0.ORA'

-- The following step will recompile all PL/SQL modules.
-- It may take serveral hours to complete.
@@ ?/rdbms/admin/utlrp.sql 
set feedback 6;


附录产生的pfile文件:
# Please change the values of the following parameters:
  control_files            = "C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\CF_D-LIXORA_ID-3300564341_01QDRM4I"
  db_recovery_file_dest    = "C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\flash_recovery_area"
  db_recovery_file_dest_size= 4102029312
  audit_file_dest          = "C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_2\DATABASE\ADUMP"
  db_name                  = "LIXORA"

# Please review the values of the following parameters:
# __oracle_base            = "C:\app\Administrator"
  __shared_pool_size       = 100663296
  __large_pool_size        = 4194304
  __java_pool_size         = 4194304
  __streams_pool_size      = 0
  __sga_target             = 176160768
  __db_cache_size          = 58720256
  __shared_io_pool_size    = 0
  remote_login_passwordfile= "EXCLUSIVE"
  db_domain                = ""
  dispatchers              = "(PROTOCOL=TCP) (SERVICE=lixoraXDB)"
  __pga_aggregate_target   = 100663296

# The values of the following parameters are from source database:
  processes                = 150
  nls_language             = "SIMPLIFIED CHINESE"
  nls_territory            = "CHINA"
  memory_target            = 276824064
  db_block_size            = 8192
  compatible               = "11.2.0.0.0"
  undo_tablespace          = "UNDOTBS1"
  audit_trail              = "OS"
  open_cursors             = 30
# diagnostic_dest          = "C:\APP\ADMINISTRATOR"













你可能感兴趣的:(rman convert 迁移win64位oracle 到linux oracle+asm 手稿)