Category: LAMP

SQL Server Recursion / CTE

Simple Employee data hierarchy to illustrate recursion through traditional while loop as well as Common Table Expressions. ( CTE )

AWS RDS vs Azure vs Managed Services for SQL Server

We are evaluating pros and cons of different hosting solutions for SQL Server which best suits our business needs.
Our plan is to evaluate AWS SQL Server RDS, Azure RDS , Managed solutions from hosting provider.
Evaluate each option in these categories.
1. Performance and Reliability
2. Ability to scale up during peak loads
3. Cost ( Based on Network , Storage, Memory and CPU )
4. Operations Efficiency
5. Compliance

SQL Server Internal Versions

SQL Server Internal Versions SQL Server Versions Database Internal Versions and Compatibility Levels Useful Query

Remove Procedure Cache and Reset Wait Stats

Remove Procedure Cache and Reset Wait Stats Remove all elements from the plan cache for the entire sql server instance

Flush the cache and suppress the regular completion message

Remove all elements from the plan cache for a

LAMP Stack Setup on El Capitan

Very Good article on Setting up LAMP Stack on El Capitan: http://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-osx-10-11-el-capitan/ On OS X Yosemite/El Capitan to start/stop/restart MySQL post 5.7 from the command line: sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

AWS Solution Architect Preparation

AWS Solution Architect  Reference Materials Load Balancing : https://aws.amazon.com/documentation/elastic-load-balancing/ Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve greater levels of fault tolerance in your applications, seamlessly providing the required amount of

AWS VPC Primer

AWS VPC : VPC are tied a specific Region. You can’t have your VPC span across multiple Regions. Security Groups: Instant Level Security NACL : Subnet Level Access Control VPC-VPC: Throgh VPC Peering CIDR : /16 – First 16 Bits

AWS AURORA RDS – Loading Billion Rows

We do online assessment and reporting for K-12 Education Industry. ( http://emetric.net/ ). We had a need to load 3 through K-12 students historical test reports for entire state for past 10 + years , which ended up being close to billion rows for historical data.

Amazon reInvent 2015 Las Vegas

Highlights: Data Migration Tool – We use aurora and data loading is little more than  walk in the park. Hope this solves our problem. QuickSight – Explore this product for our needs RedShift – See how it can cutdown our Data

Importing and Exporting Data From a MySQL DB Instance

Importing and Exporting Data into Amazon RDS We had a business need to load ~ Billion rows of Data into MySQL or Aurora Database. These are the information I gathered on optimizing load process. Load Data Infile Link to MySQL

Amazon RDS Information

Aurora RDS: AWS Released encryption for Aurora Instances. Encryption is not available as of now.  Amazon RDS Encryption Links Encrypting Amazon RDS Resources You can encrypt your Amazon RDS instances and snapshots at rest by enabling the encryption option for

MySQL Ramp Up

MYSQL: Add Column to Existing Table and Make it Auto Increment and Add Primary Key Constraint Link : Alter Table and Add Column

Query Plan and Query Profile for Executed Queries

TimeOut Error from MySQL WorkBench: Error Code:

Apache Drill Setup and Usuage

Apache Drill Setup and Usuage: Install and Configure Apache Drill http://drill.apache.org/docs/installing-drill-on-windows/ sqlline> !connect “jdbc:drill:zk=local” Enter username for jdbc:drill:zk=local: admin Enter password for jdbc:drill:zk=local: ***** http://localhost:8047/ SELECT derivedtable.ItemID ,AVG( CAST (derivedtable.TimeSpent AS INTEGER)) AvgTimeSpent FROM ( SELECT rawresponsetime.Time10.id ItemID ,rawresponsetime.Time10.value TimeSpent

MERGE Statement and Deadlocks

MERGE Statement and Deadlocks: We have MERGE SQL Statement to satisfy our functional needs. Instead of writing separate Insert / Update (UPSERT) Statement we decided to use MERGE Statement because of its simplicity in syntax.

Deadlock Events noticed :

Attaching Volume to EC2 Instance

Attaching Volume to EC2 Instance  To list the partitions 

major minor  #blocks  name  202        1   52428800 xvda1 Create a Volume in EC2 Instance and attach it to the instance.

major minor  #blocks  name  202

SQL Server or MySQL for our Business Needs?

Business Need: Currently we are in the cross-roads of growing from small-mid sized company to large scale K-12 online Test Delivery and reporting Solution provider. We primarily operate on K-12 Summative Market and its absolutely critical for us  to provide 100 % accuracy

SQL Server – Read Errorlog

Enable Audit log to capture successful and failed Logins — To Enable Failed and Successful Logins — Need to Restart the Server for this to effect

— Query for Successful Logins

— Login succeeded for user ‘xxxxxx’. Connection

NGINX Protect Domain through Password

NGINX Protect Domain through Password It’s very easy to place a simple htpasswd-based authentication system on a domain served by nginx. To do this, you’ll want your server block to look like this:

The relevant lines here are the

NGINX and APACHE URL Redirects

NGINX APACHE URL Redirects Redirect all the requests to https

Redirect Specific Pages

Redirect based on root URL

Apache URL Redirects :

How to find Config File used by Apache on Mac

Change HostName in Linux Machines

Change HostName in Linux Machines Edit  /etc/hostname , make the name change, save the file. You should also make the same changes in /etc/hosts  file Run sudo /etc/init.d/hostname restart or sudo service hostname restart

Top