Hive 保護模式

2021-09-21 11:40:25 字數 1113 閱讀 7785

使用

hive

自管理的表的時候都擔心如果誤

drop

了表怎麼辦,因此

hive

除了外部表的方式還提供了乙個功能:

protectmode

(保護模式).

細心的同學會發現文件裡其實提到過

alter table enable/disable no_drop/offline (

),其中

no_drop

禁止直接

drop table

而offline

是禁止表被讀取

.其實這些過能在

hive

裡被稱為

protectmode.

檢視原始碼是支援四種模式: 1

2

3

4

publicstaticstring flag_offline="offline";//禁止讀

publicstaticstring flag_no_drop="no_drop";//不許刪除表

publicstaticstring flag_no_drop_cascade ="no_drop_cascade";//不許刪除分割槽

publicstatic string flag_read_only="read_only";//唯讀,不過測試了下實際還不支援

這個特性的實現其實是在資料庫裡的

table_params

表裡支援的,

param_key=』protect_mode』

,而param_value

則設定相應的

mode.

因此批量做

no_drop/offline

通過sql

操作是最方便的了:)

進入保護模式

本文為 每個描述符佔8位元組,下圖中,上面位高32位,下面為低32位 disk boot ata channel 0 first hd cd on channel 0 type of disk image這個選項是vpc,我用2.6.2配置時選vpc無法啟動,得選flat才可以,2.6.0貌似選vp...

進入保護模式

以下圖2,圖4和圖5截自intel手冊 每個描述符佔8位元組,下圖中,上面位高32位,下面為低32位 disk boot ata channel 0 first hd cd on channel 0 type of disk image這個選項是vpc,我用2.6.2配置時選vpc無法啟動,得選fl...

保護模式小結

在gdt ldt以及idt中,每乙個描述符都有自己的界限和屬性等內容,是對描述符所描述物件的一種限定和保護 分頁機制中的pde和pte都含有r w以及u s位,提供了頁級保護 頁式儲存的使用使應用程式使用的是線性空間而不是實體地址,於是物理記憶體被保護起來 中斷不再像是模式下一樣使用,也提供特權檢驗...