1.
①The remote REMOTE_LOGIN_PASSWORDFILE instance parameter controls whether
it is possible to connect to the instance as a user with the SYSDBA privilege over the network.
②v$pwfile_users shows you which users have their passwords entered in the password file, and whether they have the SYSOPER privilege, the SYSDBA privilege, or both.
SQL> show parameter remote_login_
NAME TYPE VALUE
------------------------------------ --------- ---------
remote_login_passwordfile string EXCLUSIVE
SQL> select * from v$PWFILE_USERS;
USERNAME SYSDBA SYSOPER
--------------------- ---------- --------
SYS TRUE TRUE
2.增加一个可以sysdba身份远程连接数据库的用户
SQL> conn sys/gaudi@gaudi100 as sysdba
已连接。
SQL> grant sysdba to gau001 identified by gaudi;
授权成功。
SQL> conn gau001/gaudi@gaudi100 as sysdba
已连接。
SQL> select * from v$pwfile_users;
USERNAME SYSDBA SYSOPER
---------- ---------- ----------
SYS TRUE TRUE
GAU001 TRUE FALSE
3.修改参数,禁止sysdba身份远程连接数据库
①Windows:
SQL> show user;
USER 为 "SYS"
SQL> alter system set remote_login_passwordfile=none scope=spfile;
系统已更改。
SQL> show parameter remote_login_
NAME TYPE VALUE
------------------------------------ --------- -------------------
remote_login_passwordfile string EXCLUSIVE
SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> conn sys/gaudi@gaudi100 as sysdba
已连接到空闲例程。
SQL> startup
ORA-01031: insufficient privileges
②Linux:
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 385875968 bytes
Fixed Size 1219568 bytes
Variable Size 121635856 bytes
Database Buffers 260046848 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> show parameter remote_login_
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string NONE
③Windows:
SQL> conn sys/gaudi@gaudi100 as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
警告: 您不再连接到 ORACLE。
4.重新修改参数REMOTE_LOGIN_PASSWORDFILE,远程开启数据库
①Linux
SQL> alter system set remote_login_passwordfile=EXCLUSIVE scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
②Windows:
SQL> conn sys/gaudi@gaudi100 as sysdba
已连接到空闲例程。
SQL> startup
ORACLE 例程已经启动。
Total System Global Area 385875968 bytes
Fixed Size 1219568 bytes
Variable Size 125830160 bytes
Database Buffers 255852544 bytes
Redo Buffers 2973696 bytes
数据库装载完毕。
数据库已经打开。
SQL>
阅读(3583) | 评论(0) | 转发(0) |