Oracle tablespace creation and deletion, omf, partition table Creation

Source: Internet
Author: User

Now there is a table (mt) with at least million data every day, and we plan to build a partition table in the form of monthly partitions. When partitioning, let Oracle run faster 2, said p21. [SQL]

  1. SQL>AlterSystemSetDb_create_file_dest ='F: \ oradata \ orclyxkj \ tbs_test_t_mt_2012';
[SQL]
  1. SQL>CreateTablespace ts_mt_2012_1 datafileSize50 M autoextendOn;

The first sentence means to set a data file storage path for ORACLE to automatically create files under this path,And use oracle to name the data file.Indeed, after executing the above two sentences, it is as follows:

It can be found that oracle has created two folders, ORCLYXKJ \ DATAFILE, and created them. the dbf data file is not the ts_mt_2012_1.dbf file I wrote. However, the size of the file created by oracle is indeed 50 MB, indicating that it is the data file of the tablespace. Why? Because:

Alter system set db_create_file_dest = 'f: \ oradata \ orclyxkj \ tbs_test_t_mt_2012 ';

This statement means that oracle's OMF is enabled, that is, oracle's Automatic File Management. Therefore, all file names are automatically completed by oracle.Generally, OMF is not enabled for a single database instance..

To enable OMF, another method is to create a database:

When creating a database, select 3rd items. This is the omf management method. oracle automatically manages the data file name, so it is not your name. Select 2nd items.

Then, I saw the file and directory, not the regular names I expected, and I didn't want to create the tablespace in this way, so I decided to delete the tablespace that I just created (some statements directly Delete the tablespace and data files), but I didn't delete the statements at this time, but directly in PL/SQL, find ts_mt_2012_1 in the Tablespace folder, and then press the reverse key to delete it.

After the file is deleted, go to the 'f: \ oradata \ orclyxkj \ tbs_test_t_mt_2012 'directory and find that the file created by oracle is still there. I am afraid to delete it manually, the data cannot be opened because it is inconsistent with the data file after deletion. In fact, this problem does not exist at this time, because the tablespace has been deleted. The database cannot be started unless the tablespace is not deleted and the data file is not offline or deleted.
The problem has been described. Conclusion:

1. Create a tablespace to the specified directory:

[SQL]
  1. SQL>CreateTablespace wfcrmdb datafile'E:/tools/oracle/oradata/wfcrm/wfcrmdb. dbf' Size100 m autoextendOn Next50 m maxsize unlimited;-- <Span style = "color: # ff0000;"> automatic expansion of tablespaces is usually disabled, because automatic expansion may cause database downtime without warning. Solution: See the following "partition table" </span>

Interpolation:
-- When creating a new tablespace, the data file extension is ora, but the system tablespace data file is dbf, and some existing tablespace data files are dat files, is there any difference?

  • 1
  • 2
  • 3
  • Next Page

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.