SPFILE for a CDB vs. a PDB
Recently, I have had conversations with users about Oracle Database 12c. One question that often comes up is, how does the database manage the parameters between a container database (CDB) and a pluggable database (PDB)? In order to answer this question, I had to work with my pluggable database setup in a test environment. Before changing anything within my database setup I first made a backup of the current parameters using a tired and true method.
SQL> create pfile=’init12ctest.ora’ from spfile;
Before diving into change and storage of parameters, it is important that you understand the concept of inheritance. Once you under stand inheritance within the Oracle Database 12c, you will grasp how parameters can be changed and stored for PDBs.
Inheritance
Inheritance in dealing with Oracle Database 12c means that the value of a particular parameter in the root (CDB) is inherited by one or more PDBs. There are parameters that can be changed at the PDB level and override what is being inherited from the CDB. To identify which parameters can be modified for a PDB, the ISPDB_MODIFIABLE column in the V$SYSTEM_PARAMETER view must be TRUE. If the ISPDB_MODIFIABLE is TRUE then the parameter inherits the value from the CDB until it is changed with an ALTER SYSTEM SET command at the PDB.
Setting Parameters
Now, let’s work on changing parameters for a PDB. In order to do this, you needed to navigate into a PDB using the ALTER SESSION SET CONTAINER command.
SQL> ALTER SESSION SET CONTAINER=bcpdb1;
Once inside of the PDB, you needed to find what parameters are modifiable. These parameters can be found using the following SQL statement. Remember, the ISPDB_MODIFIABLE has to be TRUE.
SQL> SELECT NAME FROM V$SYSTEM_PARAMETER
WHERE ISPDB_MODIFIABLE = ‘TRUE’
ORDER BY NAME;
With this list of parameters, pick one at random to change. Lets change the statistics_level from typical to all for bcpdb1.
SQL> ALTER SYSTEM SET STATISTICS_LEVEL = ALL SCOPE = BOTH;
By using BOTH, you are setting the parameter in memory and in the spfile. This way on a reboot of the database, the PDB will retain the setting.
Now that the parameter has been changed, can you see this change in the parameters for the CDB? Not at the CDB level, but you can at the PDB level from the V$PARAMETER. If I want to see the parameters that are set system wide (CDB & PDB), you needed to use the view V$SYSTEM_PARAMETER. The following SQL will display the statistics_level parameter for both CDB and PDB (make note of the con_id column).
SQL> SELECT NAME, VALUE, DISPLAY_VALUE, CON_ID FROM V$SYSTEM_PARAMETER
WHERE NAME = ‘statistics_level’
ORDER BY NAME;
At this point, you have two different settings for statistics_level depending on which container you are in. Now, you’ll want to make a backup of the spfile and verify that your settings for the PDB is in fact stored in the spfile.
SQL> CREATE PFILE=’init12ctest1.ora’ FROM SPFILE;
Let’s take a look at the pfile you just created.
bc12c.__data_transfer_cache_size=0
bc12c.__db_cache_size=1442840576
bc12c.__java_pool_size=16777216
bc12c.__large_pool_size=33554432
bc12c.__oracle_base=’/oracle/app’#ORACLE_BASE set from environment
bc12c.__pga_aggregate_target=1073741824
bc12c.__sga_target=2147483648
bc12c.__shared_io_pool_size=117440512
bc12c.__shared_pool_size=503316480
bc12c.__streams_pool_size=16777216
bc12c._common_user_prefix=’CU’##
*.audit_file_dest=’/oracle/app/admin/bc12c/adump’
*.audit_trail=’db’
*.compatible=’12.1.0.0.0′
*.control_files=’/oracle/app/oradata/BC12C/controlfile/o1_mf_91pqwlwo_.ctl’,’/oracle/app/fast_recovery_area/BC12C/controlfile/o1_mf_91pqwm7g_.ctl’
*.db_block_size=8192
*.db_create_file_dest=’/oracle/app/oradata’
*.db_domain=’acme.com’
*.db_name=’bc12c’
*.db_recovery_file_dest=’/oracle/app/fast_recovery_area’
*.db_recovery_file_dest_size=16106127360
*.diagnostic_dest=’/oracle/app’
*.dispatchers='(PROTOCOL=TCP) (SERVICE=bc12cXDB)’
*.enable_pluggable_database=true
*.local_listener=’LISTENER_BC12C’
*.log_archive_format=’%t_%s_%r.dbf’
*.open_cursors=300
*.pga_aggregate_target=1073741824
*.processes=300
*.remote_login_passwordfile=’EXCLUSIVE’
*.sga_max_size=2147483648
*.sga_target=2147483648
*.undo_tablespace=’UNDOTBS1′
Notice that the parameter statistics_level is not included in the output for the pfile. Why is this? If you go back to the documentation on Oracle Database 12c (here), you will find a note stating:
Note: A text initialization parameter file (PFILE) cannot contain PDB-specific parameter values.
Where are the parameters stored
Since the parameters for the PDB are not stored in the spfile, where are they stored then? In order to find this, you need to take the V$SYSTEM_PARAMETER view apart using GV$FIXED_VIEW_DEFINITION.
SQL> SELECT VIEW_DEFINITION FROM GV$FIXED_VIEW_DEFINITION
WHERE VIEW_NAME = ‘V$SYSTEM_PARAMETER’;
The V$SYSTEM_PARAMETER view points you to the GV$SYSTEM_PARAMETER view. Let’s grab the definition for this view.
SQL> SELECT VIEW_DEFINITION FROM GV$FIXED_VIEW_DEFINITION
WHERE VIEW_NAME = ‘GV$SYSTEM_PARAMETER’;
The definition for GV$SYSTEM_PARAMTER shows you that the information is coming from the X$KSPPI and X$KSPPSV tables in the data dictionary. The SQL that defines the GV$SYSTEM_PARAMETER view is listed below.
select x.inst_id,x.indx+1,ksppinm,ksppity,ksppstvl, ksppstdvl, ksppstdf,
decode(bitand(ksppiflg/256,1),1,’TRUE’,’FALSE’),
decode(bitand(ksppiflg/65536,3),1,’IMMEDIATE’,2,’DEFERRED’, 3,’IMMEDIATE’,’FALSE’),
decode(bitand(ksppiflg/524288,1),1,’TRUE’,’FALSE’),
decode(bitand(ksppiflg,4),4,’FALSE’,
decode(bitand(ksppiflg/65536,3), 0, ‘FALSE’, ‘TRUE’)),
decode(bitand(ksppstvf,7),1,’MODIFIED’,’FALSE’),
decode(bitand(ksppstvf,2),2,’TRUE’,’FALSE’),
decode(bitand(ksppilrmflg/64, 1), 1, ‘TRUE’, ‘FALSE’),
decode(bitand(ksppilrmflg/268435456, 1), 1, ‘TRUE’, ‘FALSE’),
ksppdesc, ksppstcmnt, ksppihash, y.con_id
from x$ksppi x, x$ksppsv y
where (x.indx = y.indx)
and bitand(ksppiflg,268435456) = 0
and ((translate(ksppinm,’_’,’#’) not like ‘##%’)
and ((translate(ksppinm,’_’,’#’) not like ‘#%’)
or (ksppstdf = ‘FALSE’)
or (bitand(ksppstvf,5) > 0)))
Now that you know the X tables to use, let’s take a look and see if you can locate the statistics_level parameter for bcpdb1.
SQL> SELECT * FROM X$KSPPSV
WHERE INDX IN (SELEC
T INDX FROM X$KSPPI WHERE CON_ID= 3 AND KSPPINM = ‘statistics_level’);
Notice that the CON_ID is 3. If you query CDB_PDB, you will notice that bcpdb1 has CON_ID of 3. At this point, you have located where the value of statistics_level for the PDB is stored. If you go back to the documentation, you will find references that tell you if SCOPE=SPFILE or SCOPE=BOTH were used when setting the parameter; the parameter will be transferred and stored in the XML file when the PDB is unplugged from the CDB. Let’s test this out.
Unplug a PDB
To test if the parameter (statistics_level) is stored in the XML file or data dictionary. What happens to the parameter when you unplug the PDB. According to documentation when unplugged the value of statistics_level should be stored in the associated XML file for plugging into a CDB. Let’s unplug BCPDB1.
SQL> ALTER PLUGGABLE DATABASE BCPDB1 CLOSE;
SQL> ALTER PLUGGABLE DATABASE BCPDB1 UNPLUG TO ‘/TMP/BCPDB1.XML’;
SQL> DROP PLUGGABLE DATABASE BCPDB1 KEEP DATAFILES;
With the pluggable database BCPDB1 unplugged from the CDB, lets see if the parameter values for statistics_level are still in the data dictionary.
SQL> SELECT * FROM X$KSPPSV
WHERE INDX IN (SELECT INDX FROM X$KSPPI WHERE CON_ID= 3 AND KSPPINM = ‘statistics_level’);
Apparently, the parameter values for statistics_level are gone. Let’s check the XML file that was created in the /tmp directory to see if the parameter is there.
<parameters>
<parameter>processes=300</parameter>
<parameter>sga_max_size=2147483648</parameter>
<parameter>sga_target=2147483648</parameter>
<parameter>db_block_size=8192</parameter>
<parameter>compatible=12.1.0.0.0</parameter>
<parameter>open_cursors=300</parameter>
<parameter>pga_aggregate_target=1073741824</parameter>
<parameter>enable_pluggable_database=TRUE</parameter>
<parameter>_common_user_prefix=CU</parameter>
</parameters>
The values that are in the XML file appear to be just general settings. The statistics_level parameter didn’t make it into the XML file either. Hmmm… Let’s plug in the PDB and see if the value comes back to the data dictionary.
Plug-in the PDB
In order to plug-in the PDB make sure you still have the data files and the XML file needed. What you are hoping for is that the statistic_level parameter comes back for the PDB and is set to a value of ALL.
SQL> CREATE PLUGGABLE DATABASE BCPDB1 USING ‘/TMP/BCPDB1.XML’ NOCOPY;
SQL> ALTER PLUGGABLE DATABASE BCPDB1 OPEN;
With the PDB (BCPDB1) open, let’s check and see if the statistic_level parameter is in the data dictionary.
SQL> SELECT * FROM X$KSPPSV
WHERE INDX IN (SELECT INDX FROM X$KSPPI WHERE CON_ID= 3 AND KSPPINM = ‘statistics_level’);
Sure enough, the statistics_level parameter came back. This means that the parameters for the PDB are stored in the PDB data dictionary. 🙂
Conclusion
When working with Oracle Database 12c, you have to understand how the initialization parameters are set for the CDB and each of the PDBs associated. The traditional ways of looking at an SPFILE will only be useful for a CDB database. This is because the CDB is the root level that controls many of the items which are shared amongst the CDB and PDBs. In order to fully understand how parameters are set for a PDB, you need to remember that PDBs inherit parameter values from a CDB; unless they are overridden from the PDB level.
Enjoy!
twitter: @dbasolved
blog: http://dbasolved.com
Current Oracle Certs
Bobby Curtis
I’m Bobby Curtis and I’m just your normal average guy who has been working in the technology field for awhile (started when I was 18 with the US Army). The goal of this blog has changed a bit over the years. Initially, it was a general blog where I wrote thoughts down. Then it changed to focus on the Oracle Database, Oracle Enterprise Manager, and eventually Oracle GoldenGate.
If you want to follow me on a more timely manner, I can be followed on twitter at @dbasolved or on LinkedIn under “Bobby Curtis MBA”.
how to buy priligy im 16 years old It is also due to the malfunction of the baroreceptor mechanism in severe aortic stenosis
An intriguing discussion is definitely worth comment. I think that you ought to write more on this subject matter, it may not be a taboo subject but generally people don’t speak about such issues. To the next! Best wishes!!
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why waste your intelligence on just posting videos to your weblog when you could be giving us something informative to read?
Hello there! I could have sworn I’ve visited your blog before but after browsing through many of the articles I realized it’s new to me. Anyhow, I’m definitely delighted I found it and I’ll be book-marking it and checking back frequently!
Hi my loved one! I wish to say that this article is amazing, great written and come with almost all important infos. I’d like to peer extra posts like this .
Useful info. Lucky me I found your site by chance, and I am surprised why this coincidence did not came about in advance! I bookmarked it.
Hurrah, that’s what I was searching for, what a data! present here at this website, thanks admin of this website.
Very nice article, exactly what I needed.
My spouse and I stumbled over here from a different web address and thought I might as well check things out. I like what I see so now i am following you. Look forward to finding out about your web page again.
I’m truly enjoying the design and layout of your site. It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a developer to create your theme? Outstanding work!
Fantastic beat ! I would like to apprentice while you amend your web site, how can i subscribe for a blog website? The account helped me a applicable deal. I were a little bit acquainted of this your broadcast offered brilliant transparent concept
hi!,I love your writing so much! share we keep in touch more about your post on AOL? I require an expert in this area to solve my problem. May be that’s you! Looking ahead to look you.
Hello! Do you know if they make any plugins to safeguard against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?
Touche. Outstanding arguments. Keep up the great work.
Hi would you mind letting me know which webhost you’re utilizing? I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot faster then most. Can you suggest a good web hosting provider at a reasonable price? Many thanks, I appreciate it!
Hello, just wanted to mention, I loved this article. It was inspiring. Keep on posting!
I’m amazed, I have to admit. Rarely do I come across a blog that’s both educative and interesting, and let me tell you, you have hit the nail on the head. The problem is an issue that not enough folks are speaking intelligently about. Now i’m very happy that I found this in my hunt for something concerning this.
It’s awesome for me to have a site, which is beneficial in support of my experience. thanks admin
Thank you for the good writeup. It in fact was a amusement account it. Look advanced to more added agreeable from you! However, how can we communicate?
It’s amazing to pay a quick visit this web page and reading the views of all friends about this post, while I am also keen of getting familiarity.
Hi there, yes this paragraph is in fact nice and I have learned lot of things from it concerning blogging. thanks.
Admiring the time and effort you put into your blog and detailed information you provide. It’s good to come across a blog every once in a while that isn’t the same unwanted rehashed information. Wonderful read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.
Spot on with this write-up, I seriously feel this web site needs a great deal more attention. I’ll probably be returning to read more, thanks for the advice!
It’s very simple to find out any topic on web as compared to textbooks, as I found this piece of writing at this web site.
Today, I went to the beach front with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is totally off topic but I had to tell someone!
Howdy are using WordPress for your blog platform? I’m new to the blog world but I’m trying to get started and set up my own. Do you need any coding expertise to make your own blog? Any help would be greatly appreciated!
I was curious if you ever considered changing the layout of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or 2 images. Maybe you could space it out better?
It’s really a great and useful piece of information. I am happy that you shared this useful info with us. Please keep us informed like this. Thanks for sharing.
Everyone loves what you guys are up too. This sort of clever work and coverage! Keep up the superb works guys I’ve incorporated you guys to my own blogroll.
I am really loving the theme/design of your site. Do you ever run into any web browser compatibility problems? A small number of my blog readers have complained about my website not working correctly in Explorer but looks great in Opera. Do you have any tips to help fix this issue?
Hi, everything is going sound here and ofcourse every one is sharing data, that’s actually fine, keep up writing.
Pretty! This has been a really wonderful post. Thank you for supplying this information.
It’s awesome to visit this web site and reading the views of all colleagues about this paragraph, while I am also zealous of getting knowledge.
Hi friends, its enormous article regarding cultureand entirely explained, keep it up all the time.
You should take part in a contest for one of the highest quality websites on the web. I most certainly will recommend this blog!
Right away I am ready to do my breakfast, once having my breakfast coming yet again to read more news.
Just desire to say your article is as astonishing. The clarity in your post is just great and i could assume you are an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please keep up the rewarding work.
Wonderful blog! I found it while surfing around on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Many thanks
Its like you learn my thoughts! You appear to understand so much about this, like you wrote the book in it or something. I feel that you could do with a few % to force the message house a little bit, however other than that, that is wonderful blog. A great read. I’ll certainly be back.
I am in fact pleased to read this webpage posts which includes plenty of useful facts, thanks for providing these kinds of statistics.
Heya i’m for the primary time here. I found this board and I find It truly useful & it helped me out a lot. I’m hoping to offer something back and help others such as you helped me.
Aw, this was a very good post. Finding the time and actual effort to produce a very good article… but what can I say… I procrastinate a lot and don’t manage to get anything done.
Hello, i think that i saw you visited my blog thus i came to “return the favor”.I’m attempting to find things to enhance my site!I suppose its ok to use a few of your ideas!!
I all the time emailed this weblog post page to all my contacts, as if like to read it after that my links will too.
Interesting blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog shine. Please let me know where you got your design. Thanks
Aw, this was an extremely good post. Taking the time and actual effort to make a superb article… but what can I say… I put things off a whole lot and don’t seem to get anything done.
Thanks in support of sharing such a nice thought, paragraph is pleasant, thats why i have read it completely
Nice post. I was checking constantly this blog and I’m impressed! Extremely helpful information specifically the last part 🙂 I care for such info a lot. I was looking for this certain information for a very long time. Thank you and best of luck.
Incredible points. Outstanding arguments. Keep up the amazing effort.
Excellent blog you have here.. It’s difficult to find quality writing like yours these days. I honestly appreciate individuals like you! Take care!!
Great work! That is the type of info that are supposed to be shared across the net. Disgrace on the search engines for now not positioning this post higher! Come on over and talk over with my site . Thanks =)
Hello to every , for the reason that I am truly keen of reading this web site’s post to be updated regularly. It carries pleasant material.
excellent publish, very informative. I ponder why the other specialists of this sector don’t notice this. You must continue your writing. I’m sure, you have a great readers’ base already!
You ought to take part in a contest for one of the highest quality blogs on the net. I most certainly will highly recommend this web site!
Thank you a lot for sharing this with all people you actually recognize what you’re talking about! Bookmarked. Kindly also consult with my web site =). We could have a hyperlink change contract between us
My family members always say that I am wasting my time here at net, however I know I am getting know-how all the time by reading such nice articles or reviews.
Howdy very nice blog!! Guy .. Excellent .. Amazing .. I will bookmark your site and take the feeds additionally? I am happy to find so many helpful info right here in the publish, we want develop extra techniques in this regard, thanks for sharing. . . . . .
Why visitors still use to read news papers when in this technological globe all is accessible on web?
Hi there! This is kind of off topic but I need some guidance from an established blog. Is it tough to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about making my own but I’m not sure where to start. Do you have any points or suggestions? Appreciate it
Hello, I think your site might be having browser compatibility issues. When I look at your blog in Ie, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, superb blog!
If you are going for finest contents like me, simply pay a quick visit this site daily because it presents feature contents, thanks
excellent post, very informative. I’m wondering why the other experts of this sector don’t understand this. You must proceed your writing. I’m confident, you have a huge readers’ base already!
I am now not positive the place you are getting your info, but great topic. I must spend some time learning much more or understanding more. Thank you for magnificent information I was looking for this information for my mission.
Ahaa, its pleasant dialogue concerning this piece of writing here at this blog, I have read all that, so now me also commenting at this place.
Hey There. I found your blog using msn. This is a really well written article. I will be sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll definitely return.
Greetings! Very useful advice within this post! It’s the little changes that produce the most significant changes. Many thanks for sharing!
You have made some good points there. I looked on the net to learn more about the issue and found most people will go along with your views on this web site.
A motivating discussion is worth comment. There’s no doubt that that you should write more on this topic, it may not be a taboo subject but generally folks don’t talk about these subjects. To the next! Many thanks!!
Wow, that’s what I was exploring for, what a material! present here at this blog, thanks admin of this site.
Hey! I just wanted to ask if you ever have any trouble with hackers? My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no data backup. Do you have any methods to protect against hackers?
Hello my family member! I wish to say that this article is amazing, great written and come with almost all important infos. I would like to peer extra posts like this .
Hi there! I’m at work surfing around your blog from my new iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the excellent work!
I’m gone to convey my little brother, that he should also pay a quick visit this web site on regular basis to get updated from newest reports.
Hey There. I found your blog using msn. This is a really well written article. I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I will definitely return.
I’m amazed, I have to admit. Seldom do I encounter a blog that’s both educative and interesting, and without a doubt, you have hit the nail on the head. The issue is something that not enough people are speaking intelligently about. Now i’m very happy I came across this in my hunt for something regarding this.
I think this is among the most important information for me. And i am glad reading your article. But wanna remark on few general things, The web site style is great, the articles is really great : D. Good job, cheers
Hello there I am so delighted I found your web site, I really found you by accident, while I was searching on Google for something else, Regardless I am here now and would just like to say thanks a lot for a incredible post and a all round enjoyable blog (I also love the theme/design), I don’t have time to go through it all at the moment but I have saved it and also added your RSS feeds, so when I have time I will be back to read much more, Please do keep up the great work.
I am sure this article has touched all the internet people, its really really pleasant post on building up new web site.
Highly energetic post, I loved that a lot. Will there be a part 2?
There is certainly a great deal to find out about this topic. I love all of the points you’ve made.
Aw, this was an incredibly good post. Taking a few minutes and actual effort to produce a good article… but what can I say… I put things off a lot and don’t manage to get anything done.
Hi there, I found your blog by way of Google while searching for a similar matter, your website came up, it appears great. I’ve bookmarked it in my google bookmarks.
Hello there, simply turned into alert to your blog through Google, and located that it is really informative. I’m going to be careful for brussels. I will appreciate should you proceed this in future. A lot of folks will be benefited out of your writing. Cheers!
I was wondering if you ever thought of changing the structure of your site? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two pictures. Maybe you could space it out better?
Magnificent items from you, man. I have understand your stuff prior to and you’re just too great. I really like what you’ve received here, certainly like what you’re saying and the best way in which you assert it. You’re making it entertaining and you still take care of to stay it sensible. I can not wait to learn much more from you. That is actually a terrific site.
Fine way of telling, and pleasant article to obtain data concerning my presentation focus, which i am going to convey in academy.
I’ve been exploring for a bit for any high-quality articles or blog posts on this kind of area . Exploring in Yahoo I finally stumbled upon this website. Reading this information So i am glad to express that I have a very good uncanny feeling I discovered just what I needed. I most without a doubt will make certain to don?t omit this website and provides it a look regularly.
Every weekend i used to go to see this site, for the reason that i wish for enjoyment, since this this website conations really pleasant funny data too.
I’m not sure exactly why but this web site is loading incredibly slow for me. Is anyone else having this problem or is it a problem on my end? I’ll check back later and see if the problem still exists.
Hello, this weekend is good in favor of me, because this moment i am reading this fantastic educational post here at my residence.
Hello, I would like to subscribe for this weblog to take hottest updates, thus where can i do it please help out.
Wonderful goods from you, man. I’ve understand your stuff prior to and you’re just too wonderful. I actually like what you’ve received here, certainly like what you’re stating and the best way by which you assert it. You are making it entertaining and you continue to take care of to stay it smart. I can not wait to learn far more from you. This is really a great site.