Oracle establishes tablespaces and users

Source: Internet
Author: User

[SQL]View PlainCopy
  1. To establish the tablespace and the user's steps:
  2. User
  3. Create:Create user username identified by "password";
  4. Authorization:Grant create session to user name;
  5. Grant create table to user name;
  6. Grant create tablespace to user name;
  7. Grant Create view to user name;

[SQL]View PlainCopy
    1. Table Space
    2. Create a tablespace (typically a table space with n stored data and an index space):
    3. Create tablespace table space name
    4. DataFile ' Path (to build the path first) \***.dbf ' size *m
    5. Tempfile ' path \***.dbf ' size *m
    6. Autoextend on -automatic growth
    7. --There are some commands to define the size, see the need
    8. Default Storage (
    9. Initial 100K,
    10. Next 100k,
    11. );
[SQL]View PlainCopy
    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

[SQL]View PlainCopy
    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;

Complete Example:

[SQL]View PlainCopy
  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;
[SQL]View PlainCopy
    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

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.