Where am I at: CDB vs. PDB? – 12 edition
All right, how many of us use the V$INSTANCE view to verify the instance name and current status of the database after we connect? In Oracle Database 12c, we can still find this information from V$INSTANCE. Breath a sigh of relief, for the moment! What if I connect to a container database and then issue an ALTER SESSION command to move into a different container, i.e. as PDB? Will I get the name of the PDB that I move into from the V$INSTANCE view or do I need to look somewhere else? Lets take a look.
Connect to the container database as usual and use the V$INSTANCE view to see where I’m at.
[oracle@oel6 dbhome_1]$ sqlplus / as sysdbaSQL> select instance_name, version, status, con_id from v$instance;INSTANCE_NAME VERSION STATUS CON_ID
----------------- ----------------- ------------ ----------
ora12cb 12.1.0.1.0 OPEN 0
Lets move into a PDB. I have quite a few PDBs created, lets just use PDB1.
SQL> alter session set container=PDB1;Session altered.
Did I actually move containers? How can I tell? Instead of selecting INSTANCE_NAME from V$INSTANCE; we have two new SHOW commands that will provide us the information we are looking for. These command are quite simple (SHOW CON_ID & SHOW CON_NAME).
SQL> show con_idCON_ID
------------------------------
3
SQL> show con_nameCON_NAME
------------------------------
PDB1
Now that we are confident that we are in PDB1, lets take a look at the V$INSTANCE view again. What you will notice is that V$INSTANCE provides us with information relative to the container database (CDB). It only makes sense that the V$INSTANCE would return CDB information. So, how do we identify items related to the pluggable database (PDB) without the SHOW commands?
Lets take a look at a view that is similar to V$INSTANCE. Enter the V$PDBS view!
SQL> desc v$pdbs;
Name Null? Type
----------------------- -------- ----------------------------
CON_ID NUMBER
DBID NUMBER
CON_UID NUMBER
GUID RAW(16)
NAME VARCHAR2(30)
OPEN_MODE VARCHAR2(10)
RESTRICTED VARCHAR2(3)
OPEN_TIME TIMESTAMP(3)
CREATE_SCN NUMBER
TOTAL_SIZE NUMBER
This view provides similar information as V$INSTANCE does; yet is only specific to PDBs. If we wanted to find out the container_id, name, open_mode and size of the PDB we are currently connected to, we can use this query:
SQL> select con_id, name, open_mode, total_size from v$pdbs;CON_ID NAME OPEN_MODE TOTAL_SIZE
---------- ------------------------------ ---------- ----------
3 PDB1 READ WRITE 393216000
What is interesting to point out, is that since we used an ALTER SESSION statement to switch to PDB1, the V$PDBS view only lists the PDB we are currently working in. If we want to get a complete list of PDBs within the container database, we need to go back to the root container database and run the same SQL statement.
SQL> alter session set container=CDB$ROOT;Session altered.SQL> show con_nameCON_NAME
------------------------------
CDB$ROOT
SQL> select con_id, name, open_mode, total_size from v$pdbs;CON_ID NAME OPEN_MODE TOTAL_SIZE
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY 283115520
3 PDB1 READ WRITE 393216000
4 PDBTEST MOUNTED 0
5 PDB2 READ ONLY 393216000
I hope that everyone now understands how to find information related to PDBs from SQL*Plus.
Enjoy!
twitter: @curtisbl294
blog: http://dbasolved.com
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”.
augmentin no prescription He has seen through all the conspiracies of the Dark God
Yesterday, while I was at work, my cousin stole my apple ipad and tested
to see if it can survive a 30 foot drop, just so she can be a youtube sensation.
My apple ipad is now destroyed and she has
83 views. I know this is totally off topic but I had to share
it with someone! https://prostata-hifu.mystrikingly.com/
It’s very trouble-free to find out any topic on web as
compared to textbooks, as I found this post at this
web site. https://mrifusion.mystrikingly.com/
Yes! Finally someone writes about sonablate. https://biopsy-artemis.blogspot.com/2025/02/prostate-biopsy-artemis-precision-and.html
Pretty nice post. I just stumbled upon your blog and wished to say that
I have really enjoyed surfing around your blog posts.
In any case I will be subscribing to your feed and I hope you write
again soon! https://einweg-endoskope.blogspot.com/2025/02/urologische-einweg-endoskope-wiscope.html
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
I’m curious to find out what blog system you
happen to be utilizing? I’m having some minor security issues with my latest website and I’d like to find something more
secure. Do you have any recommendations? https://subscribed.fyi/blog/e-payments-methods-examples-of-modern-transactions/
Hmm is anyone else experiencing problems with the images on this blog loading?
I’m trying to find out if its a problem on my end or if it’s the blog.
Any responses would be greatly appreciated. https://menbehealth.wordpress.com/
March 2: More than 400 Italian civilians die on a cargo prepare when it stalls in a tunnel and asphyxiates them with fumes. March 25: Seventy-six Allied pilots escape from the German POW camp Stalag Luft III, outside of Berlin, by way of an expertly engineered underground tunnel. March 15: Responding to Hungary’s latest flirtation with the Allies, German troops stage alongside the border, forewarning an invasion. As many as six million workers in northern Italy strike in protest of deportations of Italians to German slave labor camps. Headlining conflict news in 1944 had been the Allied assaults on Italy and Japan, and the presence of a Hitler relative within the U.S. The Marianas see motion for the first time throughout the war, because the Allies launch a series of air attacks against the Japanese on the islands of Guam, Saipan, Tinian, and Rota. See also Little Christmas. After just a little time for mingling, we’ll begin velocity relationship!
There are plenty of foreign courting apps free on the market for expats. High on the agenda there shall be issues associated with debt sustainability for low- and middle-revenue international locations; mobilizing finance for infrastructure – physical, digital, energy infrastructure world wide; and likewise dealing, obviously, with the main geopolitical issues of the day, from Ukraine to the Middle East. William and his mom traveled to America for a lecture tour, they usually stayed voluntarily there in the beginning of the battle. Navy: Unknown to most Americans however watched very fastidiously by the FBI, William Patrick Hitler, the nephew of Adolf Hitler, lived with his mother in New York City in the course of the warfare. Dating many European and American males do not share real courting and nonetheless want free households, they begin searching for a girl who will change into a loyal good friend, spouse, and mom sites their kids. Our online courting software permits including new sites to current database and sharing all users, making your multiple websites unique in design. We sites know english irritating it apps be when someone does not know what they want!
Despite widespread English fluency and obvious similarities, Europe is wealthy in cultural nuances. Where are all the enticing women in Europe situated? The immigrants primarily belong to South Asia, Far East, Europe and Middle East. The Nazis homicide 336 Italian civilians to avenge a partisan attack that claimed the lives of 33 members of the SS who have been marching by means of a slim street in Rome. March 3: The Allies reveal that the U.S., Britain, and Soviet Union will share equally within the warfare spoils of the Italian navy. Enjoying overwhelming superiority in men and guns — together with 24,000 artillery pieces — the Soviet Union forces have been unstoppable. Allies in the end prevail in Burma marketing campaign: The fate of the China-Burma-India region was decided by the British 14th Army’s profitable Burma marketing campaign (supported by U.S.-led Chinese Nationalist forces) from mid-1944, following its victories at Imphal and Kohima. In 1943 and 1944, he led a protracted-range penetration brigade, the famed “Chindits,” in opposition to the Japanese in Burma. The INA allied itself with the Japanese through the conflict.
The freight cars had turn into the one technique of transportation in a country the place all available assets are being dedicated to the conflict effort. March 4: The Japanese authorities order schoolchildren as young as 12 to mobilize for the conflict effort. Both the Japanese and the British Royal Air Force suffered vital losses in March 1944. Read about these and other World War II events in the next section. March 31: Within the worst RAF losses of the warfare, 95 bombers are misplaced in one night in an unsuccessful raid of Nuremberg, Nazi Germany. March 30-April 2: The Japanese suffer major tools and provide losses when U.S. A detailed timeline of events and headlines of main news stories are included. Belgian ladies are known for being direct communicators who categorical their opinions overtly without hesitation. Caveman and girls living situations charmdate scam had been dependent on seasons and were frequently roam in search of food and shelter. The audience here leans in the direction of these looking for greater than only a casual fling. If you’re searching for a woman who can stand on her personal two feet, a Spanish girl is the proper selection. You’ll be able to ship winks to ladies without spending a dime and add them to your favorites checklist.