Home > Database > Mysql Tutorial > Oracle可移动表空间方法

Oracle可移动表空间方法

WBOY
Release: 2016-06-07 17:22:29
Original
1273 people have browsed it

源数据库环境: OS:WINDOWS 7 DB VERSION:Oracle 10.2.0.4.0 注:10.1.0.1.0版本不能使用此次迁移方案 DB USER:SCOTT 需要dba权

源数据库环境:

OS:WINDOWS 7
 
DB VERSION:Oracle 10.2.0.4.0 注:10.1.0.1.0版本不能使用此次迁移方案
 
DB USER:SCOTT
 
需要dba权限、用户

目标数据库环境:
 
OS: WINDOWS 7
 
DB VERSION:11.2.0.1.0 注:11g低版本不能使用此次迁移方案
 
需要dba权限、用户

实施步骤:

1、检查迁移的表空间是否符合迁移条件,属于自含式表空间
 
SQL> EXEC SYS.DBMS_TTS.TRANSPORT_SET_CHECK ('SDH_DATA_TEST01',TRUE);
 
 PL/SQL procedure successfully completed
 
SQL> SELECT * FROM TRANSPORT_SET_VIOLATIONS;--查出必须为空才是自含式

VIOLATIONS
 
2、表空间为只读模式
 
SQL> alter tablespace SDH_DATA_TEST01 read only;
 
 Tablespace altered
 
SQL> SELECT status from dba_tablespaces where tablespace_name = 'SDH_DATA_TEST01';
 
 STATUS
 
---------
 
READ ONLY

3、传输SDH_DATA_TEST01表空间对应的数据文件至远程服务器,,D:\backup
 
4、目标数据库 Create directory FTP_TEST as ‘D:\BACKUP’;
 
5、目标数据库创建dblink连接源数据库
 
create public database link DBLINK_133
 
  connect to SCOTT identified by tiger
 
  using '(DESCRIPTION =
 
    (ADDRESS_LIST =
 
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.6.246.133)(PORT = 1521))
 
    )
 
    (CONNECT_DATA =
 
      (SERVICE_NAME = demo)
 
    )
  )';
 

6、目标数据库执行数据棒导入工具将该表空间导入到目标数据库
 
d:\app\yanan\product\11.2.0\dbhome_2>impdp test/oracle  TRANSPORT_DATAFILES= 'D:\backup\SDH_DATA_TEST01_01.DBF' NETWORK_LINK='dblink_133'  TRANSPORT_TABLESPACES=(SDH_DATA_TEST01)  NOLOGFILE=Y
 
 
 
Import: Release 11.2.0.1.0 - Production on 星期四 10月 25 14:51:28 2012
 
 
 
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
 
 
 
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
 
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
启动 "TEST"."SYS_IMPORT_TRANSPORTABLE_01":  test/******** TRANSPORT_DATAFILES= '
 
D:\backup\SDH_DATA_TEST01_01.DBF' NETWORK_LINK='dblink_133' TRANSPORT_TABLESPACE
 
S=(SDH_DATA_TEST01) NOLOGFILE=Y
 
处理对象类型 TRANSPORTABLE_EXPORT/PLUGTS_BLK
 
处理对象类型 TRANSPORTABLE_EXPORT/TABLE
 
处理对象类型 TRANSPORTABLE_EXPORT/INDEX
 
处理对象类型 TRANSPORTABLE_EXPORT/INDEX_STATISTICS
 
处理对象类型 TRANSPORTABLE_EXPORT/TABLE_STATISTICS
 
处理对象类型 TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
 
作业 "TEST"."SYS_IMPORT_TRANSPORTABLE_01" 已于 14:51:51 成功完成
 
7、修改源数据库表空间状态为可读写:
 
SQL> alter tablespace SDH_DATA_TEST01 read write;

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template