« Mac De Oracle (Cross Platform Transportable Tablespace) #8 | トップページ | Mac De Oracle (Cross Platform Transportable Tablespace) #10 »

2006年9月17日 (日) / Author : Hiroshi Sekiguchi.

Mac De Oracle (Cross Platform Transportable Tablespace) #9

Oracle10g EE R1 10.1.0.2.0 for Windows(32bit)から、Oracle10g EE R1 10.1.0.3.0 for MacOSX Serverへ表領域をトランスポートする。その2 ラス前です。

2.MacOSX側(ターゲットデータベース側)でメタデータのダンプファイルとエンディアン変換後のデータファイルを取り込む。

3.トランスポートセットを利用し、ターゲット・データベースへ表領域をプラグインする。

1)エンディアン変換済みデータファイルを配置する。
2)メタデータをインポートする。
3)プラグインした表領域をread/write可能にする 。



2.MacOSX側(ターゲットデータベース側)でメタデータのダンプファイルとエンディアン変換後のデータファイルをWindowsの共有ディレクトリからコピーする。

この作業は前回から何度もやっているので今回は、GUIではなくTerminalから。

G5Server:/Volumes/DiscusWork/temp oracle$ 
G5Server:/Volumes/DiscusWork/temp oracle$ sudo cp /Volumes/WORKGROUP¥;CATFISH/TRANSPORT4MAC.DMP ./
Password:
G5Server:/Volumes/DiscusWork/temp oracle$ sudo cp /Volumes/WORKGROUP¥;CATFISH/TRANSPORTABLE01.DBF ./
G5Server:/Volumes/DiscusWork/temp oracle$ sudo chown oracle *.*
G5Server:/Volumes/DiscusWork/temp oracle$ ll
total 10560
-rwx------ 1 oracle oinstall 81920 Sep 9 12:24 TRANSPORT4MAC.DMP
-rwx------ 1 oracle oinstall 5251072 Sep 9 12:18 TRANSPORTABLE01.DBF
G5Server:/Volumes/DiscusWork/temp oracle$ chmod u-x,g+r *.*
G5Server:/Volumes/DiscusWork/temp oracle$ ll
total 10560
-rw-r----- 1 oracle oinstall 81920 Sep 9 12:24 TRANSPORT4MAC.DMP
-rw-r----- 1 oracle oinstall 5251072 Sep 9 12:18 TRANSPORTABLE01.DBF
G5Server:/Volumes/DiscusWork/temp oracle$

でWindowsの共有フォルダからDrag & Dropでローカルフォルダにコピーした状態がこれ。
P6_1


3.トランスポートセットを利用し、ターゲット・データベースへ表領域をプラグインする。
1)エンディアン変換済みデータファイルを配置する。

G5Server:/Volumes/DiscusWork/temp oracle$ ll
total 10560
-rw-r----- 1 oracle oinstall 81920 Sep 9 12:24 TRANSPORT4MAC.DMP
-rw-r----- 1 oracle oinstall 5251072 Sep 9 12:18 TRANSPORTABLE01.DBF
G5Server:/Volumes/DiscusWork/temp oracle$
G5Server:/Volumes/DiscusWork/temp oracle$ cp ./transportable01.dbf /Volumes/DiscusWork/4oracle/u02/oradata/tiger
G5Server:/Volumes/DiscusWork/temp oracle$

2)メタデータをインポートする。

G5Server:/Volumes/DiscusWork/temp oracle$
G5Server:/Volumes/DiscusWork/temp oracle$ impdp system/xxxxx directory=transport_dir dumpfile=TRANSPORT4MAC.DMP
transport_datafiles='/Volumes/DiscusWork/4oracle/u02/oradata/tiger/transportable01.dbf'

Import: Release 10.1.0.3.0 - Production on 土曜日, 09 9月, 2006 13:02

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

接続先: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
マスター表"SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01"は正常にロード/アンロードされました
"SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01"を起動しています: system/******** directory=transport_dir
dumpfile=TRANSPORT4MAC.DMP
transport_datafiles=/Volumes/DiscusWork/4oracle/u02/oradata/tiger/transportable01.dbf
オブジェクト型TRANSPORTABLE_EXPORT/PLUGTS_BLKの処理中です
オブジェクト型TRANSPORTABLE_EXPORT/TABLEの処理中です
オブジェクト型TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINTの処理中です
オブジェクト型TRANSPORTABLE_EXPORT/TTE_POSTINST/PLUGTS_BLKの処理中です
ジョブ"SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01"が13:02で正常に完了しました

G5Server:/Volumes/DiscusWork/temp oracle$


3)プラグインした表領域をread/write可能にする

G5Server:/Volumes/DiscusWork/temp oracle$ 
G5Server:/Volumes/DiscusWork/temp oracle$ sqlplus /nolog

SQL*Plus: Release 10.1.0.3.0 - Production on 土 9月 9 13:04:08 2006

Copyright (c) 1982, 2004, Oracle. All rights reserved.

> conn system
パスワードを入力してください:
接続されました。
SYSTEM> select
2 tablespace_name,
3 block_size,
4 status
5 from
6 dba_tablespaces;

TABLESPACE_NAME BLOCK_SIZE STATUS
------------------------------ ---------- ---------
SYSTEM 8192 ONLINE
UNDOTBS1 8192 ONLINE
SYSAUX 8192 ONLINE
TEMP 8192 ONLINE
USERS 8192 ONLINE
EXAMPLE 8192 ONLINE
FLOW_1 8192 ONLINE
TRANSPORTABLE 8192 READ ONLY

8行が選択されました。

SYSTEM> alter tablespace transportable read write;

表領域が変更されました。

SYSTEM> conn scott/xxxx
接続されました。
SCOTT> select * from hoge where id between 1 and 10 order by id;

ID NAME
---------- ----------------------------------------
1 〜−○かきくえこ‾^:1
2 〜−○かきくえこ‾^:2
3 〜−○かきくえこ‾^:3
4 〜−○かきくえこ‾^:4
5 〜−○かきくえこ‾^:5
6 〜−○かきくえこ‾^:6
7 〜−○かきくえこ‾^:7
8 〜−○かきくえこ‾^:8
9 〜−○かきくえこ‾^:9
10 〜−○かきくえこ‾^:10

10行が選択されました。

SCOTT> l
1 begin
2 for i in 10001..11000 loop
3 insert into hoge values(i,'〜=|○あいうえおabc‾^:'||to_char(i));
4 end loop;
5* end;
SCOTT> /

PL/SQLプロシージャが正常に完了しました。

SCOTT> commit;

コミットが完了しました。

SCOTT> select * from hoge where id between 10990 and 11000 order by id;

ID NAME
---------- ----------------------------------------
10990 〜=|○あいうえおabc‾^:10990
10991 〜=|○あいうえおabc‾^:10991
10992 〜=|○あいうえおabc‾^:10992
10993 〜=|○あいうえおabc‾^:10993
10994 〜=|○あいうえおabc‾^:10994
10995 〜=|○あいうえおabc‾^:10995
10996 〜=|○あいうえおabc‾^:10996
10997 〜=|○あいうえおabc‾^:10997
10998 〜=|○あいうえおabc‾^:10998
10999 〜=|○あいうえおabc‾^:10999
11000 〜=|○あいうえおabc‾^:11000

11行が選択されました。

SCOTT>

次回、Cross Platform Transportable Tablespaceの最終回へつづく。



聞いている曲:Jaco Pastorius - Stuttgart Aria Bireli Lagrene & Jaco Pastorius - Stuttgart Aria - Stuttgart Aria I
Bireli Lagrene & Jaco Pastorius - Stuttgart Aria - Stuttgart Aria I

| |

トラックバック


この記事へのトラックバック一覧です: Mac De Oracle (Cross Platform Transportable Tablespace) #9:

コメント

コメントを書く