Oracle创建表空间、创建用户以及授权
创建临时表空间
创建临时表空间
CREATE TEMPORARY TABLESPACE test_temp
TEMPFILE 'C:\oracle\product\10.1.0\oradata\orcl\test_temp01.dbf'
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
创建用户表空间
创建用户表空间
CREATE TABLESPACE test_data
LOGGING
DATAFILE 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\TEST_DATA01.DBF'
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
创建用户并制定表空间
创建用户并指定表空间
CREATE USER username IDENTIFIED BY password
DEFAULT TABLESPACE TEST_DATA
TEMPORARY TABLESPACE TEST_TEMP;
给用户授予权限
给用户授予权限
GRANT
CREATE SESSION, CREATE ANY TABLE, CREATE ANY VIEW ,CREATE ANY INDEX, CREATE ANY PROCEDURE,
ALTER ANY TABLE, ALTER ANY PROCEDURE,
DROP ANY TABLE, DROP ANY VIEW, DROP ANY INDEX, DROP ANY PROCEDURE,
SELECT ANY TABLE, INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE
TO username;
将role这个角色授与username,也就是说,使username这个用户可以管理和使用role所拥有的资源
GRANT role TO username;
[color=red]查看表空间的文件位置[/color]
select TABLESPACE_NAME,FILE_NAME from dba_temp_files;
or
select name from v$tempfile;
创建临时表空间
创建临时表空间
CREATE TEMPORARY TABLESPACE test_temp
TEMPFILE 'C:\oracle\product\10.1.0\oradata\orcl\test_temp01.dbf'
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
创建用户表空间
创建用户表空间
CREATE TABLESPACE test_data
LOGGING
DATAFILE 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\TEST_DATA01.DBF'
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
创建用户并制定表空间
创建用户并指定表空间
CREATE USER username IDENTIFIED BY password
DEFAULT TABLESPACE TEST_DATA
TEMPORARY TABLESPACE TEST_TEMP;
给用户授予权限
给用户授予权限
GRANT
CREATE SESSION, CREATE ANY TABLE, CREATE ANY VIEW ,CREATE ANY INDEX, CREATE ANY PROCEDURE,
ALTER ANY TABLE, ALTER ANY PROCEDURE,
DROP ANY TABLE, DROP ANY VIEW, DROP ANY INDEX, DROP ANY PROCEDURE,
SELECT ANY TABLE, INSERT ANY TABLE, UPDATE ANY TABLE, DELETE ANY TABLE
TO username;
将role这个角色授与username,也就是说,使username这个用户可以管理和使用role所拥有的资源
GRANT role TO username;
[color=red]查看表空间的文件位置[/color]
select TABLESPACE_NAME,FILE_NAME from dba_temp_files;
or
select name from v$tempfile;