<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>《ORCLE 12C 增加列,无默认值》的评论</title>
	<atom:link href="https://www.xifenfei.com/2012/12/orcle-12c-%e5%a2%9e%e5%8a%a0%e5%88%97%e6%97%a0%e9%bb%98%e8%ae%a4%e5%80%bc.html/feed" rel="self" type="application/rss+xml" />
	<link>https://www.xifenfei.com/2012/12/orcle-12c-%e5%a2%9e%e5%8a%a0%e5%88%97%e6%97%a0%e9%bb%98%e8%ae%a4%e5%80%bc.html</link>
	<description>提供7*24专业数据库(Oracle,SQL Server,MySQL,PostgreSQL等)恢复和技术支持@Tel:17813235971</description>
	<lastBuildDate>Thu, 11 Dec 2025 02:46:14 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>作者：惜分飞</title>
		<link>https://www.xifenfei.com/2012/12/orcle-12c-%e5%a2%9e%e5%8a%a0%e5%88%97%e6%97%a0%e9%bb%98%e8%ae%a4%e5%80%bc.html/comment-page-1#comment-1186</link>
		<dc:creator><![CDATA[惜分飞]]></dc:creator>
		<pubDate>Wed, 19 Dec 2012 14:01:08 +0000</pubDate>
		<guid isPermaLink="false">https://www.xifenfei.com/?p=4059#comment-1186</guid>
		<description><![CDATA[试验测试证明在11.2.0.3的版本中就已经具有了Metadata-Only DEFAULT Column Values for NULL Columns,而不是从12C开始的新特性
[sql]
SQL&gt; select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

SQL&gt; drop table t_xifenfei;

Table dropped.

SQL&gt; create table t_xifenfei(id number,name varchar2(20));

Table created.

SQL&gt; insert into t_xifenfei values (1,&#039;www.xifenfei.com&#039;);

1 row created.

SQL&gt; insert into t_xifenfei values (2,&#039;www.xifenfei.com&#039;);

1 row created.

SQL&gt; insert into t_xifenfei values (3,&#039;www.xifenfei.com&#039;);

1 row created.

SQL&gt; alter table t_xifenfei add c_xff1 varchar2(100);

Table altered.

SQL&gt; alter table t_xifenfei add c_xff2 varchar2(100) default &#039;www.xifenfei.com&#039; not null;

Table altered.

SQL&gt; desc t_xifenfei;
 Name                                                              Null?    Type
 ----------------------------------------------------------------- -------- ----------------------
 ID                                                                         NUMBER
 NAME                                                                       VARCHAR2(20)
 C_XFF1                                                                     VARCHAR2(100)
 C_XFF2                                                            NOT NULL VARCHAR2(100)

SQL&gt; select   rowid,
  2    dbms_rowid.rowid_relative_fno(rowid)rel_fno,
  3   dbms_rowid.rowid_block_number(rowid)blockno,
  4   dbms_rowid.rowid_row_number(rowid) rowno
  5   from t_xifenfei ;

ROWID                 REL_FNO    BLOCKNO      ROWNO
------------------ ---------- ---------- ----------
AAANnzAAEAAHbekAAA          4    1947556          0
AAANnzAAEAAHbekAAB          4    1947556          1
AAANnzAAEAAHbekAAC          4    1947556          2

SQL&gt; alter system checkpoint;

System altered.

SQL&gt; alter system dump datafile 4 block 1947556;

System altered.

--dump block
block_row_dump:
tab 0, row 0, @0x1f81
tl: 23 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 02
col  1: [16]  77 77 77 2e 78 69 66 65 6e 66 65 69 2e 63 6f 6d
tab 0, row 1, @0x1f6a
tl: 23 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 03
col  1: [16]  77 77 77 2e 78 69 66 65 6e 66 65 69 2e 63 6f 6d
tab 0, row 2, @0x1f53
tl: 23 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 04
col  1: [16]  77 77 77 2e 78 69 66 65 6e 66 65 69 2e 63 6f 6d
end_of_block_dump
[/sql]]]></description>
		<content:encoded><![CDATA[<p>试验测试证明在11.2.0.3的版本中就已经具有了Metadata-Only DEFAULT Column Values for NULL Columns,而不是从12C开始的新特性</p>
<pre class="brush: sql; title: ; notranslate">
SQL&gt; select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

SQL&gt; drop table t_xifenfei;

Table dropped.

SQL&gt; create table t_xifenfei(id number,name varchar2(20));

Table created.

SQL&gt; insert into t_xifenfei values (1,'www.xifenfei.com');

1 row created.

SQL&gt; insert into t_xifenfei values (2,'www.xifenfei.com');

1 row created.

SQL&gt; insert into t_xifenfei values (3,'www.xifenfei.com');

1 row created.

SQL&gt; alter table t_xifenfei add c_xff1 varchar2(100);

Table altered.

SQL&gt; alter table t_xifenfei add c_xff2 varchar2(100) default 'www.xifenfei.com' not null;

Table altered.

SQL&gt; desc t_xifenfei;
 Name                                                              Null?    Type
 ----------------------------------------------------------------- -------- ----------------------
 ID                                                                         NUMBER
 NAME                                                                       VARCHAR2(20)
 C_XFF1                                                                     VARCHAR2(100)
 C_XFF2                                                            NOT NULL VARCHAR2(100)

SQL&gt; select   rowid,
  2    dbms_rowid.rowid_relative_fno(rowid)rel_fno,
  3   dbms_rowid.rowid_block_number(rowid)blockno,
  4   dbms_rowid.rowid_row_number(rowid) rowno
  5   from t_xifenfei ;

ROWID                 REL_FNO    BLOCKNO      ROWNO
------------------ ---------- ---------- ----------
AAANnzAAEAAHbekAAA          4    1947556          0
AAANnzAAEAAHbekAAB          4    1947556          1
AAANnzAAEAAHbekAAC          4    1947556          2

SQL&gt; alter system checkpoint;

System altered.

SQL&gt; alter system dump datafile 4 block 1947556;

System altered.

--dump block
block_row_dump:
tab 0, row 0, @0x1f81
tl: 23 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 02
col  1: [16]  77 77 77 2e 78 69 66 65 6e 66 65 69 2e 63 6f 6d
tab 0, row 1, @0x1f6a
tl: 23 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 03
col  1: [16]  77 77 77 2e 78 69 66 65 6e 66 65 69 2e 63 6f 6d
tab 0, row 2, @0x1f53
tl: 23 fb: --H-FL-- lb: 0x1  cc: 2
col  0: [ 2]  c1 04
col  1: [16]  77 77 77 2e 78 69 66 65 6e 66 65 69 2e 63 6f 6d
end_of_block_dump
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
