Difference between revisions of "Basic Administrative SQL commands"

From Peter Pap's Technowiki
Jump to: navigation, search
(Create a user)
Line 17: Line 17:
  
 
== Create a user ==
 
== Create a user ==
 +
 +
Create the account:
  
 
   create user '''''username'''''
 
   create user '''''username'''''
Line 24: Line 26:
 
   quota '''''unlimited''''' on '''''tablespacename'''''
 
   quota '''''unlimited''''' on '''''tablespacename'''''
 
   account unlock;
 
   account unlock;
 +
 +
Give the account priveleges:
 +
 +
  grant connect to '''''username''''';

Revision as of 03:13, 11 January 2012

Create tablespace

 create tablespace tablespacename
  datafile '/path/to/file/filename.dbf'
  size 10m autoextend on
  next 5m maxsize 1G;

This will create a 20mb datafile that will extend by 5mb until it gets to 1gb max.

Add datafile to tablespace

 alter tablespace tablespacename
  add datafile '/path/to/file/filename.dbf'
  size 10m autoextend on
  next 5m maxsize 1G;


Create a user

Create the account:

 create user username
  identified by password
  default tablespace tablespacename
  temporary tablespace temp
  quota unlimited on tablespacename
  account unlock;

Give the account priveleges:

 grant connect to username;