.ora-code.com

Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
disable pk works differently in oracle 9 and oracle 10?

disable pk works differently in oracle 9 and oracle 10?

2006-06-09       - By Connor McDonald
Reply:     <<     11     12     13     14     15     16  

On 6/9/06, Mladen Gogala <gogala@(protected)> wrote:
>
>
> On 06/08/2006 01:40:26 PM, genegurevich@(protected) wrote:
> > Hi all:
>
> >
> > SQL>  create table test1 (f1 number);
> >
> > Table created.
> >
> > SQL>  create unique index test1_pk on test1 (f1);
> >
> > Index created.
> >
> > SQL> alter table test1 add constraint test1_pk primary key  (f1) using
> > index;
> >
> > Table altered.
> >
> > SQL> select index_name from dba_indexes where table_name = 'TEST1';
> > TEST1_PK
> >
> > SQL>  alter table test1 disable primary key;
> >
> > Table altered.
> >
> > SQL>  select index_name from dba_indexes where table_name = 'TEST1';
> > TEST1_PK
> >
> > Here the index stays after the PK is disabled.
> >
> > This is a big difference IMO and I wonder whether this is a new feature
> in
> > oracle10 or whether this is something I am not
> > doing correctly. If anyone has any insight on that please let me know
> >
> > thank you
> >
> > Gene Gurevich
> > Oracle Engineering
> > 224-405-4079
>
>
> Gene, it must be a bug in your version. In my database, 10.2.0.2, the
> index goes as well:
>
>
> Connected to:
> Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
> With the Partitioning, OLAP and Data Mining options
>
> SQL> create table test1 (f1 number);
>
> Table created.
>
> SQL> create unique index test1_pk on test1 (f1);
>
> Index created.
>
> SQL> alter table test1 add constraint test1_pk primary key  (f1) using
> 2  index test1_pk;
>
> Table altered.
>
> SQL> alter table test1 disable constraint test1_pk drop index;
>
> Table altered.
>
> SQL> select count(*) from user_indexes where index_name='TEST1_PK';
>
> COUNT(*)
> -- ---- --
>         0
>
> SQL>
>
>
> It's probably the infamous RTFM bug in your version.
>
> --
> Mladen Gogala
> http://www.mgogala.com
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
Well, yes Mladen, if you *change* the script, then you do get different
results....but I'm not sure that's the point the OP was making.  Its a
change in *defa*ult behaviour between v9 and v10, my 10.2.0.2 results below:

SQL> select * from v$version;

BANNER
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod
PL/SQL Release 10.2.0.2.0 - Production
CORE    10.2.0.2.0      Production
TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
NLSRTL Version 10.2.0.2.0 - Production

SQL> drop table test1;
drop table test1
          *
ERROR at line 1:
ORA-00942 (See ORA-00942.ora-code.com): table or view does not exist


SQL> create table test1 (f1 number);

Table created.

SQL> create unique index test1_pk on test1 (f1);

Index created.

SQL> alter table test1 add constraint test1_pk primary key  (f1) using
index;

Table altered.

SQL> select index_name from dba_indexes where table_name = 'TEST1';

INDEX_NAME
-- ---- ---- ---- ---- ---- --
TEST1_PK

SQL> alter table test1 disable primary key;

Table altered.

SQL> select index_name from dba_indexes where table_name = 'TEST1';

INDEX_NAME
-- ---- ---- ---- ---- ---- --
TEST1_PK

I have to admit I like the new default...now if only I could set a unique
index to unusable I'd be a happy camper

--
Connor McDonald
===========================
email: connor_mcdonald@(protected)
web:   http://www.oracledba.co.uk

"Semper in excremento, sole profundum qui variat"

<br><br>
<div><span class="gmail_quote">On 6/9/06, <b class="gmail_sendername">Mladen
Gogala</b> &lt;<a href="mailto:gogala@(protected)">gogala@(protected)</a>
&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0
.8ex; BORDER-LEFT: #ccc 1px solid"><br>On 06/08/2006 01:40:26 PM, <a href=
"mailto:genegurevich@(protected)">genegurevich@(protected)
</a> wrote:<br>&gt; Hi all:<br><br>&gt;<br>&gt; SQL&gt;&nbsp;&nbsp;create table
test1 (f1 number);<br>&gt;<br>&gt; Table created.<br>&gt;<br>&gt; SQL&gt;&nbsp;
&nbsp;create unique index test1_pk on test1 (f1);<br>&gt;<br>&gt; Index created.
<br>
&gt;<br>&gt; SQL&gt; alter table test1 add constraint test1_pk primary key&nbsp
;&nbsp;(f1) using<br>&gt; index;<br>&gt;<br>&gt; Table altered.<br>&gt;<br>&gt;
SQL&gt; select index_name from dba_indexes where table_name = 'TEST1';<br>
&gt; TEST1_PK<br>&gt;<br>&gt; SQL&gt;&nbsp;&nbsp;alter table test1 disable
primary key;<br>&gt;<br>&gt; Table altered.<br>&gt;<br>&gt; SQL&gt;&nbsp;&nbsp
;select index_name from dba_indexes where table_name = 'TEST1';<br>&gt; TEST1_PK
<br>&gt;
<br>&gt; Here the index stays after the PK is disabled.<br>&gt;<br>&gt; This is
a big difference IMO and I wonder whether this is a new feature in<br>&gt;
oracle10 or whether this is something I am not<br>&gt; doing correctly. If
anyone has any insight on that please let me know
<br>&gt;<br>&gt; thank you<br>&gt;<br>&gt; Gene Gurevich<br>&gt; Oracle
Engineering<br>&gt; 224-405-4079<br><br><br>Gene, it must be a bug in your
version. In my database, <a href="http://10.2.0.2">10.2.0.2</a>, the index goes
as well:
<br><br><br>Connected to:<br>Oracle Database 10g Enterprise Edition Release 10
.2.0.2.0 - Production<br>With the Partitioning, OLAP and Data Mining options<br>
<br>SQL&gt; create table test1 (f1 number);<br><br>Table created.
<br><br>SQL&gt; create unique index test1_pk on test1 (f1);<br><br>Index
created.<br><br>SQL&gt; alter table test1 add constraint test1_pk primary key
&nbsp;&nbsp;(f1) using<br>2&nbsp;&nbsp;index test1_pk;<br><br>Table altered.<br>
<br>SQL&gt; alter table test1 disable constraint test1_pk drop index;
<br><br>Table altered.<br><br>SQL&gt; select count(*) from user_indexes where
index_name='TEST1_PK';<br><br>COUNT(*)<br>-- ---- --<br>&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;0<br><br>SQL&gt;<br><br><br>It's probably the infamous
RTFM bug in your version.
<br><br>--<br>Mladen Gogala<br><a href="http://www.mgogala.com">http://www
.mgogala.com</a><br><br>--<br><a href="http://www.freelists.org/webpage/oracle-l
">http://www.freelists.org/webpage/oracle-l</a><br><br><br></blockquote>
</div>
<div>&nbsp;</div>
<div>Well, yes Mladen, if you <em>change</em> the script, then you do get
different results....but I'm not sure that's the point the OP was making.&nbsp;
Its a change in <em>defa</em>ult behaviour between v9 and v10, my <a href="http
://10.2.0.2">
10.2.0.2</a> results below:</div>
<div><br>SQL&gt; select * from v$version;</div>
<p>BANNER<br>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
<br>Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod<br>PL/SQL
Release 10.2.0.2.0 - Production<br>CORE&nbsp;&nbsp;&nbsp; 10.2.0.2.0&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp; Production
<br>TNS for 32-bit Windows: Version 10.2.0.2.0 - Production<br>NLSRTL Version
10.2.0.2.0 - Production</p>
<p>SQL&gt; drop table test1;<br>drop table test1<br>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *<br>ERROR at line 1:<br>ORA-00942 (See ORA-00942.ora-code.com): table
or view does not exist</p>
<p><br>SQL&gt; create table test1 (f1 number);</p>
<p>Table created.</p>
<p>SQL&gt; create unique index test1_pk on test1 (f1);</p>
<p>Index created.</p>
<p>SQL&gt; alter table test1 add constraint test1_pk primary key&nbsp; (f1)
using index;</p>
<p>Table altered.</p>
<p>SQL&gt; select index_name from dba_indexes where table_name = 'TEST1';</p>
<p>INDEX_NAME<br>-- ---- ---- ---- ---- ---- --<br>TEST1_PK</p>
<p>SQL&gt; alter table test1 disable primary key;</p>
<p>Table altered.</p>
<p>SQL&gt; select index_name from dba_indexes where table_name = 'TEST1';</p>
<p>INDEX_NAME<br>-- ---- ---- ---- ---- ---- --<br>TEST1_PK<br></p>
<div>&nbsp;</div>
<div>I have to admit I like the new default...now if only I could set a unique
index to unusable I'd be a happy camper<br clear="all"><br>-- <br>Connor
McDonald<br>===========================<br>email: <a href="mailto:connor
_mcdonald@(protected)">
connor_mcdonald@(protected)</a><br>web:&nbsp;&nbsp; <a href="http://www.oracledba
.co.uk">http://www.oracledba.co.uk</a><br><br>&quot;Semper in excremento, sole
profundum qui variat&quot; </div>