Ads

09 February 2014

Alter failed for Database 'DBNAME'. (Microsoft.SqlServer.Smo), The server network address "TCP:/win.abc.com:5023" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418)

Solution :-
========

1. Change the SQL Server Service Accounts and Agent Accounts to domain accounts.



2. Once this is done, start Mirroring.

3. To check the endpoints.

SELECT name, protocol_desc, port, state_desc FROM sys.tcp_endpoints

WHERE type_desc = 'DATABASE_MIRRORING'

Remove Mirroring

Alter Database DBNAME Set PARTNER OFF
==================================

08 February 2014

Memory available to SQL Server instance _PER_ machine

SQL Server 2000 Script:
====================


-- To get the total physical memory installed on SQL Server
CREATE TABLE #OS_Available_Memory (
     ID [int]
    ,NAME [sysname]
    ,Physical_Memory_In_MB [int]
    ,Physical_Memory_In_Bytes [nvarchar](512))

INSERT #OS_Available_Memory
EXEC [master]..[xp_msver]

SELECT [Name], [Physical_Memory_In_MB], [Physical_Memory_In_Bytes]
FROM #OS_Available_Memory
WHERE NAME = 'PhysicalMemory'
GO

DROP TABLE #OS_Available_Memory

--To get the minimum and maximum size of memory configured for SQL Server
SELECT * FROM [master]..[sysconfigures]
WHERE [comment] IN ('Minimum size of server memory (MB)'
                   ,'Maximum size of server memory (MB)')



SQL Server 2005 Script:
====================


-- To get the total physical memory installed on SQL Server
SELECT physical_memory_in_bytes / 1024 / 1024 AS [Physical_Memory_In_MB]
      ,virtual_memory_in_bytes / 1024 / 1024 AS [Virtual_Memory_In_MB]
FROM [master].[sys].[dm_os_sys_info]

--To get the minimum and maximum size of memory configured for SQL Server
SELECT [name] AS [Name]
      ,[configuration_id] AS [Number]
      ,[minimum] AS [Minimum]
      ,[maximum] AS [Maximum]
      ,[is_dynamic] AS [Dynamic]
      ,[is_advanced] AS [Advanced]
      ,[value] AS [ConfigValue]
      ,[value_in_use] AS [RunValue]
      ,[description] AS [Description]
FROM [master].[sys].[configurations]
WHERE NAME IN ('Min server memory (MB)'
              ,'Max server memory (MB)')




SQL Server 2008/200R2 and SQL Server 2012 Script:
======================================


-- To get the total physical memory installed on SQL Server
SELECT [total_physical_memory_kb] / 1024 AS [Total_Physical_Memory_In_MB]
      ,[available_page_file_kb] / 1024 AS [Available_Physical_Memory_In_MB]
      ,[total_page_file_kb] / 1024 AS [Total_Page_File_In_MB]
      ,[available_page_file_kb] / 1024 AS [Available_Page_File_MB]
      ,[kernel_paged_pool_kb] / 1024 AS [Kernel_Paged_Pool_MB]
      ,[kernel_nonpaged_pool_kb] / 1024 AS [Kernel_Nonpaged_Pool_MB]
      ,[system_memory_state_desc] AS [System_Memory_State_Desc]
FROM [master].[sys].[dm_os_sys_memory]

--To get the minimum and maximum size of memory configured for SQL Server.
SELECT [name] AS [Name]
      ,[configuration_id] AS [Number]
      ,[minimum] AS [Minimum]
      ,[maximum] AS [Maximum]
      ,[is_dynamic] AS [Dynamic]
      ,[is_advanced] AS [Advanced]
      ,[value] AS [ConfigValue]
      ,[value_in_use] AS [RunValue]
      ,[description] AS [Description]
FROM [master].[sys].[configurations]
WHERE NAME IN ('Min server memory (MB)'
              ,'Max server memory (MB)')


- Thanks to author, saved mytime and others too.

01 February 2014

LogShipping Changing Roles PRIMARY TO SECONDARY

- > Connect to the instances-PRI Server and Secondary Server

-> Disable the log shipping backup job on the primary server.

-> On the standby server, run the log shipping copy and restore jobs to restore any remaining transaction log backups.

-> Disable the log shipping copy and restore jobs on the secondary server.

-> On the primary server, create on last transaction log backup using the NORECOVERY option.

-> On the standby server, restore this transaction log backup using the RECOVERY option.


-> On the standby server (which will now be the primary server), right click on the database and select Properties 

-> Transaction Log Shipping.  Enable the database to become the primary database and configure the backup and secondary server settings.

26 January 2014

SQL browser service is not running on server.

1. Rename the MSSQLentries and start browser

 
Start the broser after this will create new entries on the same, 

OR
 
http://blogs.msdn.com/b/sqlserverfaq/archive/2009/09/18/sql-browser-service-is-not-running-on-server.aspx

Environment
Windows Server 2003
SQL Express 2005
Service Pack: SP2

· We followed the KB http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
· SQL browser service was already set to “automatic”.
· When we try to start the service ,we got this error :
TITLE: Surface Area Configuration
------------------------------

The service did not respond to the start or control request in a timely fashion, you need administrator privileges to be able to start/stop this service. (SQLSAC)
· The application event logs had the following errors :
The configuration of the SQL instance MSSQLServer is not valid.
The configuration of the AdminConnection\TCP protocol in the SQL instance is not valid.

The SQLBrowser service was unable to establish SQL instance and connectivity discovery.
The SQLBrowser is enabling SQL instance and connectivity discovery support

To get more information on reason for service failure, you can start the SQL Browser as a console application
· When we try starting SQL browser as a console application we got the following errors :
C:\Program Files\Microsoft SQL Server\90\Shared>sqlbrowser.exe -c
SQLBrowser: starting up in console mode
SQLBrowser: starting up SSRP redirection service
SQLBrowser is successfully listening on 0.0.0.0[1434]
SQLBrowser: failed starting SSRP redirection services -- shutting down.
What is SSRP Redirection?
SQL Server Resolution Protocol (SSRP) was developed to listen on port 1434, beginning with SQL Server 2000. This was how we managed to have multiple SQL Server instances on the same machine. The SSRP redirector as the name suggests “redirected” the client requests to the appropriate instance based on the Instance Name or Port # or Named Pipe.

· We found a key  under SQL server registry hive:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\CurrentVersion
· This is from an older default installation of SQL server 2000. This should not exist anymore since SQL Browser is a replacement for the SSRP mechanism.
· If above key exists, SQL Browser during startup tries to connect to this instance (non-existent) and hence fails
· So we renamed above key it to CurrentVersion_Old and tried to restart the browser services, this time we were able to do so.
Note: -
1. Please check for the existence of this key under the wow6432node key as well.
HKLM\SOFTWARE\WOW6432\Microsoft\MSSQLSERVER

2. Please make sure that you do not have any SQL Server 2000 instances running anymore before making the registry change.
Amrutha Varshini
SE, Microsoft SQL Server

Reviewed by
Sudarshan Narasimhan
TL, Microsoft SQL Server