数据库操作

open 打开状态

可读取数据库配置文件,可对数据文件读写

alter database open;

mount 配置状态

可读取数据库配置文件,不可对数据文件读写

alter database mount;

表空间操作

查询表空间

select tablespace_name, file_name, status,bytes/1024/1024 from dba_data_files order by 1;

创建表空间

create tablespace TEST datafile '/data/DAMENG/TEST.DBF' size 64;

删除表空间

drop tablespace test;

表空间联机

alter tablespace test online;

表空间脱机

alter tablespace test offline;

修改表空间名称

alter tablespace test rename to test2;

创建用户并设置表空间

create user TEST identified by "123456" password_policy 0 default tablespace "TEST";

需要指定密码策略password_policy,可以为以下值,或其任何组合 :

  • 0 无策略
  • 1 禁止与用户名相同
  • 2 口令长度不小于 9
  • 4 至少包含一个大写字母(A-Z)
  • 8 至少包含一个数字(0-9)
  • 16 至少包含一个标点符号(英文输入法状态下,除― 和空格外的所有符号)

注意:若为其他数字,则表示以上设置值的和,如 3=1+2,表示同时启用第 1 项和第 2 项
策略。当设置为 0 时,表示设置口令没有限制,但总长度不得超过 48 个字节。另外,若不
指定该项,则默认采用系统配置文件中 PWD_POLICY 所设值。

赋权

grant PUBLIC to test;
grant RESOURCE to test;
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐