March 14, 2012

A leader is nothing but a reflection of collective conscience.

March 14, 2012

Jyotish (Astrology) based prediction of Republican Primaries 2012

Two men Mitt Romney and Rick Santorum have emerged as the main contestants for presidency from Republican side. I tried do some astrological analysis to predict who will likely be the winner of primaries and presidency (I will post more later).  We don’t have Rick Santorum birth time no one knows about his birth certificate…weird.

Mitt Romney
This is a Jyotish (Astrology of ancient India) based analysis according to which Mr. Romney is Vrishabha lagna (Taurus ascendant). Rulers of 8th, 12th and 6th brings functionally malefic influence in their transit. For him mooltrikon (main house ownership) of Guru (Jupiter) falls in 8th house, Mangal (Mars) is 12th and Shukar (Venus) 6th house. So transit of these planets from specific houses is not going to be very great.

Dasa Influence
Date of birth used for Romney is March 12, 1947 9:51 AM Detroid, Michigan. Mr. Romney is running Surya (Sun) Mahadasa which is ruler of 4th and sitting in 10th so aspecting 4th from there. Surya in 10th gives urge to hold political office be like head or king. Budh’s (Mercury) moolatrikon falls in 5th house, house of royalty and luck. Budh (ME) is also sitting in 10th thus making a Rajyog (combination for Kingship) in 10th house. But the rajyog losses its strength for Budh being combust (close presence to Surya) and presence of Mangal (12th house influence) in 10th.

Current mahadasa (main period) and antardasa (sub-period) is Surya-Shani (Saturn). Shani is ruler of 10th in 3rd. 10th house matters are quite ignited. Career taking up all the resource and energy, all the dreams and emotions are revolving around 10th house influence (Shani), leading candidate in primaries (Shani), being on headlines, name and fame (Surya) etc. Things should be going at great pace because Shani is also rajyog karak (cause of kingship). Rick Santorum is giving hard fight, unfortunately we will not know what planet is causing this influence because of Rick’s missing time of birth.
On May 1st 2012 antardasa changes to Budh (ME) being ruler of 5th house a certain boost in his progress for kingship. So this is good; Surya and Budh dasas beneficial for Kingship and Budh anatardasa goes up to 7th March 2013 that should cover both Republican Primaries and President’s election in Nov 2012. Not considering any other influence, this dasa is great for making one head of state or country. Like I mentioned the influence of 5th house decreases because Budh’s closeness to Surya; due to combustion it loose its strength hence the strength of its mooltrikon i.e. 5th house of royalty.

Trasit Influence
May 26th Guru (JU) enters in +-5 degree orb to ascendant in first house and stays there till July 10th 2012. Otherwise Guru stays in 1st house till 23rd July 2013, aspects 5th, 7th and 9th houses therefore influences 5th i.e. royalty, influences 7th i.e. professional connection and influences 9th house of luck in some negative way. Even worse Ketu (Lunar node) is crossing his the ascendant from April 5th 2012 to Oct 25th 2012. aspects same houses as Guru. Not a good influence.

Barack Obama
Mr Obama who will be running Shai-Shani-Shani dasa after July 24th. Shani is his lagnadhipati (ascendant lord). Shani is in exaltation while transiting his 10th house of Tula (Libra). Shani ascendant lord is sitting in ascendant there by aspecting 10th house from there. All are greatly in favors of Obama and his bid for presidency in coming elections because his 10th house influence is quite positive and strong. But at the same time 5th house influence is completely missing.

Conclusion
The yogas and dasas in Romney’s chart are powerful enough to ascertain winning of primaries. Of-course in the absence of chart of his main opponent it would still be considered as one sided analysis. Everyone figures that Romney will get the Republican primaries, I am predicting that the pitch of his winning will increase drastically after May 1st like clean sweep and none of his opponent will stand there after. And intensity of his winning after May 1st will also decide how his yogas stand against the yogas of President Obama. I will revisit in June Mitt Romney vs Barack Obama.

May 6, 2009

Pervasive linked server

I recently was working on an ETL project, from Pervasive.SQL8 to SQL Server 2005. For validation I needed to create linked server to pervasive server. From SQL Server connection to Pervasive is made using “Microsoft OLE DB Provider for ODBC drivers”. I tried different ways but none worked for me so end up creating DSN to Pervasive server then creating a linked server using that DSN.

USE master
GO

EXEC sp_addlinkedserver
@server = ‘PervasiveServerName’,
@srvproduct = ‘Pervasive’,
@provider = ‘MSDASQL’,
@datasrc = ‘DSN Name’

February 17, 2009

SQL Server 2008 DMV Calender

Microsoft released calender of SQL Server 2008 system views (DMVs etc.) that can be found here SQL Server 2008 System Views

August 7, 2008

Truncating logs of mirrored database

Log files of mirrored database grow fast because there is no way to truncate logs of a mirrored database. The only way to truncate the logs is to remove the mirroring (not pause). Truncate the logs then reconfigure the mirror back.

Remove mirror

Right click on database > select Mirror… (“…” three dots means that clicking here will open a window)

Click on “Remove Mirroring” button.

Truncate Logs

Once mirroring is removed. Follow these steps to truncate logs:

1. By backing up the logs we make sure that active logs entries are flushed out on disk)

Backup log [dbname] to disk = ‘d:\db.trn’

2. Truncate all the inactive enteries from the log file. because we have flushed the logs in step 1. This step will almost truncate the log file back to its initial size.

Backup log [dbname] with TRUNCATE_ONLY

3. Check the logical name of log file.  Its the “name” field of log file entry usually have fileid “2”

Exec sp_helpdb [dbname]

4. After the log file is truncated it does not release the free space to OS. You will need to shrink the log file in order to release that space back to OS. You must go to that database by using USE, in order to shrink log file.

Use [dbname]

DBCC Shrinkfile ([logical_name_of_log_file], TRUNCATEONLY)

5. Check if the log file size.

DBCC SQLPerf(Logspace)

6. Reconfigure the mirror.

July 10, 2008

Connecting python to mysql

Assumption

Python, and mysql are installed and working. So you should be able to connect mysql and start python from shell as below.

%> mysql -hlocalhost -uroot -p

%> python
>>>

On python prompt if following command does not produce an error that means python-mysql api can load without problems;

>>> import MySQLdb
>>>

If it produces error as shown below that most probably means that python-mysqldb (python MySQL api) is not installed properly.

“Traceback (most recent call last):
File ”
“, line 1, in
import MySQLDb
ImportError: No module named MySQLDb”

Solution:

On my Ubuntu system I uninstalled and installed python-mysql api by running

%> sudo apt-get remove python-mysql
%> sudo apt-get install python-mysql

This fixed the problem. If you still get error, try purge.

%> sudo apt-get –purge remove python-mysql

If mysql is not installed on the default path then make sure mysql_config is in the your path.

%> export PATH=$PATH:/path_to_mysql_config

If it still does not solve the issue and you decide to remove mysql completely and reinstall it. I found using Synaptic Package Manager is much easier as it automatically installs all dependencies along.
Assuming (hopefully) by now python and mysql is working fine.

Working with python-mysql:

import MySQLdb
cn = MySQLdb.connect (
host = “localhost”,
user = “dbuser”,
passwd = “password”,
db = “play”
)
cr = cn.cursor()

#””” lets you span multiple rows

cr.execute(“””
create table if not exists state (
name varchar(40),
abbr char(2))
“””)
cr.execute(“””
Insert into state
values
(‘New York’,’NY’),
(‘New Jersey’,’NJ’),
(‘Maryland’, ‘MD’),
(‘Virginia’,’VA’),
(‘Washington’, ‘WA’)
“””)

cr.execute(“Select * from state”)
while 1:
row = cr.fetchone()
if row == None:
break
print “%s –> %s” % (row[0], row[1]

Python & mysql are real fun!

July 5, 2008

SQL Server 2005 Browser Service

SQL Server Browser service was introduced in version 90 or SQL Server 2005. On my first encounter I thought it was service for SQL Server Management Studio (SSMS)…Wrong.

What Browser Service is for:

If you want to get a list of SQL Servers on your subnet in other words browse the list of available servers. Browser service is the one which will help you get that. BTW you can the list of SQL Servers listening on your subnet by running

sqlcmd -L

SQL Server by default listens to port 1433. The name of that default instance is same as the name of host it is running on. Browser service does not play any role in resolving the default instance because port 1433 was assigned to SQL Server by Internet Assigned Numbers Authority (IANA). Its official and fixed. Any extra SQL Server instances (named instances) running on a machine are allocated dynamic port by default. Which means the port might change whenever the named instance is stopped/started. This behavior can be changed by assigning fixed port to that named instance and default port 0f 1433 can be changed as well. The down side of assigning fixed port to named instance or changing default port is that all the client must be updated to include the port number.

SQL Server Browser starts and claims UDP port 1434 (since it uses UDP it can listens to all broadcasts) Browser service reads the registry, identifies all instances of SQL Server on the computer, and notes the ports that they use. When a server has two or more network cards, SQL Server Browser returns the first enabled port it encounters for SQL Server. When client application instantiate connection to a named instance by hostname\instance_name. The client network library sends a UDP message to the server using port 1434. SQL Server Browser responds by returning the TCP/IP port of the requested instance. The network library on the client application then completes the connection by sending a request to the server using the port of the desired instance.

Prior to Microsoft SQL Server 2000, only one instance of SQL Server could be installed on a computer. Multiple instance support was introduced in SQL Server 2000. SQL Server Resolution Protocol (SSRP) was developed to listen on UDP port 1434 and repond to client requests by returning the names of the installed instances, and the ports or named pipes used by the instance. SQL Server 2005 introduced Browser service as a replacement for SSRP.

If Browser service is not running:

  1. Client must specify full connection parameters including the TCP/IP port or else it would not be able to connect.
  2. Browser service help connecting to dedicated administrator connection (DAC) endpoints without it DAC to named or default instance will not work.
  3. sqlcmd -L or enumerating servers any where will not work.
  4. Analysis redirector service will not work.

Security Consideration:

Since the Browser service accepts unathuenticated request it is recommended to run it under low privileged account. For SQL Server 2005, HideInstance flag can be set to stop SQL Server Browser service from responding with information about that server instance.

Cluster:

Browser service is not cluster aware so must run on each node of cluster. SQL Server Browser listens on any IP. As a cluster has multiple IPs when you enable listening on specific IPs, the user must configure the same TCP port on each IP, because SQL Server Browser returns the first IP/port pair that it encounters.

Summary:

Any remote connection error specially for named instance or OLAP redirector may have to do with browser service. For named instance make sure it is not configured to use fixed TCP/IP port. If it is using fixed port then make sure client connection is providing that port number when connecting to the named instance.