在linux作業系統上的oracle使用者下裝有oracle資料庫,啟動登陸正常。
[ggs@vm ~]$ id oracle
uid=500(oracle) gid=501(oinstall) groups=501(oinstall),500(dba)
現在本機上建立一個作業系統使用者ggs,跟oracle使用者屬同一個組
[ggs@vm ~]$ id ggs
uid=501(ggs) gid=501(oinstall) groups=501(oinstall),500(dba)
在ggs使用者下登陸和啟動資料庫報錯
[ggs@vm ~]$ sqlplus /nolog
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Oct 31 10:23:33 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> select * from v$database;
select * from v$database
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
SQL> startup
ORA-27123: unable to attach to shared memory segment
Linux Error: 13: Permission denied
Additional information: 4816901
Additional information: 10
檢查ORACLE_SID,ORACLE_HOME,LD_LIBRARY_PATH等環境變量都是正确的。都和oracle使用者一樣。
為什麼隻有oracle使用者可以,其他使用者不能
解決方法:
[root@vm ~]# su - oracle
[oracle@vm ~]$ cd $ORACLE_HOME/bin
[oracle@vm bin]$ chmod +s oracle
[oracle@vm bin]$ ll oracle
-rwsrwsr-x 1 oracle oinstall 152028761 Aug 30 19:06 oracle
[oracle@vm bin]$
關于s權限的說明:
s表示setUID 和setGID 。位于user和group權限組的第三位置。如果在user權限組中設定了s權限。那麼當該檔案被執行時,是以檔案所有者的GID,而不是使用者的GID執行檔案,是以可執行的檔案搭配這個權限,便能得到特權,任意存取該檔案的所有者能使用全部系統資源