oracle命令

oracle数据库创建用户和表空间

以超级管理员身份登陆

# 启动sqlplus不登陆
sqlplus /nolog;       
# 通过超级管理员以dba身份登陆
conn 用户名/密码 as sysdba

创建表空间

create tablespace 表空间名 datafile '文件路径/文件名.dbf' size 空间大小;
create tablespace scott_tb_space datafile '/data/oradata/orcl/scott_tb_space.dbf' size 200M;

创建用户并指定表空间

create user 用户名 identified by 密码 default tablespace 表空间;
create user scott1 identified by "!23qweQWE" default tablespace scott_tb_space;

给用户授权dba权限
grant dba to 用户;

查看当前实例

select instance_name from v$instance;

查看所有的用户

SELECT * FROM ALL_USERS;

查看ALL_USERS的结构
DESC ALL_USERS;

用户锁定与解锁

alter user test account lock;
alter user test account unlock;
posted @ 2024-03-19 15:51  村尚chun叔  阅读(3)  评论(0编辑  收藏  举报