Oracle re-associating data files

Source: Internet
Author: User

Due to the rapid growth of data in the Oracle database, the disk space of the data file is insufficient. To clean up the space, I disabled oracle, then, the data files, control files, and redo log groups are moved directly to another disk, but this causes many problems and is difficult to clean up, so they are moved back again, then I can find the method for moving it through the query:

When moving the tablespace created by the user, when the database is opened:

1. First, set the tablespace to read-only.

Alter tablespace bfina read only;

2. Set the tablespace to offline.

Alter database datafile '/opt/app/oracle/oradata/orcl/bfina. dbf' offline;

3. copy the data file to a new location.

Host cp '/opt/app/oracle/oradata/orcl/bfina. dbf''/gisdata/orcl/bfina. dbf'

4. Rename the data file to a new location.

Alter database rename file '/opt/app/oracle/oradata/orcl/bfina. dbf' to'/gisdata/orcl/bfina. dbf'

5. Connect the data file

Alter database datafile '/gisdata/orcl/bfina. dbf' online

6. Set the tablespace to read and write permissions.

Alter tablespace bfina read write;

7. Delete the old data file.

To move the system tablespace

Then MOUNT the system to the MOUNT status.

Startup mount;

1. Take the system tablespace offline

Alter database datafile '/opt/app/oracle/oradata/orcl/system01.dbf' offline;

2. copy the file to the new directory.

Host cp ''''

3. Rename the system tablespace to the new location.

Alter database rename file '/opt/app/oracle/oradata/orcl/system01.dbf' to '/gisdata/orcl/system01.dbf'

4. Then online

Alter database'/opt/app/oracle/oradata/orcl/system01.dbf' online;

5. Open the database later

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.