Oracle establishes tablespaces and users

Source: Internet
Author: User

To establish the tablespace and the user's steps:

  1. User
  2. Create:Create user username identified by "password";
  3. Authorization:Grant create session to user name;
  4. Grant create table to user name;
  5. Grant create tablespace to user name;
  6. Grant Create view to user name;
Steps to establish a tablespace and User: User creation: Create user username identified by "password"; authorization: Grant create session to username;            Grant CREATE table to  user name;            Grant create tablespace to  user name;            Grant CREATE view to  user name;

 
    1. establishes a tablespace (typically a table space and an index space of n stored data):   
    2. create tablespace  table space name   
    3. datafile < Span class= "string" >   path (to build the path first) \***.dbf   '  size *m  
    4. tempfile  '   Path \***.dbf  '  size *m  
    5. autoextend on   --auto-grow   
    6. --there are also some commands to define the size, see the need for   
    7.  default storage (  
    8.  initial  100k,  
    9.  NEXT&NBSP;100K,&NBSP;&NBSP;
Tablespace establishes table space (typically a table space with n stored data and an index space): Create tablespace tablespace name datafile ' path (to build the path first) \***.dbf  ' size *mtempfile ' path \***.dbf ' Size *mautoextend  on-auto-grow-there are also some defined-size commands to see the default storage (initial 100K, next 100k,);
 
    1. Example: creating a table space
    2. Create Tablespace Demospace
    3. DataFile ' e:/oracle_tablespaces/demospace_tbspace.dbf '
    4. Size 1500M
    5. Autoextend on next 5M maxsize 3000M;
    6. Delete Table space
    7. Drop tablespace demospace including contents and datafiles
Example: Creating table spaces Create tablespace demospace datafile ' e:/oracle_tablespaces/demospace_tbspace.dbf ' size 1500M autoextend on Next 5M maxsize 3000M; Delete table space drop tablespace demospace including contents and datafiles

    1. User Rights
    2. To grant a user permission to use the tablespace:
    3. Alter user username quota Unlimited on table space;
    4. or alter user username quota *m on table space;
User Rights grant users permission to use tablespace: Alter user username quota unlimited on table space, or alter user username quota *m on table space;


Complete Example:

  1. --Table space
  2. CREATE tablespace SDT
  3. DataFile ' F:\tablespace\demo ' size 800M
  4. EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
  5. --Index Table space
  6. CREATE tablespace Sdt_index
  7. DataFile ' F:\tablespace\demo ' size 512M
  8. EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
  9. --2. Build Users
  10. Create User demo identified by demo
  11. Default Tablespace demo;
  12. --3. Empowering
  13. Grant Connect,resource to demo;
  14. Grant create any sequence to demo;
  15. Grant create any table to demo;
  16. Grant Delete any table to demo;
  17. Grant insert any table to demo;
  18. Grant select any table to demo;
  19. Grant Unlimited tablespace to demo;
  20. Grant execute any procedure to demo;
  21. Grant update any table to demo;
  22. Grant Create any view to demo;
--Table space Create tablespace sdtdatafile ' F:\tablespace\demo ' size 800M         EXTENT MANAGEMENT LOCAL SEGMENT space MANAGEMENT AU to; --Index tablespace create tablespace sdt_indexdatafile ' F:\tablespace\demo ' size 512M                  EXTENT MANAGEMENT LOCAL SEGMENT Space MANAGEMENT AUTO;     --2. Create user demo identified by demo default Tablespace demo; --3. Empowering Grant Connect,resource to demo;grant create any sequence to demo;grant create any table to demo;grant delete any tab Le to demo;grant Insert no table to demo;grant Select any table to Demo;grant unlimited tablespace to Demo;grant execute Any procedure to demo;grant update any table to demo;grant create any view to demo;
 
    1. --Import and export commands
    2. IP Export mode: Exp demo/[email protected]:1521/orcl file=f:/f.dmp full=y
    3. Exp Demo/[email protected] file=f:/f.dmp full=y
    4. Imp demo/[email protected] file=f:/f.dmp full=y ignore=y

Oracle establishes tablespaces and users

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.