Arquivo da tag: Amazon RDS

AWS RDS PostgreSQL error “remaining connection slots are reserved for non-replication superuser connections”

Amazon has to set the number of connections based on each model’s right to demand a certain amount of memory and connections

MODEL      max_connections innodb_buffer_pool_size
---------  --------------- -----------------------
t1.micro   34                326107136 (  311M)
m1-small   125              1179648000 ( 1125M,  1.097G)
m1-large   623              5882511360 ( 5610M,  5.479G)
m1-xlarge  1263            11922309120 (11370M, 11.103G)
m2-xlarge  1441            13605273600 (12975M, 12.671G)
m2-2xlarge 2900            27367833600 (26100M, 25.488G)
m2-4xlarge 5816            54892953600 (52350M, 51.123G)

But if you want you can change the max connection size to custom by

From RDS Console > Parameter Groups > Edit Parameters,

You can change the value of the max_connections parameter to a custom value.

For closing the connections periodically you can setup a cron job some thing like this.
[code type=sql]
select pg_terminate_backend(procpid)
from pg_stat_activity
where usename = ‘yourusername’
and current_query = ‘
and query_start < current_timestamp - interval '5 minutes';

Como restaurar um arquivo SQL Server BAK no Amazon RDS

Steps to Restore .bak SQL Server backup file to Amazon RDS

  1. Launch a Windows + SQL Server Amazon EC2 on-demand instance. (Use the same availability zone as your Amazon RDS instance to speed up the data transfers.) Make sure to increase the default size of the EBS volume to accomodate 3-4 times the space occupied by the .bak file. You’ll need space to store the .bak file, the restored database MDF/LDF, and the scripts generated for the migration. You can also create a separate EBS volume.
  2. Zip your .bak file and upload it to this new instance
  3. To transfer the file securely, you can copy/paste it via remote desktop.
  4. Another way is to install FileZilla FTP Server
  5. and set up FTP over SSL. Then, use WinSCP FTP client software to upload the file there (with resume capability). Both of these are freeware.

  6. Restore the .bak file into the SQL server database local to that Amazon EC2 instance
  7. Install and run the SQL Azure Migration tool.
  8. Select the source database as the local server
  9. Select Analyze/Migrate > SQL Database
  10. Generate scripts (Edit the .xml config file in the SQL Azure folder if you need to change the location where the scripts are generated. They can get large!)
  11. Select the destination server as “SQL Server” type and enter the RDS hostname / endpoint.
  12. Run the scripts on the destination server
  13. Save the RTF log files for troubleshooting

The above procedure is a quick and painless way to retore your SQL Server .bak backup files into an Amazon RDS instance.


Baixar o SQL Azure