Data migration between different Oracle tablespaces

Source: Internet
Author: User
-- Migrate data in the default (users) tablespace of the database testdb and testuser to the tablespace (newtablespace) -- 1. Use the system user to log on to testdb

-- Migrate data in the default (users) tablespace of the database testdb and testuser to the tablespace (newtablespace) -- 1. Use the system user to log on to testdb

Homepage → Database Technology

Background:

Read News

Data migration between different Oracle tablespaces

[Date:] Source: Linux community Author: Linux [Font:]

-- Migrate data in the default (users) tablespace of testdb and testuser to the tablespace (newtablespace)

-- 1. Use the system user to log on to the testdb database, create directory (testdir), and grant the read and write permissions to the testuser.

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
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

  • 0
  • Sequence usage in Oracle

    Enable MySQL remote access on CentOS

    Oracle tablespace Oracle data migration

    Image Information

    View All comments in this article (0)

    Comments

    Latest Information

    Popular this week

    Introduction to Linux community-advertisement service-website map-help Info-contact us
    The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.


    Copyright©2006-2014 Linux community All rights reserved Zhejiang ICP backup No. 06018118

    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.