附註:

使用 Oracle Autonomous Database 追蹤 OCI 資源、成本和使用狀況報表

簡介

Oracle Autonomous Database 是一種便利的媒介,可追蹤 Oracle Cloud Infrastructure (OCI) 資源、相關的成本和使用狀況報表。資源使用狀況報表會以列表化格式顯示,讓您更容易閱讀、下載及用於進一步分析。您可以使用 Oracle Autonomous Database 中的內建檢視輕鬆存取這些報表。

目標

必要條件

作業 1:建立動態群組並新增必要的規則

  1. 建立動態群組。

    動態群組

  2. 為動態群組新增下列必要規則。

    resource.id = '<autonomous database ocid>'
    
    ALL {resource.type = 'autonomous-database', resource.compartment.id =  '<compartment-ocid>'}
    

    注意:

    • resource.id 是 Oracle Autonomous Database 執行處理的 OCID。

    • resource.compartment.id 是區間的 OCID。

作業 2:建立必要的原則

建立取得權限以存取在「工作 1」中建立之動態群組的必要原則。這些是存取檢視的必要項目。

原則

例如,若要存取所有檢視,請定義下列原則:

注意:請勿將此原則中的 OCID 取代為其他 OCID。此使用狀況報表 OCID 提供您租用戶的 Oracle Cloud Infrastructure 使用狀況資料。

Define tenancy usage-report as ocid1.tenancy.oc1..aaaaaaaaned4fkpkisbwjlr5xxxxxxxxxxfbilvqknstgtvzub7vhqkggq
Endorse dynamic-group <group-name> to read objects in tenancy usage-report
Allow dynamic-group <group-name> to inspect compartments in tenancy
Allow dynamic-group <group-name> to inspect tenancies in tenancy
Allow dynamic-group <group-name> to read buckets in tenancy
Allow dynamic-group <group-name> to read autonomous-database in tenancy
Allow dynamic-group <group-name> to read usage-reports in tenancy
Allow dynamic-group <group-name> to manage buckets in tenancy
Allow dynamic-group <group-name> to manage objects in tenancy
Allow dynamic-group <group-name> to read autonomous-database in compartment <compartment>

作業 3:驗證或啟用 Oracle Autonomous Database 上 ADMIN 使用者的資源主體

開啟 Oracle SQL Developer 工具,然後執行下列命令。

  1. 確認 Oracle Autonomous Database 執行處理上的 ADMIN 使用者已啟用資源主體。

    SELECT owner, credential_name FROM dba_credentials
    WHERE credential_name = 'OCI$RESOURCE_PRINCIPAL' AND owner = 'ADMIN';
    
    OWNER CREDENTIAL_NAME
    ----- ---------------------
    ADMIN OCI$RESOURCE_PRINCIPAL
    
  2. 如果未啟用資源主體,請啟用資源主體。

    EXEC DBMS_CLOUD_ADMIN.ENABLE_RESOURCE_PRINCIPAL();
    

工作 4:存取 OCI 報表使用狀況檢視

執行適當的查詢以存取檢視。視觀表可能需要一些時間才能植入和預期。您也可以下載不同檔案格式的報表。

認可

其他學習資源

瀏覽 docs.oracle.com/learn 的其他實驗室,或前往 Oracle Learning YouTube 頻道存取更多免費學習內容。此外,請造訪 education.oracle.com/learning-explorer 以成為 Oracle Learning Explorer。

如需產品文件,請造訪 Oracle Help Center