Skip to content

Instantly share code, notes, and snippets.

@aristotle0x01
aristotle0x01 / dropdatabase.sql
Created September 13, 2014 06:51
T-SQL forcefully delete a database involved in replication
--you should substitute 'dbname' with the database name you want to drop
use master
go
exec sp_helpreplicationdb
exec sp_removedbreplication 'dbname'
ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE dbname SET MULTI_USER
@aristotle0x01
aristotle0x01 / getReplicationObjectsInformation.sql
Created September 13, 2014 06:59
T-SQL replication objects information
--********** Execute at the Distributor in the master database **********--
USE master;
go
--Is the current server a Distributor?
--Is the distribution database installed?
--Are there other Publishers using this Distributor?
EXEC sp_get_distributor
--Is the current server a Distributor?
// scalastyle:off println
import duplicate.SimHash
import org.apache.commons.lang3.StringUtils
import org.apache.log4j.{Level, Logger}
import org.apache.spark.{SparkConf, SparkContext}
import scopt.OptionParser
import scala.collection.mutable.ArrayBuffer
object GroupedDuplicate {
@aristotle0x01
aristotle0x01 / gist:de820afcabf43e68139ce79ca099691f
Created July 21, 2016 11:19
simhash duplicates detection 2
// scalastyle:off println
import duplicate.SimHash
import org.apache.commons.lang3.StringUtils
import org.apache.log4j.{Level, Logger}
import org.apache.spark.rdd.RDD
import org.apache.spark.storage.StorageLevel
import org.apache.spark.{SparkConf, SparkContext}
import scopt.OptionParser
import scala.collection.mutable.ArrayBuffer