[Original] Oracle database logical migration steps

Source: Internet
Author: User
Oracle Database logical migration steps

1. First, query and obtain the exp export script for exporting all non-Oracle user data:

 1   Select   '  Exp system/password @ orcl file =  '   | Username |   '  . Dmp log =  '   |  2   3 Username |   ' . Log owner =  '   | Username |   '  4   5   '  6   7     From  All_users t  8   9    Where T. Created >  10  11 ( Select R. Created From All_users R Where R. Username =   '  System  ' ) +   1 ;

2. Then, obtain the SQL script created for non-oracle users in the new database:

 1   Select   '  Create user '   | Username |   '  Identified by password;  '   |   '  2   3   /  '   |   '  4   5   Grant connect, resource '   | Username |   '  ;  '   |   '  6   7   /  '  8   9     From  All_users t  10   11   Where T. Created >  12   13 ( Select R. Created From All_users R Where R. Username =   '  System  ' ) +   1 ;

3. Then, obtain the SQL script for creating the tablespace required for data import in the new database:

 1  Select   '  Create tablespace  '   | Name |   '  Logging datafile  '   | Name |  2   3          '  . Ora  '   | 4   5          '  Size 1000 m autoextend on next 300 m maxsize unlimited extent management local;  '  6   7     From  V $ tablespace  8   9    Where Name Not   In ( '  System ' , '  Undotbs1  ' , '  Sysaux  ' , '  Users  ' , '  Temp  ' );

4. Finally, query and obtain the IMP import script to import all non-Oracle user data:

 1   Select  '  IMP system/password @ orcl file =  '   | Username |   '  . Dmp log =  '   |  2   3 Username |   '  . Log fromuser =  '   | Username|   '  Touser =  '   | Username |   '  4   5   '  6   7     From  All_users t  8   9    Where T. Created>  10   11 ( Select R. Created From All_users R Where R. Username =   '  System  ' ) +   1 ;

Finally, query and confirm the data migration is successful.

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.