夫妻结婚以后,签订协议,双方都要在Google Latitude中允许对方查看自己的Location,这样新时代的夫妻应该会减少很多互相撒谎的机会吧。:)
夫妻结婚以后,签订协议,双方都要在Google Latitude中允许对方查看自己的Location,这样新时代的夫妻应该会减少很多互相撒谎的机会吧。:)
先来看一下例子。我们创建一张表T2。
[sourcecode language=”sql” light=”true”]SQL> create table t2 (n number);
Table created.
SQL> desc t2
Name Null? Type
—————————————– ——– —————————-
N NUMBER[/sourcecode]
尝试使用exp将此表导出。
D:\Temp>exp kamus/oracle tables=t2
Export: Release 11.2.0.1.0 - Production on Fri Apr 16 18:11:51 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, Data Mining and Real Application Testing opt
ions
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path ...
EXP-00011: KAMUS.T2 does not exist
Export terminated successfully with warnings.
报错说这张表并不存在。这是让很多客户费解的地方,在测试库中创建应用的表结构,然后再将表结构exp到产品库中去,这是很多客户常用的方法,但是在11gR2中如果这些表是新创建的没有插入过任何一条记录,那么将会碰到上面这样的错误。
原因在于11gR2中的新功能 – Deferred Segment Creation(延迟段创建),默认情况下这个功能是启用的。
[sourcecode language=”sql” light=”true”]SQL> show parameter DEFERRED_SEGMENT_CREATION
NAME TYPE VALUE
———————————— ——————– ——————–
deferred_segment_creation boolean TRUE[/sourcecode]
延迟段创建的含义是当此新创建一个可能会有Segment的对象时(比如表、索引、物化视图等),如果这个对象中还没有任何记录需要消耗一个Extent,那么将不会在创建对象时自动创建Segment,这样做的好处无疑是在创建对象时大大提高了速度。
对于上例中的T2表,我们在创建结束就立刻检查DBA_SEGMENTS视图,会发现没有任何记录。
[sourcecode language=”sql” light=”true”]SQL> select segment_name from user_segments where segment_name=’T2′;
no rows selected[/sourcecode]
而对于exp程序而言,当仅仅存在Object的定义而没有相应的Segment时,就会报出EXP-00011对象不存在的错误。
解决方法就很简单了,以下方法任选其一。
1. 设置DEFERRED_SEGMENT_CREATION为FALSE,这样创建对象时就会自动创建Segment
2. 在创建对象时,明确指定立刻创建Segment
[sourcecode language=”sql” light=”true”]create table t2 (n number) SEGMENT CREATION IMMEDIATE;[/sourcecode]
3. 使用expdp替代exp(Datapump本身就是Oracle10g以后的推荐工具)
D:\Temp>expdp kamus/oracle tables=t2
Export: Release 11.2.0.1.0 - Production on Fri Apr 16 18:14:41 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, Data Mining and Real Application Testing opt
ions
Starting "KAMUS"."SYS_EXPORT_TABLE_01": kamus/******** tables=t2
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "KAMUS"."T2" 0 KB 0 rows
Master table "KAMUS"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for KAMUS.SYS_EXPORT_TABLE_01 is:
D:\ORACLE\ADMIN\ORCL\DPDUMP\EXPDAT.DMP
Job "KAMUS"."SYS_EXPORT_TABLE_01" successfully completed at 18:15:10
Update@2012-05-29
在最新的11.2.0.3中,该问题已经不再存在,即使没有segment,用exp也仍然可以正常导出。
SQL> host exp kamus/oracle tables=t_test
Export: Release 11.2.0.3.0 - Production on Tue May 29 14:56:21 2012
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, Oracle Label Security and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses UTF8 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table T_TEST 0 rows exported
Export terminated successfully without warnings.
SQL> select segment_name from user_segments where segment_name='T_TEST';
no rows selected
恩墨科技在吸收了Ora-600这份新鲜血液之后,开始推出非常有特色的Oracle高级技能培训课程,请允许我说,至少到目前为止,这份课程,除了恩墨科技,在国内还没有任何一个培训机构可以做出来。
这不仅仅是课程内容的安排,教师的选择,这份课程还融合了我们思考了很长时间的理念 – “备份重于一切,恢复来源实践”,我们希望能够通过这一系列课程让学员在备份和恢复这条线上深入浅出,从入门到精通。
无论你是想要了解最高屋建瓴的备份恢复理论,还是最internal的数据块结构,无论你是刚入门的新手DBA还是从业多年的有经验者,都可以从这份课程中找到可以学习的地方。
我们在5月份期待您的到来。:-)