Automated Database Copy
Jan 16, 2008
I have a database (actually several of them) on a production server. I want to be able to create an automatic process so every evening the production database is copied to a different server that runs staging sites.
I know that this is possible through database mirroring, but I don't want the database to be constantly mirrored. I would prefer to have a script that ran every night that just make an exact copy over to the staging server.
Is there any way to automate this, possibly through the copy database wizard? Does anyone have any good suggestions as to how I can make this work? If not, does anyone know of a good straight forward article on database mirroring that will get me started quick?
Thanks.
http://www.dynamicajax.com
View 5 Replies
ADVERTISEMENT
Apr 16, 2007
Hi all,
i am a student doing my final year project and i have the duty to develop a automated part-archiving for our MsSql Server 2000 Database, but its not so simple :eek: .
the environment:
- MsSql Server 2000
- Suns App-Server Glasfish
- Java (J2EE)
- Hibernate
the requirements:
1.)
Some tables should be synchronized and redundant (the same data in both databases)
2.)
If the maindatabase is changing the schema the archivedatabse must do the same changes.
3.)
The datas in some tables (the ones that aren't synchronized) which are older then 2 Years should be moving (copy, paste) to the archivedatabase every 24 hours.
4.)
If there are is a access for a data which are not in the maindatabase, it is necassary to get it from the archivedatabase.
I don't find a way to realise this ...
can some one give me a hint?
... Sorry for my bad english, i hope i explained my problem good enough.
Thanks for ur answers
View 10 Replies
View Related
Jul 20, 2005
Hi folks,I got a script which restores a database. It works fineif it is running in my Query Analyzer.It fails when I put this script in an automated schedule using theSQL agent.This is my scriptRESTORE DATABASE [RestoreTest]FROM DISK = N'E:sqlbakRestoreTest.BAK'WITH FILE = 1, NOUNLOAD , STATS = 10, RECOVERYand this is the error message from the scheduler (Sorry its in German)Executing as User dbo. Exclusiv access to database not possiblebecauseit is in use (which is not).. Rest may be clear ;-))Ausführt als Benutzer: dbo. Exklusiver Zugriff auf die Datenbank istnicht möglich, da die Datenbank gerade verwendet wird. [SQLSTATE42000] (Fehler 3101) RESTORE DATABASE wird fehlerbedingt beendet.[SQLSTATE 42000] (Fehler 3013). Fehler bei SchrittDo you have any suggestion to me ?
View 5 Replies
View Related
May 12, 2007
Hi All,I need help in creating a function in VB for my ASP.NET application where I want to add records to database on the first day of every month.I have got no idea about what I have to do for achieving this goal.Its basically for a customer based application where Interest will be paid into customers' account and I need to implement this for every customer on 1st day of every monthThe thing I am not sure about is how can I get the application to add a record for each customer on the first day of each month, i.e. how can I get the application to check that its 1st day of month and then the application adds records automatically for each customer based on my specified rules.If any of you could help me with this, I'll really appreciate it.Thank you.
View 5 Replies
View Related
Nov 26, 2014
possible to send Pivot query results as automated database email ?
View 3 Replies
View Related
May 11, 2006
Hi,
I set up DB mirror between a primary (SQL1) and a mirror (SQL2); no witness. I have a problem when I issue command:
alter database DBmirrorTest
Set Partner = N'TCP://SQL2.mycom.com:5022';
go
The error message is:
The remote copy of database "DBmirrorTest" has not been rolled forward to a point in time that is encompassed in the local copy of the database log.
I have the steps below prior to the command. (Note that both servers' service accounts use the same domain account. The domain account I login to do db mirror setup is a member of the local admin group.)
1. backup database DBmirrorTest on SQL1
2. backup database log
3. copy db and log backup files to SQL2
4. restore db with norecovery
5. restore log with norecovery
6. create endpoints on both SQL1 and SQL2
CREATE ENDPOINT [Mirroring]
STATE=STARTED
AS TCP (LISTENER_PORT = 5022, LISTENER_IP = ALL)
FOR DATA_MIRRORING (ROLE = PARTNER)
7. enable mirror on mirror server SQL2
:connect SQL2
alter database DBmirrorTest
Set Partner = N'TCP://SQL1.mycom.com:5022';
go
8. Enable mirror on primary server SQL1
:connect SQL1
alter database DBmirrorTest
Set Partner = N'TCP://SQL2.mycom.com:5022';
go
This is where I got the error.
The remote copy of database "DBmirrorTest" has not been rolled forward to a point in time that is encompassed in the local copy
Thanks for any help,
KT
View 8 Replies
View Related
Feb 23, 2008
Hi ,
I'm just new in this SQL 2005, and I do not reallly sure the subject is right or not but as example in this link below
http://msdn2.microsoft.com/en-us/library/ms190307.aspx
I want updated to few of person of any changes in database just by sending to their emails in every 2 hours as an example. I go through the example given but I do not know the step how to run stored procedures. The Information that I want to give to them is like as:
Date From : 23/02/2008
Date To: 24/02/2008
Number of user : 3
My draft table is like this
Sequence_No Submitted_Dt Name
-------------------- ------------------- ------------------------
1 2/21/2008 4:16:45 PM John
2 2/22/2008 4:16:45 PM Dean
3 2/23/2008 4:16:45 PM Rick
4 2/24/2008 4:16:45 PM Van
thanks to all of your corcern to help me
Regards;
View 13 Replies
View Related
Nov 4, 2006
Hello,
if i have a given database (a model) and i want to copy this database in the same database instance. Is it ok to copy the mdf and ldf file and attach the files with a new database name in the same instance.
Or is the datebase name part of the .mdf file?
Regards
Markus
View 6 Replies
View Related
Oct 28, 2006
Hello I am a software developer with minimal SQL server administration skills. Currently I am using SQL Server 2000.I need to know if there is a way to copy a particular table from a database, and to copy the table into a different database.Basically on a project I am working on we are using a table named "Customers" from a database named QTR. We need to copy this database table into a different database named "Research". How can this be done? Is if very complicated?
View 1 Replies
View Related
Sep 24, 2007
Hi guys,
I've been assigned the task of setting up access to our SQL Server 2005 box. A consultant developing for us has accessing to 2 databases and I've set this up fine. It appears however that one of these databases is re-copied over to the server every night to keep data reasonably current.
I'm not interesting in changing this method as I'm not the maintainer (as yet).
Basically I would like to know if I've setup access to this database (it works fine), when the database is updated (with an SSIS package) the account seems to get deleted. Do the original permissions from the source database overwrite those of its destination?
Cheers
View 1 Replies
View Related
Nov 1, 2006
I'm using SQL Server Management Studio Express and I'm trying to figure out how to copy a table(s) from my local database to my web hosting database. I know how to do it in 2000, but it's completely different now. Is this feature not allowed on SSMSE? If so, then how do I deploy database tables to a web host?Also, how do you add local database(s) to SSMSE? I tried to use 'attach database' in SSMSE and it wouldn't allow me to navigate to My Documents folder where the database resides. Thanks...
View 8 Replies
View Related
Dec 29, 2004
If I want to copy the data from Table1 in Database A to Table2 in
Database B but Table1 column name is code , Table 2 column name is
vesselcode.
(Code = vesselcode)
How to copy all data from Table1 in Database A to Table2 in Database B ?
Do I need to write the SQL statment ? and Can I use Server Enterprise
Manager Tool?Thx a lot.
View 1 Replies
View Related
Jul 20, 2005
Hello,I need to copy a table from an 8i oracle database to a sqlserver 2000 database.Is it possible to use the command "COPY FROM ... TO ..." ?So, what is the correct syntax ?Thanks for your helpCyril
View 1 Replies
View Related
Jan 6, 2008
Hi,
I have a complicated sql server mobile database (.sdf) and need to create a SQL SERVER database with the same tables. How can I do it without scripting the whole thing? I thought of using the views.information_schema databases, but it is still a lot of coding.
thanks
View 3 Replies
View Related
Mar 27, 2007
hii want to copy one database table to onther database table using script?my database is ms-sql server 2000
View 4 Replies
View Related
Apr 8, 2005
i have an database created with MSDE using the windows authentication,
and now i want to send this database to someone, can i just backup this
database and send it,
can other people access my database with windows authenticaiton in his computer ??? or i need to do some extra stuff???
View 3 Replies
View Related
Jul 25, 2001
Running SQL 2000 and need to copy an entire database (structure and data) from our inhouse development server to our 'live' server at our hosting co. What's the best solution? I can't do it directly because both machines are behind firewalls or course.
Thanks in advance!
Jim
View 1 Replies
View Related
Sep 12, 2001
I am pretty new to SQL Server 7.0 and am having a problem. I have two databases, both on seperate SQL Servers. The problem I am having is I have a copy of one and a backup of the other. I need both of these to be restored into a third SQL Server I have locally. None of these Servers see each other so I can't register them. All I have to work with is the Backup and the copy. Can someone tell me how to accomplish this. I have tried to do restore and import.
Thanks so much in advance for any help.
View 2 Replies
View Related
Sep 26, 2001
What is the best method to copy databases among all the options.
* bcp
* sp_detach and attach
* DTS
* Back up from source restore to destination
View 1 Replies
View Related
Jul 12, 2000
Hi,
What is the quickest and easiest way to make a copy of an entire database ie. create a test environment from production?
Thanks in advance,
Darrin
View 1 Replies
View Related
Feb 27, 2001
Hi,
I have to make a copy of my db with all users/passowrds/views/sp...etc to same server with diff.name.
What is the best way to do this and how long will it take to transfer around 5gb of data.
Thanks
View 1 Replies
View Related
Apr 28, 2008
How can you copy a database from one server to another without taking it down?
I know I can detach the database and then copy it thru the file system, but how can it be done with the database running?
Thanks
View 1 Replies
View Related
Jun 28, 2004
what would be the best way to copy a database from one server to another.
Thanks.
View 1 Replies
View Related
Jul 12, 2004
I wanted copy a database from one server to another server.So far I'm doing this is by detaching and attaching the DB.But when i tried to restore the DB on the new server its giving some error. Is't a good process to detach and attach.PLease let me know if there is any better way of doing this.
View 5 Replies
View Related
Mar 18, 2007
I need to move a database from sql 2000 to sql 2005. My research suggests that I can backup a sql 2000 db from enterprise manager and restore it with sql 2005 management studio. Are there step by step directions for this or can someone tell me how to do this?
what about logins? Are they transfered in this process. My research also suggests the I use copy database wizard by this failed on me and I can't find anything in the event log or anywhere else to tell me why. Please help. Thanks
View 3 Replies
View Related
Feb 2, 2004
when i'm copying my database from one server to another server the package is faling with the follwoing errors
Step Error Source: Microsoft SQL-DMO (ODBC SQLState: 28000)
Step Error Description:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'mmmservicestart'.
Step Error code: 80004005
Step Error Help File:SQLDMO80.hlp
Step Error Help Context ID:700
What is the exact problem with these errors and what should i do to overcome this.Can anyone help me in this regard.
Thanks.
View 7 Replies
View Related
Apr 5, 2004
Hi to all,
i would like to know how i can solv e my problem.
I have two databases, one is a work in progress(from now WIP) and the other is a container about all the data (ALLDATA). The databases have the same structure, the first is stored in a MSDE 2000 and the second in a SQL Server 2000.
When something happen, i copy a part of data from the WIP to the ALLDATA and i clear the WIP from the copied data.
Now i'm using the insert into instruction for each table.
Is this method right to work?
Can you suggest me something differen?
Thank you.
Emanuele
View 1 Replies
View Related
May 19, 2004
I have copied a Database from one server to another server by detaching and attaching.Everything looks fine but i didn't get the logins associated with the DB onto new server.
How can i get those logins into the database on new server.
Thanks.
View 3 Replies
View Related
Nov 28, 2005
Hi
How can i copy database to another name.
I have acct database now i want to copy acct database to oldacct database. How can i do this.
thanks
asm
View 3 Replies
View Related
Mar 7, 2006
when i try this query to attach a database,
EXEC sp_attach_db @dbname = 'EnvNew',
@filename1 = 'D:K-PlusEngineeringDBDatabaseEnvNew.mdf',
@filename2 = 'D:K-PlusEngineeringDBDatabaseEnvNew.ldf'
ERROR :
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'D:K-PlusEngineeringDBDatabaseEnvNew.mdf' is not a valid database file header. The PageAudit property is incorrect.
pls help me....
View 4 Replies
View Related
Mar 20, 2006
how do i copy a database from the support area to the testing area?
reply wil be appreciated
View 3 Replies
View Related
Oct 12, 2006
How do I copy a database from one server to another? Do I have to take the database offline to perform this task?
View 7 Replies
View Related
Nov 16, 2006
I have two 'identical' sql databases, Live and Test but they have got out of sync - I've developed on Test and now Live is a lot different. How can I copy Test to replace Live.
By the way, Live isn't used yet, but is going to be soon.
View 4 Replies
View Related