Wednesday, January 30, 2013

The server 'LOGSHIPLINK__0' already exists


As part of my expereince I have faced some unknown Logshiiping error.

Due to some issues, we have planned to re-configure the logshipping in production server. We break the logshipping by right click on the database properties-->Transaction logshipping and removed the database from the logshipping .

But while reconfiguring the logshiiping again we got the below error.

Issue:

Msg 15028, Level 16, State 1, Procedure sp_addlinkedserver, Line 82
The server 'LOGSHIPLINK__0' already exists.

Resolution:

Upon investigation I found that , While creating the loghsipping it creates the Linked server.












Right Click and delete the linked server and reconfigured the Log shipping.It works for us and logshipping was configured without any issues.

Please let me know if you are facing any further issues apart from this in logshipping .

Access Denied - SQl 2008 R2 Installation Error

Today I have faced little funny error, which I haven’t faced earlier.

While installing the SQL server 2008 R2 on Windows Server 2008 R2 X64, I got the below error at the 80% of the SQL Installation. Even you click on OK, it says that database engine doesn’t install properly.

When I saw the Services , SQL Server service is running fine but SQL agent is not running. Getting an error while starting it.







I have tried uninstalling/installing and rebooting the machine ,nothing works, it breaks my head for an hour, after 1 hour I found that it is blocking at the group policies level.

Explanation:

For security reasons in some projects/servers, Windows team/Clients will enable the group policies at the domain level. Same thing happened here.

So I have checked the 3 places where the SQL server service (which the SQL server services needs to run) in the Group policies and I found that service was not added as part of the installation.

Group polices are blocking SQL server installation to add them in the below policies, So I have added it manually and re-ran the installation.

Resolution:

Go to Run àgpedit.mscàit will open the below window, go to the path which I showed in the below screen shot.



















In the User Rights Assignment à Go to the each one of the below polices and click on Properties and add the user id (your SQL service account). Make sure that your service account is alos added as a Windows server admin as well.






Atlast issue is resolved and SQL server was installed successfully JJ

This post may help me or someone in future instead of bothering/breaking their heads for hours….

Tuesday, January 29, 2013

Database Backup or Restore Progress

As a DBA, we normally do backup and restore the database in SQL server as a day to day activities or tickets.

Below Script will help you to find the status of  Backup (FULL,DIFF or Tlog) and Restore(database,log ,restore headeron and restore verifyon)

It will give you the estimated time to complete the operation (backup or restore).

select
d.name as [Database Name],Percent_complete, dateadd(second,estimated_completion_time/1000,
getdate()) as EstimatedCompletionTime, Getdate() as Current_Time_now, CAST((datediff(minute,
start_time, getdate())) as varchar(50)) +' ' + 'Minutes' as CMD_Running_From, CAST((estimated_completion_time/1000/60) as varchar(50)) +' ' + 'Minutes' as Will_Complete_in,
start_time as CMD_Start_Time, command As Running_Command
from sys.dm_exec_requests req
inner join sys.sysdatabases d on d.dbid = req.database_id
where req.command in ('RESTORE DATABASE', 'BACKUP DATABASE', 'RESTORE LOG', 'BACKUP LOG','RESTORE HEADERON','RESTORE VERIFYON')