Local Oracle data uploaded to AWS RDS

Source: Internet
Author: User

How to install Oracle and AWS RDS to create Oracle is no longer detailed here. Simply create some simple data on local Oracle, and then try to import RDS.


·          

Step 1: Giving permission

Log on to the local Oracle input command below:


Sql> Grant Unlimited tablespace to SCOTT; Sql> Grant Read,write on directory Data_pump_dir to SCOTT; Sql> Grant execute on dbms_datapump to SCOTT; Sql> @/usr/oracle/dumpscott.sql

PL/SQL procedure successfully completed.


Dumpscott.sql content:

DECLAREHDNL number; BEGINHDNL: = dbms_datapump.open (Operation = ' EXPORT ', Job_mode = ' SCHEMA ', job_name=>null);D bms_datapump. Add_file (handle = hdnl, filename = ' scott.dmp ', directory = ' Data_pump_dir ', filetype = dbms_datapump.ku$ _file_type_dump_file);D bms_datapump.add_file (handle = hdnl, filename = ' exp.log ', directory = ' Data_pump_ DIR ', filetype = dbms_datapump.ku$_file_type_log_file);D bms_datapump. Metadata_filter (HDNL, ' schema_expr ', ' in (' SCOTT ') ');D bms_datapump.start_job (HDNL); end;/
Step 4: Transfer dump FILE to Amazon RDS DB using Dbms_file_transfer

BEGIN
Dbms_file_transfer. Put_file (
Source_directory_object = ' Data_pump_dir ',
Source_file_name = ' Scott.dmp ',
Destination_directory_object = ' Data_pump_dir ',
Destination_file_name = ' Scott_copied.dmp ',
Destination_database = ' To_rds '
);
END;
/


The SQL file is sqlplus in the following line:

Sql> @/usr/oracle/putscott.sql

PL/SQL procedure successfully completed.


Step 4: Import data to RDS using pump

IMPDP <username>@<TNS_ENTRY> Dumpfile=user1copied.dmpdirectory=data_pump_dir full=y

Enter the following content:

IMPDP [email protected]_db dumpfile=scott_copied.dmp Directory=data_pump_dir full=y


Prompted to enter the password will automatically complete the upload import process. You can then connect to RDS to inquire about the grass operations such as Scott's EMP table. There will be two error here, but you can ignore


This article is from the "Technical Blog" blog, please be sure to keep this source http://raytech.blog.51cto.com/7602157/1684108

Local Oracle data uploaded to AWS RDS

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.