创建用户

一、创建用户

只有dba权限的用户才可以创建用户:

create user username

identified {by password|EXTERNALLY|GLOBALLY AS external name}

[default tablespace tablespace_name]

[temporary tablespace tablespace_name]

[quota{正整数 [K|M]} on tablespace_name]

[quota{正整数[K|M]} on tablespace_name]

[password expire]

[a、ccount{lock|unlock}]

[profile{概要文件|default}]

创建用户时一定要指定默认表空间和默认临时表空间。这样在创建数据库对象时默认存储在默认表空间中。如果不设置默认表空间,在创建db对象时忘记指定表空间后,创建的db对象

会存储在system表空间中。这样会严重冲击数据库的性能。

在表空间上给用户分配配额可以防止因用户错误的操作占用过多的磁盘空间

查看用户在表空间上的配额的视图是dba_ts_quotas

查看用户的视图是dba_users

二、创建概要文件

create profile profile_name limit

  {资源限制参数}

  {口令限制参数}

ex:

create profile profile_name limit

  failed_login_attempts 8

  password_life_time 90

  password_lock_time unlimited

  password_reuse_time 28

  password_grace_time 7

  sessions_per_user 3

  cpu_per_session 16800

  logical_reads_per_session 23688

  connect_time 180

  idle_time 28;

三、将概要文件赋予给用户

alter user username profile profile_name;

原文地址:https://www.cnblogs.com/moonfans/p/3986677.html