rmanconvert遷移win64位oracle到linuxoracle+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"