C:\>sqlplus /nolog
SQL*Plus: Release 9.2.0.8.0 - Production on Fri Feb 6 08:31:04 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> create tablespace test1 datafile 'c:\oracle\oradata\mydata\test101.dbf' size 50M ;
Tablespace created.
SQL> create user jason identified by oracle default tablespace test1 ;
User created.
SQL> grant dba to jason;
Grant success.
SQL> connect jason/oracle
Connected.
SQL> create table testing01 (a1 varchar2(10), a2 varchar2(10));
Table create.
SQL> insert into testing01 values('01','AA');
1 row created.
SQL> insert into testing01 values('02','BB');
1 row created.
SQL> commit;
Commit complete.
SQL> connect / as sysdba
Connected.
SQL> alter tablespace test1 read only;
Tablespace altered.
***拷贝test101.dbf 至 c:\oracle\oradata下
SQL> alter tablespace test1 read write;
Tablespace altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
***建立第二个数据库mytest
C:\>set oracle_sid=mytest
C:\>cd oracle
C:\oracle>cd oradata
C:\oracle\oradata>dir
驱动器 C 中的卷没有标签。
卷的序列号是 8C43-756C
C:\oracle\oradata 的目录
2009-02-06 08:50 <DIR> .
2009-02-06 08:50 <DIR> ..
2009-02-06 08:44 <DIR> myData
2009-02-06 08:50 <DIR> mytest
2009-02-06 08:44 52,436,992 TEST101.DBF
1 个文件 52,436,992 字节
4 个目录 45,865,721,856 可用字节
C:\oracle\oradata>move test101.dbf mytest
C:\oracle\oradata>cd mytest
C:\oracle\oradata\mytest>dir
驱动器 C 中的卷没有标签。
卷的序列号是 8C43-756C
C:\oracle\oradata\mytest 的目录
2009-02-06 08:58 <DIR> .
2009-02-06 08:58 <DIR> ..
2009-02-06 08:57 1,613,824 CONTROL01.CTL
2009-02-06 08:57 1,613,824 CONTROL02.CTL
2009-02-06 08:57 26,222,592 INDX01.DBF
2009-02-06 08:57 10,486,272 REDO01.LOG
2009-02-06 08:57 10,486,272 REDO02.LOG
2009-02-06 08:57 262,152,192 SYSTEM01.DBF
2009-02-06 08:57 41,951,232 TEMP01.DBF
2009-02-06 08:44 52,436,992 TEST101.DBF
2009-02-06 08:57 10,493,952 TOOLS01.DBF
2009-02-06 08:57 209,723,392 UNDOTBS01.DBF
2009-02-06 08:57 26,222,592 USERS01.DBF
11 个文件 653,403,136 字节
2 个目录 45,865,713,664 可用字节
C:\oracle\oradata\mytest>imp userid=sys/oracle transport_tablespace=y datafiles='c:\oracle\oradata\mytest\test101.dbf' tablespaces
=test1 log=imp01.log
Import: Release 9.2.0.8.0 - Production on Fri Feb 6 09:02:47 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
IMP-00058: ORACLE error 28009 encountered
connection to sys should be as sysdba or sysoperUsername: sys/oracle as sysdba
Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
IMP-00002: failed to open EXPDAT.DMP for read
Import file: EXPDAT.DMP > ^C
C:\oracle\oradata\mytest>set oracle_sid=mydata
C:\oracle\oradata\mytest>sqlplus /nolog
SQL*Plus: Release 9.2.0.8.0 - Production on Fri Feb 6 09:04:35 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup
ORACLE 例程已经启动。
ORACLE instance started.
Total System Global Area 160505168 bytes
Fixed Size 453968 bytes
Variable Size 134217728 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> alter tablespace test1 read only;
Tablespace altered.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
C:\oracle\oradata\mytest>cd ..
C:\oracle\oradata>set oracle_sid=mydata
C:\oracle\oradata>exp file=exp.dmp transport_tablespace=y tablespaces=test1 log=exp.log
Export: Release 9.2.0.8.0 - Production on Fri Feb 6 09:28:13 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Username: sys/oracle as sysdba
Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace TEST1 ...
. exporting cluster definitions
. exporting table definitions
. . exporting table TESTING01
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
C:\oracle\oradata>dir
驱动器 C 中的卷没有标签。
卷的序列号是 8C43-756C
C:\oracle\oradata 的目录
2009-02-06 09:06 <DIR> .
2009-02-06 09:06 <DIR> ..
2009-02-06 09:07 4,096 exp.dmp
2009-02-06 09:07 552 exp.log
2009-02-06 08:44 <DIR> myData
2009-02-06 09:02 <DIR> mytest
2 个文件 4,648 字节
4 个目录 45,865,639,936 可用字节
C:\oracle\oradata>notepad exp.dmp
**拷贝数据文件 test101.dbf 至 c:\oracle\oradata\mytest\下
C:\oracle\oradata>imp file=exp.dmp log=imp.log transport_tablespace=y tablespaces=test1 datafiles='c:\oracle\oradata\mytest\test101.dbf'
Import: Release 9.2.0.8.0 - Production on Fri Feb 6 09:38:41 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Username: sys/oracle as sysdba
Connected to: Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
Export file created by EXPORT:V09.02.00 via conventional path
About to import transportable tablespace(s) metadata...
import done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
. importing SYS's objects into SYS
. importing JASON's objects into JASON
. . importing table "TESTING01"
Import terminated successfully without warnings.
C:\oracle\oradata>
C:\oracle\oradata>sqlplus /nolog
SQL*Plus: Release 9.2.0.8.0 - Production on Fri Feb 6 09:54:29 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> alter tablespace test1 read write;
Tablespace altered.
SQL>