Friday, January 26, 2018

Error in creating Microsoft SQL server connection

Error:
Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library

This is the basic error and this will have a full stack trace.
When creating database connection, you must have enabled the "integratedSecurity=true".
This will enable LDAP users to access the database.

Solution :



1.goto: https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url#Connectingintegrated
2. Download the JDBC file and extract to your preferred location
3.open the auth folder matching your OS x64 or x86
4. copy sqljdbc_auth.dll file and paste in: C:\Program Files\Java\jdk_version\bin
restart either eclipse or netbeans

In a case when you do not have permission to copy the files to folders.
set thi as a VM argument
In eclipse

1) Create a folder 'sqlauth' in your C: drive, and copy the dll file sqljdbc_auth.dll to the folder
2) Go to Run> Run Configurations
3) Choose the 'Arguments' tab for your class
4) Add the below code in VM arguments:
         -Djava.library.path="C:\\sqlauth"
5) Hit 'Apply' and click 'Run'

https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url#Connectingintegrated
https://blogs.msdn.microsoft.com/jdbcteam/2017/03/31/jdbc-download-center-pages-and-repackaging/



Tuesday, January 23, 2018

Clean Boot

Issue     : the data collector set or one of t its dependencies is already in use
Solution :

Clean boot

Let’s disable all startup items and third party services when booting. This method will help us determine if this issue is caused by a loading program or service. Please perform the following steps:

1. Click the Start Button type "msconfig" (without quotation marks) in the Start Search box, and then press Enter.

Note: If prompted, please click Continue on the User Account Control (UAC) window.

2. Click the "Services" tab, check the "Hide All Microsoft Services" box and click "Disable All" (if it is not gray).

3. Click the "Startup" tab, click "Disable All" and click "OK".

Then, restart the computer. When the "System Configuration Utility" window appears, please check the "Don't show this message or launch the System Configuration Utility when Windows starts" box and click OK.

https://social.technet.microsoft.com/Forums/office/en-US/6c95b8cc-d7f5-46ed-8858-06e4f16204d3/start-and-stop-error-for-performance-counter-in-perfmon-of-windows-server-2008?forum=winserverManagement

Get the queries run by a users

USE master
go
SELECT sdest.DatabaseName
    ,sdes.session_id
    ,sdes.[host_name]
    ,sdes.[program_name]
    ,sdes.client_interface_name
    ,sdes.login_name
    ,sdes.login_time
    ,sdes.nt_domain
    ,sdes.nt_user_name
    ,sdec.client_net_address
    ,sdec.local_net_address
    ,sdest.ObjName
    ,sdest.Query
FROM sys.dm_exec_sessions AS sdes
INNER JOIN sys.dm_exec_connections AS sdec ON sdec.session_id = sdes.session_id
CROSS APPLY (
    SELECT db_name(dbid) AS DatabaseName
        ,object_id(objectid) AS ObjName
        ,ISNULL((
                SELECT TEXT AS [processing-instruction(definition)]
                FROM sys.dm_exec_sql_text(sdec.most_recent_sql_handle)
                FOR XML PATH('')
                    ,TYPE
                ), '') AS Query

    FROM sys.dm_exec_sql_text(sdec.most_recent_sql_handle)
    ) sdest
where sdes.session_id <> @@SPID
--and sdes.nt_user_name = '' -- Put the username here !
--ANd login_name ='user'
ORDER BY sdec.session_id

Thursday, January 11, 2018

Always on group database fails. May be not accessible or recovery mode. This may due to some incident happened in the database server.

1.       Always on group database fails. May be not accessible or recovery mode. This may due to some incident happened in the database server.

Soution: set online database from primary database. Eg: let’s say you have two servers and each server has two availability groups. Server1 has availGroup1 as primary and server2 has availGroup2 as primary. The database ‘myDB’ has failed and it’s a member of availGroup2. AvailGroup2 resides in server2 and try to bring the ‘myDB’ online in server2.

ALTER DATABASE MyDB SET ONLINE

If you execute this in other server, you might get the error as

-----------------------------------------------------
Msg 5052, Level 16, State 1, Line 2
ALTER DATABASE is not permitted while a database is in the Restoring state.
Msg 5069, Level 16, State 1, Line 2

ALTER DATABASE statement failed.
---------------------------------------------------------

Give little time. Server2, MyDb will come online.
After MyDB comes online add database to the AvailGroup2 from the server2 and connect with the MyDb in the server1.




Monday, January 8, 2018

Fix for Certificate Error in Chrome - NET::ERR_CERT_COMMON_NAME_INVALID

this error comes in chrome due to upgration done in the TLS process.
Below URL has described this clearly.

http://www.expta.com/2017/06/fix-for-certificate-error-in-chrome.html


Sunday, January 7, 2018

Error: Apache Load Balancer Stop / Start

You must have seen the following error while trying to stop the Load Balancer.


Starting the 'Apache2.4' service
(OS 5)Access is denied.  : AH00373: Failed to open the 'Apache2.4' service

Reason and Solution
This is because, you do not permission.
In Linux give required permission.
In windows, Open the command prompt in admin mode.

Then you won't get the above error.


Thursday, January 4, 2018

Useful Chrome Browser features

1. check the disk cache write, read etc

chrome://net-internals/#timeline

once you type chrome:// , you will get popups for so many extenstions