(1.)授予權限語法以下: Grant 權限|角色 to 用戶名; 示例:用戶martin授予connect和resource兩個角色 Grant connect,resource to martin (2.)撤銷權限語法以下: Revoke 權限|角色 from 用戶名; 撤銷兩個角色 Revoke connect,resource from martin; (3.)容許用戶查看emp表中的記錄 Grant select on scott.emp to martin; (4.)容許用戶更新emp中的記錄 Grant update on scott.emp to martin; 依次類推,刪除和查詢數據庫
(1.)示例:建立序列,從序號10開始,每次增長1,最大爲2000,不循環,在增長會報錯,緩存30個序列號。 Create sequence seq1 Start with 10 Increment by 1 Maxvalue 2000 Nocycle 10 Cache 30; (2.)更改序列 Alter sequence [schema.] sequence_name [increment by integer] [maxvalue integer|momaxvalue] [minvalue integer|nominvalue] [cycle|nocycle] [cache integer|nocache]; (3.)刪除序列:刪除seq1 Drop sequence seq1; (4.)使用序列 Select sys_guid() from dual;緩存
私有同義詞,和共有同義詞 建立私有同義詞: Create sysnonym 同義詞名 for 對象名稱 建立同義詞:sy_emp Create synonym sy_emp for a_hr.emp 建立共有同義詞: Crate public synonym 名稱 for 對象; Create public synonym public_sy_emp for emp; 刪除同義詞: 刪除私有同義詞 Drop synonym 須要刪除的名稱; 刪除共有同義詞: Drop public sysnonym 須要刪除的名稱安全
(1.)索引分類表 物理分類 邏輯分類 分區或非分區索引 單例或組合索引 B樹索引(標準索引) 惟一或非惟一索引 正常或反向建索引 基於函數索引 位圖索引 (2.)建立普通索引 Crate index 索引名稱 on 索引表名 多索引名稱 索引空間 (3.)示例:在salgrade表中,爲級別編號grade列建立惟一索引, Create unique index index_unique_grade on salgrade(grade); (4.)反向索引示例 在emp表中編號爲empno列建反向索引 Create index index_reverse_empno on emp (empno) reverse; (5.)位圖索引優勢: 對於大批及時查詢,能夠減小響應時間 相比其餘索引技術,佔用空間比較少 即便配置低,也能得到顯著的性別 (6.)刪除索引: Drop index 索引名; (7.)重建索引 Alter index 索引名 rebuild noreverse;oracle
(1.)優勢 改善表的查詢性能 表更容易管理 便於備份和恢復 提升數據安全性 (符合如下條件能夠建成區分表1.數據量大於2G,數據的劃分明顯) (2.)分區表的分類 範圍分區,列表分區,散列分區,複合分區,間隔分區(優勢:分區劃分清楚,明細),虛擬化分區。 (3.)建立間隔分區語法: Alter table 分區表名稱 add partition 分區名 ralue less than (maxrelue);less