TTS备份实验

  1. 查看系统版本支持的系统
     1 SQL> select * from v$TRANSPORTABLE_PLATFORM ORDER BY PLATFORM_NAME;
     2
     3 PLATFORM_ID PLATFORM_NAME                        ENDIAN_FORMAT
     4 ----------- ------------------------------------ --------------
     5           6 AIX-Based Systems (64-bit)           Big
     6          16 Apple Mac OS                         Big
     7          21 Apple Mac OS (x86-64)                Little
     8          19 HP IA Open VMS                       Little
     9          15 HP Open VMS                          Little
    10           5 HP Tru64 UNIX                        Little
    11           3 HP-UX (64-bit)                       Big
    12           4 HP-UX IA (64-bit)                    Big
    13          18 IBM Power Based Linux                Big
    14           9 IBM zSeries Based Linux              Big
    15          10 Linux IA (32-bit)                    Little
    16
    17 PLATFORM_ID PLATFORM_NAME                        ENDIAN_FORMAT
    18 ----------- ------------------------------------ --------------
    19          11 Linux IA (64-bit)                    Little
    20          13 Linux x86 64-bit                     Little
    21           7 Microsoft Windows IA (32-bit)        Little
    22           8 Microsoft Windows IA (64-bit)        Little
    23          12 Microsoft Windows x86 64-bit         Little
    24          17 Solaris Operating System (x86)       Little
    25          20 Solaris Operating System (x86-64)    Little
    26           1 Solaris[tm] OE (32-bit)              Big
    27           2 Solaris[tm] OE (64-bit)              Big
    28
    29 20 rows selected.

    我源的机器是 Linux x86 64-bit ,参考官方文档,如果两个平台不同,则表空间需要转化。我这边是从 linux 到windows

特别需要注意一些限制,系统表空间,SYS用户对象等。

2. 查询表空间是否为自包含

SQL> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK(‘TTS_TPS‘, TRUE);

PL/SQL procedure successfully completed.

查询视图

SQL> select * from TRANSPORT_SET_VIOLATIONS;

no rows selected

没有记录就是符合条件,没有字包含。

3.Generate a Transportable Tablespace Set  修改表空间为只读

SQL> alter tablespace tts_tps read only;

Tablespace altered.

4. 创建目录

SQL> create directory  dir_cyf as ‘/tmp/dir_cyf‘;

Directory created.
SQL> grant read,write on directory dir_cyf to public;

Grant succeeded.

5.数据导出

[[email protected] dir_cyf]$ expdp  system/a123456  dumpfile=aaaa.dmp directory=dir_cyf
        transport_tablespaces=TTS_TPS logfile=exp_cyf.log

Export: Release 11.2.0.3.0 - Production on Thu Dec 25 00:51:35 2014

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01":  system/******** dumpfile=aaaa.dmp directory=dir_cyf
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 320 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SYNONYM/SYNONYM
Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/PRE_TABLE_ACTION
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/VIEW/COMMENT
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/POST_TABLE_ACTION
Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCACT_SCHEMA
. . exported "SYSTEM"."REPCAT$_AUDIT_ATTRIBUTE"          6.328 KB       2 rows
. . exported "SYSTEM"."REPCAT$_OBJECT_TYPES"             6.882 KB      28 rows
. . exported "SYSTEM"."REPCAT$_RESOLUTION_METHOD"        5.835 KB      19 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_STATUS"          5.484 KB       3 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_TYPES"           6.289 KB       2 rows
. . exported "SYSTEM"."DEF$_AQCALL"                          0 KB       0 rows
. . exported "SYSTEM"."DEF$_AQERROR"                         0 KB       0 rows
. . exported "SYSTEM"."DEF$_CALLDEST"                        0 KB       0 rows
. . exported "SYSTEM"."DEF$_DEFAULTDEST"                     0 KB       0 rows
. . exported "SYSTEM"."DEF$_DESTINATION"                     0 KB       0 rows
. . exported "SYSTEM"."DEF$_ERROR"                           0 KB       0 rows
. . exported "SYSTEM"."DEF$_LOB"                             0 KB       0 rows
. . exported "SYSTEM"."DEF$_ORIGIN"                          0 KB       0 rows
. . exported "SYSTEM"."DEF$_PROPAGATOR"                      0 KB       0 rows
. . exported "SYSTEM"."DEF$_PUSHED_TRANSACTIONS"             0 KB       0 rows
. . exported "SYSTEM"."MVIEW$_ADV_INDEX"                     0 KB       0 rows
. . exported "SYSTEM"."MVIEW$_ADV_PARTITION"                 0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_AUDIT_COLUMN"                 0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_COLUMN_GROUP"                 0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_CONFLICT"                     0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_DDL"                          0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_EXCEPTIONS"                   0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_EXTENSION"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_FLAVORS"                      0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_FLAVOR_OBJECTS"               0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_GENERATED"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_GROUPED_COLUMN"               0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_INSTANTIATION_DDL"            0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_KEY_COLUMNS"                  0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_OBJECT_PARMS"                 0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_PARAMETER_COLUMN"             0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_PRIORITY"                     0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_PRIORITY_GROUP"               0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_REFRESH_TEMPLATES"            0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_REPCAT"                       0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_REPCATLOG"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_REPCOLUMN"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_REPGROUP_PRIVS"               0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_REPOBJECT"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_REPPROP"                      0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_REPSCHEMA"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_RESOLUTION"                   0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_RESOLUTION_STATISTICS"        0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_RESOL_STATS_CONTROL"          0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_RUNTIME_PARMS"                0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_SITES_NEW"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_SITE_OBJECTS"                 0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_SNAPGROUP"                    0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_OBJECTS"             0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_PARMS"               0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_REFGROUPS"           0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_SITES"               0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_TEMPLATE_TARGETS"             0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_USER_AUTHORIZATIONS"          0 KB       0 rows
. . exported "SYSTEM"."REPCAT$_USER_PARM_VALUES"             0 KB       0 rows
. . exported "SYSTEM"."SQLPLUS_PRODUCT_PROFILE"              0 KB       0 rows
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
  /tmp/dir_cyf/aaaa.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at 00:52:42

6.rman导出数据:

RMAN TARGET /

RMAN> CONVERT TABLESPACE tts_tps
2> TO PLATFORM ‘Microsoft Windows x86 64-bit‘
3>  FORMAT ‘/tmp/dir_cyf/aaaa01.dbf‘;

Starting conversion at source at 25-DEC-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile conversion
input datafile file number=00009 name=/app/oracle/oradata/orcl/tts01.dbf
converted datafile=/tmp/dir_cyf/aaaa01.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:16
Finished conversion at source at 25-DEC-14

7.拷贝dmp 数据定义文件和dbf 数据文件到目标库服务器

8.在目标库中,执行转换

CONVERT DATAFILE
‘D:\tts01.dbf‘
 TO PLATFORM="Microsoft Windows x86 64-bit"
 FROM PLATFORM="Linux x86 64-bit"
 format ‘D:\tts02.dbf‘;

9.执行导

impdp tts/tts dumpfile=aaaa01.dmp directory=c_dir
   transport_datafiles= d:\TTS02.DBF
   logfile=tts_import.log
时间: 2024-10-08 08:22:12

TTS备份实验的相关文章

mysql 主从备份实验

1.分别在master服务器和slave服务器上安装 mysql $yum install -y mysql mysql-dev mysql-master A.在master上操作: A.1.编辑mysql配置文件: $ vim /etc/my.cnf 在[mysqld]段内添加行: server-id=129           #根据喜好随便起,最好有一定规律. log-bin=mysql-bin       #开启二进制日志功能,必须 A.2. 重启mysqld服务,进入mysql $se

Oracle数据库备份实验笔记[不完整,内容乱]

rman target / log=/orasoft/backup/${DATE}backup1.log <<EOFrun {allocate channel c1 device type disk;allocate channel c2 device type disk;allocate channel c3 device type disk;backup database format '/orasoft/backup/db_%T%U.bak';backup current control

innobackupex 备份实验

[[email protected] ~]# xtrabackup -v xtrabackup version 2.3.5 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 45cda89) [[email protected] ~]# /usr/bin/innobackupex -v innobackupex version 2.3.5 Linux (x86_64) (revision id: 45cda89) wget htt

IPSec_VPN设备备份实验

IPSec_VPN设备备份验

双线路切换-冗余备份实验

步骤及方法:1.首先配置IP搭建底层,R1/R2/R4运行EIGRP动态路由,发布自己的直连网络,为了更真实的模拟环境,R3上不配置动态路由,而是写两条默认路由分别指向不同的下一跳(也就是自己的网关).全局:ip route 0.0.0.0 0.0.0.0 202.103.23.2     //指向电信下一跳的默认路由       ip route 0.0.0.0 0.0.0.0 58.49.34.4     //指向网通下一跳的默认路由(在申请光纤线路时,会分配IP地址以及网关,此时的网关就是

Centos6.5 rsync同步备份

前言:本章主要讲解实现快速.安全.高效的异地备份 实验环境:服务端A 192.168.1.10   客户端B 192.168.1.20 一,安装rsync    yum  -y  install  rsync*   新建配置文件 vi /etc/rsyncd.conf uid = nobody gid = nobody use chroot = yes address = 192.168.1.10 port 873 log file = /var/log/rsyncd.log pid file

第三章 数据库备份和还原

一.数据库恢复模式 1.完整:能够让数据库恢复到出现故障的时间点和指定时间点(主要是日志文件完 整备份) 2.大容量日志:数据库日志不记录对数据修改的时间(即指定的时间点)效率高只 能通过日志恢复到故障点 3.简单:对事务日志不活跃的逻辑日志文件覆盖重复利用(日志写满后覆盖完成的 提交的事务日志)不能利用日志还原数据库,只能利用完整数据库文件恢 复 1)简单恢复模式 数据库备份和还原策略 数据小 数据变化不大 数据库不能恢复到出现故障的时间点(重复擦写日志文件) 完整数据库备份  完整的数据库备

inotify介绍及rsync + inotify 实时同步备份

1.前言 rsync (remote sync)是一款非常好的数据同步工具,能够通过对比同步双方的数据变动,实现增量同步,还可以通过LAN/WAN实现远程多台主机间文件的同步,还能结合crond任务计划来执行自动备份,又可以结合ssh实现远程数据备份的安全,种种特性使他看起来相当优秀.但如果需备份数据十分庞大时,它的不足之处就显现出来了,比如每次执行同步操作时,rsync都会扫描全部数据进而计算出增量部分,而后再同步增量数据,这将会十分耗时,使其变得低效:并且受限于crond计划任务最小时间间隔

HSRP-热备份

实验HSRP-热备份 实验目标:在router5上设置网关为192.168.2.252 ,router8上设置网关为192.168.2.253 ,在router5和router8上创建虚拟网关,让pc7能够访问pc9 实验环境: 实验步骤 一.配置ip地址 二.在router5上配置,开启f0/0.f0/1,并配置ip 三.在router8上给f0/1, f0/2配置IP 四.在router5配置动态路由 五.在router9配置动态路由 六.在router8配置动态路由 七.进入f0/0接口,