Oracle Transport Tablespace by RMAN

前面测试了使用传统的方法传输表空间需要对表空间进行离线,由于生产库一般不能离线操作,所以传统方法存在一定的局限性.
使用RMAN可以在保证表空间在线的状态下进行传输.

(1)完全备份数据库
RMAN> backup database plus archivelog;

(2)使用RMAN在源库创建4个文件.但该步骤出错了,如下.

RMAN> transport tablespace tsmgmt_ts4 tablespace destination '/oracle/home/test/td' auxiliary destination '/home/oracle/test/ad';

RMAN-05026: WARNING: presuming following set of tablespaces applies to specified point in time

List of tablespaces expected to have UNDO segments
tablespace SYSTEM
tablespace UNDOTBS1

Creating automatic instance, with SID='pqce'

initialization parameters used for automatic instance:
db_name=HDB
compatible=10.2.0.1.0
db_block_size=8192
db_files=200
db_unique_name=tspitr_HDB_pqce
large_pool_size=1M
shared_pool_size=110M
#No auxiliary parameter file used
db_create_file_dest=/home/oracle/test/ad
control_files=/home/oracle/test/ad/cntrl_tspitr_HDB_pqce.f


starting up automatic instance HDB
Oracle instance started

Total System Global Area     205520896 bytes

Fixed Size                     1218508 bytes
Variable Size                146802740 bytes
Database Buffers              50331648 bytes
Redo Buffers                   7168000 bytes
Automatic instance created

contents of Memory Script:
{
# set the until clause
set until  scn 4949276;
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log for tspitr to a resent until time
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
}
executing Memory Script

executing command: SET until clause

Starting restore at 20-APR-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=37 devtype=DISK

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/HDB/autobackup/2012_04_20/o1_mf_s_781099983_7s1rlwok_.bkp
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/flash_recovery_area/HDB/autobackup/2012_04_20/o1_mf_s_781099983_7s1rlwok_.bkp tag=TAG20120420T121303
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
output filename=/home/oracle/test/ad/cntrl_tspitr_HDB_pqce.f
Finished restore at 20-APR-12

sql statement: alter database mount clone database

sql statement: alter system archive log current

sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;
released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1

contents of Memory Script:
{
# generated tablespace point-in-time recovery script
# set the until clause
set until  scn 4949276;
# set an omf destination filename for restore
set newname for clone datafile  1 to new;
# set an omf destination filename for restore
set newname for clone datafile  2 to new;
# set an omf destination filename for restore
set newname for clone datafile  3 to new;
# set an omf destination tempfile
set newname for clone tempfile  1 to new;
# set a destination filename for restore
set newname for datafile  16 to
 "/oracle/home/test/td/tsmgmt_ts4.ora";
# rename all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set plus the auxilliary tablespaces
restore clone datafile  1, 2, 3, 16;
switch clone datafile all;
#online the datafiles restored or flipped
sql clone "alter database datafile  1 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  2 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  3 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  16 online";
# make the controlfile point at the restored datafiles, then recover them
recover clone database tablespace  "TSMGMT_TS4", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
# PLUG HERE the creation of a temporary tablespace if export fails due to lack
# of temporary space.
# For example in Unix these two lines would do that:
#sql clone "create tablespace aux_tspitr_tmp
#           datafile ''/tmp/aux_tspitr_tmp.dbf'' size 500K";
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed temporary file 1 to /home/oracle/test/ad/TSPITR_HDB_PQCE/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 20-APR-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=39 devtype=DISK

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /home/oracle/test/ad/TSPITR_HDB_PQCE/datafile/o1_mf_system_%u_.dbf
restoring datafile 00002 to /home/oracle/test/ad/TSPITR_HDB_PQCE/datafile/o1_mf_undotbs1_%u_.dbf
restoring datafile 00003 to /home/oracle/test/ad/TSPITR_HDB_PQCE/datafile/o1_mf_sysaux_%u_.dbf
restoring datafile 00016 to /oracle/home/test/td/tsmgmt_ts4.ora
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/HDB/backupset/2012_04_20/o1_mf_nnndf_FULL_DATA_7s1og29b_.bkp
ORA-19870: error reading backup piece /u01/app/oracle/flash_recovery_area/HDB/backupset/2012_04_20/o1_mf_nnndf_FULL_DATA_7s1og29b_.bkp
ORA-19504: failed to create file "/oracle/home/test/td/tsmgmt_ts4.ora"
ORA-27040: file create error, unable to create file
Linux Error: 2: No such file or directory
failover to previous backup


Removing automatic instance
shutting down automatic instance
Oracle instance shut down
Automatic instance removed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of tranport tablespace command at 04/20/2012 14:15:27
RMAN-03015: error occurred in stored script Memory Script
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore

RMAN>

发现是文件路径出错了,/oracle/home/test/td/tsmgmt_ts4.ora!!!!!

接下来在RAC上测试

RMAN> backup database format '/home/oracle/backup/%U';
Starting backup at 21-APR-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=+DATA/jrprod/datafile/system.275.779728799
input datafile fno=00003 name=+DATA/jrprod/datafile/sysaux.276.779728801
input datafile fno=00006 name=+DATA/jrprod/datafile/omf_ts.292.780350751
input datafile fno=00002 name=+DATA/jrprod/datafile/undotbs1.277.779728801
input datafile fno=00005 name=+DATA/jrprod/datafile/undotbs2.283.779729107
input datafile fno=00004 name=+DATA/jrprod/datafile/users.278.779728801
channel ORA_DISK_1: starting piece 1 at 21-APR-12
channel ORA_DISK_1: finished piece 1 at 21-APR-12
piece handle=/home/oracle/backup/13n905rb_1_1 tag=TAG20120421T143835 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:05
Finished backup at 21-APR-12

Starting Control File and SPFILE Autobackup at 21-APR-12
piece handle=+RECOVERY/jrprod/autobackup/2012_04_21/s_781195301.379.781195303 comment=NONE
Finished Control File and SPFILE Autobackup at 21-APR-12

RMAN> sql 'alter system archive log current';

sql statement: alter system archive log current

RMAN> backup archivelog all format '/home/oracle/backup/%U'; 

Starting backup at 21-APR-12
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=24 recid=43 stamp=781194086
input archive log thread=1 sequence=25 recid=44 stamp=781194284
input archive log thread=1 sequence=26 recid=46 stamp=781194531
input archive log thread=1 sequence=27 recid=49 stamp=781195400
input archive log thread=1 sequence=28 recid=50 stamp=781195454
input archive log thread=2 sequence=19 recid=41 stamp=781189273
input archive log thread=2 sequence=20 recid=42 stamp=781194080
input archive log thread=2 sequence=21 recid=45 stamp=781194284
input archive log thread=2 sequence=22 recid=47 stamp=781194532
input archive log thread=2 sequence=23 recid=48 stamp=781195399
input archive log thread=2 sequence=24 recid=51 stamp=781195455
channel ORA_DISK_1: starting piece 1 at 21-APR-12
channel ORA_DISK_1: finished piece 1 at 21-APR-12
piece handle=/home/oracle/backup/15n90662_1_1 tag=TAG20120421T144417 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26
Finished backup at 21-APR-12

Starting Control File and SPFILE Autobackup at 21-APR-12
piece handle=+RECOVERY/jrprod/autobackup/2012_04_21/s_781195484.386.781195485 comment=NONE
Finished Control File and SPFILE Autobackup at 21-APR-12

RMAN> transport tablespace omf_ts tablespace destination '/home/oracle/test/td' auxiliary destination '/home/oracle/test/ad';

RMAN-05026: WARNING: presuming following set of tablespaces applies to specified point in time

List of tablespaces expected to have UNDO segments
tablespace SYSTEM
tablespace UNDOTBS1
tablespace UNDOTBS2

Creating automatic instance, with SID='xeEz'

initialization parameters used for automatic instance:
db_name=JRPROD
compatible=10.2.0.1.0
db_block_size=8192
db_files=200
db_unique_name=tspitr_JRPROD_xeEz
large_pool_size=1M
shared_pool_size=110M
#No auxiliary parameter file used
db_create_file_dest=/home/oracle/test/ad
control_files=/home/oracle/test/ad/cntrl_tspitr_JRPROD_xeEz.f


starting up automatic instance JRPROD

Oracle instance started

Total System Global Area     201326592 bytes

Fixed Size                     1218508 bytes
Variable Size                146802740 bytes
Database Buffers              50331648 bytes
Redo Buffers                   2973696 bytes
Automatic instance created

contents of Memory Script:
{
# set the until clause
set until  scn 1605367;
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log for tspitr to a resent until time
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
}
executing Memory Script

executing command: SET until clause

Starting restore at 21-APR-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=34 devtype=DISK

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece +RECOVERY/jrprod/autobackup/2012_04_21/s_781195301.379.781195303
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=+RECOVERY/jrprod/autobackup/2012_04_21/s_781195301.379.781195303 tag=TAG20120421T144141
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
output filename=/home/oracle/test/ad/cntrl_tspitr_JRPROD_xeEz.f
Finished restore at 21-APR-12

sql statement: alter database mount clone database

sql statement: alter system archive log current

sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;
released channel: ORA_DISK_1
released channel: ORA_AUX_DISK_1

contents of Memory Script:
{
# generated tablespace point-in-time recovery script
# set the until clause
set until  scn 1605367;
# set an omf destination filename for restore
set newname for clone datafile  1 to new;
# set an omf destination filename for restore
set newname for clone datafile  2 to new;
# set an omf destination filename for restore
set newname for clone datafile  5 to new;
# set an omf destination filename for restore
set newname for clone datafile  3 to new;
# set an omf destination tempfile
set newname for clone tempfile  1 to new;
# set a destination filename for restore
set newname for datafile  6 to
 "/home/oracle/test/td/omf_ts.292.780350751";
# rename all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set plus the auxilliary tablespaces
restore clone datafile  1, 2, 5, 3, 6;
switch clone datafile all;
#online the datafiles restored or flipped
sql clone "alter database datafile  1 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  2 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  5 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  3 online";
#online the datafiles restored or flipped
sql clone "alter database datafile  6 online";
# make the controlfile point at the restored datafiles, then recover them
recover clone database tablespace  "OMF_TS", "SYSTEM", "UNDOTBS1", "UNDOTBS2", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
# PLUG HERE the creation of a temporary tablespace if export fails due to lack
# of temporary space.
# For example in Unix these two lines would do that:
#sql clone "create tablespace aux_tspitr_tmp
#           datafile ''/tmp/aux_tspitr_tmp.dbf'' size 500K";
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed temporary file 1 to /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 21-APR-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=36 devtype=DISK

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_system_%u_.dbf
restoring datafile 00002 to /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_undotbs1_%u_.dbf
restoring datafile 00005 to /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_undotbs2_%u_.dbf
restoring datafile 00003 to /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_sysaux_%u_.dbf
restoring datafile 00006 to /home/oracle/test/td/omf_ts.292.780350751
channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/backup/13n905rb_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/home/oracle/backup/13n905rb_1_1 tag=TAG20120421T143835
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:06:05
Finished restore at 21-APR-12

datafile 1 switched to datafile copy
input datafile copy recid=9 stamp=781195895 filename=/home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_system_7s4owbkl_.dbf
datafile 2 switched to datafile copy
input datafile copy recid=10 stamp=781195895 filename=/home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_undotbs1_7s4owbsb_.dbf
datafile 5 switched to datafile copy
input datafile copy recid=11 stamp=781195895 filename=/home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_undotbs2_7s4owbv8_.dbf
datafile 3 switched to datafile copy
input datafile copy recid=12 stamp=781195895 filename=/home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_sysaux_7s4owbn2_.dbf
datafile 6 switched to datafile copy
input datafile copy recid=13 stamp=781195895 filename=/home/oracle/test/td/omf_ts.292.780350751

sql statement: alter database datafile  1 online

sql statement: alter database datafile  2 online

sql statement: alter database datafile  5 online

sql statement: alter database datafile  3 online

sql statement: alter database datafile  6 online

Starting recover at 21-APR-12
using channel ORA_AUX_DISK_1

starting media recovery

archive log thread 1 sequence 27 is already on disk as file +RECOVERY/jrprod/1_27_779728994.dbf
archive log thread 1 sequence 28 is already on disk as file +RECOVERY/jrprod/1_28_779728994.dbf
archive log thread 2 sequence 23 is already on disk as file +RECOVERY/jrprod/2_23_779728994.dbf
archive log thread 2 sequence 24 is already on disk as file +RECOVERY/jrprod/2_24_779728994.dbf
archive log filename=+RECOVERY/jrprod/1_27_779728994.dbf thread=1 sequence=27
archive log filename=+RECOVERY/jrprod/2_23_779728994.dbf thread=2 sequence=23
archive log filename=+RECOVERY/jrprod/2_24_779728994.dbf thread=2 sequence=24
archive log filename=+RECOVERY/jrprod/1_28_779728994.dbf thread=1 sequence=28
media recovery complete, elapsed time: 00:00:03
Finished recover at 21-APR-12

database opened

contents of Memory Script:
{
#mark read only the tablespace that will be exported
sql clone "alter tablespace OMF_TS read only";
# create directory for datapump export
sql clone "create or replace directory STREAMS_DIROBJ_DPDIR as ''
/home/oracle/test/td''";
# export the tablespaces in the recovery set
host 'expdp userid=\"/@\(DESCRIPTION=\(ADDRESS=\(PROTOCOL=beq\)\(PROGRAM=/u01/app/oracle/product/10.2.0/db_1/bin/oracle\)\(ARGV0=oraclexeEz\)\(ARGS=^'\(DESCRIPTION=\(LOCAL=YES\)\(ADDRESS=\(PROTOCOL=beq\)\)\)^'\)\(ENVS=^'ORACLE_SID=xeEz^'\)\)\(CONNECT_DATA=\(SID=xeEz\)\)\) as sysdba\" transport_tablespaces=
 OMF_TS dumpfile=
dmpfile.dmp directory=
STREAMS_DIROBJ_DPDIR logfile=
explog.log';
}
executing Memory Script

sql statement: alter tablespace OMF_TS read only

sql statement: create or replace directory STREAMS_DIROBJ_DPDIR as ''/home/oracle/test/td''


Export: Release 10.2.0.1.0 - Production on Saturday, 21 April, 2012 14:53:02

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
Starting "SYS"."SYS_EXPORT_TRANSPORTABLE_01":  userid="/********@(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/u01/app/oracle/product/10.2.0/db_1/bin/oracle)(ARGV0=oraclexeEz)(ARGS=\(DESCRIPTION=\(LOCAL=YES\)\(ADDRESS=\(PROTOCOL=beq\)\)\))(ENVS=ORACLE_SID=xeEz))(CONNECT_DATA=(SID=xeEz))) AS SYSDBA" transport_tablespaces= OMF_TS dumpfile=dmpfile.dmp directory=STREAMS_DIROBJ_DPDIR logfile=explog.log
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYS"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_TRANSPORTABLE_01 is:
  /home/oracle/test/td/dmpfile.dmp
Job "SYS"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at 14:53:55

host command complete
/*
   The following command may be used to import the tablespaces.
   Substitute values for and .
   impdp directory= dumpfile= 'dmpfile.dmp' transport_datafiles= /home/oracle/test/td/omf_ts.292.780350751
*/
--------------------------------------------------------------
-- Start of sample PL/SQL script for importing the tablespaces
--------------------------------------------------------------
-- creating directory objects
CREATE DIRECTORY STREAMS$DIROBJ$1 AS  '/home/oracle/test/td/';
CREATE DIRECTORY STREAMS$DIROBJ$DPDIR AS  '/home/oracle/test/td';
/* PL/SQL Script to import the exported tablespaces */
DECLARE
  -- the datafiles
  tbs_files     dbms_streams_tablespace_adm.file_set;
  cvt_files     dbms_streams_tablespace_adm.file_set;
  -- the dumpfile to import
  dump_file     dbms_streams_tablespace_adm.file;
  dp_job_name   VARCHAR2(30) := NULL;
  -- names of tablespaces that were imported
  ts_names       dbms_streams_tablespace_adm.tablespace_set;
BEGIN
  -- dump file name and location
  dump_file.file_name :=  'dmpfile.dmp';
  dump_file.directory_object := 'STREAMS$DIROBJ$DPDIR';
  -- forming list of datafiles for import
  tbs_files( 1).file_name :=  'omf_ts.292.780350751';
  tbs_files( 1).directory_object :=  'STREAMS$DIROBJ$1';
  -- import tablespaces
  dbms_streams_tablespace_adm.attach_tablespaces(
    datapump_job_name      => dp_job_name,
    dump_file              => dump_file,
    tablespace_files       => tbs_files,
    converted_files        => cvt_files,
    tablespace_names       => ts_names);
  -- output names of imported tablespaces
  IF ts_names IS NOT NULL AND ts_names.first IS NOT NULL THEN
    FOR i IN ts_names.first .. ts_names.last LOOP
      dbms_output.put_line('imported tablespace '|| ts_names(i));
    END LOOP;
  END IF;
END;
/
-- dropping directory objects
DROP DIRECTORY STREAMS$DIROBJ$1;
DROP DIRECTORY STREAMS$DIROBJ$DPDIR;
--------------------------------------------------------------
-- End of sample PL/SQL script
--------------------------------------------------------------

Removing automatic instance
shutting down automatic instance
Oracle instance shut down
Automatic instance removed
auxiliary instance file /home/oracle/test/ad/cntrl_tspitr_JRPROD_xeEz.f deleted
auxiliary instance file /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_system_7s4owbkl_.dbf deleted
auxiliary instance file /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_undotbs1_7s4owbsb_.dbf deleted
auxiliary instance file /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_undotbs2_7s4owbv8_.dbf deleted
auxiliary instance file /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_sysaux_7s4owbn2_.dbf deleted
auxiliary instance file /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/datafile/o1_mf_temp_7s4p9y7v_.tmp deleted
auxiliary instance file /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/onlinelog/o1_mf_1_7s4p86bc_.log deleted
auxiliary instance file /home/oracle/test/ad/TSPITR_JRPROD_XEEZ/onlinelog/o1_mf_2_7s4p8ksd_.log deleted

RMAN>

注意在使用RAMN进行生成TTS metdata和数据文件时,当备份文件放在ASM上时容易出错,放在本地磁盘可以成功;另外需要控制文件和TTS表空间数据文件的备份.

(3),另外当源,目标库的平台不同时(32->64位),RMAN也可以起到作用,RMAN可以用来对数据文件进行转换.
SELECT * FROM V$TRANSPORTABLE_PLATFORM;
col platform_name for a40
SELECT d.PLATFORM_NAME,tp.ENDIAN_FORMAT FROM V$TRANSPORTABLE_PLATFORM tp, V$DATABASE d WHERE tp.PLATFORM_NAME = d.PLATFORM_NAME;

PLATFORM_NAME                            ENDIAN_FORMAT
---------------------------------------- --------------
Linux IA (32-bit)                        Little

查看源和目标平台后,如果两者不一致,可以使用RMAN在目标库将拷贝过来的数据文件(/home/oracle/32)进行转换.

RMAN> convert datafile '/home/oracle/32/tsmgmt_ts4.ora'
      to platform 'Linux IA (64-bit)'
      from platform 'Linux IA (32-bit)'
      db_file_name_covert='/home/oracle/32','/home/oracle/64';

或者拷贝之前进行表空间的转换,但数据文件很大的表空间会很慢.

RMAN> convert tablespace tsmgmt_ts4 to platform 'Microsoft Windows IA (32-bit)' format '/home/oracle/tsmgmt_ts_ms32.dbf';



你可能感兴趣的:(Oracle,10G,RAC,Oracle,Administration,Oracle,Backup,Recovery)