1

Topic: The DB identifier

All greetings!
Prompt please, whether is in a DB certain GUID which changes after its recovery.
In advance thanks!

2

Re: The DB identifier

Found, at least so.

select Max (restore_history_id) as RestoreId
from msdb. restorehistory
where destination_database_name = ' TraTaTa'

3

Re: The DB identifier

IDVT;
And what for? Want to protect the product from propagation?

4

Re: The DB identifier

skyANA wrote:

IDVT;
And what for? Want to protect the product from propagation?

is not present, I want to automate entering questions from employees of business (where procedure of the report got to, made hour back, etc.),  administrators  a DB, the Server test to create the DB are not present possibility (rights)

5

Re: The DB identifier

Whether is easier to search for date last  and if it fresh, mailing to do to all users:
The basis is just recovered, at whom that disappeared - all claims to

6

Re: The DB identifier

IDVT;
1) if  only a DB:

select [sqlserver] = @@ servername
,bs. [backup_set_id]
,rhd. [restore_date]
,bs. [backup_finish_date]
,[backupName] = bs. [name]
,[backup_type] = bs. [type]
,[copyOnly] = bs. [is_copy_only]
,bs. [position]
,[dbName_source] = bs. [database_name]
,[dbName] = rhd. [destination_database_name]
,[db_id] = DB_ID (rhd. [destination_database_name])
,rhd. [restore_type]
,bs. [first_lsn]
,bs. [last_lsn]
,bs. [database_backup_lsn]
,bmf. [physical_device_name]
,[backup_size_MB] = cast ((bs. [backup_size]/1024./1024.) as decimal (10,3))
from (
select [backup_set_id], [restore_history_id] = null
from [msdb]. [dbo]. [backupset]
union
select [backup_set_id], [restore_history_id]
from [msdb]. [dbo]. [restorehistory]
) bsa
inner join [msdb]. [dbo]. [backupset] bs
on bs. [backup_set_id] = bsa. [backup_set_id]
inner join [msdb]. [dbo]. [backupmediafamily] bmf
on bmf. [media_set_id] = bs. [media_set_id]
inner join [msdb]. [dbo]. [backupfile] bf
on bf. [backup_set_id] = bs. [backup_set_id]
left outer join [msdb]. [dbo]. [restorehistory] rhd
on rhd. [backup_set_id] = bsa. [backup_set_id] and rhd. [restore_history_id] = bsa. [restore_history_id]
where rhd. [restore_history_id] is not null
group by bs. [backup_set_id], bs. [name], bs. [database_name], bs. [backup_finish_date], bs. [position]
,bs. [first_lsn], bs. [last_lsn], bs. [database_backup_lsn], bs. [backup_size], bs. [type], bs. [is_copy_only]
,bmf. [physical_device_name] , rhd. [backup_set_id], rhd. [destination_database_name], rhd. [restore_date], rhd. [restore_type]
;

2) can be it and not your case, but if  VM entirely,
That remained though any traces, it is possible to make so:
To create job in which  insert GETDATE in the table-broad gull each 5 seconds.
If the number of these records in time regular intervals is identical, happened nothing.
And if any records miss, and the more so for enough big period or the server did not work, or was  VM.

7

Re: The DB identifier

dukrey wrote:

2) can be it and not your case, but if  VM entirely,

unless at  VM sequel service not ?
I can be mistaken, but if it so easier to look at this time
Than  the server - "to create job in which  insert GETDATE in the table-broad gull each 5 seconds".

8

Re: The DB identifier

Whether

o-o wrote:

to search for date last  and if it fresh, mailing to do to all users is easier:
The basis is just recovered, at whom that disappeared - all claims to

+ Their phone numbers, home addresses that not  was  bases:-D