windows平臺下Oracle10.2 RMAN資料庫遷移至Linux平臺下

huangdazhu發表於2015-10-10
windows平臺下Oracle10.2 rman資料庫遷移至Linux平臺Oracle 10.2下

1.Convert database特性介紹
 
1)、只能傳輸資料表空間的資料檔案。臨時表空間將不會被傳輸,如果臨時表空間是本地管理的話,那麼傳輸資料庫完成後將會自動在目標資料庫建立臨時表空間。
 
2)、假如源主資料庫使用PFILE,那麼PFILE也會被傳輸。如果源資料庫使用的是SPFILE,那麼將會自動產生一個PFILE進行傳輸,並在目標資料庫生成SPFILE。
 
3)、控制檔案和聯機日誌檔案將不會被傳輸。在目標資料庫open resetlogs的過程中,將會自動建立控制檔案和聯機日誌檔案。
 
4)、 BFILE、外部表和directory將不會被傳輸。RMAN檢查的時候將會把這些物件列出,使用者可以手工建立這些物件。
 
5)、密碼檔案將不會被傳輸,使用者必須在目標資料庫手工建立密碼檔案。
 
傳輸資料庫的第一步是將源資料庫置於READ ONLY模式

SQL> shutdown immediate
資料庫已經關閉。
已經解除安裝資料庫。
ORACLE 例程已經關閉。
SQL> startup mount;
ORACLE 例程已經啟動。

Total System Global Area 1073741824 bytes
Fixed Size                  1307424 bytes
Variable Size             297798880 bytes
Database Buffers          767557632 bytes
Redo Buffers                7077888 bytes
資料庫裝載完畢。
SQL> alter database open read only;

資料庫已更改。

 

2.檢視ORACLE 10g可以支援轉換的目標資料庫的平臺

SQL> set linesize 300

##源資料庫(windows平臺)的ENDIAN

SQL> SELECT D.PLATFORM_NAME, ENDIAN_FORMAT
  2    FROM V$TRANSPORTABLE_PLATFORM. TP, V$DATABASE D
  3   WHERE TP.PLATFORM_NAME = D.PLATFORM_NAME;

PLATFORM_NAME                            ENDIAN_FORMAT
---------------------------------------- --------------------
Microsoft Windows IA (32-bit)            Little

 

SQL> col PLATFORM_NAME for a40;

##支援轉換的目的資料庫平臺(在10G中進行全庫跨平臺的遷移,那麼只能在低位和低位或者高位和高位平臺之間進行遷移,無法進行高位與低位平臺的遷移
SQL> select * from V$TRANSPORTABLE_PLATFORM. order by 3;

PLATFORM_ID PLATFORM_NAME                            ENDIAN_FORMAT
----------- ---------------------------------------- --------------------
          6 AIX-Based Systems (64-bit)               Big
         18 IBM Power Based Linux                    Big
          2 Solaris[tm] OE (64-bit)                  Big
          4 HP-UX IA (64-bit)                        Big
         16 Apple Mac OS                             Big
          1 Solaris[tm] OE (32-bit)                  Big
          9 IBM zSeries Based Linux                  Big
          3 HP-UX (64-bit)                           Big
         17 Solaris Operating System (x86)           Little
         20 Solaris Operating System (x86-64)        Little
         12 Microsoft Windows x86 64-bit             Little

PLATFORM_ID PLATFORM_NAME                            ENDIAN_FORMAT
----------- ---------------------------------------- --------------------
         13 Linux x86 64-bit                         Little
          8 Microsoft Windows IA (64-bit)            Little
         19 HP IA Open VMS                           Little
         11 Linux IA (64-bit)                        Little
          5 HP Tru64 UNIX                            Little
         10 Linux IA (32-bit)                        Little
          7 Microsoft Windows IA (32-bit)            Little
         15 HP Open VMS                              Little

已選擇19行。

 

3. convert database前檢查

利用dbms_tdb包檢查資料庫能否被傳輸以及列出外部表和DIRECTORY等無法傳輸的物件資訊(本次是Microsoft Windows IA (32-bit)平臺遷移至Linux IA (32-bit)平臺)

SQL> set serveroutput on
SQL> declare
  2  db_ready boolean;
  3  begin
  4  db_ready := dbms_tdb.check_db('Linux IA (32-bit)',dbms_tdb.skip_none);
  5  end;
  6  /

PL/SQL 過程已成功完成。

 

##使用dbms_tdb.check_external檢查資料庫中是否存在外部表、目錄和BFILEs,RMAN不能自動傳輸這些檔案,需要手動複製和建立目錄

SQL> declare
  2  external boolean;
  3  begin
  4  external := dbms_tdb.check_external;
  5  end;
  6  /
The following external tables exist in the database:
SH.SALES_TRANSACTIONS_EXT
The following directories exist in the database:
SYS.TTS_EXP, SYS.ORACLE_OCM_CONFIG_DIR2, SYS.ORACLE_OCM_CONFIG_DIR, SYS.DATA_DUM
P, SYS.DIR, SYS.DATA_PUMP_DIR, SYS.SUBDIR, SYS.XMLDIR, SYS.MEDIA_DIR, SYS.LOG_FI
LE_DIR, SYS.DATA_FILE_DIR
The following BFILEs exist in the database:
PM.PRINT_MEDIA

PL/SQL 過程已成功完成。

 

5.使用RMAN轉換資料庫

D:\>rman target /

恢復管理器: Release 10.2.0.5.0 - Production on 星期三 2月 27 16:25:17 2013

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

連線到目標資料庫: ORA10G (DBID=4098065600)

RMAN> convert database new database 'ora10g' transport script. 'd:\backup\transpo
rtdb.sql' to platform. 'Linux IA (32-bit)' db_file_name_convert 'D:\ORACLE\PRODUC
T\10.2.0\ORADATA\ORA10G' 'D:\backup';

啟動 convert 於 27-2月 -13
使用目標資料庫控制檔案替代恢復目錄
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=152 devtype=DISK

在資料庫中找到外部表 SH.SALES_TRANSACTIONS_EXT

在資料庫中找到目錄 SYS.TTS_EXP
在資料庫中找到目錄 SYS.ORACLE_OCM_CONFIG_DIR2
在資料庫中找到目錄 SYS.ORACLE_OCM_CONFIG_DIR
在資料庫中找到目錄 SYS.DATA_DUMP
在資料庫中找到目錄 SYS.DIR
在資料庫中找到目錄 SYS.DATA_PUMP_DIR
在資料庫中找到目錄 SYS.SUBDIR
在資料庫中找到目錄 SYS.XMLDIR
在資料庫中找到目錄 SYS.MEDIA_DIR
在資料庫中找到目錄 SYS.LOG_FILE_DIR
在資料庫中找到目錄 SYS.DATA_FILE_DIR
在資料庫中找到目錄 SYS.WORK_DIR
在資料庫中找到目錄 SYS.ADMIN_DIR

在資料庫中找到 BFILE PM.PRINT_MEDIA

在口令檔案中找到使用者 SYS (具有 SYSDBA and SYSOPER 許可權)
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00002 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\UNDOTBS01.DB
F
在檔案 D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\UNDOTBS01.DBF 的轉換期間發現一些
損壞的塊
已轉換的資料檔案 = D:\BACKUP\UNDOTBS01.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:55
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00008 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\TS_DB_DATA01
.DBF
已轉換的資料檔案 = D:\BACKUP\TS_DB_DATA01.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:45
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00001 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\SYSTEM01.DBF

已轉換的資料檔案 = D:\BACKUP\SYSTEM01.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:15
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00003 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\SYSAUX01.DBF

已轉換的資料檔案 = D:\BACKUP\SYSAUX01.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:15
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00006 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\WAP_USER_DAT
A_TABLESPACE01.DBF
已轉換的資料檔案 = D:\BACKUP\WAP_USER_DATA_TABLESPACE01.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:15
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00033 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\TEST01.DBF
已轉換的資料檔案 = D:\BACKUP\TEST01.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:07
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00005 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\EXAMPLE01.DB
F
已轉換的資料檔案 = D:\BACKUP\EXAMPLE01.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:07
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00032 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\UNDOTBS02.DB
F
已轉換的資料檔案 = D:\BACKUP\UNDOTBS02.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:03
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00034 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\TEST02.DBF
已轉換的資料檔案 = D:\BACKUP\TEST02.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:03
通道 ORA_DISK_1: 啟動資料檔案轉換
輸入資料檔案 fno=00004 name=D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G\USERS01.DBF
已轉換的資料檔案 = D:\BACKUP\USERS01.DBF
通道 ORA_DISK_1: 資料檔案轉換完畢, 經過時間: 00:00:01
在目標平臺上執行 SQL 指令碼 D:\BACKUP\TRANSPORTDB.SQL 以建立資料庫
編輯 init.ora 檔案 D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\INIT_00O31IUF_1_0.ORA
。此 PFILE 將用於在目標平臺上建立資料庫據
要重新編譯所有 PL/SQL 模組, 請在目標平臺上執行 utlirp.sql 和 utlrp.sql
要更改內部資料庫識別符號, 請使用 DBNEWID 實用程式
完成 backup 於 27-2月 -13

RMAN>

 

注:

1)、new database表示目標資料庫的名字

2)、transport script指定生成建庫指令碼的位置

3)、to platform表示目標資料庫的平臺

4)、db_file_name_convert中

指定源資料庫資料檔案所在的位置為:'D:\ORACLE\PRODUCT\10.2.0\ORADATA\ORA10G'

轉換後資料檔案存放的目錄為:''D:\backup'

 

6.修改生成的引數檔案

透過檢視RMAN轉換時生成的指令碼D:\backup\TRANSPORTDB.SQL,可以找到生的的初始化引數檔案是:D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\INIT_00O31IUF_1_0.ORA

由於WINLINUX的目錄結構區別太大,我們需要修改這個指令碼以適應LINUX平臺。特別要注意大小寫。修改完成之後我們把它複製到目標資料庫的相關位置。

TRANSPORTDB.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='D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\INIT_00O31IUF_1_0.ORA'
CREATE CONTROLFILE REUSE SET DATABASE "ORA10G" RESETLOGS FORCE LOGGING ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 SIZE 50M,
  GROUP 2 SIZE 50M,
  GROUP 3 SIZE 50M
DATAFILE
  'D:\BACKUP\SYSTEM01.DBF',
  'D:\BACKUP\UNDOTBS01.DBF',
  'D:\BACKUP\SYSAUX01.DBF',
  'D:\BACKUP\USERS01.DBF',
  'D:\BACKUP\EXAMPLE01.DBF',
  'D:\BACKUP\WAP_USER_DATA_TABLESPACE01.DBF',
  'D:\BACKUP\TS_DB_DATA01.DBF',
  'D:\BACKUP\UNDOTBS02.DBF',
  'D:\BACKUP\TEST01.DBF',
  'D:\BACKUP\TEST02.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
     SIZE 524288000  AUTOEXTEND OFF;
-- 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='D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\INIT_00O31IUF_1_0.ORA'
@@ ?/rdbms/admin/utlirp.sql
SHUTDOWN IMMEDIATE
STARTUP PFILE='D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\INIT_00O31IUF_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;

 

初始化引數檔案INIT_00O31IUF_1_0.ORA內容如下:

# Please change the values of the following parameters:

  control_files            = "D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\CF_D-ORA10G_ID-4098065600_00O31IUF"

  db_create_file_dest      = "D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\ora10g"

  db_recovery_file_dest    = "D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\flash_recovery_area"

  db_recovery_file_dest_size= 2147483648

  service_names            = "ORA10G"

  audit_file_dest          = "D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\ADUMP"

  background_dump_dest     = "D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\BDUMP"

  user_dump_dest           = "D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\UDUMP"

  core_dump_dest           = "D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\CDUMP"

  db_name                  = "ORA10G"

 

# Please review the values of the following parameters:

  __shared_pool_size       = 281018368

  __large_pool_size        = 4194304

  __java_pool_size         = 8388608

  __streams_pool_size      = 4194304

# db_file_name_convert     = "oradata\oracle10g"

# db_file_name_convert     = "oradata\ora10g"

# log_file_name_convert    = "oradata\oracle10g"

# log_file_name_convert    = "oradata\ora10g"

  __db_cache_size          = 767557632

  standby_archive_dest     = ""

  fal_client               = "oracle10g"

  fal_server               = "ora10g"

  remote_login_passwordfile= "EXCLUSIVE"

  db_domain                = ""

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

 

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

  processes                = 150

  sga_max_size             = 1073741824

  nls_length_semantics     = "BYTE"

  resource_manager_plan    = ""

  sga_target               = 1073741824

  db_block_size            = 8192

  compatible               = "10.2.0.1.0"

  log_archive_config       = "DG_CONFIG=(ora10g"

  log_archive_config       = "oracle10g)"

# log_archive_dest_1       = "LOCATION=D:\oracle\product\10.2.0\oradata\ora10g\ARCHIVELOG\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ora10g"

  log_archive_dest_2       = "SERVICE=oracle10g LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=oracle10g"

  log_archive_dest_state_1 = "enable"

  log_archive_dest_state_2 = "enable"

  db_file_multiblock_read_count= 16

  standby_file_management  = "AUTO"

  fast_start_mttr_target   = 10

  undo_management          = "AUTO"

  undo_tablespace          = "UNDOTBS1"

  undo_retention           = 900

  job_queue_processes      = 10

  open_cursors             = 300

  pga_aggregate_target     = 524288000

  aq_tm_processes          = 0

修改後的初始化引數檔案內容INIT.ORA如下:

# Please change the values of the following parameters:

  control_files            = "/home/oracle/oradata/ora10g/CONTROL.CTL"

  db_create_file_dest      = "/home/oracle/oradata/ora10g"

  db_recovery_file_dest    = "/home/oracle/flash_recovery_area"

  db_recovery_file_dest_size= 2147483648

  service_names            = "ORA10G"

  audit_file_dest          = "/home/oracle/admin/ora10g/adump"

  background_dump_dest     = "/home/oracle/admin/ora10g/bdump"

  user_dump_dest           = "/home/oracle/admin/ora10g/udump"

  core_dump_dest           = "/home/oracle/admin/ora10g/cdump"

  db_name                  = "ORA10G"

 

# Please review the values of the following parameters:

  __shared_pool_size       = 281018368

  __large_pool_size        = 4194304

  __java_pool_size         = 8388608

  __streams_pool_size      = 4194304

# db_file_name_convert     = "oradata\oracle10g"

# db_file_name_convert     = "oradata\ora10g"

# log_file_name_convert    = "oradata\oracle10g"

# log_file_name_convert    = "oradata\ora10g"

  __db_cache_size          = 767557632

  standby_archive_dest     = ""

  fal_client               = "oracle10g"

  fal_server               = "ora10g"

  remote_login_passwordfile= "EXCLUSIVE"

  db_domain                = ""

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

 

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

  processes                = 150

  sga_max_size             = 1073741824

  nls_length_semantics     = "BYTE"

  resource_manager_plan    = ""

  sga_target               = 1073741824

  db_block_size            = 8192

  compatible               = "10.2.0.1.0"

  log_archive_config       = "DG_CONFIG=(ora10g"

  log_archive_config       = "oracle10g)"

# log_archive_dest_1       = "LOCATION=D:\oracle\product\10.2.0\oradata\ora10g\ARCHIVELOG\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ora10g"

  log_archive_dest_2       = "SERVICE=oracle10g LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=oracle10g"

  log_archive_dest_state_1 = "enable"

  log_archive_dest_state_2 = "enable"

  db_file_multiblock_read_count= 16

  standby_file_management  = "AUTO"

  fast_start_mttr_target   = 10

  undo_management          = "AUTO"

  undo_tablespace          = "UNDOTBS1"

  undo_retention           = 900

  job_queue_processes      = 10

  open_cursors             = 300

  pga_aggregate_target     = 524288000

  aq_tm_processes          = 0

 

修改後的轉換RMAN轉換指令碼TRANSPORTDB.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='/rong/backup/INIT.ORA'
CREATE CONTROLFILE REUSE SET DATABASE "ORA10G" RESETLOGS FORCE LOGGING ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/home/oracle/oradata/ora10g/REDO01.LOG' SIZE 50M,
  GROUP 2 '/home/oracle/oradata/ora10g/REDO02.LOG' SIZE 50M,
  GROUP 3 '/home/oracle/oradata/ora10g/REDO03.LOG' SIZE 50M
DATAFILE
  '/home/oracle/oradata/ora10g/SYSTEM01.DBF',
  '/home/oracle/oradata/ora10g/UNDOTBS01.DBF',
  '/home/oracle/oradata/ora10g/SYSAUX01.DBF',
  '/home/oracle/oradata/ora10g/USERS01.DBF',
  '/home/oracle/oradata/ora10g/EXAMPLE01.DBF',
  '/home/oracle/oradata/ora10g/WAP_USER_DATA_TABLESPACE01.DBF',
  '/home/oracle/oradata/ora10g/TS_DB_DATA01.DBF',
  '/home/oracle/oradata/ora10g/UNDOTBS02.DBF',
  '/home/oracle/oradata/ora10g/TEST01.DBF',
  '/home/oracle/oradata/ora10g/TEST02.DBF'
CHARACTER SET ZHS16GBK
;

-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.

RECOVER DATABASE USING BACKUP CONTROLFILE

-- 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
     SIZE 524288000  AUTOEXTEND OFF;
-- 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='/rong/backup/INIT.ORA'
@@ ?/rdbms/admin/utlirp.sql
SHUTDOWN IMMEDIATE
STARTUP PFILE='/rong/backup/INIT.ORA'
-- The following step will recompile all PL/SQL modules.
-- It may take serveral hours to complete.
@@ ?/rdbms/admin/utlrp.sql
set feedback 6;

7.將修改後的引數檔案INIT.ORA和RMAN轉換指令碼TRANSPORTDB.SQL上次至目標資料庫伺服器相關位置上

 

8.在目標資料庫上還原資料庫

確保在源資料庫上(windows平臺)RMAN轉換生成的資料檔案已上傳至目標資料庫對應位置上,並確保上述引數檔案INIT.ORA中提到的目錄已建立(如*dump目錄)

a.在目標資料庫上僅安裝資料庫軟體

b.在目標資料庫上建立如下目錄

/home/oracle/oradata/ora10g

/home/oracle/flash_recovery_area

/home/oracle/admin/ora10g/adump

/home/oracle/admin/ora10g/bdump

/home/oracle/admin/ora10g/udump

/home/oracle/admin/ora10g/cdump

 

9.

[oracle@localhost ~]$ export ORACLE_SID=ora10g
[oracle@localhost ~]$ sqlplus /nolog

SQL*Plus: Release 10.2.0.5.0 - Production on Wed Mar 6 20:42:49 2013

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.

SQL> conn / as sysdba
Connected to an idle instance.

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28869493/viewspace-1813715/,如需轉載,請註明出處,否則將追究法律責任。

相關文章