For more details on deploying data for RDS, importing and exporting, see [official documentation].
To deploy data for RDS, it is important to note that the RDS database only has 1521 ports open, so all operations can only be done through a 1521 port database connection.
1 Exporting data
In the source database:
--查看数据库目录:select * from dba_directories t;--数据导出(操作系统命令行执行,而不是数据库SQL命令行):expdp TESTDB/TESTDB schemas=TESTDB dumpfile=expdp.dmp directory=DATA_PUMP_DIR
2 Create a tablespace, user, and authorization in the target database
In the target database, which is the RDS database:
--创建表空间:create tablespace TESTDB;--创建用户create user TESTDB identified by TESTDB default tablespace TESTDB;--给用户授权grant connect, resource, dba to TESTDB;
3 Importing Data
In the source database:
--建立dblinkcreate database link to_rds connect to TESTDB identified by TESTDBusing ‘(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<dns or ip address of remote db>)(PORT=1521))(CONNECT_DATA=(SID=orcl)))‘
Note Set the location of the host to the server IP address or domain name.
--Copy the library file to the RDS library: BEGIN dbms_file_transfer. Put_file (source_directory_object = ' Data_pump_dir ', source_file_name = ' E Xpdp.dmp ', destination_directory_object = ' Data_pump_dir ', destination_file_name = ' expdp_copied. DMP ', destination_database = ' to_rds ' ); END;/--Import library (operating system command line execution, not database SQL command line):IMPDP [email protected] dumpfile=expdp_copied. DMP Directory=data_pump_dir full=y--Delete Dblink Drop database link to_rds;
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Amazon AWS Learning-Deploy data for an Oracle-type RDS Database