database-restore

PostgreSQL 9.1 pg_restore error regarding PLPGSQL

走远了吗. 提交于 2019-11-28 16:23:59
问题 I am using Postgres for a django project and I am currently implementing a database backup/restore system that as simple as possible performs a pg_dump when the user clicks backup and then pg_restore when they click restore backup. All seems fine and dandy until it actually tries to perform the pg_restore at which time it gives this error: pg_restore: [archiver (db)] Error from TOC entry 3206; 0 0 COMMENT EXTENSION plpgsql pg_restore: [archiver (db)] could not execute query: ERROR: must be

having problems trying to restore encrypted database

北城以北 提交于 2019-11-28 14:18:08
Im trying to copy an encrypted database from the default server to my server for testing purposes but im having troubles doing so because i have never done it so im going to explain my procedure and the errors i got first i create a master key : USE master GO CREATE MASTER KEY ENCRYPTION BY PASSWORD ='DB-PaSSw0rD' GO all is good for now : Command(s) completed successfully. then i create a certificate by importing the certificate created on the default server: CREATE CERTIFICATE TDECERT FROM FILE = 'C:\temp\TDECert.cer' WITH PRIVATE KEY (FILE = 'C:\temp\TDECertKey.pvk' , DECRYPTION BY PASSWORD

Restore MySQL DB with Unicode characters (Arabic and Kurdish) in .gz format

懵懂的女人 提交于 2019-11-28 11:50:27
I have a MySQL backup file in .gz format that was created by the backup wizard in cPanel. When the restoration is done by the backup wizard, contents with Arabic and Kurdish characters do not show correctly, even though I changed the collation to different UTF-8 encoding in PhpMyadmin. For example, the real data in DB is : كامپى زانكۆ and the data showed after the restoring become to this : بÙâØ²Ø§ÙÙÛÛâ This is a fairly common problem caused by inconsistent encoding schemes when creating and exporting the database. Here is the simplest way to solve it: Import your backup file Export it again,

Exclusive access could not be obtained because the database is in use

随声附和 提交于 2019-11-28 05:16:57
I'm using following code to restore databases, void Restore(string ConnectionString, string DatabaseFullPath, string backUpPath) { string sRestore = "USE [master] RESTORE DATABASE [" + DatabaseFullPath + "] FROM DISK = N'" + backUpPath + "' WITH FILE = 1, NOUNLOAD, STATS = 10"; using (SqlConnection con = new SqlConnection(ConnectionString)) { con.Open(); SqlCommand cmdBackUp = new SqlCommand(sRestore, con); cmdBackUp.ExecuteNonQuery(); } } but I receive below exception "Exclusive access could not be obtained because the database is in use. RESTORE DATABASE is terminating abnormally. Changed

Enable binary mode while restoring a Database from an SQL dump

荒凉一梦 提交于 2019-11-28 04:37:15
I am extremely new to MySQL and am running it on Windows. I am trying to restore a Database from a dumpfile in MySQL, but I get the following error: $ >mysql -u root -p -h localhost -D database -o < dump.sql ERROR: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: 'SQLite format 3'. I have tried putting --binary-mode in the ini file but it still gives the same error. What should I do? Please help. UPDATE As suggested by Nick in his comment I

Fully automated SQL Server Restore

谁都会走 提交于 2019-11-28 03:40:42
I'm not very fluent with SQL Server commands. I need a script to restore a database from a .bak file and move the logical_data and logical_log files to a specific path. I can do: restore filelistonly from disk='D:\backups\my_backup.bak' This will give me a result set with a column LogicalName , next I need to use the logical names from the result set in the restore command: restore database my_db_name from disk='d:\backups\my_backups.bak' with file=1, move 'logical_data_file' to 'd:\data\mydb.mdf', move 'logical_log_file' to 'd:\data\mylog.ldf' How do I capture the logical names from the first

Restore Problem SQL Server Version?

ぐ巨炮叔叔 提交于 2019-11-27 19:33:42
问题 I am getting following error. Restore failed for Server I have recently upgraded SQL Server 2005 Express to SQL Server 2008 Express. I have taken a Backup on Production Server, having SQL Server 2008 Backup was good and I tried restoring Backup on Production Server, that works great. Than I downloaded that backup file in .Zip format with FileZila Software (And that is good too). But when I tried to restore that file I am getting following error. Restore failed for Server An exception occurred

having problems trying to restore encrypted database

五迷三道 提交于 2019-11-27 19:32:11
问题 Im trying to copy an encrypted database from the default server to my server for testing purposes but im having troubles doing so because i have never done it so im going to explain my procedure and the errors i got first i create a master key : USE master GO CREATE MASTER KEY ENCRYPTION BY PASSWORD ='DB-PaSSw0rD' GO all is good for now : Command(s) completed successfully. then i create a certificate by importing the certificate created on the default server: CREATE CERTIFICATE TDECERT FROM

Fully automated SQL Server Restore

a 夏天 提交于 2019-11-27 19:15:21
问题 I'm not very fluent with SQL Server commands. I need a script to restore a database from a .bak file and move the logical_data and logical_log files to a specific path. I can do: restore filelistonly from disk='D:\backups\my_backup.bak' This will give me a result set with a column LogicalName , next I need to use the logical names from the result set in the restore command: restore database my_db_name from disk='d:\backups\my_backups.bak' with file=1, move 'logical_data_file' to 'd:\data\mydb

How to restore PostgreSQL dump file into Postgres databases?

混江龙づ霸主 提交于 2019-11-27 17:58:23
I have a dump file with a .SQL extension (in fact it is a plain-text SQL file). I want to restore it into my created databases. I am using pgAdmin III , and when I use its "Restore Wizard" it does not highlight the button "Restore". Instead it is expecting a .backup file extension. I tried using shell the commands for restoring the dump, but it still didn't work. I am a newbie at this. If anybody could help me I would be obliged. Edit I used following command to the Shell SQL Pane of PostGres while sitting at the newTestDB. newTestDB-# \i E:\db-rbl-restore-20120511_Dump-20120514.sql It still