oracle 创建用户及表空间命令


1、突然想查看数据库中哪些用户拥有DBA权限,于是百度了一下,找到了这一条语句:

select * from dba_role_privs where granted_role='DBA'
注意:执行这一条语句需要执行者本来就要有DBA权限
另外如果要是想收回某用户的DBA权限则执行:

revoke dba from user_Name

2、在cmd命令行输入  sqlplus sys/tarena as sysdba    即可.

然后输入:create user tarena identified by user;
grant connect,resource,create session,create table to user;创建用户并且赋予权限权.

 

3、查看数据库

select * from v$database;

 

4、允许远程访问

https://blog.csdn.net/pengpengpeng85/article/details/78757484

 

5、创建表空间

create tablespace tablespacename datafile 'd:\data.dbf' size xxxm;
    tablespacename:表空间的名字
    d:\data.dbf':表空间的存储位置
    xxx表空间的大小,m单位为兆(M)

6、将空间分配给用户:
   alert user username default tablespace tablespacename;
   将名字为tablespacename的表空间分配给username 

 7、允许 自动扩展表空间

alter database datafile '/Database/oraapp/oracle/oradata/scorl/SC_CORE20200618.dbf' autoextend on;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM