Oracle创建用户和表空间

一、概述

1.数据库实际管理中,不同业务系统需要使用’不同的用户'进行管理维护和使用,这样做把业务数据和系统数据独立分开管理,利于数据库系统管理;

2.在数据库中创建业务系统用户时候,建议为用户创建指定的用户表空间,否则全部默认为user表空间存储,使得user表空间容易过大,不易管理、查询。

二、操作

1.create user <username> identified by <password>;  此方式使用默认user表空间,不推荐此语句。

2.create user <username> identified by <password>

  default tablespace <tablespace_name> --默认的指定表空间

 temporary tablespace temp  --默认的临时表空间

quota unlimited on <tablespace_name>  --表空间额度

grant create session to <username> ; --授权登陆。

示例:

create user test identified by 123456

default tablespace testtbs --指定的表空间

temporary tablespace testtemp  --指定的临时表空间

quota unlimited on testtbs  --表空间额度

grant create session to test; --授权登陆。

 3.查询

SQL> select * from dba_users t where t.username=test;

posted @ 2022-05-08 15:00  花之旭  阅读(1827)  评论(0编辑  收藏  举报