Unix Technical Forum

Question: Is is safe to move a 'plan table' to a temp tablespace???

This is a discussion on Question: Is is safe to move a 'plan table' to a temp tablespace??? within the Oracle Database forums, part of the Database Server Software category; --> Hey, all. I've got a non-managed standby database, which I am hoping to release as a reporting database. I'm ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2008, 05:45 AM
BD
 
Posts: n/a
Default Question: Is is safe to move a 'plan table' to a temp tablespace???

Hey, all.

I've got a non-managed standby database, which I am hoping to release
as a reporting database.

I'm trying to determine what I can and can't do with this db. Clearly,
as it can only be opened in read only mode, I can't modify anything.

I am trying an explain plan on a SQL statement (something I'm sure the
developers would like for testing) and get an error:

RA-01552: cannot use system rollback segment for non-system tablespace

My current impression as to why this is happening is that explain plan
writes to the plan_table, which is stored in a permanent tablespace.

Can I not run explain plans in a read-only standby, then? Or is there
some mechanism of moving the plan_table to a temp tablespace? Sounds
like a bad idea, but otherwise, I see no way of using explain plan for
tuning in a read-only db...

Thanks for all comments,

BD.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 05:45 AM
Brian Peasland
 
Posts: n/a
Default Re: Question: Is is safe to move a 'plan table' to a temp tablespace???

> Can I not run explain plans in a read-only standby, then?

Why would you? The Optimizer takes things into account like the load on
the system (in 10g). The load in your read-only system will differ from
your production system, so that can lead to different execution plans.
And unless you guarantee that every other configuration item is
identical in the two systems, tuning a query on your read-only database
may not yield the same results on your production database.

> Or is there
> some mechanism of moving the plan_table to a temp tablespace?


Sorry but no. The PLAN_TABLE is a permanent segment and you can only
have temporary segments in the TEMP tablespace.

HTH,
Brian


--
================================================== =================

Brian Peasland
oracle_dba@nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-25-2008, 05:45 AM
bdbafh@gmail.com
 
Posts: n/a
Default Re: Question: Is is safe to move a 'plan table' to a temp tablespace???


BD wrote:
> Hey, all.
>
> I've got a non-managed standby database, which I am hoping to release
> as a reporting database.
>
> I'm trying to determine what I can and can't do with this db. Clearly,
> as it can only be opened in read only mode, I can't modify anything.
>
> I am trying an explain plan on a SQL statement (something I'm sure the
> developers would like for testing) and get an error:
>
> RA-01552: cannot use system rollback segment for non-system tablespace
>
> My current impression as to why this is happening is that explain plan
> writes to the plan_table, which is stored in a permanent tablespace.
>
> Can I not run explain plans in a read-only standby, then? Or is there
> some mechanism of moving the plan_table to a temp tablespace? Sounds
> like a bad idea, but otherwise, I see no way of using explain plan for
> tuning in a read-only db...
>
> Thanks for all comments,
>
> BD.


One could certainly create the plan table as a global temporary table
in the source production database.
Whether that is sufficient to work on a standby database is another
matter.

-bdbafh

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-25-2008, 05:45 AM
Jonathan Lewis
 
Posts: n/a
Default Re: Question: Is is safe to move a 'plan table' to a temp tablespace???

"BD" <bobby_dread@hotmail.com> wrote in message
news:1149195265.097581.181410@g10g2000cwb.googlegr oups.com...
> Hey, all.
>
> I've got a non-managed standby database, which I am hoping to release
> as a reporting database.
>
> I'm trying to determine what I can and can't do with this db. Clearly,
> as it can only be opened in read only mode, I can't modify anything.
>
> I am trying an explain plan on a SQL statement (something I'm sure the
> developers would like for testing) and get an error:
>
> RA-01552: cannot use system rollback segment for non-system tablespace
>
> My current impression as to why this is happening is that explain plan
> writes to the plan_table, which is stored in a permanent tablespace.
>
> Can I not run explain plans in a read-only standby, then? Or is there
> some mechanism of moving the plan_table to a temp tablespace? Sounds
> like a bad idea, but otherwise, I see no way of using explain plan for
> tuning in a read-only db...
>
> Thanks for all comments,
>
> BD.
>


Interesting question.

In 10g, the default install of the plan_table
table is a global temporary table (called
plan_table$) in the SYS schema with a
public synonym and public access - and
I've the same sort of thing in 8i and 9i
but using the system schema for the last
few years.

But explain plan executes
SELECT ORA_PLAN_ID_SEQ$.NEXTVAL FROM DUAL

which leads to an update of the seq$ table, which
means there is another reason why explain plan would
probably not work in a read-only database.


--
Regards

Jonathan Lewis
http://www.oracle.com/technology/com...ce1.html#lewis

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-25-2008, 05:46 AM
BD
 
Posts: n/a
Default Re: Question: Is is safe to move a 'plan table' to a temp tablespace???

> In 10g, the default install of the plan_table
> table is a global temporary table


Sorry forgot to say I'm running 8.1.7.4 here. Bit of a different world.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-25-2008, 05:46 AM
Jonathan Lewis
 
Posts: n/a
Default Re: Question: Is is safe to move a 'plan table' to a temp tablespace???

"BD" <bobby_dread@hotmail.com> wrote in message
news:1149265536.856099.119680@h76g2000cwa.googlegr oups.com...
>> In 10g, the default install of the plan_table
>> table is a global temporary table

>
> Sorry forgot to say I'm running 8.1.7.4 here. Bit of a different world.
>
>


On the other hand, if you look closely
you will note that I've put:

I've [done] the same sort of thing in 8i and 9i
but using the system schema for the last
few years.

--
Regards

Jonathan Lewis
http://www.oracle.com/technology/com...ce1.html#lewis

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-25-2008, 05:46 AM
BD
 
Posts: n/a
Default Re: Question: Is is safe to move a 'plan table' to a temp tablespace???


> On the other hand, if you look closely
> you will note that I've put:



Yes, I see... But I think that in my case it's moot, because it's a
read-only standby database that I'm trying to get Explain Plan working
in; creating a temporary table in a standard schema would not do much
for me here, as that schema will still be read only.

The only way I could make it work would be to either create another
tablespace which I could write to, or create the plan_table in the
temporary tablespace - neither of which is allowed.

I do not believe there's a way to make it work. Your comment about
updating the seq$ table convinces me even more.

Thanks for the insights; not the news I wanted, but at least I've done
due diligence. ;-)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:05 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com