Create a new tablespace in Oracle

Source: Internet
Author: User

Select tablespace_name, file_name, ceil (bytes/1024/1024) mbfrom dba_data_files order by 1; create tablespace tanzugan logging datafile 'H: \ APP \ ZUGANTAN \ ORADATA \ ORCL2012 \ tanzugan. dbf 'size 100 m reuse extent management local segment space management auto; www.2cto.com --- view tablespace Information select * from dba_data_files order by 1; ------ interspersed order by 1 order by2 order by 1 sort order by the first column By 2 is sorted by the second column. If only two columns are written as order by 3, an error is returned. ------------------- Add the new data file alter tablespace ts1 add datafile 'd: \ ORACLE \ ORADATA \ Ora10 \ ts1.2 'size 2 m; the data file can only be added and cannot be deleted unless the tablespace is deleted. However, in the 10 Gb database version, you can delete ---------------- Delete the tablespace data file alter tablespace ts1 drop datafile 'd: \ ORACLE \ ORADATA \ ORA10 \ TS1.2 '. The tablespace can increase the size of the data file, you can also narrow down the Alter database datafile '..... 'Resize 100 m; automatically extended select FILE_NAME, AUTOEXTENSIBLE, MAXBLOCKS, INCREMENT_BY from dba_data_files; changed to automatically extended alter database datafile 'd: \ ORACLE \ ORADATA \ O10 \ TS1.1 'autoextend on next 1 m maxsize 100 m; changed to manual extension of alter database datafile 'd: \ ORACLE \ ORADATA \ O10 \ TS1.1 'autoextend off; tablespace read-only Alter tablespace users read only; Verify select TABLESPACE_NAME, STATUS from dba_tablespaces; read and write Alter tablespace users read Write; the tables in the read-only tablespace cannot be dml, but can be dropped. Because the drop operation is system tablespace, the SYSTEM tablespace cannot be read-only. Www.2cto.com Offline tablespace alter tablespace users offline; Verify select TABLESPACE_NAME, STATUS from dba_tablespaces; online alter tablespace users online; only complete data files can be online. If incomplete, restore the table. Restore the consistency before online; the user can access the author tanzugan only when the file is online

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.