Thursday, February 24, 2022

How to uninstall windows updates in CLI commands?

 To see a list of installed patches

c:\> wmic qfe list

or
c:\> wmic qfe list brief /format:table



To uninstall a listed patch

c:\> wusa /uninstall /kb:<kbnumber>

example:

wusa /uninstall /kb:892890

Monday, February 21, 2022

Cannot use the special principal ‘sa’. Microsoft SQL Server, Error: 15405

 When importing a database in your SQL instance you would find yourself with Cannot use the special principal 'sa'. Microsoft SQL Server, Error: 15405 popping out when setting the sa user as the DBO of the database. To fix this,

Open SQL Management Studio and Click New Query. Type:

USE mydatabase
exec sp_changedbowner 'sa', 'true'

Close the new query and after viewing the security of the sa, you will find that that sa is the DBO of the database.

Tuesday, February 15, 2022

Log Disk Exhaustion Error VMWare vCenter

vCenter Server /storage/log filling up due to localhost_access.log and catalina.log in sso and lookupsvc log directories (85475)


 Symptoms
  1. /storage/log is filling up
  2. You are receiving constant alerts in vCenter Server that /storage/log is above 80%
  3. The output of this command "du -hSx /storage/log |sort -rh |head -30" returns the following directories as the ones using more space:
    • /var/log/vmware/sso/tomcat
    • /var/log/vmware/eam/web
    • /var/log/vmware/lookupsvc/tomcat
    • /var/log/vmware/lookupsvc
  4. Under those directories there are too many localhost_access*.log and catalina*.log files.
  5. localhost_access*.log and catalina*.log are not compressed
 Cause
There is no proper log rotation and compression being performed on these files and it can start filling /storage/log
 Resolution
Currently there is no resolution. VMware is aware of this issue and will fix it in a future release.
 Workaround
Remember: Always take a snapshot of your vCenter Server whenever you are going to make any changes.

1. Copy the files in the attached "configs.zip" file in this KB to the respective file listed below in your vCenter Server Appliance:

configs.zip                 >  Your vCenter Server
-----------                    -------------------
SSO_server.xml              >  /usr/lib/vmware-sso/vmware-sts/conf/server.xml
SSO_logging.properties      >  /usr/lib/vmware-sso/vmware-sts/conf/logging.properties
LOOKSVC_server.xml          >  /usr/lib/vmware-lookupsvc/conf/server.xml
LOOKSVC_logging.properties  >  /usr/lib/vmware-lookupsvc/conf/logging.properties


2. Restart the vmware-stsd and lookupsvc services

service-control --stop vmware-stsd && service-control --start vmware-stsd
service-control --stop lookupsvc && service-control --start lookupsvc


3. Copy "tomcat_compress.cron" located in the attached file "tomcat_compress.zip" in this KB to /etc/cron.d on your vCenter Server appliance.