Let's say you've created a common user in your Oracle 12c instance and you granted the user permissions to connect and select some specific dynamic views (e.g. V$PDBS, V$CONTAINERS).
Afterwards, you connect with that common user to the root container (CDB$ROOT), you query V$PDBS but no rows are returned.
This issue was raised in the OTN forum by a user and my answer to that user was very simple - use the CONTAINER_DATA clause (See: https://community.oracle.com/message/13301017#13301017).
Basically, when a common user is connected to the ROOT and it executes a query on a container data object (As per Oracle Doc, container data objects include: V$, GV$, CDB_, and some Automatic Worklaod Repository DBA_HIST* view), then that query will only dispay data for the PDBs which are visible for that common user, and this is what you can set using the CONTAINER_DATA clause.
Demonstration
In the first step I'll create a common user, grant him permissions to connect and query V$PDBS and then I'll connect with that user and try to query V$PDBS.
SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY PDBTEST MOUNTED PINIDB READ WRITE SQL> create user C##TEST identified by test; User created. SQL> grant connect to C##TEST; Grant succeeded. SQL> grant select on sys.v_$pdbs to C##TEST; Grant succeeded. SQL> connect C##TEST/test@isrvmrh541-cdb.world Connected. SQL> select * from v$pdbs; no rows selectedAs you can see, no rows are returned from the query.
Let's connect again with SYS and verify which PDBs are visible for user C##TEST using the CDB_CONTAINER_DATA dictionary view which displays information about the user-level and object-level CONTAINER_DATA attributes specific in the CDB:
SQL> connect sys@isrvmrh541-cdb.world as sysdba Enter password: Connected. SQL> SELECT username, 2 owner, 3 object_name, 4 all_containers container_name 5 FROM CDB_CONTAINER_DATA 6 WHERE username = 'C##TEST'; no rows selectedAs you can see, user C##TEST has no container data attributes.
Let's specify that user C##TEST can see the data of V$PDBS from all the containers:
SQL> alter user C##TEST set container_data=all for sys.v_$pdbs container = current; User altered. SQL> SELECT username, 2 owner, 3 object_name, 4 all_containers, 5 container_name 6 FROM CDB_CONTAINER_DATA 7 WHERE username = 'C##TEST' 8 ; USERNAME OWNER OBJECT_NAME ALL_CONTAINERS CONTAINER_NAME --------------- ---------- --------------- ------------- -------------------- C##TEST SYS V_$PDBS YAs you can see, the CONTAINER_NAME is NULL because I sepcific in the aler command that the container_data will be visible for all containers.
If we would like to specify that the data of every container data object that the user has SELECT permissions to access, you can remove the "for" clause and execute the following command:
SQL> alter user C##TEST set container_data=all container = current; User altered. SQL> SELECT username, 2 owner, 3 object_name, 4 all_containers, 5 container_name 6 FROM CDB_CONTAINER_DATA 7 WHERE username = 'C##TEST'; USERNAME OWNER OBJECT_NAME ALL_CONTAINERS CONTAINER_NAME --------------- ---------- --------------- ------------- -------------------- C##TEST SYS V_$PDBS Y C##TEST Y
As you can see, now user C##TEST has an access for all the objects which he will granted permissions to SELECT from.
Summary
- Once you create a COMMON USER, you should also specify which PDBs data are visible to that common user for which objects using the CONTAINER_DATA clause
- You can specify the object-level CONTAINER_DATA attributes for a user using the ALTER USER command
- You can view the information about the user-level and object-level CONTAINER_DATA attributes via CDB_CONTAINER_DATA dictionary view
Useful Links:
Very nice post. Thanks for Sharing... :)
ReplyDeleteRegards,
Pinto
Thanks Pinto :)
DeleteHi
ReplyDeleteI have a User created table in my APPROOt and PDB
I am not able to query the data in my PDB from approot
I have tried alter user set container_data=all container =ALL
Its not allowing me to perform ;error.
Anything im missing here !!
Even though the CDB/PDB architecture has been available for years now, it has only recently been widely adopted.
ReplyDeleteThe security landscape certainly become more complex because of CDB.
Thanks for this post, it was exactly what I was looking for.
Diyarbakır
ReplyDeleteAdana
Bursa
izmir
Sakarya
3E0
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
G5TL2
siirt evden eve nakliyat
ReplyDeleteadıyaman evden eve nakliyat
kastamonu evden eve nakliyat
artvin evden eve nakliyat
malatya evden eve nakliyat
Z3İ
izmir evden eve nakliyat
ReplyDeletemalatya evden eve nakliyat
hatay evden eve nakliyat
kocaeli evden eve nakliyat
mersin evden eve nakliyat
UJ6NUB
F6B0D
ReplyDeleteSivas Lojistik
Adıyaman Parça Eşya Taşıma
Bartın Evden Eve Nakliyat
Hatay Lojistik
Adana Lojistik
3EF74
ReplyDeleteBingöl Lojistik
Antalya Lojistik
Mersin Parça Eşya Taşıma
Düzce Evden Eve Nakliyat
Tokat Evden Eve Nakliyat
6A3B7
ReplyDeleteKarabük Evden Eve Nakliyat
Siirt Parça Eşya Taşıma
Sinop Evden Eve Nakliyat
Lbank Güvenilir mi
Yenimahalle Boya Ustası
Karapürçek Fayans Ustası
İstanbul Şehirler Arası Nakliyat
Çankırı Evden Eve Nakliyat
Bitlis Lojistik
C3E3B
ReplyDeleteIğdır Şehir İçi Nakliyat
Çanakkale Şehirler Arası Nakliyat
Konya Şehirler Arası Nakliyat
Bayburt Şehir İçi Nakliyat
Tunceli Parça Eşya Taşıma
Urfa Lojistik
Casper Coin Hangi Borsada
Çerkezköy Halı Yıkama
Yozgat Lojistik
18555
ReplyDeletereferanskodunedir.com.tr
E54FF
ReplyDeleteistanbul kadınlarla sohbet
mobil sohbet chat
erzincan sohbet uygulamaları
bedava görüntülü sohbet sitesi
bedava sohbet siteleri
hakkari ucretsiz sohbet
balıkesir muhabbet sohbet
gümüşhane yabancı sohbet
tokat bedava görüntülü sohbet sitesi
96460
ReplyDeletehakkari telefonda canlı sohbet
giresun mobil sohbet sitesi
tekirdağ sesli sohbet siteleri
aydın en iyi rastgele görüntülü sohbet
mardin canlı ücretsiz sohbet
çankırı sohbet siteleri
samsun bedava görüntülü sohbet
antep canlı sohbet odası
karabük parasız sohbet siteleri
AB5B5
ReplyDeleteadıyaman sesli sohbet
sivas canlı sohbet odaları
görüntülü canlı sohbet
canlı sohbet
kızlarla canlı sohbet
zonguldak canlı sohbet siteleri ücretsiz
istanbul ücretsiz sohbet siteleri
bursa sesli görüntülü sohbet
tekirdağ canlı sohbet ücretsiz
14831
ReplyDeletecanlı görüntülü sohbet uygulamaları
en iyi rastgele görüntülü sohbet
antep telefonda sohbet
bedava görüntülü sohbet sitesi
Erzurum Kadınlarla Sohbet Et
canli goruntulu sohbet siteleri
Afyon Kızlarla Canlı Sohbet
mobil sesli sohbet
Amasya Sohbet Uygulamaları
DD8A3
ReplyDeleteBinance Ne Zaman Kuruldu
Threads Beğeni Hilesi
Binance Borsası Güvenilir mi
Bitcoin Nasıl Kazılır
Apenft Coin Hangi Borsada
Nonolive Takipçi Hilesi
Spotify Dinlenme Hilesi
Bitcoin Kazanma
Bitcoin Nedir
6B2D1
ReplyDeleteFlare Coin Hangi Borsada
Dxgm Coin Hangi Borsada
Caw Coin Hangi Borsada
Chat Gpt Coin Hangi Borsada
Telegram Abone Satın Al
Aion Coin Hangi Borsada
Periscope Beğeni Hilesi
Milyon Coin Hangi Borsada
Coin Nasıl Alınır
725C0
ReplyDeleteBitcoin Para Kazanma
Paribu Borsası Güvenilir mi
Referans Kimliği Nedir
Discord Sunucu Üyesi Satın Al
Likee App Takipçi Hilesi
Bitcoin Nasıl Para Kazanılır
Binance Nasıl Üye Olunur
Aion Coin Hangi Borsada
Coin Madenciliği Nasıl Yapılır
Pursuing a nursing career in Germany comes with numerous advantages that make it an attractive option for professionals around the globe. The robust healthcare system is complemented by a strong reputation for quality care, ensuring that nurses are well-equipped to provide excellent services. Furthermore, the emphasis on research and evidence-based practices encourages nurses to engage in continuous learning and professional development. The multicultural environment within German healthcare fosters collaboration and understanding among diverse teams, enhancing the overall workplace experience. Additionally, the country's focus on innovation in healthcare ensures that nurses are exposed to cutting-edge technologies and practices, allowing them to remain at the forefront of their profession. These factors collectively contribute to a rewarding career that not only nurtures personal and professional growth but also firmly positions nurses as integral members of the healthcare community.
ReplyDeletehttps://www.dynamichealthstaff.com/nursing-jobs-in-germany-for-indian-nurses
Respect and I have a dandy proposal: What Was The First Home Renovation Show reddit house renovation
ReplyDelete