How to Keep Administrator Passwords Synchronized with the Data Dictionary

To synchronize the passwords for non-SYS administrative users, such as SYSDBASYSOPERSYSBACKUPSYSDG, and SYSKM users, you must first revoke and then regrant the privileges to these users as follows:

1.Find all users who have been granted the SYSDBA privilege.

SQL> show user
USER is "SYS"
SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO
         4 PDB2                           READ WRITE NO
        12 PDB3                           MOUNTED
SQL> alter session set container=PDB1;

Session altered.

SQL> SELECT USERNAME FROM V$PWFILE_USERS WHERE USERNAME != 'SYS' AND SYSDBA='TRUE';

no rows selected

SQL> desc v$PWFILE_USERS
 Name                                                                                                              Null?    Type
 ----------------------------------------------------------------------------------------------------------------- -------- ----------------------------------------------------------------------------
 USERNAME                                                                                                                   VARCHAR2(128)
 SYSDBA                                                                                                                     VARCHAR2(5)
 SYSOPER                                                                                                                    VARCHAR2(5)
 SYSASM                                                                                                                     VARCHAR2(5)
 SYSBACKUP                                                                                                                  VARCHAR2(5)
 SYSDG                                                                                                                      VARCHAR2(5)
 SYSKM                                                                                                                      VARCHAR2(5)
 ACCOUNT_STATUS                                                                                                             VARCHAR2(30)
 PASSWORD_PROFILE                                                                                                           VARCHAR2(128)
 LAST_LOGIN                                                                                                                 TIMESTAMP(9) WITH TIME ZONE
 LOCK_DATE                                                                                                                  DATE
 EXPIRY_DATE                                                                                                                DATE
 EXTERNAL_NAME                                                                                                              VARCHAR2(1024)
 AUTHENTICATION_TYPE                                                                                                        VARCHAR2(8)
 COMMON                                                                                                                     VARCHAR2(3)
 CON_ID                                                                                                                     NUMBER

SQL> SELECT USERNAME FROM V$PWFILE_USERS;

USERNAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SYS
C##MAXWELL

SQL>

2.Revoke and then re-grant the SYSDBA privilege to these users.

SQL> create user pandasthree identified by pandasthree;

User created.

SQL> grant sysdba to pandasthree;

Grant succeeded.

SQL> revoke sysdba from pandasthree;

Revoke succeeded.

SQL> 

3.Find all users who have been granted the SYSOPER privilege


SQL> SELECT USERNAME FROM V$PWFILE_USERS WHERE USERNAME != 'SYS' AND SYSOPER='TRUE';

USERNAME
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
C##MAXWELL

SQL> 

4.Revoke and regrant the SYSOPER privilege to these users

REVOKE SYSOPER FROM non-SYS-user;
GRANT SYSOPER TO non-SYS-user;

5.Find all users who have been granted the SYSBACKUP privilege.

SQL> SELECT USERNAME FROM V$PWFILE_USERS WHERE USERNAME != 'SYS' AND SYSBACKUP ='TRUE';

no rows selected

SQL>

6.Revoke and regrant the SYSBACKUP privilege to these users.

REVOKE SYSBACKUP FROM non-SYS-user;
GRANT SYSBACKUP TO non-SYS-user;

7.Find all users who have been granted the SYSDG privilege.

SELECT USERNAME FROM V$PWFILE_USERS WHERE USERNAME != 'SYS' AND SYSDG='TRUE';

8.Revoke and regrant the SYSDG privilege to these users.

REVOKE SYSDG FROM non-SYS-user;
GRANT SYSDG TO non-SYS-user;

9.Find all users who have been granted the SYSKM privilege.

SELECT USERNAME FROM V$PWFILE_USERS WHERE USERNAME != 'SYS' AND SYSKM='TRUE';

10.Revoke and regrant the SYSKM privilege to these users.

REVOKE SYSKM FROM non-SYS-user;
GRANT SYSKM TO non-SYS-user;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值