Message
Login failed for user ‘Domain\MachineName$'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: MachineName]

It’s related to SSRS Reporting Server and run as Network Service account. It’s supposed to be good. Because when you added a computer to domain, it will register Local system and Network Service account permission to the SPN records.
That’s why sometime you don’t know WHY you put Network Service account as a service account, then everything will be fixed. (Reference 2)
I’ve been encountered the error for al long time, and I’ve tried lots methods from Google.com
https://connect.microsoft.com/SQLServer/feedback/details/529716/problem-with-cannot-find-database-id-0-the-database-may-be-offline

"Now, what I found out: This server has an AUDIT on a database. If the audit is enabled, I get this error. If I disable the audit, the query runs fine."
Situation:

Could not allocate space for object 'dbo.SORT temporary run storage:  141564582166528' in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup

Solution:
CHECKDB (Part 6): Consistency checking options for a VLDB



Once you set up SQL Log Shipping, it will produce 4 Major jobs:
I assume the Primary server is R1, the Secondary is R2
  • Alerts (Both on Primary R1 and Secondary R2)
  • Backup (On Primary)
  • Copy (On Secondary)
  • Restore (On Secondary)
I’ve set up already and Backup/Copy/Restore are all worked fine and correctly. But Alerts on Primary R1 has been sent all the time below

Get SQL Service Accounts

1 comment

2014-12-12

Recently our Domain team created an exclusive OU for DBA. I’d like to control all the SQL service accounts. But SQL server not only has SQL Engine and SQL Agent accounts but also SSIS/SSAS/SSRS/Full Text, etc.....
How do I know all the accounts in SQL Server? If you have SQL 2008+, you can use a new DMV “sys.dm_server_services”.
If you have SQL 2005, you have to use undocumented “xp_regread” function to read registry records that in Windows Server.
It’s also fit to SQL 2008+…

Automated Database Restore Script Out

No comments

2014-12-08

Limitation:

In order to be compatible with SQL 2005 ( no default value for T-SQL variable), I changed the code script method.

A lot of posts that used “RESTORE FILELISTONLY” and “BackupSet” table to grab backup files.

Yes, I agree it would be more accurate for latest backup and correct LSN/DB logical name. But if someone drop/detach DB and left backup histories and backup files. It would be incorrect. Additional, sometimes when you use “RESTORE FILELISTONLY” to grab backup files, it will show “Access Denied” message.

In order to avoid the problem, I use “sys.Master_files” table to match “Backupset” and “BackupsetMediafamily”.

Any Array value if you have like

$searcher.propertiesToLoad.Add("xxxxx")
$myarray.Columns.Add("DistinguishedName")

Always, Always put "| Out-Null" behind to prevent the null element feed Function first and get "False" then return "0" back.
So your Table doesn't need to add one more "Ghost" column

I tried to figure it out from someone recommend to find out who tried to login the database.
The user is me and is a database sysadmin. So it slap backup the wrong solution.
What caused it?


Situation:
I created the customized SQL Endpoint for 3rd party vendor uses. I grant "Connection" permission for the account. Deny "Public" connect to Default [Tcp] Endpoint.
Turn on Firewall (ex: port 4999), Allow Remote Connection in SQL, Enable Tcp portocol, Name Pipe, SharedMemory. But it still showed the Error 64 even if the account was successfully established.



Connection Failed;
sqlstate '28000';
sql server error: 18456;
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'XXXX'


↑
Top