create user username identified by 密码grant connect to username grant select any table to username2 dos sqlplus /nolog conn /as sysdba alter user sys identified by 密码
--创建用户并且赋予只读权限 create user username identified by password SQL> conn system/system as sysdba; 已连接。 SQL> create user user2 identified by user2;用户已创建。SQL> grant connect to user2;授权成功。SQL> grant select any table to user2;授权成功。SQL> conn user2/user2; 已连接。 SQL> select * from scott.dept; DEPTNO DNAME LOC ---------- -------------- ------------- 60 dfsdf we 70 jiujiang 50 NANCHANG 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON已选择7行。SQL> delete scott.dept; delete scott.dept * 第 1 行出现错误: ORA-01031: 权限不足--修改用户密码 --alter user username identified by new_password SQL> conn system/system as sysdba; 已连接。 SQL> alter user user2 identified by pd;用户已更改。SQL> conn user2/pd; 已连接。
谢谢你的回答 create user username identified by 密码 //这句执行后,它还能以dba的角色登陆呢?
identified by 密码grant connect to username
grant select any table to username2
dos
sqlplus /nolog
conn /as sysdba
alter user sys identified by 密码
SQL> conn system/system as sysdba;
已连接。
SQL> create user user2 identified by user2;用户已创建。SQL> grant connect to user2;授权成功。SQL> grant select any table to user2;授权成功。SQL> conn user2/user2;
已连接。
SQL> select * from scott.dept; DEPTNO DNAME LOC
---------- -------------- -------------
60 dfsdf we
70 jiujiang
50 NANCHANG
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON已选择7行。SQL> delete scott.dept;
delete scott.dept
*
第 1 行出现错误:
ORA-01031: 权限不足--修改用户密码 --alter user username identified by new_password
SQL> conn system/system as sysdba;
已连接。
SQL> alter user user2 identified by pd;用户已更改。SQL> conn user2/pd;
已连接。
create user username
identified by 密码 //这句执行后,它还能以dba的角色登陆呢?
你如果在安装oracle的服务器上以dba登陆是不需要密码的,其他机器要密码认证。
这就要你安装oracle数据库的那台服务器系统用户和所在环境保证db的安全了。
就跟sql server里面的操作系统认证一个道理吧!