Year: 2014

Removing Additional Data Files from TempDB

I had a need to remove TempDB DataFiles in one of our environments. When I ran the simple DBCC SHRINKFILE Command, I encountered following error. DBCC SHRINKFILE: Page 4:11283400 could not be moved because it is a work table page.

Quick way to Reindex all tables on SQL Server Database

USE NMPortal GO EXEC sp_MSforeachtable @command1=”print ‘?’ DBCC DBREINDEX (‘?’, ‘ ‘, 80)” GO EXEC sp_updatestats GO

Rename SQL Server Database

Rename SQL Server Database: Change the Database to Single User Mode and Rollback all the existing Transactions. This is done because you need to obtain Exclusive Database Lock. That way you don’t encounter errors related to obtaining database lock. Rename

Import Excel Into SQL Server

Copied from here. http://blogs.technet.com/b/sqlthoughts/archive/2008/10/03/out-sql-powershell-function-export-pipeline-to-a-new-sql-server-table.aspx http://tools.perceptus.ca/text-wiz.php http://dnhlmssql.blogspot.com/2013/05/from-excel-to-insert-into-another.html ############################################################################## ## ## out-sql.ps1 ## ## by Alexey Yeltsov, Microsoft Corp. ## Raju Venkataraman Added some fixes for Table creation and Inserts ## Export pipeline contents into a new SQL table ## ## Parameters:

How do I Change SQL Database from Single_User to Multi_User Mode

How do I Change SQL Database from Single_User to Multi_User Mode: Sometimes, we have the need to set the database in Single User Mode to do some upgrades or blocking all the access to the Database. Set the Database to

Nissan Murano 2010 Rack and Pinion Cost

Dealership VS Non-Delarship Price I have NISSAN Murano 2010 AWD and I started noticing the Stiffness in power steering. I went to the NISSAN Dealer to Diagnose the problem and they found the Rack and Pinion was leaking. Obviously, the

SQL Server – Generic Error Handling I use

This is generic Error Handler I use for my Adhoc Scripts as Well as functions, stored procedures,etc. — Adding the error message. USE master; GO EXEC sp_addmessage 50001, 16, N’The Record doesn”t exist. Parameter : %s , Value : %s’,@replace=’Replace’;

Tagged with: ,

PHP Drivers for MSSQL Issues

PHP Drivers for MSSQL Issues I wanted to setup my Mac Book Pro to access the SQL Server RDS Instance on AWS.My intial thinking was just google on how to setup PHP Drivers on Mac OSX and follow the steps.

SQL Script Header Footer I use

SQL Script Header Footer I use : /****************************************************************************************************** ** Desc: This File will create the XXXXXXXXXXXXXXXXXXXXXXX . ** Auth: Raju Venkataraman ( [email protected] ) ** Date: 09/21/2014 Created ************************** ** Change History ************************** ** CR Date Author Description ** —–

Checklist for SQL Server Installation

Feature Selection : We don’t want to install all the features. Identify the features needed and install only those features. Model Database Properties : Figure out all the Model database Properties and configure them Correctly. File Layout : Make sure

Helpful Linux Commands

Helpful Linux Commands Find whats on port running on a particular  port : ex port 8098 $ sudo netstat -apn | grep 8098 tcp 0 0 10.224.35.187:8098 0.0.0.0:* LISTEN 19666/beam.smp Find status of a particular process : ex status of

Git Cheat Sheet

Git Quick Reference Adding the ShortCut: $ git config –global alias.add-commit ‘!git add -A && git commit’ $ git add-commit $ git config –global –edit [user] name = Raju email = i90Runne[email protected] [gui] recentrepo = C:/Git [alias] add-comment = !git

Tagged with:

MySQL and phpMyAdmin Setup

MySQL and phpMyAdmin Setup sudo yum install mysql sudo yum install mysql-server sudo yum install mysql-devel sudo chgrp -R mysql /var/lib/mysql sudo chmod -R 770 /var/lib/mysql sudo service mysqld start sudo yum install phpmyadmin Errors: # tail -f error.log 2014/03/06

Install S3CMD tools on EC2 Instance.

Install S3CMD tools on EC2 Instance. SSH Into your EC2 Box and you run the following command to install S3CMD. $ sudo yum install s3cmd Loaded plugins: priorities, update-motd, upgrade-helper Bad id for repo: datastax , byte = 8 amzn-main/latest

Setup EC2 Instance with NGINX and PHP-FPM

Setup EC2 Instance with NGINX and PHP-FPM Login into AWS Console and launch default Amazon Instance. Security Group: Create your security group and download your key. Restrict the permissions on your key. sudo chmod 400 Kaizen.pem SSH into your Machine:

SQL Server – Interview Questions

Database Professional – Interview Questions What factors do you usually consider for your datastore selection ? Data Volume , Variety and Velocity. Whats CAP Theorem?. Consistency , Availability and Partition Tolerance and you can’t all three together. In theoretical computer science,

Tagged with: ,

NGINX – SSL Certificate Setup

Create the Server Key and Certificate Signing Request Start off by creating the 1024 rsa private key. sudo openssl genrsa -des3 -out /etc/nginx/conf.d/i90runner.key 1024 sudo openssl req -new -key /etc/nginx/conf.d/i90runner.key -out /etc/nginx/conf.d/i90runner.csr Remove the Passphrase sudo cp /etc/nginx/conf.d/i90runner.key /etc/nginx/conf.d/i90runner.key.org sudo

xp_cmdshell command to Add User

Add user to Admin Group through SQL Server Its absolutely bad practice to turn on xp_cmdshell without comprehensive security audit and security testing. By default this feature is turned off. If you end up having the permission to execute xp_cmdshell,

Connect to SQL Server When SA or Service Account Credentials not Available

Connect to SQL Server When SA Account or Service Account Credentials not Available : I recently inherited the SQL Serer which was running under a user account who left the company and no one knows the password for sa account.

Move SQL Server Database to Different Location

Move SQL Server Database to Different Location : There are several way to do this but I find this option being simple.Sometimes we face the issue with Drive being full. It happens when we have Database on C Drive and

Top