Oracle 学习笔记(一)

1、查看当前登录用户

show user dba_users

2、启用scott用户

alter userscottaccount unlock;

3、修改表空间的状态(联机/脱机)

alter  tablespacetablespace_name online(默认)/offline;

4、修改表空间的状态(只读/读写)

alter tablespace tablespace_name read only/read write(默认);

5、查看表空间的状态

select status from dba_tablespaces where tablespace_name='XXXX';

6、增加数据文件

alter tablespace tablespace_name add datafile 'xx.dbf' size xx;

7、查询数据文件

select file_name from dba_data_files where tablespace_name='XXXX';

8、删除数据文件

alter tablespace tablespace_name

drop datafile 'XX.dbf';

9、创建用户

create user username identified bypassword;

10、赋予DBA权限

grant dba to username;

11、删除用户

drop user username cascade;

你可能感兴趣的:(数据运维)