Oracle 11g of some common statements recorded

A common statement

  1, create a temporary table space:

create temporary tablespace project_temp 
tempfile 'D:\Oracle\dataspace\project_temp.dbf' 
size 50m 
autoextend on 
next 50m maxsize 20480m 
extent management local;

  " Project_temp " tablespace name, " the tempfile behind the" path to the temporary storage table space, the temporary placement table space mainly temporary data, if some data using the select query, the system will query the data in a temporary intermediate the temporary table space, after the use of temporary table is automatically deleted.

  2, create a table space:

create tablespace project_data 
logging 
datafile 'D:\Oracle\dataspace\project_data.dbf' 
size 50m 
autoextend on              
next 50m maxsize 20480m     
extent management local; 

  " Project_data " tablespace name, " datafile behind the" path table storage space.

  For the temporary table space and table space is concerned, autoextend on the table indicate when space is not enough automatic extension , next 50m automatic extension increment is 50MB, extent Management local representative of management is local .

  3, create a user and set the table space:

create user gb20163493 identified by gb20163493 
default tablespace project_data 
temporary tablespace project_temp;

  Two " 20163493 " are the user's username and password.

  4, the user permissions:

grant connect,resource,dba to gb20163493;

 

  Note: the establishment of table space and create a user, given the basic rights must be completed under the system user.

Guess you like

Origin www.cnblogs.com/guobin-/p/11600876.html