Data migration between different oracle tablespaces

Source: Internet
Author: User

Java code for data migration between different oracle tablespaces -- migrate data in the database testdb and the username testuser's default (users) tablespace to the tablespace (newtablespace) -- 1. log on to the testdb database as a system user, create a directory (testdir), and grant the read and write permissions to the testuser user www.2cto.com create or replace directory testdir as 'e: \ temp '; grant read, write on directory testdir to testuser; -- use the expdp command to export data of the testuser. expdp system/aaaaaa @ testdb directory = testdir dumpfile = testdb. dmp schemas = testuser; -- 2. create a tablespace newtablespace www.2cto.com create tablespace newtablespace logging datafile 'e: \ oracle \ product \ 10.2.0 \ oradata \ oa \ newtablespace. dbf 'size 100 m autoextend on next 200 m maxsize 2048 m extent management local; -- 3. change the table space of testuser to newtablespace alter user testuser default tablespace newtablespace; -- 4. delete tables and sequences under the testuser -- 5. import Data impdp system/aaaaaa @ testdb directory = testdir dumpfile = testdb. dmp remap_tablespace = users: newtablespace

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.