How Do I Determine The Backup Date Of A Restored Database..?
Feb 1, 2007
Hi All,
I have to a few backups restored from a set of backup files. The
backup files have been removed from the drive because of some storage
constrains...
For some data comparison reasons, I need to figure out the actual date
of these backup files that is used to restore these databases. Is
there any system table I can query to figure the actual backup times
of these databases...
Any help will be much appreciated.. Thanks in advance.
- Aravin
View 1 Replies
ADVERTISEMENT
Nov 15, 2007
We replicate a SQL2000 database (DataBaseA) to a SQL2000 database (DataBaseB) by using the Restore function and hasn't change its logical name but only the physical data path and file name. It is running fine for a year. We use the same way to migrate the DataBaseB to a new SQL2005 server with the Restore function and the daily operation is running perfect. However, when we do the Backup of DatabaseB in the SQL2005, it just prompt the error message
System.Data.SqlClient.SqlError: The backup of full-text catalog 'DataBaseA' is not permitted because it is not online. Check errorlog file for the reason that full-text catalog became offline and bring it online. Or BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Smo)
Please note we left the DataBaseA in the old SQL2000 server.
Please help on how we can delete the Full-text catalog from DatabaseB so we can do a backup
Many Thanks
View 1 Replies
View Related
Feb 5, 2008
Hello!
I am trying to find out name of the backup file database was restored from (I am restoring from DISK), something similar to physical_device_name in backupmediafamily. restorehistory doesn't have this information.
Any advice is greatly appreciated.
Thanks,
Igor
View 3 Replies
View Related
Jun 15, 2006
Hi There
I am trying to establish the date a database was last used.
At first i checked out sp_helpfile and sysfiles to see if there was a date last modified, i also tried using xp_cmdshell to check the date on the actual .mdf or .ldf on the o/s but if the file has not grown the date will be the create date.
I need to establish the date a database was last used, either the last time someone logged into it or the last time any sort of command was run against the database, i cannot use sysprocesses as there are no connections to the database, so i need to determine the last time there actually were any processes run against this database.
And i need to use tsql, checking audit logs etc is not viable, can anyone help ?
Thanx
View 6 Replies
View Related
May 12, 2015
I have been experiencing "Specified cast is not valid" error while restoring backup of DB. Version of SQL server management tool from which I am taking the backup is "Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (Intel X86) Jun 17 2011 00:57:23 Copyright (c) Microsoft Corporation Express Edition with Advanced Services on Windows NT 6.1 (Build 7601: Service Pack 1) (WOW64) (Hypervisor) ". And restoring to the same version tool.
I have tried all the workarounds like TSQL, Upgrade the version of restoring DB to higher version, MDF and LDF files generation. But they are not working.
View 12 Replies
View Related
Apr 24, 2007
According to BOL, you can initialize a transactional subscriber by restoring the Publisher's backup to the Subscriber DB. But any timestamp columns must be converted to binary(8) and indexed views must be converted to tables. But are there other things you must do? What about identity columns? Triggers?
Thanks
View 1 Replies
View Related
May 6, 2006
Hello
I have restored a SQL 2000 backup of my database, ever since my web applications are unable to use any of the stored procedures.
I get the following error:
Could not find stored procedure 'xxx'.
If I use enterprise manager and go to the procedures tab the procedure appears there.
Any ideas what is up?
PS: The username has been changed, before the backup it was "user1" now its something else. For some reason it still shows that the procedure object is owned by "user1". Could this be the problem?
Thanks in advance.
View 1 Replies
View Related
Oct 30, 2015
I missed the ability to restore based on a time (10/23 6pm) due to our purge cycle in our production environment, but I was able to obtain the 10/18 full backup, the 10/23 differential backup, and the 4, 10/23 trans. log backups. I moved all the fore mentioned files to a staging environment, and now I am trying to restore all of the files to 10/23 6pm and I get :
"The log or differential backup cannot be restored because no files are ready to rollforward" error.
View 3 Replies
View Related
Jan 24, 2006
I just restored my SQL server 2000 database on the SQL server 2005. after this i ran the Service broker sample ("Hello World") on this database by changing the AdventureWorks name to the new database name. The "setup.sql" runs fine. When i run the "SendMessage.sql" i was not getting any rows in the output (The message was not getting inserted into the queue). I checked the Service broker is enabled on this databased using the query "select is_broker_enabled from sys.databases where name = 'newdbname' " It was 1. I even tried the ALTER DATABASE SET ENABLE_BROKER. but it didnt work.
When i tried the sample on a newly created database it worked fine.
Is there any solution to make the restored database to work for service broker.
Thanks
Prashanth
View 3 Replies
View Related
Apr 20, 2006
hi all,
our datbase was restore but the publications were all gone.
however replication monitor shows publication and subscription.
worst. can create the publication with the same name because
it raises an error saying that it can't drop publication becuase
there is a subscription in it.
how can i remove the publication when the are already gone in the publication
folder but exist in the replication monitor
thanks for the help
View 4 Replies
View Related
Jan 20, 2006
Is there a way to restore a 2000 database to 2005?
will the restore process convert automatically to 2005?
View 1 Replies
View Related
Dec 7, 2007
Hi,
I have recently restored a backup of a SQL Server 2000 Database (from my production server €“ which is a shared hosting service) on my dev machine so I can do some testing. The issue I am having is with the permission of objects. Some of the objects were created with the dbo user and some with another login (myLogin). The ones that were created with dbo work fine on my dev machine. The others do not work unless I prefix them with €œmyLogin€?€¦ I get an €œInvalid object name€? if I don€™t prefix them. This is problematic because there are hundreds of stored procs and tables that I would need to modify in order to use them on my dev machine.
Can anyone tell me how to create a new user with the necessary permissions so I can execute my procs and access tables without having to prefix them?
Hope this makes sense €“ please let me know if it doesn€™t.
Thanks,
Mike
View 5 Replies
View Related
Mar 31, 2008
Hi
I have an sql server 2005+sp2 instance and a db on it.
I have create a database master key (specifying a password so it WILL NOT get encrypted by the server master key) on my database and backed it up
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'test'
go
BACKUP MASTER KEY TO FILE = 'c:Genesis_DBMasterKey.key' ENCRYPTION BY PASSWORD = 'test'
Then I have created a asymmetic key without specifying a password therefore the key will get encrypted bt the database master key.
CREATE ASYMMETRIC KEY card WITH ALGORITHM = RSA_512
And then for test I run
DECLARE @Encryptvalasym varbinary(MAX)
SET @Encryptvalasym = EncryptByAsymKey(AsymKey_ID('card'), 'EncryptedData')
SELECT @Encryptvalasym
SELECT CONVERT(varchar(max),DecryptByAsymKey(AsymKey_ID('card'),@Encryptvalasym) )
And the result is OK.
Problem: as a recovey plan if I restore the database on the same or other instance (althogh the asymmetic key is part of backup) the decrypt doesn€™t work.
I have tried to create a bank database restore tha databse master key and recreate the asymmetric key, but I€™m afraid I€™m still not having any luck with it, as it does not decrypt.
My main issue is that is any case if I have to recover the database , how do I have to make sure that encryption/Dycription will work?
Thanks
View 10 Replies
View Related
Mar 26, 2007
I only have the ldf file and the bak file.
My bak file was current to 3/2/2007
My ldf file was current to 3/25/2007
I do not have the mdf file.
How to I apply the transaction from the ldf file to my resotred database?
View 6 Replies
View Related
Mar 19, 2008
Dear All,
I have a user with DBOWNER,DBCREATOR role and access is set to deny on viewing any other databases. Now when I connect using this user and try to restore the database. after restore, I can not open it or access it using the same user.
what is causing this.
Thanks,
View 3 Replies
View Related
May 16, 2007
Is there any workaround on this? I need to migrate my data in sql server 2005 into sql server 2000. Thanks in advance.
View 2 Replies
View Related
Apr 8, 2002
Hi I took a Full Backup on Production Server and Restored the Same Database on Testing Server, i am able to see all the Tables Stored Procedure and View except Logins, i am not able to see any logins, there are total 650 Logins under the Database how can i see the logins and how to restore the logins, while i am trying to create any logins it is saying Error Occured login is already existing in the Database..
Bye,
Madhavi
View 3 Replies
View Related
Aug 22, 2007
Thanks in advance for help.
Could someone please help me for SWL backup restoration and db by user
I restored SQL 7.0 database to SQL 2000. ( by creating empty db on SQL 2000 and restored from SQL 7 backup) -- restore ok..
I need to use same SQL user which is admin for DB on SQL 7, for SQL 2000 also. ( DB user is sql user not domain user)
I put mixed authentication mode ( windows and SQL) in SQL 2000 enterprises manager security tab setting.
I can see DB user is available in DB user list on restored DB but can not access DB when I try to access from query analyser
I tried to create new login with same name as it was in SQL 7 and tried to give full admin access on SQL 2000 enterprise manager but I get error 21002:[ SQL DMO] User 'user' already exists.
Kind Regards
Sunod
View 1 Replies
View Related
Sep 20, 2007
I restored a backup of a replication database named "distribution" to a non-replicated development instance (ss2000). Well, when I try to drop the database I am told I can not because it is used for replication. It isn't. But you now how Microsoft is . . . . So the question is: how do I drop the database without rebuilding the server, or jumping through firery hoops????
Thanks!
Scorched
View 1 Replies
View Related
Jan 17, 2007
I have a SQL 2k database backup and I restore it in sql server 2005.
Is this now a SQL Server 2005 database or a 2K database in a 2005 server.
Means do I need to convert databases somehow when I migrated from 2000 to 2005. Is the above mentioned way a way to migrate... or are ther some conversation tools.
Any help / links / ressources would be Great...
Felix
View 5 Replies
View Related
Aug 23, 2007
We have a log shipping database running on SQL 2000 ENT SP4, the secondary DB is in standby/read only mode . we have a job that runs every day to take it offline, make a copy of the files and attach them as a new database for reporting purposes.
We're planning to upgrade to SQL 2005 however, when we copy the Standby/read only database files and attach using "CREATE DAABASE FOR ATTACH" we get :
msg 1284
Cannot attach a database that was being restored.
this works in SQL 2000 but not SQL 2005, is there a way to force attach the DB ?
Thanks.
View 4 Replies
View Related
Nov 5, 2015
I have a table that contains the SKU and a period of time the SKU was available to purchase (StartDtKey and EndDtKey). I am trying to write a query determine which skus were available during a given date range. The DtKeys correspond to a date in our calendar table and are in order. So DtKey 5 is 4 days after DtKey 1.
Code:
CREATE TABLE #SKU(
[SKU] varchar(10) NULL,
[StartDtKey] int NULL,
[EndDtKey] int NULL);
INSERT INTO #SKU VALUES ('Sku1',1,9)
,('Sku2',2,6)
,('Sku3',10,20)
,('Sku4',5,9)
,('Sku5',25,30)
Example:
Which SKUs were available on at least one day between DtKey 7 and DtKey 9?
Answer:
Sku1, Sku4
View 1 Replies
View Related
Dec 3, 2013
I need a SQL query which lists out directory path from which the database has been restored recently ( i.e backup path ).....
View 2 Replies
View Related
Jun 20, 2014
This is the logic I need to incorporate in to sql
if the getdate() < term start date then R
if the getdate() > term date date and getdate() < term end date then C
if the getdate() > term end date then H
I have come up with the following type of case statement that will allow me to determine the first two values (to a degree), however , I need to evaluate the end date as well.
Is there a way to look at multiple columns in a case statement?
CASE
WHEN DATEDIFF(DD,GETDATE(),TRM_BEGIN_DTE) >0 THEN 'R' else 'C' end
View 5 Replies
View Related
Oct 2, 2006
I need to determine the actual date/time that a message was placed on the queue. In my "activated" procedure I want to log this information and pass it along to further processing routines. From what I can tell, the Queue table itself does not have this information captured.
View 4 Replies
View Related
Nov 7, 2012
Is it possible to determine an index create date in SQL Server 2008 R2? The index in question is not a primary key.
View 8 Replies
View Related
Jul 20, 2005
DECLARE @varDate datetimeDECLARE @varMonthDate datetimeDECLARE @varYear datetimeDECLARE @varFOM varchar(10)DECLARE @NumDaysInMonth as intselect @varDate = '2/1/2004'select @varMonthDate = MONTH(@varDate)select @varYear = YEAR(@varDate)select @varFOM = CAST(CAST(@varMonthDate as int) as varchar) + '/1/' +CAST(CAST(@varYear as int) as varchar)select @NumDaysInMonth = DATEDIFF (day,@varFOM,DATEADD(mm,1,@varFOM))select @NumDaysInMonth as DaysInMonth
View 1 Replies
View Related
May 12, 2015
Given the data below, I have a couple needs:
1) Query to determine if any date ranges overlap (regardless of category, e.g., row ids 6 & 7 below)
2) Query to determine if any date ranges of the same category overlap
declare @t1 table (id int primary key, category int, start_date datetime, end_date datetime)
insert @t1 select 1, 1, '1/1/2015 12:00:00 AM', '1/15/2015 12:59:59 PM'
insert @t1 select 2, 1, '1/16/2015 12:00:00 AM', '1/31/2015 12:59:59 PM'
insert @t1 select 3, 1, '2/1/2015 12:00:00 AM', '2/15/2015 12:59:59 PM'
insert @t1 select 4, 1, '2/16/2015 12:00:00 AM', '2/28/2015 12:59:59 PM'
insert @t1 select 5, 1, '3/1/2015 12:00:00 AM', '3/15/2015 12:59:59 PM'
[code]....
View 7 Replies
View Related
Apr 9, 2008
I have a problem when i restore my .DAT_BAK file. I am getting error like "The backup set holds a backup of a database other than existing database. Restore Database is terminating abnormally".
I tried by using
RESTORE DATABASE <DATABASENAME>
FROM DISK = 'D:DATAMYTEST.DAT_BAK'
WITH MOVE 'VZAI_DATA' TO D:PROGRAM FILES..MSSQLTEST.MDF',
MOVE 'VZAI_LOG' TO D:PROGRAM FILES..MSSQLTEST.LDF',
REPLACE
And also i tried like
RESTORE DATABASE <DATABASENAME>
FROM DISK = 'D:DATAMYTEST.DAT_BAK'
WITH REPLACE
When i use like this,
RESTORE FILELISTONLY FROM DISK = 'D:DATAMYTEST.DAT_BAK'. I am able to get the output as LogicalName, PhysicalName, Type, FileGroupName, Size, etc.
Can i anyone please help me out?
Thanks in Advance,
Anand Rajagopal
View 8 Replies
View Related
Jan 31, 2008
Hi there
I'm getting this message on my third automated backup of the transaction logs of the day. Both databases are in full recovery mode, both successfully backed up at 01.00. The transaction logs backed up perfectly happily at 01:30 and 05:30, but failed at 09:30.
The only difference between 05:30 and 09:30's backups is that the log files were shrunk at 08:15 (the databases in question are the ones that sit under ILM2007, and keeping the log files small keeps the system running better).
Is it possible that shrinking the log files causes the database to think that there hasn't been a full database backup?
Thanks
Jane
View 3 Replies
View Related
Feb 13, 2008
What is the most reliable way to determine the last LSN of a database? I've looked in sys.database_files to no avail. I've also looked in msdb.dbo.backupset which is accurate but only based on backups already performed not the current state of the database.
-joe
View 5 Replies
View Related
Feb 21, 2001
Problem: I can add 4 items to a SQL 7.0 database but I need to redirect the user if all 4 items exist in the same Record elsewhere in the Database.
Clearly I need some kind of statement like "if category1 = var1 AND category2 = var 2 AND..." but don't know where to put it.
Code:
strSQL = "SELECT * FROM tblUserQuarter"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn,adOpenStatic , adLockOptimistic
'Insert choices from report.asp into tblUserQuarter
objRS.AddNew
objRS("cboFY") = Request.Form("cboFY")
objRS("Quarter") = Request.Form("Quarter")
objRS("ID") = Request.Form("ID")
objRS("Report") = Request.Form("Report")
objRS.Update
objRS.Close
Set objRS = Nothing
objConn.Close
set objConn = Nothing
View 1 Replies
View Related