Oracle12c创建用户

首先以Oracle管理员用户登录系统,并使用sys用户登录Oracle

$ sudo su - oracle
$ sqlplus /nosql
SQL> conn sys as sysdba:
Enter password: 
Connected.

创建临时表空间

# 查看临时表空间
SQL> select name from v$tempfile;

# 创建临时表空间
SQL> create temporary tablespace test_temp tempfile '/home/oracle/app/oracle/oradata/orcl/test_temp.dbf' size 1000M autoextend on next 100M maxsize unlimited;

创建数据表空间

# 查看数据表空间
SQL> select name from v$datafile;

# 创建数据表空间
SQL> create tablespace test_data datafile '/home/oracle/app/oracle/oradata/orcl/test_data.dbf' size 1000M autoextend on next 500M maxsize unlimited;

创建用户

SQL> create user test identified by test default tablespace test_data temporary tablespace test_temp;

create user test identified by flintstone;
ORA-65096: invalid common user or role name

# Oracle 12c 执行上面的命令会出错,需要先执行下面的语句,然后再创建用户

SQL> alter session set "_ORACLE_SCRIPT"=true;

# 创建用户
SQL> create user test identified by test default tablespace test_data temporary tablespace test_temp;

User created.

赋予权限

SQL> GRANT ALL PRIVILEGES TO test;
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容