Rename OR relocate the data file of a certain space

Source: Internet
Author: User

Rename OR relocate RNAME: 1. offline tablespace: alter tablespace users offline normal; 2. use the OS command mv to rename and re-adjust the physical location: 3. rename data file: alter tablespace users rename datafile '/u02/oracle/rbdb1/user1.dbf ', '/u02/oracle/rbdb1/user2.dbf' TO'/u02/oracle/rbdb1/users01.dbf', '/u02/oracle/rbdb1/users02.dbf'; 4. we recommend that you perform a new full backup: RELOCATE: 1. determine the location and size of the tablespace data file: SQL> SELECT FILE_NAME, BYTES FROM DBA_DATA_FILES WHERE TABLESPACE_NAME = 'users'; 2. offline tablespace: alter tablespace users offline normal; 3. use the OS command to copy the file to a new location. the rname must be the name to be changed: When you rename and relocate datafiles with these procedures, only the pointers to the datafiles, as recorded in the database control file, are changed. the procedures do not physically rename any operating system files, nor do they copy files at the operating system level.4.rename datafile: alter tablespace users rename datafile '/u01/app/oracle/oradata/ORA11G/datafile/o1_mf_users_8mm4pff5 _. dbf ''/u01/app/oracle/oradata/ORA11G/datafile/USERS02.DBF 'TO'/u01/app/oracle/oradata/ORA11G/datafile/users01.dbf''/u01/app /oracle/oradata/ORA11G/datafile/USERS02.DBF '; 5. online datafile: alter tablespace users online; 6. we recommend that you back up your database.

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.