How many times have I told not to create objects in the SYS schema?


SQL> show user
USER is “SYS”
SQL> create table xyz (n number);

Table created.

SQL> drop table xyz;

Table dropped.

SQL> flashback table xyz to before drop;
flashback table xyz to before drop
*
ERROR at line 1:
ORA-38305: object not in RECYCLE BIN

SQL> show parameter recycle

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
buffer_pool_recycle                  string
db_recycle_cache_size                big integer 0
recyclebin                           string      on

oooopsie dasy! Looks like though I have recycle bin enabled I can’t have the feature, just because it’s in the SYS schema. Is it?

Let’s take a deeper look:

SQL> create table xyz (n number) tablespace users;

Table created.

SQL> drop table xyz;

Table dropped.

SQL> flashback table xyz to before drop;

Flashback complete.

SQL> desc sys.xyz
 
Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 N                                                  NUMBER

So the problem it’s not the SYS schema, it’s the SYSTEM tablespace. Whatever object lands there, it won’t be able to come back after droping it.

Small stuff that sometimes makes the difference.

LMC.

About these ads

2 thoughts on “How many times have I told not to create objects in the SYS schema?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s