insufficient privileges for 'SYS' when 'shutdown immediate'
SQL> select * from v$version;
BANNER
-------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> conn / as sysdba
已连接。
SQL> set autot on;
SQL> select count(*) from session_privs;
COUNT(*)
----------
208
执行计划
----------------------------------------------------------
Plan hash value: 3293442843
---------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 31 | 1 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 31 | | |
| 2 | NESTED LOOPS | | 1 | 31 | 1 (0)| 00:00:01 |
|* 3 | FIXED TABLE FULL| X$KZSPR | 1 | 26 | 0 (0)| 00:00:01 |
|* 4 | INDEX RANGE SCAN| I_SYSTEM_PRIVILEGE_MAP | 1 | 5 | 1 (0)| 00:00:01 |
---------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
3 - filter("INST_ID"=USERENV('INSTANCE'))
4 - access("SPM"."PRIVILEGE"=(-"KZSPRPRV"))
统计信息
----------------------------------------------------------
0 recursive calls
0 db block gets
3 consistent gets
0 physical reads
0 redo size
431 bytes sent via SQL*Net to client
419 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
SQL> shutdown immediate;
ORA-01097: 无法在事务处理过程中关闭 - 请首先提交或回退
SQL> set autot off;
SQL> shutdown immediate
ORA-01031: insufficient privileges
SQL> show user;
USER is "SYS"
SQL> select count(*) from session_privs;
COUNT(*)
----------
200
SQL> create table tmp_session_privs as select * from session_privs;
表已创建。
SQL> conn / as sysdba
已连接。
SQL> select * from session_privs s where not exists (select 1 from tmp_session_privs t where s.privilege=t.privilege);
PRIVILEGE
--------------------------------------------------------------------------------
SYSOPER
EXEMPT ACCESS POLICY
ANALYZE ANY DICTIONARY
SELECT ANY DICTIONARY
EXEMPT IDENTITY POLICY
ALTER DATABASE LINK
SYSDBA
ALTER PUBLIC DATABASE LINK
已选择8行。