国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

如何使用exp以傳輸表空間的方式將其導出

2024-07-21 02:44:31
字體:
來源:轉載
供稿:網友
 

有時候,可以使用exp將以傳輸表空間的方式將其導出,傳輸表空間是一種機制,用來把一個數據庫上的格式數據文件附加到另一個數據庫。

需要注意:

對于導出文件dmp來說,Oracle實現了跨平臺的處理,即在任何一個可運行的平臺上,都能使用imp將其導入,但是對于表空間所包含的數據文件而言,各個平臺上是不一樣的,包含不能通過簡單的復制來處理。數據文件不是獨立于OS的。

傳輸表空間移動數據速度非常快。

使用前提:

1.源和目標數據庫使用相同的字符集。

2.目標數據庫不能有和源表空間相同的表空間

3.源和目標數據庫擁有相同的塊大小

4.必須傳輸自包含的對象集

5.源和目標數據庫運行的硬件平臺必須相同

這里以linux下Oracle9.2.0.4為例,簡要介紹一下使用:

1.創建表空間,并生成數據

sqlplus "/ as sysdba"

create tablespace hexiong datafile ?/hexiong.dbf size 1M;

create user hexiong identified by hexiong default tablespace hexiong;

grant connect, resource to hexiong;

conn hexiong/hexiong

create table t as select * from all_objects;

2.檢查一下表空間是否齊備:

exec sys.dbms_tts.transport_set_check('hexiong', TRUE);

PL/SQL PRocedure successfully completed.

SQL> select * from sys.transport_set_violations;

no rows selected

這表示該表空里的對象集是自包含的(對象及其索引都在此表空間中)

3.設定表空間為只讀

alter tablespace hexiong read only;

4.開始exp

SQL> host exp userid=/'sys/change_on_install as sysdba/' transport_tablespace=y tablespaces=(hexiong) file=/u01/app/oracle/exphexiong.dmp

Export: Release 9.2.0.4.0 - Production on ÐÇÆÚÈÕ 7ÔÂ 30 19:27:00 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to: Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production

With the Partitioning and Oracle Data Mining options

JServer Release 9.2.0.4.0 - Production

Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

Note: table data (rows) will not be exported

About to export transportable tablespace metadata...

For tablespace HEXIONG ...

. exporting cluster definitions

. exporting table definitions

. . exporting table T

. exporting referential integrity constraints

. exporting triggers

. end transportable tablespace metadata export

Export terminated successfully without warnings.

5.將導出的文件以及相關源表空間的數據文件拷到目標數據庫或機器上

導出文件:/u01/app/oracle/exphexiong.dmp

數據文件:

SQL> select b.name from v$tablespace a, v$datafile b where a.ts#=b.ts# and a.name='HEXIONG';

NAME

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/bjlnx1/hexiong.dbf

6.進入目標機器上,創建對應表空間的用戶,不必指定缺省表空間

設exphexiong.dmp以及hexiong.dbf的位置都在/home/oradba上

cd /home/oradba

SQL>create user hexiong identified by hexiong;

7.導入:

imp file=exphexiong.dmp userid=/'sys/change_on_install as sysdba/' transport_tablespace=y datafiles=/home/oradba/hexiong.dbf


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 杂多县| 莲花县| 辽阳市| 萍乡市| 丰原市| 沁水县| 厦门市| 商洛市| 岳池县| 阳谷县| 阜平县| 金沙县| 佳木斯市| 综艺| 新蔡县| 精河县| 城步| 沈丘县| 惠东县| 博兴县| 迁安市| 涞源县| 加查县| 花莲县| 丁青县| 礼泉县| 砀山县| 中阳县| 隆子县| 辰溪县| 新巴尔虎左旗| 合江县| 天台县| 青海省| 红河县| 临江市| 维西| 渝中区| 永康市| 醴陵市| 宜都市|