创建用户(用超级管理员,并不是Linux里的root,而是Oracle数据库的超级管理员sys)
1、以超级管理员登录到Oracle实例
[oracle@dbserver ~]$ sqlplus sys as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed May 13 21:14:34 2020
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
2、创建zhangsan这个用户,密码是zs1234
SQL> CREATE USER zhangsan IDENTIFIED BY zs1234;
User created.
3、给zhangsan这个用户授予connect和resource权限
SQL> GRANT connect,resource TO zhangsan;
Grant succeeded.
4、给zhangsan这个用户授予创建任意视图的权限
SQL> GRANT CREATE ANY VIEW TO zhangsan;
Grant succeeded.
SQL>
授权成功后,就可以用这个用户登录PL/SQL客户端了。