Oracle Label Securit簡介sql
Oracle Label Security是內置於數據庫引擎中的過程與約束條件集,該數據引擎實施對在單個表或整個模式上的"行"級訪問控制。要利用Oracle Label Security,須要建立一個或多個安全策略,其中每個安全策略都包含一組標籤。你能夠用這些標籤來標明哪些用戶可以訪問什麼類型數據。在建立了一個策略以後,將該策略應用於須要保護的表,並將這些標籤授予你的用戶,這樣,你就完成了整個過程。Oracle Label Security對查詢的修改是透明的,而且在即時計算訪問級別,以執行你的新策略。Oracle Label Security 讓企業和政府機構可以將具備不一樣訪問要求的數據(包括政府機密數據)整合到同一個數據庫中。它根據數據分類和應用用戶的訪問標籤實施多級訪問控制。藉助這一強大功能,用戶能夠在 Oracle Database 中按需訪問與研發項目、非公共財務信息或者醫療保健信息相關的敏感數據。數據庫
Oracle Label Security安裝安全
首先使用下面腳本檢查數據庫實例是否安裝了Oracle Label Security組件app
col comp_name for a36;
col version for a30;
select comp_id, comp_name, version, status
from dba_registry
where comp_name='Oracle Label Security';
若是沒有安裝Oracle Label Security組件,那麼能夠使用catols.sql腳本建立Oracle Label Security所須要用戶LBACSYS及數據庫對象spa
@?/rdbms/admin/catols.sql3d
執行腳本過程可能會遇到「ORA-01432: public synonym to be dropped does not exist」錯誤,這個是刪除的同義詞不存在,沒必要糾結。能夠忽略。 另外,須要注意的是:腳本執行完成後會執行shutdown immediate關閉數據實例。code
Oracle Label Security對象和有效性檢查orm
能夠使用下面腳本檢查Oracle Label Security對象和對象有效性,以下所示:對象
select object_type,object_name
from dba_objects
where owner='LBACSYS' and status='INVALID';
select object_type,count(*)
from dba_objects
where owner='LBACSYS' group by object_type;
卸載Oracle Label Securityblog
卸載Oracle Label Security也僅需執行一個catnools.sql腳本便可。以下所示:
SQL> @?/rdbms/admin/catnools.sql
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
Trigger dropped.
Trigger dropped.
Trigger dropped.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
User dropped.
2 rows deleted.
Commit complete.
SQL>