[20131109]deferred segment creation与12c的exp命令.txt

简介: [20131109]deferred segment creation与12c的exp命令.txt 参考链接:http://space.itpub.net/267265/viewspace-713311 昨天想导出一些数据在自己的12c测试环境,发现具有段延迟建立特性的表使用exp也能导出。
[20131109]deferred segment creation与12c的exp命令.txt

参考链接:http://space.itpub.net/267265/viewspace-713311


昨天想导出一些数据在自己的12c测试环境,发现具有段延迟建立特性的表使用exp也能导出。

例子如下:
SCOTT@test01p> @ver
BANNER                                                                               CON_ID
-------------------------------------------------------------------------------- ----------
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production              0

SCOTT@test01p> create table t ( a number);
Table created.

SCOTT@test01p> select DBMS_METADATA.get_ddl ('TABLE','T') from dual;
DBMS_METADATA.GET_DDL('TABLE','T')
-------------------------------------------------------------------------

  CREATE TABLE "SCOTT"."T"
   (    "A" NUMBER
   ) SEGMENT CREATION DEFERRED
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
 NOCOMPRESS LOGGING
  TABLESPACE "USERS"

--SEGMENT CREATION DEFERRED说明表具有段延迟建立特性。

d:\tools\rlwrap>exp scott/tiger@test01p tables=(t) file=t.dmp
Export: Release 12.1.0.1.0 - Production on Sat Nov 9 22:26:23 2013
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                              T          0 rows exported
Export terminated successfully without warnings.


--说明12c可以导出,这样看来前面的版本应该算BUG。

做一个move看看
参考链接:http://space.itpub.net/267265/viewspace-713311
SCOTT@test01p> alter table t move tablespace users;
Table altered.

SCOTT@test01p> select  table_name ,segment_created from user_tables where table_name='T';
TABLE_NAME SEG
---------- ---
T          NO

SCOTT@test01p> select  segment_name ,segment_type ,bytes from user_segments where segment_name='T' and segment_type='TABLE';
no rows selected

--看来11G遇到的问题都是bug。看看11.2.0.3问题还存在吗?

SCOTT@test> @ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

SCOTT@test> create table t ( a number);

Table created.

SCOTT@test> select DBMS_METADATA.get_ddl ('TABLE','T') from dual;
DBMS_METADATA.GET_DDL('TABLE','T')
------------------------------------------------------------------

  CREATE TABLE "SCOTT"."T"
   (    "A" NUMBER
   ) SEGMENT CREATION DEFERRED
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
 NOCOMPRESS LOGGING
  TABLESPACE "USERS"

$ exp scott/btbtms tables=(t) file=t.dmp
Export: Release 11.2.0.3.0 - Production on Mon Nov 11 09:09:08 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 ZHS16GBK character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                              T          0 rows exported
Export terminated successfully without warnings.

--可以发现t也被导出!

--做一个move看看
SCOTT@test> alter table t move tablespace users;
Table altered.

SCOTT@test> select  table_name ,segment_created from user_tables where table_name='T';
TABLE_NAME SEG
---------- ---
T          NO

SCOTT@test> select  segment_name ,segment_type ,bytes from user_segments where segment_name='T' and segment_type='TABLE';
no rows selected

--做一个imp导入看看。
SCOTT@test> rename t to tx;
Table renamed.

$ imp scott/btbtms full=y file=t.dmp
Import: Release 11.2.0.3.0 - Production on Mon Nov 11 09:12:24 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 ZHS16GBK character set and AL16UTF16 NCHAR character set
. importing SCOTT's objects into SCOTT
. importing SCOTT's objects into SCOTT
. . importing table                            "T"          0 rows imported
Import terminated successfully without warnings.


SCOTT@test> desc t;
Name  Null?    Type
----- -------- ---------
A              NUMBER


SCOTT@test> select  segment_name ,segment_type ,bytes from user_segments where segment_name='TX' and segment_type='TABLE';
no rows selected

SCOTT@test> select  segment_name ,segment_type ,bytes from user_segments where segment_name='T' and segment_type='TABLE';
no rows selected

--可以发现t表结构导入(没有记录).但是没有建立数据段。

总结:
可以发现每一个新特性的出现,总是意味着一堆bug的出现。使用新特性要注意。


目录
相关文章
|
SQL 关系型数据库
ORA-1652: unable to extend temp segment by 128 in tablespace xxx Troubleshootin
当收到告警信息ORA-01652: unable to extend temp segment by 128 in tablespace xxxx 时,如何Troubleshooting ORA-1652这样的问题呢? 当然一般xxx是临时表空间,也有可能是用户表空间。
2048 0
|
关系型数据库 Oracle Linux
[20180306]关于DEFERRED ROLLBACK2.txt
[20180306]关于DEFERRED ROLLBACK2.txt --//上午测试DEFERRED ROLLBACK针对表空间offline才有效,我测试回滚一定会写到DEFERRED ROLLBACK段.
975 0
|
Oracle 关系型数据库 SQL
【MOS】EVENT: DROP_SEGMENTS - cleanup of TEMPORARY segments (文档 ID 47400.1)
【MOS】EVENT: DROP_SEGMENTS - Forcing cleanup of TEMPORARY segments (文档 ID 47400.1) ***Checked for relevance on 14-Jun-2012*** ...
1159 0
|
数据库管理
[20160819]什么是DEFERRED ROLLBACK.txt
[20160819]什么是DEFERRED ROLLBACK.txt A "Deferred Rollback" segment is created for a tablespace when a tablespace is taken offline.
882 0
|
数据库 数据库管理 关系型数据库
ORA-01157: cannot identify/lock data file %s - see DBWR trace file的处理
<span style="color:rgb(102,102,102); font-family:宋体,Arial; line-height:26px">一个测试环境,由于主机工程师更换存储,在没有停数据库的情况下关闭操作系统,导致启动数据库时报ORA-</span><span style="color:rgb(102,102,102); font-family:宋体,Arial; lin
2711 0
|
存储 Oracle 关系型数据库
oracle参数之DEFERRED_SEGMENT_CREATION
         众所周知,在清空表内所有数据时,truncate比delete要快很多,原因是,delete语句每次删除一行,都在事务日志中为所删除的每行记录一项。
830 0