oracle小知識點13--rman convert轉換表空間位元組順序
rman convert可實現不同位元組順序endian_format的表空間轉換,用於不同位元組順序endian_format的跨平臺表空間傳輸.
os: centos 6.6
db version:11.2.0.4.0
以下測試:
[oracle@ct6605 ~]$ sqlplus / as sysdba
##列出支援轉換的平臺及位元組順序
SQL> select * from v$transportable_platform;
/*
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
1 Solaris[tm] OE (32-bit) Big
2 Solaris[tm] OE (64-bit) Big
7 Microsoft Windows IA (32-bit) Little
10 Linux IA (32-bit) Little
6 AIX-Based Systems (64-bit) Big
3 HP-UX (64-bit) Big
5 HP Tru64 UNIX Little
4 HP-UX IA (64-bit) Big
11 Linux IA (64-bit) Little
15 HP Open VMS Little
8 Microsoft Windows IA (64-bit) Little
9 IBM zSeries Based Linux Big
13 Linux x86 64-bit Little
16 Apple Mac OS Big
12 Microsoft Windows x86 64-bit Little
17 Solaris Operating System (x86) Little
18 IBM Power Based Linux Big
19 HP IA Open VMS Little
20 Solaris Operating System (x86-64) Little
21 Apple Mac OS (x86-64) Little
*/
##convert tablespace
#convert tablespace必須在源資料庫執行
#轉換隻是跨平臺不同endian_format傳輸的一部分,其它tts的步驟這裡省略
[oracle@ct6605 ~]$ sqlplus / as sysdba
#將要轉換的表空間只讀
SQL> alter tablespace test read only;
#轉換為'AIX-Based Systems (64-bit)'平臺使用的表空間
[oracle@ct6605 ct66]$ rman target /
RMAN> convert tablespace 'TEST'
to platform 'AIX-Based Systems (64-bit)'
db_file_name_convert '/u02/oradata/ct66','/home/oracle';
##convert datafile
#convert datafile必須在目標庫執行
#配合上rman transport在源庫生成匯入後設資料和資料檔案,convert datafile在目標庫執行,這樣可以免去源庫表空間read only
[oracle@ct6605 ct66]$ rman target /
#轉換為'Linux x86 64-bit'平臺使用的資料檔案
RMAN> convert datafile
'/home/oracle/test01.dbf'
to platform 'Linux x86 64-bit'
from platform 'AIX-Based Systems (64-bit)'
db_file_name_convert '/home/oracle','/home/oracle/test';
##convert database
#convert database是隻支援相同位元組順序endian_format
#convert database可在源庫也可在目標庫執行
#源庫和目標庫的版本要相同
[oracle@ct6605 ~]$ sqlplus / as sysdba
#啟動資料庫到read only模式
SQL> shutdown immediate;
SQL> statup open read only;
#使用dbms_tdb.check_db檢查是否支援轉換
SQL> declare
b_support boolean;
begin
b_support := dbms_tdb.check_db('Linux x86 64-bit', 0);
dbms_output.put_line(case b_support when true then 'support' else
'nonsupport' end);
end;
/
/*
support
*/
#使用dbms_tdb.check_external檢查需要手工處理的部分
SQL> declare
b_external boolean;
begin
b_external := dbms_tdb.check_external;
end;
/
/*
The following directories exist in the database:
SYS.HOME_DUMP, SYS.TSPITR_DIROBJ_DPDIR, SYS.XMLDIR, SYS.ORACLE_OCM_CONFIG_DIR2, SYS.ORACLE_OCM_CONFIG_DIR, SYS.DATA_PUMP_DIR
*/
[oracle@ct6605 ct66]$ rman target /
#開始轉換資料庫
#下面是在源庫轉換的資料庫,也可以透過convert database on target platform上目標庫上轉換.
#在目標庫轉換,convert database on target platform命令也是在源庫執行,用來產生轉換指令碼.
#convert database on target platform命令要加上convert script引數生成轉換檔案指令碼.
RMAN> convert database new database ct66new
transport script '/home/oracle/initdb.sql'
to platform 'Linux x86 64-bit'
db_file_name_convert '/u02/oradata/ct66','/home/oracle';
/*
Starting conversion at source at 08-JAN-16
using channel ORA_DISK_1
Directory SYS.HOME_DUMP found in the database
Directory SYS.TSPITR_DIROBJ_DPDIR found in the database
Directory SYS.XMLDIR found in the database
Directory SYS.ORACLE_OCM_CONFIG_DIR2 found in the database
Directory SYS.ORACLE_OCM_CONFIG_DIR found in the database
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 file number=00001 name=/u02/oradata/ct66/system01.dbf
converted datafile=/home/oracle/system01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00002 name=/u02/oradata/ct66/sysaux01.dbf
converted datafile=/home/oracle/sysaux01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00003 name=/u02/oradata/ct66/undotbs01.dbf
converted datafile=/home/oracle/undotbs01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00005 name=/u02/oradata/ct66/test01.dbf
converted datafile=/home/oracle/test01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00004 name=/u02/oradata/ct66/users01.dbf
converted datafile=/home/oracle/users01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Edit init.ora file /u01/app/oracle/product/11.2.0/db_1/dbs/init_00qqs7jp_1_0.ora. This PFILE will be used to create the database on the target platform
#利用產生的/home/oracle/initdb.sql指令碼在目標庫執行,並透過utlirp.sql重新編譯物件
#/home/oracle/initdb.sql要根據實際的情況做相應的修改,或者手動執行裡面的內容
Run SQL script /home/oracle/initdb.sql on the target platform to create database
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 conversion at source at 08-JAN-16
*/
os: centos 6.6
db version:11.2.0.4.0
以下測試:
[oracle@ct6605 ~]$ sqlplus / as sysdba
##列出支援轉換的平臺及位元組順序
SQL> select * from v$transportable_platform;
/*
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
1 Solaris[tm] OE (32-bit) Big
2 Solaris[tm] OE (64-bit) Big
7 Microsoft Windows IA (32-bit) Little
10 Linux IA (32-bit) Little
6 AIX-Based Systems (64-bit) Big
3 HP-UX (64-bit) Big
5 HP Tru64 UNIX Little
4 HP-UX IA (64-bit) Big
11 Linux IA (64-bit) Little
15 HP Open VMS Little
8 Microsoft Windows IA (64-bit) Little
9 IBM zSeries Based Linux Big
13 Linux x86 64-bit Little
16 Apple Mac OS Big
12 Microsoft Windows x86 64-bit Little
17 Solaris Operating System (x86) Little
18 IBM Power Based Linux Big
19 HP IA Open VMS Little
20 Solaris Operating System (x86-64) Little
21 Apple Mac OS (x86-64) Little
*/
##convert tablespace
#convert tablespace必須在源資料庫執行
#轉換隻是跨平臺不同endian_format傳輸的一部分,其它tts的步驟這裡省略
[oracle@ct6605 ~]$ sqlplus / as sysdba
#將要轉換的表空間只讀
SQL> alter tablespace test read only;
#轉換為'AIX-Based Systems (64-bit)'平臺使用的表空間
[oracle@ct6605 ct66]$ rman target /
RMAN> convert tablespace 'TEST'
to platform 'AIX-Based Systems (64-bit)'
db_file_name_convert '/u02/oradata/ct66','/home/oracle';
##convert datafile
#convert datafile必須在目標庫執行
#配合上rman transport在源庫生成匯入後設資料和資料檔案,convert datafile在目標庫執行,這樣可以免去源庫表空間read only
[oracle@ct6605 ct66]$ rman target /
#轉換為'Linux x86 64-bit'平臺使用的資料檔案
RMAN> convert datafile
'/home/oracle/test01.dbf'
to platform 'Linux x86 64-bit'
from platform 'AIX-Based Systems (64-bit)'
db_file_name_convert '/home/oracle','/home/oracle/test';
##convert database
#convert database是隻支援相同位元組順序endian_format
#convert database可在源庫也可在目標庫執行
#源庫和目標庫的版本要相同
[oracle@ct6605 ~]$ sqlplus / as sysdba
#啟動資料庫到read only模式
SQL> shutdown immediate;
SQL> statup open read only;
#使用dbms_tdb.check_db檢查是否支援轉換
SQL> declare
b_support boolean;
begin
b_support := dbms_tdb.check_db('Linux x86 64-bit', 0);
dbms_output.put_line(case b_support when true then 'support' else
'nonsupport' end);
end;
/
/*
support
*/
#使用dbms_tdb.check_external檢查需要手工處理的部分
SQL> declare
b_external boolean;
begin
b_external := dbms_tdb.check_external;
end;
/
/*
The following directories exist in the database:
SYS.HOME_DUMP, SYS.TSPITR_DIROBJ_DPDIR, SYS.XMLDIR, SYS.ORACLE_OCM_CONFIG_DIR2, SYS.ORACLE_OCM_CONFIG_DIR, SYS.DATA_PUMP_DIR
*/
[oracle@ct6605 ct66]$ rman target /
#開始轉換資料庫
#下面是在源庫轉換的資料庫,也可以透過convert database on target platform上目標庫上轉換.
#在目標庫轉換,convert database on target platform命令也是在源庫執行,用來產生轉換指令碼.
#convert database on target platform命令要加上convert script引數生成轉換檔案指令碼.
RMAN> convert database new database ct66new
transport script '/home/oracle/initdb.sql'
to platform 'Linux x86 64-bit'
db_file_name_convert '/u02/oradata/ct66','/home/oracle';
/*
Starting conversion at source at 08-JAN-16
using channel ORA_DISK_1
Directory SYS.HOME_DUMP found in the database
Directory SYS.TSPITR_DIROBJ_DPDIR found in the database
Directory SYS.XMLDIR found in the database
Directory SYS.ORACLE_OCM_CONFIG_DIR2 found in the database
Directory SYS.ORACLE_OCM_CONFIG_DIR found in the database
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 file number=00001 name=/u02/oradata/ct66/system01.dbf
converted datafile=/home/oracle/system01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00002 name=/u02/oradata/ct66/sysaux01.dbf
converted datafile=/home/oracle/sysaux01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00003 name=/u02/oradata/ct66/undotbs01.dbf
converted datafile=/home/oracle/undotbs01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00005 name=/u02/oradata/ct66/test01.dbf
converted datafile=/home/oracle/test01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00004 name=/u02/oradata/ct66/users01.dbf
converted datafile=/home/oracle/users01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Edit init.ora file /u01/app/oracle/product/11.2.0/db_1/dbs/init_00qqs7jp_1_0.ora. This PFILE will be used to create the database on the target platform
#利用產生的/home/oracle/initdb.sql指令碼在目標庫執行,並透過utlirp.sql重新編譯物件
#/home/oracle/initdb.sql要根據實際的情況做相應的修改,或者手動執行裡面的內容
Run SQL script /home/oracle/initdb.sql on the target platform to create database
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 conversion at source at 08-JAN-16
*/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28539951/viewspace-1974015/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle表空間小知識Oracle
- 傳輸表空間(TTS) - 不同位元組序平臺 RMAN Convert - 1TTS
- 傳輸表空間(TTS) - 不同位元組序平臺 RMAN Convert - 2TTS
- oracle小知識點14--xtts傳輸表空間OracleTTS
- oracle小知識點10--表空間時間點恢復(TSPITR)Oracle
- 傳輸表空間(TTS) - 不同位元組序平臺 RMAN Convert - 5 ASM到ASMTTSASM
- RMAN跨小版本跨平臺與位元組序傳輸表空間
- oracle小知識點12--傳輸表空間通過rmanOracle
- 傳輸表空間(TTS) - 不同位元組序平臺 RMAN Convert - 3 檔案系統TTS
- oracle小知識點11--傳輸表空間通過impdp/expdpOracle
- 分享:大端小端-位元組儲存順序
- 傳輸表空間(TTS) - 不同位元組序平臺 RMAN Convert - 4 檔案系統到ASMTTSASM
- c# 主機和網路位元組序的轉換 關於網路位元組序和主機位元組序的轉換C#
- 網路通訊時位元組序轉換原理與網路位元組序、大端和小端模式模式
- 同位元組序跨平臺表空間傳輸的測試
- 傳輸表空間(TTS) - 不同位元組序平臺 RMAN Convert - 6 使用RMAN增量備減少停機時間TTS
- 第五篇:主機位元組序與網路位元組序的轉換
- 異構OS平臺的不同點 - 位元組順序
- oracle10g_rman_cross os_同位元組序_convert databaseOracleROSDatabase
- 大端序、小端序、網路位元組序
- oracle臨時表空間組Oracle
- Oracle Temp 表空間切換Oracle
- oracle檢查 小表空間Oracle
- 將字典管理表空間轉換為本地管理表空間
- mac os 工作空間 桌面順序Mac
- ORACLE線上切換undo表空間Oracle
- Oracle undo表空間切換(ZT)Oracle
- 漢字-字母-位元組-位之間的轉換
- nodejs字元與位元組之間的轉換NodeJS字元
- 位元組陣列轉浮點數線上轉換器陣列
- 位元組編碼轉換
- 轉換協議位元組協議
- [轉移]ORACLE MOVE 表空間Oracle
- 雜湊表知識點小結
- php名稱空間的呼叫順序PHP
- float浮點數線上轉位元組陣列轉換工具陣列
- imp/EXP 表空間轉換問題
- 理解位元組序