Subscribe to Posts by Email

Subscriber Count

    701

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Administration : How to distinguish you are seeing rows on CDB or PDB

Hi,

In view of multiple databases sharing single SGA how to distinguish which database you will need to see.

Now all dynamic views has two new columns for example:- V$process

	SQL> desc v$process
	Column			Datatype
	ADDR 			RAW(4 | 8)  
	PID 			NUMBER  
	SOSID 			VARCHAR2(24)  
	SPID 			VARCHAR2(24)  
	STID 			VARCHAR2(24)  
	EXECUTION_TYPE 		VARCHAR2(10)  
	PNAME 			VARCHAR2(5)  
	USERNAME 		VARCHAR2(15)
	SERIAL#  	 	NUMBER  
	TERMINAL	 	VARCHAR2(30) 
	PROGRAM 	 	VARCHAR2(48) 
	TRACEID 	 	VARCHAR2(255) 
	TRACEFILE	 	VARCHAR2(513) 
	BACKGROUND	 	VARCHAR2(1) 1 
	LATCHWAIT 	 	VARCHAR2(16)  
	LATCHSPIN 	 	VARCHAR2(16)  
	PGA_USED_MEM 	 	NUMBER PGA  
	PGA_ALLOC_MEM 	 	NUMBER PGA  
	PGA_FREEABLE_MEM 	NUMBER  
	PGA_MAX_MEM 		NUMBER  
	CON_ID 			NUMBER 	



	SQL> desc DBA_HIST_SQLTEXT  
	Name                                      Null?    Type  
	----------------------------------------- -------- ----------------------------  
	DBID                                      NOT NULL NUMBER  
	SQL_ID                                    NOT NULL VARCHAR2(13)  
	SQL_TEXT                                           CLOB  
	COMMAND_TYPE                                       NUMBER  
	CON_DBID                                           NUMBER  
	CON_ID                                             NUMBER  
	

As you see, the CON_ID,

The ID of the container to which the data pertains. Possible values include:

0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.
1: This value is used for rows containing data that pertain to only the root
n: Where n is the applicable container ID for the rows containing data

So we have to always filter the con_id when using v$session or v$process where con_id=container_id

-Thanks
Geek DBA

Comments are closed.