Oracle changes the tablespace File Location

Source: Internet
Author: User

Complete the steps for Oracle to change the tablespace file location:

// Create a temporary tablespace [SQL] create temporary tablespace test_temp tempfile 'd: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ test_temp01.dbf 'size 32 m autoextend on next 32 m maxsize 2048 m extent management local; // create a data table space [SQL] create tablespace test_data logging datafile 'd: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ test_data01.dbf 'size 32 m autoextend on next 32 m maxsize 2048 m extent management local; // create a user and specify the tablespace [SQL] crea Te user test01 identified by test01 default tablespace test_data temporary tablespace test_temp; // grant the user the [SQL] grant connect, resource to test01; // create test tables and data [SQL] conn test01/test01; [SQL] create table tab_test01 (a VARCHAR2 (6), B VARCHAR2 (30), c VARCHAR2 (80 ), d NUMBER (4); [SQL] insert into tab_test01 (a, B, c, d) values ('1', '2', '3', 4 ); commit; select * from tab_test01; // start migration [plain] SET ORACLE_SI D = DB10G SQLPLUS/nolog conn sys/sys as sysdba; shutdown immediate; (File Operation) Copy (MOVE) the data file to the new path // change the path setting [plain] startup mount; alter database rename FILE 'd: \ oracle \ product \ 10.2.0 \ oradata \ orcl \ test_data01.dbf 'to 'd: \ TEST_DATA01.DBF'; alter database open; // test: import new data to the user and check whether the file size imp test01/test01 @ orcl file = d: \ cust is increased in the new location. dmp ignore = y full = y // The test is successful. The process is complete. // Delete the case data for this operation // Delete the user [SQL] drop user test01 cascade; // Delete the TABLESPACE [SQL] DROP TABLESPACE test_temp INCLUDING CONTENTS AND DATAFILES; drop tablespace test_data including contents and datafiles;

 

 

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.