Oracle 10 Gb tablespace physical location Transfer

Source: Internet
Author: User

Oracle 10g tablespace physical location transfer so I moved the tablespace to another hard disk, the process is as follows: Operating Environment: Database: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 tablespace: database Files used before USERS transfer: C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ USERS01.DBF database files used after the transfer: D: \ DB Data \ Oracle \ orcl \ USERS01.DBF brief operation steps: Step 1: log on to the database Step 2: Stop the database Step 3: Start the database in open Mode Step 4: Change the tablespace (USERS) step 5 offline: manually copy the database files used by the tablespace (C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ USERS01.DBF) to the directory to be transferred (D: \ DB Data \ Oracle \ orcl \ U SERS01.DBF), step 6: Associate the tablespace with the database files in the new directory Step 7: Bring the tablespace online, submit, OK, and complete. Detailed SQL: Step 1: C: \> sqlplus/nolog SQL> conn/as sysdba Step 2: SQL> shutdown immediate step 3: SQL> startup open Step 4: SQL> alter tablespace eucrmspace offline; Step 5: manually copy database files to the desired directory. Step 6: [before and after the operation, you can use SQL to query the changes in the database files used in the table space: select name from v $ datafile;] SQL> alter tablespace eucrmspace rename datafile 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ USERS01.DBF 'to 'd: \ DB Data \ Oracle \ orcl \ USERS01.DBF'; Step 7: SQL> alter tablespace eucrmspace online; SQL> commit; SQL> exit; Note: 1. when transferring a tablespace, make sure that you do not perform any write operations on the tablespace (for example, the project sequence is still running). Otherwise, an error will be reported after the test, when performing the sixth step of the result of the write operation on the tablespace while transferring the edge, the ERROR is reported: ERROR is in row 1st: ORA-01113: file 11 needs to be introduced Quality recovery ORA-01110: Data File 11: 'd: \ DB Data \ Oracle \ orcl \ USERS01.DBF '2. step 5 (copy a file) must be after Step 4; otherwise, an error will be reported in Step 6. The error message is similar to step 3. assume that an error is reported in step 6, so you have to recover the database files (D: \ DB Data \ Oracle \ orcl \ USERS01.DBF) that are used today ), restore the database files used previously (C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ USERS01.DBF), that is, re-Execute Steps 5, 6, and 7, however, the SQL statement in step 5 is slightly changed. ....... SQL> rollback; SQL> alter tablespace eucrmspace rename datafile 'd: \ DB Data \ Oracle \ orcl \ USERS01.DBF 'to 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ USERS01.DBF ';...... The following is the wall-crossing operation command: C: \ Documents ents and Settings \ XXX> sqlplus/nolog SQL * Plus: Release 10.2.0.1.0-Production on Monday November 15 16:29:14 2010 Copyright (c) 1982,200 5, oracle. all rights reserved. SQL> conn/as sysdba is connected. SQL> shutdown the immediate database. Previously, the database was detached. ORACLE routine was previously disabled. SQL> startup open ORACLE started before. Total System Global Area 612368384 bytes Fixed Size 1250428 bytes Variable Size 83889028 bytes Database Buffers 520093696 bytes Redo Buffers 7135232 bytes Database load ends. The database was previously opened. SQL> alter tablespace users offline; The tablespace has been modified. SQL> select name from v $ datafile; NAME C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ SYSTEM01.DBF C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ UNDOTBS01.DBF C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ SYSAUX01.DBF C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ USERS01.DBF SQL> alter tablespace USERS rename datafile 'C: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ USERS01.DBF 'to 'd: \ DB Data \ Oracle \ orcl \ USERS01.DBF'; The tablespace has been modified. SQL> select name from v $ datafile; NAME -------------------------------------------------------------------------------- C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ SYSTEM01.DBF C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ UNDOTBS01.DBF C: \ ORACLE \ PRODUCT \ 10.2.0 \ ORADATA \ ORCL \ SYSAUX01.DBF D: \ db data \ ORACLE \ ORCL \ USERS01.DBF SQL> alter tablespace users online; The tablespace has been modified. SQL> commit; submitted completely.

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.