最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

Oracle表空间迁移

来源:动视网 责编:小OO 时间:2025-10-02 01:02:35
文档

Oracle表空间迁移

C:\\>sqlplus/nologSQL*Plus:Release9.2.0.8.0-ProductiononFriFeb608:31:042009Copyright(c)1982,2002,OracleCorporation.Allrightsreserved. SQL>connect/assysdbaConnected.SQL>createtablespacetest1datafile'c:\\oracle\\oradata\\mydata\est101.dbf'size50M;Tabl
推荐度:
导读C:\\>sqlplus/nologSQL*Plus:Release9.2.0.8.0-ProductiononFriFeb608:31:042009Copyright(c)1982,2002,OracleCorporation.Allrightsreserved. SQL>connect/assysdbaConnected.SQL>createtablespacetest1datafile'c:\\oracle\\oradata\\mydata\est101.dbf'size50M;Tabl
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\est101.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

.

2009-02-06 08:50

..

2009-02-06 08:44

myData

2009-02-06 08:50

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

.

2009-02-06 08:58

..

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,6 可用字节 

 

C:\\oracle\\oradata\\mytest>imp userid=sys/oracle transport_tablespace=y datafiles='c:\\oracle\\oradata\\mytest\est101.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 6678 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

.

2009-02-06 09:06

..

2009-02-06 09:07 4,096 exp.dmp 

2009-02-06 09:07 552 exp.log 

2009-02-06 08:44

myData

2009-02-06 09:02

mytest

2 个文件 4,8 字节 

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\est101.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>

文档

Oracle表空间迁移

C:\\>sqlplus/nologSQL*Plus:Release9.2.0.8.0-ProductiononFriFeb608:31:042009Copyright(c)1982,2002,OracleCorporation.Allrightsreserved. SQL>connect/assysdbaConnected.SQL>createtablespacetest1datafile'c:\\oracle\\oradata\\mydata\est101.dbf'size50M;Tabl
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top