Six minutes to learn how to create an Oracle Tablespace

Source: Internet
Author: User

After a long time to learn to create an Oracle tablespace, so share with you, after reading this article you certainly have a lot of gains, hope this article can teach you more things.

1. Query the free space first

    1. Select Tablespace_name,file_id,block_id,bytes,blocks from Dba_free_space;

2. Increase the Oracle table space

First, query the data file name, size and path information, the following statement:

    1. Select Tablespace_name,file_id,bytes,file_name from Dba_data_files;

3. Modify the file size statement as follows

    1. ALTER DATABASE DataFile
    2. ' Need to add a path to the data file, which is the path queried above
    3. ' Resize 800M;

4. Create Oracle Tablespace

  1. Create Tablespace Test
  2. DataFile '/home/app/oracle/oradata/oracle8i/test01.dbf ' size 8M
  3. Autoextend on
  4. Next 5M
  5. MaxSize 10M;
  6. Create Tablespace Sales
  7. DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
  8. Autoextend on
  9. Next 50M
  10. MaxSize Unlimited
  11. MaxSize Unlimited is not limited in size
  12. Create Tablespace Sales
  13. DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
  14. Autoextend on
  15. Next 50M
  16. MaxSize 1000M
  17. Extent management Local uniform;
  18. Unform indicates that the size of the zone is the same, default is 1M
  19. Create Tablespace Sales
  20. DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
  21. Autoextend on
  22. Next 50M
  23. MaxSize 1000M
  24. Extent management local uniform size 500K;
  25. Unform size 500K indicates that the area is the same sized as 500K
  26. Create Tablespace Sales
  27. DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
  28. Autoextend on
  29. Next 50M
  30. MaxSize 1000M
  31. Extent management local autoallocate;
  32. Autoallocate indicates that the size of the area is changed automatically with the size of the table, large table uses the large Area small table to use the cell
  33. Create Tablespace Sales
  34. DataFile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
  35. Autoextend on
  36. Next 50M
  37. MaxSize 1000M
  38. temporary;
  39. Temporary creating a dictionary management Temp table space
  40. Create temporary tablespace sales
  41. Tempfile '/home/app/oracle/oradata/oracle8i/sales01.dbf ' size 800M
  42. Autoextend on
  43. Next 50M
  44. MaxSize 1000M
  45. Creates a local administrative temporary tablespace, and if it is a temporary tablespace, datafile in all statements is changed to Tempfile
  46. 8i system default Create dictionary manage temporary tablespace to create local manage temporary tablespace add temporary tablespace keyword
  47. You must not use the Atuoallocate parameter when creating a local administrative temporary tablespace, and the system creates uniform management by default
  48. To add a data file to the tablespace:
  49. Alter TABLESPACE sales Add
  50. DataFile '/home/app/oracle/oradata/oracle8i/sales02.dbf ' size 800M
  51. Autoextend on Next 50M
  52. MaxSize 1000M;

Create a locally managed temporary Oracle Tablespace, if it is a temporary tablespace, all statements in DataFile are replaced by the tempfile8i system by default to create a dictionary management temporary tablespace, to create a local administrative temporary tablespace to add temporary tablespace keyword When creating a local administrative temporary tablespace, you must not use the Atuoallocate parameter, the system creates uniform management by default

To add a data file to the tablespace:

    1. Alter TABLESPACE sales Add
    2. DataFile '/home/app/oracle/oradata/oracle8i/sales02.dbf ' size 800M
    3. Autoextend on Next 50M
    4. MaxSize 1000M;

5. Change Auto-extended properties:

    1. ALTER DATABASE DataFile
    2. '/home/app/oracle/oradata/oracle8i/sales01.dbf ',
    3. '/HOME/APP/ORACLE/ORADATA/ORACLE8I/SALES02.DBF '
    4. '/HOME/APP/ORACLE/ORADATA/ORACLE8I/SALES01.DBF
    5. Autoextend off;

The above introduction to create an Oracle tablespace, here to share with you, hope to be useful to everyone.

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.