【跟我學oracle18c】第十七天:Multitenant Architecture多租戶框架:2.2 Overview of Commonality in the CDB(藍色感悟)
在CDB中,每個使用者、角色或物件都是通用的或本地的。類似地,通常或區域性授予特權.
This section contains the following topics:
- About Commonality in a CDB
A common phenomenon defined in a root is the same in all containers plugged in to this root. - Overview of Common and Local Users in a CDB
If a user account owns objects that define the database, then this user account is common. User accounts that are not Oracle-supplied are either local or common. - Overview of Common and Local Roles in a CDB
User-created roles are either local or common. Common roles are either common to the CDB itself or to a specific application container. - Overview of Privilege and Role Grants in a CDB
Just as in a non-CDB, users in a CDB can grant and be granted roles and privileges. Roles and privileges in a CDB, however, are either locally or commonly granted. - Overview of Common and Local Objects in a CDB
A common object is defined in either the CDB root or an application root, and can be referenced using metadata links or object links. A local object is every object that is not a common object. - Overview of Common Audit Configurations
For both mixed mode and unified auditing, a common audit configuration is visible and enforced across all PDBs. - Overview of PDB Lockdown Profiles
A PDB lockdown profile is a named set of features that control operations available to users connected to a PDB. For example, a PDB lockdown profile can disable privileges that come with theALTER SYSTEM
statement.
Parent topic: Overview of the Multitenant Architecture
2.2.1 About Commonality in a CDB
在根中定義的一個常見現象在插入到這個根的所有容器中都是一樣的.
本節包含以下主題:
- 共性的原則
在CDB中,在系統容器(CDB本身)或特定應用程式容器中都可能出現這種現象. - CDB中的名稱空間
在CDB中,每個物件的名稱空間都限定在其容器的作用域內.
Parent topic: Overview of Commonality in the CDB
2.2.1.1 共性的原則
在CDB中,在系統容器(CDB本身)或特定應用程式容器中都可能出現這種現象。
例如,如果您在連線到CDB$ROOT時建立一個公共使用者帳戶,那麼這個使用者帳戶對於CDB中的所有PDBs和應用程式根都是通用的。但是,如果您在連線到應用程式根目錄時建立了一個應用程式通用使用者帳戶,那麼這個使用者帳戶只對這個應用程式容器中的PDBs通用.
在CDB$ROOT或應用程式根的上下文中,公共原則如下:
-
在每個現有容器和未來容器中都存在相同的常見現象.
因此,CDB根中定義的公共使用者在插入到CDB根的每個PDB中具有相同的標識;在應用程式根中定義的公共使用者在插入到該應用程式根的每個應用程式PDB中具有相同的標識。相比之下,一個本地現象的作用域僅侷限於一個現有容器.(一句話非強調兩次,看著都費勁,不就是CDB根與application root一致)
-
只有普通使用者才能改變常見現象的存在.
更準確地說,只有登入到CDB根或應用程式根的公共使用者才能建立、銷燬或修改當前容器中通用的使用者、角色或物件的屬性.
Parent topic: About Commonality in a CDB
2.2.1.2 CDB中的名稱空間
在CDB中,每個物件的名稱空間都限定在其容器的作用域內。
以下原則總結了界定範圍的規則
-
從應用程式的角度來看,PDB與非cdb沒有區別.
-
區域性現象是在一個容器內產生並限制在一個容器內.
Note:
In this topic, the word “ 現象” means “使用者帳戶、角色或資料庫物件.”
-
常見現象定義在一個CDB根或應用程式根中,並且存在於所有已經或將要插入到這個根中的PDBs中。
這個說法比較有意思,我進行了一次在cdb和pdb內的cdb下建立的c##test使用者的存在性檢驗,發現都可以看到,但是使用者本身具有的許可權是私有的,必須單獨給予
例子:在cdb的sys使用者下create user C##test identified by test;但是未給任何許可權,pdb的sys使用者下grant dba to c##test;然後參見下圖可以理解上面的存在於三個字
下圖是cdb內的c##test使用者許可權截圖
下圖是pdb內的
測試使用者的可連線行為
SQL> conn c##test/[email protected]
提示
SQL> conn c##test/[email protected]
Connected to Oracle Database 18c Enterprise Edition Release 18.0.0.0.0
Connected as c##[email protected]
以上原則對區域性現象和常見現象具有啟示意義.
- 區域性現象
本地現象必須在容器中唯一命名,但不能跨CDB中的所有容器。在不同容器中同名的區域性現象是不同的。例如,本地使用者sh一個PDB不會與另一個PDB中的本地使用者sh發生衝突。(pdb使用者的私有性).
CDB$ROOT常見現象
在CDB$ROOT中定義的常見現象存在於多個容器中,並且在每個名稱空間中必須是唯一的。例如,CDB根包含預定義的通用使用者,如SYSTEM和SYS。為了確保名稱空間分離,Oracle資料庫防止在另一個容器中建立SYSTEMuser。(
我試著在pdb內建立cdb$root中存在的c##test使用者是不允許的
SQL> create user C##test identified by test;
create user C##test identified by test
ORA-65094: 本地使用者名稱或角色名無效,由於cdb內不允許使用者建立非c##開頭的使用者,就不存在其他嘗試了
)
為了確保名稱空間分離,在CDB根中使用者建立的公共現象的名稱必須以COMMON_USER_PREFIX初始化引數指定的值開始。預設的字首是c##或c##。所有其他使用者建立的現象的名稱不能以c#或c#開頭。例如,您不能在hrpdb中建立名為c##hr的本地使用者,也不能在名為hr的CDB根中建立公共使用者.
SQL> show parameter COMMON_USER_PREFIX
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
common_user_prefix string
應用程式常見的現象
在應用程式容器中,本地和應用程式常見現象的名稱不能衝突.
-
應用程式通用使用者和角色
應用程式通用使用者和CDB通用使用者的原理是一樣的。不同之處在於,對於CDB公共使用者,公共使用者字首的預設值是c##或c##,而在應用程式根中,公共使用者字首的預設值是空字串.
多租戶體系結構假設您從應用程式根建立應用程式PDBs,或者將單租戶應用程式轉換為多租戶應用程式.
-
應用程式常見的物件
多租戶體系結構假設您在應用程式根中建立應用程式公共物件。稍後,您將在應用程式PDBs中本地新增資料。但是,Oracle資料庫支援在應用程式PDB中建立本地表。在本例中,本地表與應用程式PDB中的應用程式公共物件駐留在同一個名稱空間中。
See Also:
Oracle Database Security Guide to learn more about common users and roles
Parent topic: About Commonality in a CDB
2.2.2 Overview of CDB中的普通使用者和本地使用者
如果使用者帳戶擁有定義資料庫的物件,則此使用者帳戶是常見的。非oracle提供的使用者帳戶要麼是本地帳戶,要麼是通用帳戶
CDB公共使用者是在CDB根中建立的公共使用者。應用程式公共使用者是在應用程式根目錄中建立的使用者,並且僅在此應用程式容器中通用
下圖顯示了CDB中可能的使用者帳戶型別
Figure 2-6 User Accounts in a CDB
Description of "Figure 2-6 User Accounts in a CDB"
CDB公共使用者可以連線到CDB中具有足夠許可權的任何容器。相反,應用程式普通使用者只能連線到建立它的應用程式根,或者連線到這個應用程式根的PDB,這取決於它的許可權.
This section contains the following topics:
- Common Users in a CDB
Within the context of either the system container (CDB) or an application container, a common user is a database user that has the same identity in the root and in every existing and future PDB within this container. - Local Users in a CDB
A local user is a database user that is not common and can operate only within a single PDB.
See Also:
Oracle Database Security Guide for an overview of common and local users
Parent topic: Overview of Commonality in the CDB
2.2.2.1 Common Users in a CDB
在系統容器(CDB)或應用程式容器的上下文中,公共使用者是在根目錄中以及在此容器中的每個現有和將來的PDB中具有相同標識的資料庫使用者.
每個普通使用者都可以連線到其容器的根,並在其具有足夠許可權的任何PDB中執行操作。一些管理任務必須由普通使用者執行。示例包括建立PDB和斷開PDB的連線.
例如,系統是具有DBA許可權的CDB公共使用者。因此,系統可以連線到CDB根和資料庫中的任何PDB。您可以在saas_sales應用程式容器中建立一個公共使用者saas_sales_admin。在這種情況下,saas_sales_admin使用者只能連線到saas_sales應用程式根或saas_salesapplication容器中的應用程式PDB。
每個普通使用者要麼是oracle提供的,要麼是使用者建立的。oracle提供的普通使用者的例子有SYS和SYSTEM。每個使用者建立的公共使用者要麼是CDB公共使用者,要麼是應用程式公共使用者.
Figure 2-7 在兩個PDBs中顯示示例使用者和模式:hrpdb和salespdb。在CDB$ROOT、hrpdb和salespdb中具有模式的SYS和c## #dbaare CDB通用使用者。hrpdb中存在本地使用者hr和 rep。salespdb中也有本地使用者hr和rep.
Figure 2-7 Users and Schemas in a CDB
Description of "Figure 2-7 Users and Schemas in a CDB"
普通使用者具有以下特徵:
-
普通使用者可以登入任何具有CREATE會話特權的容器(包括CDB$ROOT).
普通使用者不需要在每個容器中擁有相同的特權。例如,c##dbauser可以在hrpdb和根目錄中建立會話,但不能在salespdb中建立會話。因為具有適當許可權的普通使用者可以在容器之間切換,所以根使用者可以管理PDBs.
-
應用程式公共使用者在其自己的應用程式容器之外的任何容器中沒有建立會話特權.
因此,應用程式公共使用者被限制在其自己的應用程式容器中。例如,在saas_sales應用程式中建立的應用程式公共使用者只能連線到saas_sales應用程式容器中的應用程式根和PDBs。
-
使用者建立的CDB公共使用者的名稱必須遵循其他資料庫使用者的命名規則。此外,名稱必須以COMMON_USER_PREFIX初始化引數指定的字元開頭,預設為c##或c##。oracle提供的通用使用者名稱和使用者建立的應用程式通用使用者名稱沒有這個限制。
本地使用者名稱不能以字元c##或c##開頭.
-
在建立它的容器(系統容器或特定應用程式容器)中的所有PDBs中,每個公共使用者都被惟一地命名。
CDB公共使用者是在CDB根中定義的,但是必須能夠以相同的身份連線到每個PDB。應用程式公共使用者駐留在應用程式根中,可以以相同的身份連線到其容器中的每個應用程式PDB。
See Also:
-
Oracle Database Security Guide to learn about common user accounts
-
Oracle Database Reference to learn about
COMMON_USER_PREFIX
Parent topic: Overview of Common and Local Users in a CDB
2.2.2.2 Local Users in a CDB
本地使用者是不常見的資料庫使用者,只能在單個PDB中操作。
本地使用者具有以下特徵:
-
本地使用者是特定於PDB的,可能在此PDB中擁有一個模式.
在圖2-7中,hrpdb上的本地使用者hr擁有hr模式。在salespdb上,本地使用者重新分配rep模式,本地使用者hr擁有hr模式.
-
本地使用者可以管理PDB,包括開啟和關閉它。
具有SYSDBA特權的普通使用者可以向本地使用者授予SYSDBA特權。在本例中,特權使用者仍然是本地使用者。
-
一個PDB中的本地使用者無法登入到另一個PDB或CDB根。
例如,當本地使用者hr連線到hrpdb時,hr不使用資料庫連結就不能訪問駐留在salespdb資料庫中的shschema中的物件。同樣,當本地使用者sh連線到salespdb PDB時,sh不使用資料庫連結就無法訪問駐留在hrpdb中的hrschema中的物件。
-
本地使用者的名稱不能以字元c##或c##開頭。
-
本地使用者的名稱必須在其PDB中是唯一的。
包含該使用者模式的使用者名稱和PDB確定一個惟一的本地使用者。圖2-7顯示了hrpdb上存在一個名為rep的本地使用者和模式。salespdb PDB上存在一個完全獨立的名為rep的本地使用者和模式。
下表描述了圖2-7中涉及CDB的場景。每行描述在前一行的操作之後發生的操作。公共使用者系統在兩個PDBs中建立本地使用者.
Table 2-3 Local Users in a CDB
Operation | Description |
---|---|
|
|
|
|
|
The |
|
|
|
|
|
The |
See Also:
Oracle Database Security Guide to learn about local user accounts
Parent topic: Overview of Common and Local Users in a CDB
2.2.3 Overview of CDB中的公共和本地角色
使用者建立的角色要麼是本地的,要麼是通用的。公共角色對於CDB本身或特定的應用程式容器都是通用的。
每個oracle提供的角色都是常見的,例如預定義的DBA角色。在oracle提供的指令碼中,向oracle提供的使用者和角色授予的所有特權或角色通常都被授予,只有一個例外:系統特權在本地授予公共角色。
This section contains the following topics:
- Common Roles in a CDB
A common role exists either in the CDB root or an application root, and applies to every PDB within the root container (either the CDB or the application container). - Local Roles in a CDB
A local role exists only in a single PDB, just as a role in a non-CDB exists only in the non-CDB.
See Also:
Parent topic: Overview of Commonality in the CDB
2.2.3.1 Common Roles in a CDB
一個通用角色存在於CDB根或應用程式根中,並應用於根容器(無論是CDB還是應用程式容器)中的每個PDB。
公共角色對於跨容器操作非常有用,可以確保每個PDB中都有一個公共使用者。每個常見角色都是以下型別之一:
-
Oracle-supplied
All Oracle-supplied roles, such as
DBA
andPUBLIC
, are common to the CDB. -
User-created
通過執行Create role…CONTAINER=ALL在CDB根或應用程式根中,它們決定了角色通用的容器。使用標準命名約定。此外,CDB公共角色的名稱必須以COMMON_USER_PREFIX初始化引數指定的字元開頭,預設為c##或c##。
角色的作用域是定義它的根的作用域。如果您在CDB$ROOT中定義角色,那麼它的作用域就是整個CDB。如果您在應用程式根目錄中定義角色,那麼它的作用域就是應用程式容器。
See Also:
-
Oracle Database Security Guide to learn how to manage common roles
-
Oracle Database SQL Language Reference to learn about the
CREATE ROLE
statement
Parent topic: Overview of Common and Local Roles in a CDB
2.2.3.2 Local Roles in a CDB
本地角色只存在於單個PDB中,就像非cdb中的角色只存在於非cdb中一樣。
本地角色只能包含應用於角色所在容器中的角色和特權。例如,如果您在hrpdb中建立了本地角色pdbadmin,那麼這個角色的作用域僅限於這個PDB。
相同CDB或相同應用程式容器中的PDBs可能包含同名的本地角色。例如,使用者建立的角色pdbadmin可能存在於hrpdb和salespdb中。然而,這些角色是完全獨立的
See Also:
Oracle Database Security Guide to learn how to manage local roles
Parent topic: Overview of Common and Local Roles in a CDB
2.2.4 Overview of Privilege and Role Grants in a CDB
就像在非CDB中一樣,CDB中的使用者可以授予並被授予角色和特權。然而,CDB中的角色和特權要麼在本地授予,要麼通常授予。
本地授予的特權或角色僅在授予它的PDB中可執行。被授予的特權或角色通常在容器中的每個現有和將來的PDB(無論是CDB還是應用程式容器)中都可以執行。
使用者和角色可以是通用的,也可以是本地的。然而,特權本身既不是普通的,也不是本地的。如果使用者使用CONTAINER=CURRENT子句在本地授予特權
This section contains the following topics:
- Principles of Privilege and Role Grants in a CDB
In a CDB, every act of granting, whether local or common, occurs within a container. The container may be the CDB root, an application root, or a PDB. - Privileges and Roles Granted Locally in a CDB
Roles and privileges may be granted locally to users and roles regardless of whether the grantees, grantors, or roles being granted are local or common. - Roles and Privileges Granted Commonly in a CDB
Privileges and common roles may be granted commonly. - Grants to PUBLIC in a CDB
In a CDB,PUBLIC
is a common role. In a PDB, privileges granted locally toPUBLIC
enable all local and common user account to exercise these privileges in this PDB only. - Grants of Privileges and Roles: Scenario
In this scenario,SYSTEM
creates common userc##dba
and tries to give this user privileges to query a table in thehr
schema inhrpdb
.
See Also:
Oracle Database Security Guide to learn how to manage common privileges
Parent topic: Overview of Commonality in the CDB
2.2.4.1 Principles of Privilege and Role Grants in a CDB
在CDB中,所有的授權行為,無論是本地的還是普通的,都發生在一個容器中。容器可以是CDB根、應用程式根或PDB。
如果當前的容器是CDB根,那麼授予通常意味著授予CDB中的所有容器。但是,如果當前容器是應用程式根,那麼授予通常意味著授予當前應用程式容器中的所有PDBs。
授予的基本原則如下:
- 普通現象和區域性現象都可以在區域性授予和被授予。
- 只有常見的現象才可能被普遍授予或被授予
本地使用者、角色和特權被限制到特定的PDB。因此,本地使用者可能不會通常授予角色和特權,而本地角色和特權可能不會通常授予
The following sections describe the implications of the preceding principles.
Parent topic: Overview of Privilege and Role Grants in a CDB
2.2.4.2 Privileges and Roles Granted Locally in a CDB
角色和特權可以在本地授予使用者和角色,而不管被授予的角色是本地的還是通用的。
The following table explains the valid possibilities for locally granted roles and privileges.
Table 2-4 Local Grants
Phenomenon | May Grant Locally | May Be Granted Locally | May Receive a Role or Privilege Granted Locally |
---|---|---|---|
Common User |
Yes |
N/A |
Yes |
Local User |
Yes |
N/A |
Yes |
Common Role |
N/A |
YesFoot 1 |
Yes |
Local Role |
N/A |
YesFoot 2 |
Yes |
Privilege |
N/A |
Yes |
N/A |
Footnote 1
此角色中的特權僅在授予角色的容器中可用,而不管特權是本地授予的還是普通授予的。
Footnote 2
此角色中的特權僅在授予和建立該角色的容器中可用。
This section contains the following topics:
- What Makes a Privilege or Role Grant Local
To grant a role or privilege locally, use theGRANT
statement with theCONTAINER=CURRENT
clause, which is the default. - Roles and Privileges Granted Locally
A user or role may be locally granted a privilege (CONTAINER=CURRENT
).
Parent topic: Overview of Privilege and Role Grants in a CDB
2.2.4.2.1 What Makes a Privilege or Role Grant Local
要在本地授予角色或特權,請使用grant語句和CONTAINER=CURRENT子句(預設為CONTAINER=CURRENT子句)。
具體來說,只有在滿足以下條件時,才能在本地授予角色或特權:
-
授予人具有授予指定角色或特權所需的特權。
對於系統角色和特權,授予方必須擁有授予的角色或特權的管理選項。對於物件特權,授予方必須具有授予特權的選項。 -
The grant applies to only one container.
預設情況下,GRANT語句包含CONTAINER=CURRENT子句,該子句表示在本地授予特權或角色
Example 2-4 Granting a Privilege Locally
在本例中,sys和c##hr_admin都是普通使用者。該示例連線到hrpdb作為系統(具有管理員許可權),然後在本地將employees表上的讀許可權授予c##hr_admin。此授權僅適用於hrpdb內的c##hr_admin,不適用於任何其他PDBs.
CONNECT [email protected]
Enter password: password
Connected.
GRANT READ ON employees TO c##hr_admin CONTAINER=CURRENT;
See Also:
Oracle Database Security Guide to learn more about granting local roles and privileges
Parent topic: Privileges and Roles Granted Locally in a CDB
2.2.4.2.2 Roles and Privileges Granted Locally
使用者或角色可能被本地授予特權(容器=當前)。
For example, a READ ANY TABLE
privilege granted locally to a local or common user in hrpdb
applies only to this user in this PDB. Analogously, the READ ANY TABLE
privilege granted to user hr
in a non-CDB has no bearing on the privileges of an hr
user that exists in a separate non-CDB.
使用者或角色可能被本地授予角色(容器=當前)。如表2-4所示,公共角色可能會獲得本地授予的特權。例如,在hrpdb中,公共角色c##dba可以在本地被授予讀取任何表特權。如果c##cdb公共角色是本地授予的,那麼角色中的特權只應用於授予角色的容器中。在本例中,具有c##cdba角色的普通使用者沒有權利在hrpdb之外的任何PDB中行使此特權,因為hrpdb中的這個角色在本地被授予了特權。
See Also:
Oracle Database Security Guide to learn how to grant roles and privileges in a CDB
Parent topic: Privileges and Roles Granted Locally in a CDB
2.2.4.3 Roles and Privileges Granted Commonly in a CDB
通常可以授予特權和公共角色。
只有在受資助者和受資助者都是通用的情況下,使用者帳戶或角色才能被授予角色和特權。如果角色是通用的,那麼角色本身必須是通用的。下表解釋了普通贈款的可能性。
Table 2-5 Common Grants
Phenomenon | May Grant Commonly | May Be Granted Commonly | May Receive Roles and Privileges Granted Commonly |
---|---|---|---|
Common User Account |
Yes |
N/A |
Yes |
Local User Account |
No |
N/A |
No |
Common Role |
N/A |
YesFoot 3 |
Yes |
Local Role |
N/A |
No |
No |
Privilege |
N/A |
Yes |
N/A |
Footnote 3
被授予公共角色的特權在所有容器中都可用。此外,在本地授予公共角色的任何特權僅在將該特權授予公共角色的容器中可用。
This section contains the following topics:
- What Makes a Grant Common
TheCONTAINER=ALL
clause specifies that the privilege or role is being granted commonly. - Roles and Privileges Granted Commonly
A common user account or role may be granted a privilege commonly (CONTAINER=ALL
).
See Also:
Oracle Database Security Guide to learn more about common grants
Parent topic: Overview of Privilege and Role Grants in a CDB
2.2.4.3.1 What Makes a Grant Common
CONTAINER=ALL子句指定通常授予特權或角色.
當符合以下條件時,通常會授予角色或特權:
-
授予人是普通使用者。
執行授權的使用者要麼是CDB本身的通用使用者,要麼是特定應用程式容器的通用使用者。 -
被授予者是一個普通使用者或普通角色。
贈款的接收者對cdb本身來說是通用的,對特定的應用程式容器也是通用的。 -
授予人具有授予指定角色或特權所需的特權。
對於系統角色和特權,授予方必須擁有授予的角色或特權的管理選項。對於物件特權,授予方必須具有授予特權的選項。 -
贈款適用於發生贈款的容器(無論是cdb還是應用程式容器)中的所有PDBs。
GRANT語句包含一個CONTAINER=ALL子句,指定通常授予特權或角色。 -
如果角色被授予,那麼它必須是通用的,如果物件特權被授予,那麼授予特權的物件必須是通用的。
Example 2-5 Granting a Privilege Commonly
在本例中,系統和c##hr_admin都是普通使用者。系統連線到CDB根,然後將CREATE任何表特權授予c##hr_admin。在這種情況下,c##hr_admin現在可以在CDB中的任何PDB中建立一個表.
CONNECT [email protected]
Enter password: password
Connected.
GRANT CREATE ANY TABLE TO c##hr_admin CONTAINER=ALL;
小試一下
SQL> grant dba to c##test container=all;
Grant succeeded
SQL> conn c##test/[email protected]
Connected to Oracle Database 18c Enterprise Edition Release 18.0.0.0.0
Connected as c##[email protected]
See Also:
Oracle Database Security Guide to learn how to grant common privileges privileges
Parent topic: Roles and Privileges Granted Commonly in a CDB
2.2.4.3.2 Roles and Privileges Granted Commonly
公共使用者帳戶或角色可能會被授予通常的特權(CONTAINER=ALL).
在CDB根或應用程式根的上下文中,特權被授予當前容器中所有現有和將來的PDBs中的這個公共使用者帳戶或角色。例如,如果系統連線到CDB根,並向CDB公共使用者帳戶c##dba授予SELECT任何表特權,那麼c##dba使用者在CDB中的所有PDBs中都具有此特權。通常授予的角色或特權不能在本地撤消。
使用者或角色可能會獲得通常授予的公共角色。如表2-5的腳註所述,公共角色可以在本地獲得特權。因此,一個普通使用者可以被授予一個普通角色,這個角色可能包含本地授予的特權
例如,公共角色c##admin可以被授予對hrpdb來說是本地的SELECT任何表特權。在公共角色中本地授予的特權僅適用於授予特權的容器。因此,具有c##admin角色的普通使用者無權在salespdb或hrpdb之外的任何PDB中行使hrpdb包含的特權。
See Also:
Oracle Database Security Guide to learn how to grant roles and privileges in a CDB
Parent topic: Roles and Privileges Granted Commonly in a CDB
2.2.4.4 Grants to PUBLIC in a CDB
在cdb,公眾是一個常見角色。在PDB中,在本地授予PUBLIC的特權使所有本地和公共使用者帳戶僅在此PDB中行使這些特權。
授予oracle提供的使用者和角色的所有特權和角色通常都被授予,但授予PUBLIC的系統特權除外,PUBLIC是在本地授予的。這個異常之所以存在,是因為您可能希望撤銷Oracle資料庫中預設包含的某些授予,比如在SYS上執行。實現的方案.
假設hrpdb中存在本地使用者帳戶hr。此使用者在本地授予hr上的SELECT特權。員工公開。hrpdb中的普通使用者和本地使用者可以行使授予給PUBLIC的特權。salespdb或任何其他PDB中的使用者帳戶沒有查詢hr的特權。員工在hrpdb。
通常授予PUBLIC的特權使所有本地使用者能夠在各自的PDBs中行使被授予的特權,並使所有普通使用者能夠在有權訪問的PDBs中行使此特權。Oracle建議使用者通常不向公眾授予特權和角色。
See Also:
Oracle Database Security Guide to learn how the PUBLIC
role works in a multitenant environment
Parent topic: Overview of Privilege and Role Grants in a CDB
2.2.4.5 Grants of Privileges and Roles: Scenario
在這個場景中,系統建立普通使用者c##dba,並嘗試給這個使用者特權來查詢hrpdb中hr模式中的表。
該場景展示了CONTAINER子句如何影響角色和特權的授予。第一列顯示了CDB$ROOT中的操作。第二列顯示hrpdb中的操作。
Table 2-6 Granting Roles and Privileges in a CDB
t | Operations in CDB$ROOT | Operations in hrpdb | Explanation |
---|---|---|---|
t1 |
|
n/a |
Common user |
t2 |
|
n/a |
|
t3 |
|
n/a |
|
t4 |
|
n/a |
|
t5 |
|
n/a |
|
t6 |
|
n/a |
|
t7 |
n/a |
|
|
t8 |
n/a |
|
|
t9 |
n/a |
|
|
t10 |
n/a |
|
Common user |
t11 |
n/a |
|
The query of |
t12 |
|
n/a |
Common user |
t13 |
|
n/a |
|
t14 |
n/a |
|
A query of |
t15 |
|
n/a |
|
t17 |
n/a |
|
The query succeeds. |
See Also:
Oracle Database Security Guide to learn how to manage common and local roles
Parent topic: Overview of Privilege and Role Grants in a CDB
2.2.5 Overview of Common and Local Objects in a CDB
公共物件在CDB根或應用程式根中定義,可以使用元資料鏈接或物件連結引用。區域性物件是指不是普通物件的所有物件。
資料庫提供的公共物件在CDB$ROOT中定義,不能更改。Oracle資料庫不支援在CDB$ROOT中建立公共物件。
您可以將大多數模式物件(如表、檢視、PL/SQL和Java程式單元、序列等)作為應用程式根中的公共物件建立。如果物件存在於應用程式根中,則稱其為應用程式公共物件。
本地使用者可以擁有一個公共物件。此外,一個普通使用者可以擁有一個本地物件,但只有當物件不是資料鏈接或元資料鏈接,也不是元資料鏈接或資料鏈接時才可以。
See Also:
-
相關推薦
【跟我學oracle18c】第十七天:Multitenant Architecture多租戶框架:2.2 Overview of Commonality in the CDB(藍色感悟)
在CDB中,每個使用者、角色或物件都是通用的或本地的。類似地,通常或區域性授予特權. This section contains the following topics: About Commonality in a CDB A common phenomenon defined i
【跟我學oracle18c】第十八天:EXTENDED DATA-LINKED專項測試
EXTENDED DATA-LINKED:共享公共物件的元資料和資料給Application PDB,在Application PDB內可以
【跟我學oracle18c】第十八天:DATA-LINKED專項測試
DATA-LINKED:共享公共物件的元資料和資料給Application PDB,在Appliation PDB中僅可查詢公共物件在Application root記憶
【跟我學oracle18c】第十八天:METADATA-LINKED專項測試
METADATA-LINKED:共享公共物件的元資料給Application PDB,不可以檢視公共物件在Application root記憶體儲的資料,在Appliation PDB內可插入本地資料。 這句話整理出來幾點
【跟我學oracle18c】第十八天:Multitenant Architecture:2.3 Application root,pdb,Container Maps專項測試(對應例項實踐)
對映表指定元資料鏈接的公共表中的一列,並使用分割槽將不同的應用程式PDBs與不同的列值關聯起來。通過這
【跟我學oracle18c】第十八天:Multitenant Architecture:2.3 Overview of Applications in an Application Container
2.3 Overview of Applications in an Application Container 在應用程式容器中,應用程式是儲存在應用程式root中的命名的、版本化的公共資料和元資料集. 在應用程式容器的上下文中,術語“應用程式”指的是“主應用程式定義”。例如,應
【跟我學oracle18c】第十六天:Multitenant Architecture多租戶框架:2.1 Overview of Containers in a CDB(藍色感悟)
容器是多租戶容器資料庫(CDB)中的模式、物件和相關結構的集合。在CDB中,每個容器都有唯一的ID和名稱 This section contains the following topics: The CDB Root and System Container The CDB
【跟我學oracle18c】第十五天:Multitenant Architecture多租戶框架:1.3 Path to Database Consolidation
在其存在期間, a database is either a CDB or a non-CDB. 您必須在建立時將資料庫定義為CDB,然後在這個CDB中建立PDBs和應用程式容器。. You cannot later transform a non-CDB into a CDB, or a CD
【跟我學oracle18c】第十九天:Multitenant Architecture:2.5 Overview of Tablespaces and Database Files in a CDB
2.5 Overview of Tablespaces and Database Files in a CDB CDB的結構與非CDB相同,不同之處是每個PDB和應用程式根都有自己的表空間集,包括自己的系統SYSAUX和undo表空間. A CDB contains th
【跟我學oracle18c】第四十三天:2 Day DBA:9.4 Backing Up Your Database
這一章節與oracle10g,11g無任何區別,僅轉載,不做實踐 9.4 Backing Up Your Database 節描述如何使用Oracle Recovery Manager (RMAN)備份資料庫。Oracle建議的磁碟備份策略提供了資料庫的有效每日備
【跟我學oracle18c】第四十五天:2 Day DBA:10.2 Diagnosing Performance Problems Using ADDM
10.2 Diagnosing Performance Problems Using ADDM At times, database performance problems arise that require your diagnosis and correction. Usual
【跟我學oracle18c】第四十九天:Database 2 Day + Performance Tuning Guide: 2.1使用自動工作負載儲存庫收集資料庫統計資訊(AWR,ASH)
2.1 Gathering Database Statistics Using the Automatic Workload Repository 資料庫統計資訊提供關於資料庫上的負載型別以及資料庫使用的內部和外部資源的資訊。要使用ADDM準確診斷資料庫的效能問題,必須提供統計資訊。
【跟我學oracle18c】第四十八天:2 Day DBA:13 使用EM Express管理PDBs
瞭解一下, 13 Managing PDBs with EM Express This chapter describes managing pluggable databases (PDBs) in a multitenant container d
【跟我學oracle18c】第四天:Cloning a Remote PDB or Non-CDB
7.5.1 Cloning a Remote PDB Using No Clauses: Example The following statement clones the pdb2 PDB from the pdb1 remote PDB: CREATE PLUGGA
【跟我學oracle18c】第十三天:Multitenant Architecture多租戶框架:1.1 About the Multitenant Architecture關於多租戶框架
多租戶體系結構允許Oracle資料庫充當多租戶容器資料庫 CDB包括0、1或許多客戶建立的可插入資料庫(PDBs)。 PDB是模式、模式物件和非模式物件的可移植集合,在Oracle Net客戶端看來它們是非cdb。 Oracle資料庫12c之前的所有Oracle資料庫都
【跟我學oracle18c】第一天:初試PDB
一、安裝 下載oracle18.3的通用版for winX64 WINDOWS.X64_180000_db_home.zip 解壓縮,點選setup安裝,在42%的位置卡了很長時間,以為壞了,結果等了一中午過去了。 二、與10g,11g的變化 1、作為window
【跟我學apache-commons】【四】commons-io的使用
commons-io是一款處理io流的工具,封裝了很多處理io流和檔案的方法,可以大大簡化我們處理io流和操作檔案的程式碼。從common-io的官方使用文件可以看出,它主要分為工具類、尾端類、行迭代器、檔案過濾器、檔案比較器和擴充套件流。 官網地址:http://co
【軟工項目組】第十七次會議
blog 開始 規劃 class 討論 過程 1-1 完成 數據庫設計 第十七次會議 時間:2018-1-12 19:00 至 20:00 地點:第三教學樓A樓休息區 討論最終規劃。 近期任務 賀一純、王越琛:css的運用。 王哲光、生力軍:前端頁面編寫。 陳
【leetcode 簡單】第十七題 二進制求和
def ret 示例 fine style dot 函數 其中 小數 實現 int sqrt(int x) 函數。 計算並返回 x 的平方根,其中 x 是非負整數。 由於返回類型是整數,結果只保留整數的部分,小數部分將被舍去。 示例 1: 輸入: 4 輸出: 2 示例
【小白看的Java教程】第十五章,更聰明的寫程式碼:方法
之前講解的迴圈操作,可以解決的是程式碼重複的問題,但是此時的重複的程式碼必須是有規律的。那迴圈操作,能解決所有的程式碼重複嗎?答案肯定是不行的,比如針對於某一種功能的重複操作,迴圈解決不了,終於方法就該登場了。舉個例子。 編寫一個飛機大戰遊戲,程式在執行過程中