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