我无法使用sqlplus在oracle数据库中创建一个视图(权限不足)

时间:2010-06-16 14:15:00

标签: oracle views database-permissions

我正在运行这个SQL:

CREATE VIEW
showMembersInfo(MemberID,Fname,Lname,Address,DOB,Telephone,NIC,Email,WorkplaceID,WorkName,WorkAddress,WorkTelephone,StartingDate,ExpiryDate,Amount,WitnessID,WitName,WitAddress,WitNIC,WitEmail,WitTelephone)
AS SELECT 
mem.MemberID,mem.FirstName,mem.LastName,mem.Address,mem.DOB,mem.Telephone,mem.NIC,mem.Email,
wrk.WorkPlaceID,wrk.Name,wrk.Address,wrk.Telephone,
anl.StartingDate,anl.ExpiryDate,anl.Amount,
wit.WitnessID,wit.Name,wit.Address,wit.NIC,wit.Email,wit.Telephone 
FROM Member mem, WorkPlace wrk, AnnualFees anl, Witness wit 
WHERE mem.MemberID = anl.MemberID AND mem.WorkPlaceID = work.WorkPlaceID AND mem.WitnessID = wit.WitnessID

当我尝试创建视图时,我收到此错误:

  

第1行的错误:
  ORA-01031:权限不足

为什么?我使用sysman

登录sqlplus

2 个答案:

答案 0 :(得分:1)

确保SYSMAN被授予FROM子句 直接 中每个表的SELECT权限,而不是通过角色。请参阅CREATE VIEW prerequisites

答案 1 :(得分:0)

尝试以sys或sysadm

的身份登录

请参阅oracle用户here