set sort_area_size & sort_area_retained_size twice in 10g version
在10g version中,如果是manul PGA管理模式下,alter session set sort_area_size和sort_area_retained_size要设两次才能生效。
alter session set sort_area_size= 500000000;
alter session set sort_area_size= 500000000;
对于parallel sort,设置两次还不能对slave进程生效,可以通过设置隐藏参数 _sort_multiblock_read_count使其生效
parallel sort:
alter session set sort_area_size= 500000000;
alter session set “_sort_multiblock_read_count”=4;
我测试了正在使用的10203和10204版本,都可以重现
大家也可以试试自己的版本是不是有这一问题,测试步骤如下:
首先建一个test表,大约几十M吧。
测试过程如下:
我们系统上default sort_area_size=4M, sort_area_retained_size没有设,默认和sort_area_size一样
sqlplus xxxx/xxxx
SQL*Plus: Release 10.2.0.3.0 – Production on Sun Sep 27 08:25:09 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, OLAP and Data Mining optionsSQL> select sid from v$mystat where rownum=1;
SID
———-
19975SQL> !ora sesstat 19975 memory
NAME VALUE
—————————————————————- ———-
session uga memory 200704
session uga memory max 203328
session pga memory 609024
session pga memory max 609024
workarea memory allocated 0
sorts (memory) 246 rows selected.
SQL> alter session set sort_area_size=500000000; — set to 500M
Session altered.
SQL> select count(*) from (select * from test order by 1,2,3,4,5,6);
COUNT(*)
———-
857152SQL> !ora sesstat 19975 memory
NAME VALUE
—————————————————————- ———-
session uga memory 4337344
session uga memory max 4337344 — 可以看到这里使用的是默认的4M sort_area_size
session pga memory 5212192
session pga memory max 5212192
workarea memory allocated 0
sorts (memory) 246 rows selected.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, OLAP and Data Mining optionssqlplus xxxxx/xxxx
SQL*Plus: Release 10.2.0.3.0 – Production on Sun Sep 27 08:26:50 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, OLAP and Data Mining optionsSQL> select sid from v$mystat where rownum=1;
SID
———-
19975SQL> !ora sesstat 19975 memory
NAME VALUE
—————————————————————- ———-
session uga memory 200704
session uga memory max 203328
session pga memory 609024
session pga memory max 609024
workarea memory allocated 0
sorts (memory) 246 rows selected.
SQL> alter session set sort_area_size=500000000;
Session altered.
SQL> / — 再设置一遍
Session altered.
SQL> select count(*) from (select * from test order by 1,2,3,4,5,6);
COUNT(*)
———-
857152SQL> !ora sesstat 19975 memory
NAME VALUE
—————————————————————- ———-
session uga memory 57545920
session uga memory max 57545920
session pga memory 58019184 — 这里就是使用的我们设置的500M了
session pga memory max 58019184
workarea memory allocated 0
sorts (memory) 256 rows selected.
sort_area_retained_size 实验
sqlplus xxxx/xxxxx
SQL*Plus: Release 10.2.0.3.0 – Production on Sun Sep 27 08:47:09 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, OLAP and Data Mining optionsSQL> alter session set sort_area_size=500000000;
Session altered.
SQL> show parameter sort
NAME TYPE VALUE
———————————— ———– ——————————
nls_sort string
sort_area_retained_size integer 0
sort_area_size integer 500000000
SQL> alter session set sort_area_retained_size=10000000;Session altered.
SQL> select count(*) from (select * from test order by 1,2,3,4,5,6);
COUNT(*)
———-
857152ora sesstat 19975 memory
NAME VALUE
—————————————————————- ———-
session uga memory 57548992
session uga memory max 57548992
session pga memory 58019184 — sort_area_size是500M,但是 sort_area_retained_size还是默认值
session pga memory max 58019184
workarea memory allocated 0
sorts (memory) 276 rows selected.
sqlplus xxxxx/xxxxxx
SQL*Plus: Release 10.2.0.3.0 – Production on Sun Sep 27 08:48:19 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, OLAP and Data Mining optionsSQL> alter session set sort_area_size=500000000;
Session altered.
SQL> alter session set sort_area_retained_size=10000000;
Session altered.
SQL> alter session set sort_area_retained_size=10000000;
Session altered.
SQL> select count(*) from (select * from test order by 1,2,3,4,5,6);
COUNT(*)
———-
857152SQL>
ora sesstat 19975 memory
NAME VALUE
—————————————————————- ———-
session uga memory 10358720
session uga memory max 10358720
session pga memory 58001672 — 这里sort_area_retained_size就起作用了
session pga memory max 58001672
workarea memory allocated 0
sorts (memory) 256 rows selected.
你太牛了, 以前在SQLULDR2中只设了一次,结果这些选项没生效, 被人家说是工具的问题, 也就是我的人品的问题了.
agree with the author, had done everything correctly.
10.2.0.1 反而没有这个问题
hi ,你是在哪里找到要设“_sort_multiblock_read_count”,我在metalink上搜这个关键词都找不到任何记录。alter session set “_sort_multiblock_read_count”=
这是一个和sort相关的参数,具体你可以查找一份PPT名字为”If Your Memory Serves You Right“.里面介绍的比较详细。
I have learn several excellent stuff here. Definitely worth bookmarking for revisiting. I wonder how much effort you place to create this type of magnificent informative site.
Simply a smiling visitant here to share the love (:, btw outstanding design and style. “Individuals may form communities, but it is institutions alone that can create a nation.” by Benjamin Disraeli.
Fine way of telling, and nice paragraph to get facts on the topic of my presentation subject, which i am going to present in institution of higher education.
In to compete, some organizations get started with its search engine marketing having pay-per-click marketing and advertising products, such as Google. Even if this might lead to superb initially outcomes, the repayments so that you can Bing and google are unrecoverable charges, which inturn reduce business earnings on a monthly basis.
F*ckin’ remarkable things here. I am very happy to see your post. Thank you a lot and i am taking a look ahead to touch you. Will you kindly drop me a mail?
I’m curious to find out what blog platform you happen to be working with? I’m experiencing some minor security problems with my latest blog and I’d like to find something more safe. Do you have any solutions?
Nice blog right here! Also your web site lots up very fast! What host are you the usage of? Can I get your affiliate hyperlink on your host? I wish my website loaded up as quickly as yours lol
No matter if some one searches for his vital thing, so he/she wishes to be available that in detail, so that thing is maintained over here.
One more thing that I desire to share at this time is that, whatsoever you are using free blogging service except if you don’t update your web site on regularly basis then it’s no more worth.
Sorry for my bad English.I would like to thank you for the efforts you have put in writing this site. I am hoping the same high-grade site post from you in the upcoming as well. In fact your creative writing abilities has encouraged me to get my own website now. Really the blogging is spreading its wings quickly. Your write up is a great example of it.
Very well written story. It will be useful to everyone who employess it, including myself. Keep up the good work – can’r wait to read more posts.
Thanks for revealing your ideas. I’d personally also like to say that video games have been ever evolving. Modern tools and innovative developments have made it easier to create genuine and active games. These entertainment video games were not that sensible when the actual concept was first being tried. Just like other areas of technologies, video games as well have had to develop by many generations. This is testimony towards the fast growth of video games.
I ran across your site last week and started to follow your posts consistently. I haven’t commented on any kind of blog site just yet but I was considering to start soon. It’s truly exciting to actually contribute to an article even if it’s only a blog. I really don’t know exactly what to write other than I really loved reading through a couple of of your articles. Great articles for sure. I will keep visiting your blog regularly. I learned a lot from you. Thanks!
{Thanks for one’s marvelous posting! I seriously enjoyed reading it, you are a great author.I will always bookmark your blog and will come back down the road. I want to encourage yourself to continue your great writing, have a nice morning!|My partner and I absolutely love your blog and find most of your post’s to be exactly what I’m looking for. can you offer guest writers to write content for you? I wouldn’t mind composing a post or elaborating on most of the subjects you write concerning here. Again, awesome web log!|We stumbled over here from a different page and thought I might as well check things out. I like what I see so now i’m following you. Look forward to looking over your web page repeatedly.|I like what you guys tend to be up too. Such clever work and exposure! Keep up the fantastic works guys I’ve included you guys to my blogroll.|Greetings I am so happy I found your website, I really found you by accident, while I was researching on Askjeeve for something else, Anyways I am here now and would just like to say many thanks for a marvelous post and a all round entertaining blog (I also love the theme/design), I don’t have time to read through it all at the minute but I have book-marked it and also added your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the excellent work.|Admiring the time and effort you put into your website and detailed information you offer. It’s nice to come across a blog every once in a while that isn’t the same out of date rehashed information. Wonderful read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.|Greetings! I’ve been reading your site for a while now and finally got the courage to go ahead and give you a shout out from New Caney Texas! Just wanted to tell you keep up the excellent work!
Aw, this was a very nice post. Taking the time and actual effort to generate a top notch article… but what can I say… I put things off a lot and don’t manage to get nearly anything done.
It’s really a nice and useful piece of information. I’m happy that you simply shared this helpful info with us. Please keep us informed like this. Thank you for sharing.
I conceive this website has incredibly fantastic pent topic material blog posts.
With havin so much written content do you ever run into any problems of plagorism or copyright infringement? My blog has a lot of unique content I’ve either authored myself or outsourced but it appears a lot of it is popping it up all over the internet without my agreement. Do you know any solutions to help protect against content from being ripped off? I’d definitely appreciate it.
Hello there! Quick question that’s completely off topic. Do you know how to make your site mobile friendly? My web site looks weird when browsing from my apple iphone. I’m trying to find a template or plugin that might be able to correct this issue. If you have any recommendations, please share. Many thanks!
I enjoy, cause I discovered exactly what I was taking a look for. You’ve ended my four day long hunt! God Bless you man. Have a nice day. Bye
Wonderful website. Lots of useful info here. I’m sending it to several friends ans also sharing in delicious. And certainly, thanks for your sweat!
Whether you are looking for the ever green Daytona replica replica bell %%%amp; ross 49mm model watches watch; you will find the right watch at the right price right here