oracle传输表空间功能测试(含详细过程)(二)
be exported
About to export transportable tablespace metadata...
For tablespace AAA ...
. exporting cluster definitions
. exporting table definitions
. . exporting table A1
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
suse11sp2:~>
二、目标服务器上导入表空间
5.将导出的dmp文件和数据文件拷贝到目标服务器
scp /oracle/oradata/aa.dbf oracle@10.1.122.54:/oracle/oradata
scp /tmp/aaatts.dmp oracle@10.1.122.54:/tmp
6.创建用户
SQL> create user bbb identified by bbb;
User created.
SQL> grant connect,resource to bbb;
Grant succeeded.
SQL> commit;
Commit complete.
7.导入表空间
imp \'sys/its7888$ as sysdba\' tablespaces=aaa transport_tablespace=y file=/tmp/aaatts.dmp datafiles=/oracle/oradata/aa.dbf fromuser=aaa touser=bbb
SQL> conn aaa/aaa
Connected.
SQL> select * from a1
2 ;
ID NAME
---------- --------------------
01 lurou
02 hello,DBA!
SQL>
SQL>
SQL> conn / as sysdba
Connected.
SQL> drop tablespace aaa including contents and datafiles;
Tablespace dropped.
——————————————————————————
三、之前遭遇的报错
未设置字符集的操作过程中,遭遇报错
suse11sp2:~> exp \'sys/its7888$ as sysdba\' tablespaces=aaa file=/tmp/aaatts.dmp transport_tablespace=y
Export: Release 11.2.0.3.0 - Production on Wed Jul 24 15:31:57 2013
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
Export done in US7ASCII character set and UTF8 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace AAA ...
. exporting cluster definitions
. exporting table definitions
. . exporting table A1
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
suse11sp2:~>
imp userid=system/its7888$ tablespaces=aaa transport_tablespace=y file=/tmp/aaatts.dmp datafiles=/oracle/oradata/aa.dbf
Import: Release 11.2.0.3.0 - Production on Wed Jul 24 09:22:57 2013
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
Export file created by EXPORT:V11.02.00 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
IMP-00053: Import mode incompatible with Export dump file
IMP-00000: Import terminated unsuccessfully