- Oracle Database 12c Security Cookbook
- Zoran Pavlovi? Maja Veselica
- 380字
- 2021-07-02 16:43:14
The sysdg privilege – how, when, and why should you use it?
It is recommended that you use the sysdg
administrative privilege instead of sysdba
administrative privilege to perform operations related to data guard tasks.
Getting ready
For this recipe, you'll need:
- An existing database user (for example,
mike
) and a password file in the 12c format if you want to complete it using a password-authenticated user - An existing OS user (for example,
kelly
), who belongs to thedgdba
OS group in order to connect to the database using OS authentication
How to do it...
Instructions are split into sections for database authentication and OS authentication.
The instructions for database authentication are as follows:
- Connect to the database as
sysdba
(or another user who can grant thesysdg
privilege):sqlplus / as sysdba
- Grant
SYSDG
privilege to usermike
:SQL> grant sysdg to mike;
- Exit SQL*Plus, connect
mike
using thedgmgrl
command-line interface:SQL> exit $ dgmgrl DGMRRL> connect mike/test_1
How it works...
When you connect to the database as sysdg
, you are connected as a predefined user, sysdg
. Using the sysdg
privilege, you can connect to the database even when it is not open.
After completing step 2 successfully in the Database authentication section, user mike
, as expected, can grant/revoke sysdg
privilege to/from another existing user. If you want to try it out, type the statements given here.
After you connect to the database using the sysdg
administrative privilege, you can perform the following operations:

There's more...
You can't drop user sysdg
. When you are connected to the database as sysdg
, you are connected as sysdg
user to the SYS
schema:
SQL> connect / as sysdg Connected. SQL> show user USER is "SYSDG" SQL> select sys_context( 'userenv', 'current_schema' ) from dual; SYS_CONTEXT('USERENV','CURRENT_SCHEMA') ------------------------------------------------------------------ SYS
See also
- Creating password-authenticated users
- Creating and using OS-authenticated users
- Visual Basic .NET程序設計(第3版)
- 測試驅動開發:入門、實戰與進階
- 軟件界面交互設計基礎
- Arduino開發實戰指南:LabVIEW卷
- 羅克韋爾ControlLogix系統應用技術
- Windows Presentation Foundation Development Cookbook
- Quarkus實踐指南:構建新一代的Kubernetes原生Java微服務
- 快速念咒:MySQL入門指南與進階實戰
- 單片機C語言程序設計實訓100例
- Python機器學習算法: 原理、實現與案例
- OpenResty完全開發指南:構建百萬級別并發的Web應用
- Spring Boot+MVC實戰指南
- Beginning C++ Game Programming
- 軟件工程與UML案例解析(第三版)
- Greenplum構建實時數據倉庫實踐