[20170623]利用传输表空间恢复数据库2.txt

[20170623]利用传输表空间恢复数据库2.txt

--//继续上午的测试,测试truncate,是否可行,理论讲应该没有问题.我主要的目的测试是否要切换日志.
--//参考链接 : http://blog.itpub.net/267265/viewspace-2141166/

1.环境:
SCOTT@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SCOTT@book> alter system archive log current ;
System altered.
--//测试前先切换一次日志.

SCOTT@book> select count(*) from t;
    COUNT(*)
------------
       84192

SCOTT@book> select current_scn,sysdate from v$database ;
CURRENT_SCN SYSDATE
------------ -------------------
13276962316 2017-06-23 15:21:54

SCOTT@book> truncate table t ;
Table truncated.

2.开始测试恢复:
$ mkdir /home/oracle/aux1

RMAN> transport tablespace tea tablespace destination '/home/oracle/aux1' auxiliary destination '/home/oracle/aux1' until scn 13276962316;

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='hFvw'

initialization parameters used for automatic instance:
db_name=BOOK
db_unique_name=hFvw_tspitr_BOOK
compatible=11.2.0.4.0
db_block_size=8192
db_files=200
sga_target=1G
processes=80
db_create_file_dest=/home/oracle/aux1
log_archive_dest_1='location=/home/oracle/aux1'
#No auxiliary parameter file used

starting up automatic instance BOOK

Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2260088 bytes
Variable Size                285213576 bytes
Database Buffers             771751936 bytes
Redo Buffers                   9711616 bytes
Automatic instance created
Running TRANSPORT_SET_CHECK on recovery set tablespaces
TRANSPORT_SET_CHECK completed successfully

contents of Memory Script:
{
# set requested point in time
set until  scn 13276962316;
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log
sql 'alter system archive log current';
}
executing Memory Script

executing command: SET until clause

Starting restore at 2017-06-23 15:24:49
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=127 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=133 device type=DISK
allocated channel: ORA_AUX_DISK_3
channel ORA_AUX_DISK_3: SID=139 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/BOOK/autobackup/2017_06_23/o1_mf_s_947414679_dns04qp7_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/BOOK/autobackup/2017_06_23/o1_mf_s_947414679_dns04qp7_.bkp tag=TAG20170623T104439
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/home/oracle/aux1/BOOK/controlfile/o1_mf_dnsjl28h_.ctl
Finished restore at 2017-06-23 15:24:51

sql statement: alter database mount clone database

sql statement: alter system archive log current

contents of Memory Script:
{
# set requested point in time
set until  scn 13276962316;
# set destinations for recovery set and auxiliary set datafiles
set newname for clone datafile  1 to new;
set newname for clone datafile  3 to new;
set newname for clone datafile  2 to new;
set newname for clone tempfile  1 to new;
set newname for datafile  6 to
"/home/oracle/aux1/tea01.dbf";
# switch all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set and the auxiliary set
restore clone datafile  1, 3, 2, 6;
switch clone datafile all;
}
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 tempfile 1 to /home/oracle/aux1/BOOK/datafile/o1_mf_temp_%u_.tmp in control file

Starting restore at 2017-06-23 15:24:56
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /home/oracle/aux1/BOOK/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /home/oracle/aux1/tea01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/backup/full_20170623_f8s7gn1n_1_1.bak
channel ORA_AUX_DISK_2: starting datafile backup set restore
channel ORA_AUX_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_2: restoring datafile 00001 to /home/oracle/aux1/BOOK/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_2: reading from backup piece /home/oracle/backup/full_20170623_f9s7gn1n_1_1.bak
channel ORA_AUX_DISK_3: starting datafile backup set restore
channel ORA_AUX_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_3: restoring datafile 00002 to /home/oracle/aux1/BOOK/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_3: reading from backup piece /home/oracle/backup/full_20170623_f7s7gn1n_1_1.bak
channel ORA_AUX_DISK_1: piece handle=/home/oracle/backup/full_20170623_f8s7gn1n_1_1.bak tag=TAG20170623T100023
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_2: piece handle=/home/oracle/backup/full_20170623_f9s7gn1n_1_1.bak tag=TAG20170623T100023
channel ORA_AUX_DISK_2: restored backup piece 1
channel ORA_AUX_DISK_2: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_3: piece handle=/home/oracle/backup/full_20170623_f7s7gn1n_1_1.bak tag=TAG20170623T100023
channel ORA_AUX_DISK_3: restored backup piece 1
channel ORA_AUX_DISK_3: restore complete, elapsed time: 00:00:15
Finished restore at 2017-06-23 15:25:11

datafile 1 switched to datafile copy
input datafile copy RECID=17 STAMP=947431511 file name=/home/oracle/aux1/BOOK/datafile/o1_mf_system_dnsjl8cy_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=18 STAMP=947431511 file name=/home/oracle/aux1/BOOK/datafile/o1_mf_undotbs1_dnsjl8cp_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=19 STAMP=947431511 file name=/home/oracle/aux1/BOOK/datafile/o1_mf_sysaux_dnsjl8dc_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=20 STAMP=947431511 file name=/home/oracle/aux1/tea01.dbf

{
# set requested point in time
set until  scn 13276962316;
# online the datafiles restored or switched
sql clone "alter database datafile  1 online";
sql clone "alter database datafile  3 online";
sql clone "alter database datafile  2 online";
sql clone "alter database datafile  6 online";
# recover and open resetlogs
recover clone database tablespace  "TEA", "SYSTEM", "UNDOTBS1", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
}
executing Memory Script

executing command: SET until clause

sql statement: alter database datafile  1 online

sql statement: alter database datafile  3 online

sql statement: alter database datafile  2 online

sql statement: alter database datafile  6 online

Starting recover at 2017-06-23 15:25:11
using channel ORA_AUX_DISK_1
using channel ORA_AUX_DISK_2
using channel ORA_AUX_DISK_3

starting media recovery
archived log for thread 1 with sequence 697 is already on disk as file /u01/app/oracle/archivelog/book/1_697_896605872.dbf
archived log for thread 1 with sequence 698 is already on disk as file /u01/app/oracle/archivelog/book/1_698_896605872.dbf
archived log for thread 1 with sequence 699 is already on disk as file /u01/app/oracle/archivelog/book/1_699_896605872.dbf
archived log for thread 1 with sequence 700 is already on disk as file /u01/app/oracle/archivelog/book/1_700_896605872.dbf
archived log for thread 1 with sequence 701 is already on disk as file /u01/app/oracle/archivelog/book/1_701_896605872.dbf
archived log for thread 1 with sequence 702 is already on disk as file /u01/app/oracle/archivelog/book/1_702_896605872.dbf
archived log for thread 1 with sequence 703 is already on disk as file /u01/app/oracle/archivelog/book/1_703_896605872.dbf
archived log for thread 1 with sequence 704 is already on disk as file /u01/app/oracle/archivelog/book/1_704_896605872.dbf
archived log for thread 1 with sequence 705 is already on disk as file /u01/app/oracle/archivelog/book/1_705_896605872.dbf
archived log for thread 1 with sequence 706 is already on disk as file /u01/app/oracle/archivelog/book/1_706_896605872.dbf
archived log for thread 1 with sequence 707 is already on disk as file /u01/app/oracle/archivelog/book/1_707_896605872.dbf
archived log for thread 1 with sequence 708 is already on disk as file /u01/app/oracle/archivelog/book/1_708_896605872.dbf
archived log for thread 1 with sequence 709 is already on disk as file /u01/app/oracle/archivelog/book/1_709_896605872.dbf
archived log file name=/u01/app/oracle/archivelog/book/1_697_896605872.dbf thread=1 sequence=697
archived log file name=/u01/app/oracle/archivelog/book/1_698_896605872.dbf thread=1 sequence=698
archived log file name=/u01/app/oracle/archivelog/book/1_699_896605872.dbf thread=1 sequence=699
archived log file name=/u01/app/oracle/archivelog/book/1_700_896605872.dbf thread=1 sequence=700
archived log file name=/u01/app/oracle/archivelog/book/1_701_896605872.dbf thread=1 sequence=701
archived log file name=/u01/app/oracle/archivelog/book/1_702_896605872.dbf thread=1 sequence=702
archived log file name=/u01/app/oracle/archivelog/book/1_703_896605872.dbf thread=1 sequence=703
archived log file name=/u01/app/oracle/archivelog/book/1_704_896605872.dbf thread=1 sequence=704
archived log file name=/u01/app/oracle/archivelog/book/1_705_896605872.dbf thread=1 sequence=705
archived log file name=/u01/app/oracle/archivelog/book/1_706_896605872.dbf thread=1 sequence=706
archived log file name=/u01/app/oracle/archivelog/book/1_707_896605872.dbf thread=1 sequence=707
archived log file name=/u01/app/oracle/archivelog/book/1_708_896605872.dbf thread=1 sequence=708
archived log file name=/u01/app/oracle/archivelog/book/1_709_896605872.dbf thread=1 sequence=709
media recovery complete, elapsed time: 00:00:04
Finished recover at 2017-06-23 15:25:16

database opened

contents of Memory Script:
{
# make read only the tablespace that will be exported
sql clone 'alter tablespace  TEA read only';
# create directory for datapump export
sql clone "create or replace directory STREAMS_DIROBJ_DPDIR as ''
/home/oracle/aux1''";
}
executing Memory Script

sql statement: alter tablespace  TEA read only

sql statement: create or replace directory STREAMS_DIROBJ_DPDIR as ''/home/oracle/aux1''
Performing export of metadata...
   EXPDP> Starting "SYS"."TSPITR_EXP_hFvw":
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/TABLE
   EXPDP> Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
   EXPDP> Master table "SYS"."TSPITR_EXP_hFvw" successfully loaded/unloaded
   EXPDP> ******************************************************************************
   EXPDP> Dump file set for SYS.TSPITR_EXP_hFvw is:
   EXPDP>   /home/oracle/aux1/dmpfile.dmp
   EXPDP> ******************************************************************************
   EXPDP> Datafiles required for transportable tablespace TEA:
   EXPDP>   /home/oracle/aux1/tea01.dbf
   EXPDP> Job "SYS"."TSPITR_EXP_hFvw" successfully completed at Fri Jun 23 15:25:53 2017 elapsed 0 00:00:31
Export completed

/*
   The following command may be used to import the tablespaces.
   Substitute values for <logon> and <directory>.
   impdp <logon> directory=<directory> dumpfile= 'dmpfile.dmp' transport_datafiles= /home/oracle/aux1/tea01.dbf
*/
--------------------------------------------------------------
-- Start of sample PL/SQL script for importing the tablespaces
--------------------------------------------------------------
-- creating directory objects
CREATE DIRECTORY STREAMS$DIROBJ$1 AS  '/home/oracle/aux1/';
CREATE DIRECTORY STREAMS$DIROBJ$DPDIR AS  '/home/oracle/aux1';
/* 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 :=  'tea01.dbf';
  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
database closed
database dismounted
Oracle instance shut down
Automatic instance removed
auxiliary instance file /home/oracle/aux1/BOOK/datafile/o1_mf_temp_dnsjlx0l_.tmp deleted
auxiliary instance file /home/oracle/aux1/BOOK/onlinelog/o1_mf_3_dnsjlwnd_.log deleted
auxiliary instance file /home/oracle/aux1/BOOK/onlinelog/o1_mf_2_dnsjlwj5_.log deleted
auxiliary instance file /home/oracle/aux1/BOOK/onlinelog/o1_mf_1_dnsjlw9h_.log deleted
auxiliary instance file /home/oracle/aux1/BOOK/datafile/o1_mf_sysaux_dnsjl8dc_.dbf deleted
auxiliary instance file /home/oracle/aux1/BOOK/datafile/o1_mf_undotbs1_dnsjl8cp_.dbf deleted
auxiliary instance file /home/oracle/aux1/BOOK/datafile/o1_mf_system_dnsjl8cy_.dbf deleted
auxiliary instance file /home/oracle/aux1/BOOK/controlfile/o1_mf_dnsjl28h_.ctl deleted
--//OK,没有问题,上午不知道第一次问题在那里.

$ ls -l //u01/app/oracle/archivelog/book
total 215340
-rw-r----- 1 oracle oinstall    79360 2017-06-23 09:54:41 1_695_896605872.dbf
-rw-r----- 1 oracle oinstall 11775488 2017-06-23 09:59:36 1_696_896605872.dbf
-rw-r----- 1 oracle oinstall   101888 2017-06-23 10:01:06 1_697_896605872.dbf
-rw-r----- 1 oracle oinstall     7680 2017-06-23 10:01:18 1_698_896605872.dbf
-rw-r----- 1 oracle oinstall    13824 2017-06-23 10:01:43 1_699_896605872.dbf
-rw-r----- 1 oracle oinstall 11830272 2017-06-23 10:07:44 1_700_896605872.dbf
-rw-r----- 1 oracle oinstall   298496 2017-06-23 10:10:11 1_701_896605872.dbf
-rw-r----- 1 oracle oinstall    99328 2017-06-23 10:12:26 1_702_896605872.dbf
-rw-r----- 1 oracle oinstall   745984 2017-06-23 10:15:53 1_703_896605872.dbf
-rw-r----- 1 oracle oinstall 50181632 2017-06-23 10:24:41 1_704_896605872.dbf
-rw-r----- 1 oracle oinstall 50181632 2017-06-23 10:24:42 1_705_896605872.dbf
-rw-r----- 1 oracle oinstall 50181632 2017-06-23 10:24:44 1_706_896605872.dbf
-rw-r----- 1 oracle oinstall 38688768 2017-06-23 13:55:30 1_707_896605872.dbf
-rw-r----- 1 oracle oinstall  5877760 2017-06-23 15:21:37 1_708_896605872.dbf
-rw-r----- 1 oracle oinstall   141824 2017-06-23 15:24:55 1_709_896605872.dbf

--//从时间看,在做传输时自动执行了一次日志切换.从alert中也可以看出来:
Fri Jun 23 15:21:37 2017
ALTER SYSTEM ARCHIVE LOG
Fri Jun 23 15:21:37 2017
Beginning log switch checkpoint up to RBA [0x2c5.2.10], SCN: 13276962295
Thread 1 advanced to log sequence 709 (LGWR switch)
  Current log# 3 seq# 709 mem# 0: /mnt/ramdisk/book/redo03.log
Archived Log entry 1248 added for thread 1 sequence 708 ID 0x4fb7d86e dest 1:
Fri Jun 23 15:21:38 2017
Completed checkpoint up to RBA [0x2c5.2.10], SCN: 13276962295
Fri Jun 23 15:24:55 2017
ALTER SYSTEM ARCHIVE LOG
Fri Jun 23 15:24:55 2017
Beginning log switch checkpoint up to RBA [0x2c6.2.10], SCN: 13276962601
Thread 1 advanced to log sequence 710 (LGWR switch)
  Current log# 1 seq# 710 mem# 0: /mnt/ramdisk/book/redo01.log
Archived Log entry 1249 added for thread 1 sequence 709 ID 0x4fb7d86e dest 1:
Fri Jun 23 15:25:04 2017
Incremental checkpoint up to RBA [0x2c5.2.0], current log tail at RBA [0x2c6.a.0]
Fri Jun 23 15:29:53 2017
Completed checkpoint up to RBA [0x2c6.2.10], SCN: 13276962601

3.导入数据:
SCOTT@book> grant dba to ttt IDENTIFIED BY ttt;
Grant succeeded.

$ cp /home/oracle/aux1/dmpfile.dmp /u01/app/oracle/admin/book/dpdump/

impdp system/oracle dumpfile=dmpfile.dmp transport_datafiles=/home/oracle/aux1/tea01.dbf REMAP_TABLESPACE=TEA:MILK
REMAP_SCHEMA=scott:ttt logfile=impdp.log

$ impdp system/oracle dumpfile=dmpfile.dmp transport_datafiles=/home/oracle/aux1/tea01.dbf REMAP_TABLESPACE=TEA:MILK
REMAP_SCHEMA=scott:ttt logfile=impdp.log

Import: Release 11.2.0.4.0 - Production on Fri Jun 23 15:36:59 2017

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  system/a****** dumpfile=dmpfile.dmp
transport_datafiles=/home/oracle/aux1/tea01.dbf REMAP_TABLESPACE=TEA:MILK REMAP_SCHEMA=scott:ttt logfile=impdp.log
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Fri Jun 23 15:37:03 2017 elapsed 0 00:00:03

--//ok,成功!!

4.测试:
SCOTT@book> select count(*) from scott.t;
    COUNT(*)
------------
           0

SCOTT@book> select count(*) from ttt.t;
    COUNT(*)
------------
       84192

--//可以发现测试ok.可以发现rman的transport tablespace还是很简单的,封装的复杂的命令.
--//至于上午第一次失败,无法在重新再现了,放弃探究.

时间: 2024-07-31 09:59:05

[20170623]利用传输表空间恢复数据库2.txt的相关文章

[20170623]利用传输表空间恢复部分数据.txt

[20170623]利用传输表空间恢复部分数据.txt --//昨天我测试使用传输表空间+dblink,上午补充测试发现表空间设置只读才能执行impdp导入原数据,这个也很好理解. --//这样的操作模式仅仅减少expdp生成原数据的过程. --//我想一下,rman也支持建立传输表空间的命令.我仔细看了以前的笔记,发现这样最大的有点不用设置只读,实际上它是通过建立辅组实 --//例来建立传输文件,理论讲可以恢复到特定的scn,这样可以利用它解决一些误操作的问题,还是通过例子来说明问题. 1.环

【MOS】如何利用RMAN可传输表空间迁移数据库到不同字节序的平台(文档 ID 1983639.1)

如何利用 RMAN 可传输表空间迁移数据库到不同字节序的平台 (文档 ID 1983639.1) 适用于: Oracle Database - Enterprise Edition - 版本 10.1.0.2 到 12.1.0.1 [发行版 10.1 到 12.1]本文档所含信息适用于所有平台******************* 警告 ************* Document 1334152.1 Corrupt IOT when using Transportable Tablespace

[20150408]只读表空间以及数据库恢复2.txt

[20150408]只读表空间以及数据库恢复2.txt --昨天检查时发现1个小问题,就是有1个表空间设置只读,也许某个时间打开变成读写,又设置会只读,而备份仅仅在第1次设置只读时做过1次, --按照道理如果使用原来的备份恢复会存在问题的,自己测试1下,顺便看看有什么变通的方法解决这个问题. 1.建立测试环境: SCOTT@test> @ &r/ver1 PORT_STRING                    VERSION        BANNER ----------------

[20150408]只读表空间以及数据库恢复4.txt

[20150408]只读表空间以及数据库恢复4.txt 参考链接: http://blog.itpub.net/267265/viewspace-1544583/ http://blog.itpub.net/267265/viewspace-1548059/ http://blog.itpub.net/267265/viewspace-1548967/ --上午做了测试,通过新建控制文件的方式来恢复,实际上更常用的方式使用bbed,修改数据文件块1,保持与控制文件的记录一致. --通过对比来看看

[20170623]传输表空间补充测试.txt

[20170623]传输表空间补充测试.txt --//昨天测试了使用dblink+传输表空间,链接如下:http://blog.itpub.net/267265/viewspace-2141115/ --//今天补充测试看看加参数SQLFILE生成的脚本是什么内容. impdp scott/book network_link=l_dbcn1 transport_tablespaces=users transport_datafiles=/home/oracle/backup/sugar01.d

[20150408]只读表空间以及数据库恢复3.txt

[20150408]只读表空间以及数据库恢复3.txt --昨天检查时发现1个小问题,就是有1个表空间设置只读,也许某个时间打开变成读写,又设置会只读,而备份仅仅在第1次设置只读时做过1次, --按照道理如果使用原来的备份恢复会存在问题的,自己测试1下,我上午已经测试了可以使用以前的做了来恢复,但是这里存在一些小问题, --我在第2次打开读写时,没有任何ddl,dml操作对这个表空间,如果存在这些操作会出现什么情况呢? --继续上午的测试. 1.建立测试环境: SCOTT@test> @ &

Oracle技术:基于时间点的表空间恢复

TSPITR(表空间时间点恢复)用于将一个或多个表空间恢复到过去某个时间点的状态,而其他表空间仍然保持现有状态. TSPITR 相关的概念和术语: (1) TSPITR (Tablespace Point-In-Time Recover).TSPITR 是表空间时间点恢复的英文缩写格式,它表示将一个或多个表空间恢复到过去时间点的状态,而其他 表空间仍然保持现有状态. (2) TSPITR 实现方法.当实现表空间时间点恢复时,既可以使用用户管理的表空间时间点恢复方法,也可以使用RMAN 管理的表空

Oracle可传输表空间的总结

传输表空间综述: 不论是数据字典管理的表空间还是本地管理的表空间,都可以使用传输表空间技术:从9i开始传输表空间不需要在源数据库和目标数据库之间具有同样的DB_BLOCK_SIZE块大小:使用传输表空间迁移数据比使用数据导入导出工具迁移数据的速度要快,这是因为传输表空间只是复制包含实际数据的数据文件到目标数据库的指定位置,而使用数据导入导出工具将传输表空间对象的元数据到目标数据库. 我们知道Oracle利用imp/impdp传输表空间transport_tablespace需要满足以下条件: 1

【TTS】传输表空间Linux -&gt;AIX 基于rman

[TTS]传输表空间Linux asm -> AIX asm 基于rman 一.1  BLOG文档结构图       一.2  前言部分   一.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① 异构平台下传输表空间的实施 ② 传输表空间基于表空间的read only和rman2种方式 ③ 平台字节序.自包含概念 ④ expdp/impdp的应用     Tips:        ① 若文章代码格式有错乱,推