ITPub博客

首页 > Linux操作系统 > Linux操作系统 > sysdba和sysoper

sysdba和sysoper

原创 Linux操作系统 作者:lsq_008 时间:2009-03-05 13:49:36 0 删除 编辑

1.sysdba和sysoper的系统权限有哪些:

SYSDBA

Perform. STARTUP and SHUTDOWN operations
ALTER DATABASE: open, mount, back up, or change character set

CREATE DATABASE
DROP DATABASE
CREATE SPFILE
ALTER DATABASE ARCHIVELOG
ALTER DATABASE RECOVER
Includes the RESTRICTED SESSION privilege
 
SYSOPER

Perform. STARTUP and SHUTDOWN operations
CREATE SPFILE
ALTER DATABASE OPEN/MOUNT/BACKUP
ALTER DATABASE ARCHIVELOG
ALTER DATABASE RECOVER (Complete recovery only. Any form. of incomplete recovery, such as UNTIL TIME|CHANGE|CANCEL|CONTROLFILE requires connecting as SYSDBA.)
Includes the RESTRICTED SESSION privilege

2.当用户以sysdba和sysoper身份登陆数据库后,其所属schema应该是相应的sys或者public:

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Mar 5 11:27:01 2009

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options

SQL> grant sysdba to scott;

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
[oracle@localhost dbs]$ sqlplus scott/tiger as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Mar 5 11:27:20 2009

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options

SQL> show user
USER is "SYS"

再看以sysoper身份登陆数据库的情况:

[oracle@localhost dbs]$ sqlplus '/as sysdba'

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Mar 5 11:28:00 2009

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options

SQL> grant sysoper to scott
  2  ;

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
[oracle@localhost dbs]$ sqlplus scott/tiger as sysoper;

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Mar 5 11:28:19 2009

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options

SQL> show user
USER is "PUBLIC"

通过查看v$pwfile_users视图,可以得知有哪些用户被授予了sysdba或sysoper权限:

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP
------------------------------ ----- -----
SYS                            TRUE  TRUE
SCOTT                          TRUE  TRUE

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10972173/viewspace-561483/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 查看oracle版本
请登录后发表评论 登录
全部评论
十余年大型金融及电信系统数据库管理经验,曾服务于中国建设银行、中国移动。对oracle,mysql数据库有深入了解。 擅长python开发,独立开发了开源数据库自动化监控运维平台Power Monitor。

注册时间:2008-02-29

  • 博文量
    325
  • 访问量
    1258379