Oracle資料庫 筆記2

2021-06-21 23:12:48 字數 1211 閱讀 3871

oracle 建立檢視時

,提示使用者許可權不足

問題:使用scott

登入oracle

以後,建立檢視,提示「許可權不夠」,怎麼解決?

回答:這是因為scott

這個帳戶目前沒有建立檢視的許可權。解決方法為:

首先使用system

帳戶進行登入,其中「

tigertiger

」為安裝

oracle

時所指定的密碼

(可修改):

sqlplus system/tigertiger

然後執行:

grant create any view to scott

執行:exit

退出當前system

帳戶。再使用sqlplus

登入就可以建立檢視了,如:

sqlplus scott/tigert

下面建立乙個最簡單檢視:

create or replace view v1

as select * from t1;

附錄:如果以上方法不能解決您的問題,可以嘗試以下方法。 反正我的問題是解決了,記錄下來。害我找大半天;

描述:

同乙個資料庫:db1

兩個自定義使用者:分別為 user1

、user2

在user1

建立檢視,其中試圖內包含

user2

中的表。 提示「許可權不足」

執行以下sql

,根據自己使用者不同需修改使用:

--為user1

授權grant create any table to user1;

grant select any table to user1;

grant comment any table to user1;

grant lock any table to user1;

grant select any dictionary to user1;

--為user2

授權grant create any table to user2;

grant select any table to user2;

grant comment any table to user2;

grant lock any table to user2;

grant select any dictionary to user2;

oracle資料庫筆記

資料庫的匯入匯出 匯出 備份 exp 使用者名稱 密碼 要連線的遠端計算機ip 搜尋要備份的遠端資料庫名稱 file 檔案路徑 匯入 imp同上 例 exp kw kw2014 192.168.1.114 1521 orcl file f kw.dmp compress y imp kw kw201...

oracle資料庫筆記

基礎知識 1.ddl 資料定義語言。create drop alter 對錶的操作 2.dml 資料操作語言。insert update delete對資料的操作 3.tcl transaction control language 事務控制語言 commit 提交 rollback 取消 4.dq...

oracle資料庫知識筆記(2) 表操作

增加資料 新增表的所有列的值 insert into 表名 values 值1,值2,新增表的部分列字段的值 insert into 表名 列1,列2,values 值1,值2,新增查詢到表中的所有值 insert into 表2 select from 表1新增主鍵自增列 insert into ...