千家信息网

【Oracle Database】数据库用户管理

发表于:2025-01-22 作者:千家信息网编辑
千家信息网最后更新 2025年01月22日,创建用户SQL> create user soe identified by soe default tablespace soe temporary tablespace temp;User cre
千家信息网最后更新 2025年01月22日【Oracle Database】数据库用户管理
创建用户SQL> create user soe identified by soe default tablespace soe temporary tablespace temp;User created.查询用户的默认表空间SQL> set line 200SQL> col username for a30SQL> col account_status for a20SQL> select username,account_status,created from dba_users where username = 'SOE';USERNAME                       ACCOUNT_STATUS       CREATED------------------------------ -------------------- ---------SOE                            OPEN                 08-MAY-19查询用户的默认临时表空间SQL> col default_tablespace for a30SQL> col temporary_tablespace for a30SQL> select username,default_tablespace,temporary_tablespace from dba_users where username='SOE';USERNAME                       DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE------------------------------ ------------------------------ ------------------------------SOE                            SOE                            TEMP修改用户的默认表空间SQL> alter user soe default tablespace soe01;User altered.修改用户的临时表空间SQL> alter user soe temporary tablespace temp01;User altered.用户密码过期SQL> alter user soe password expire;User altered.SQL> select username,account_status,created from dba_users where username = 'SOE';USERNAME                       ACCOUNT_STATUS       CREATED------------------------------ -------------------- ---------SOE                            EXPIRED              08-MAY-19锁定用户SQL> alter user soe account lock;User altered.SQL> select username,account_status,created from dba_users where username = 'SOE';USERNAME                       ACCOUNT_STATUS       CREATED------------------------------ -------------------- ---------SOE                            EXPIRED & LOCKED     08-MAY-19解锁用户SQL> alter user soe account unlock;User altered.SQL> select username,account_status,created from dba_users where username = 'SOE';USERNAME                       ACCOUNT_STATUS       CREATED------------------------------ -------------------- ---------SOE                            EXPIRED              08-MAY-19修改用户密码SQL> alter user soe identified by soe;User altered.SQL>  select username,account_status,created from dba_users where username = 'SOE';USERNAME                       ACCOUNT_STATUS       CREATED------------------------------ -------------------- ---------SOE                            OPEN                 08-MAY-19删除用户SQL> drop user soe cascade;User dropped.


0