March 27, 2013

Indexes on Views

I tried to create a Index on View. Then SQL Server said I have to alter that index as a schema bound view. Then I created Schema Bound View.

USE AdventureWorks2012
GO

CREATE VIEW
[dbo].[vHR]
WITH SCHEMABINDING
AS
SELECT
BusinessEntityID AS A,
NationalIDNumber AS B,
LoginID AS C
FROM HumanResources.Employee
GO

Then I created Index on that View.

CREATE UNIQUE CLUSTERED INDEX UCI_vHR ON vHR(A,B)
GO

Then after that I altered index. And my index got disappeared suddenly.

ALTER VIEW [dbo].[vHR] 
WITH SCHEMABINDING
AS
SELECT
BusinessEntityID AS A,
NationalIDNumber AS B
FROM HumanResources.Employee
GO

Then I ran below query to confirm that index got disappeared forever.

SELECT * FROM sys.indexes WHERE name = 'UCI_vHR'

I got nothing as result Sad smile. As soon as I figured this out, I hope to write about this again.

March 21, 2013

Install MongoDB on Windows

Installing MongoDB on windows. OOps. What I'm going to post about is not how to install MongoDB on Windows. Because It is not a normal installation process which you have select path like that. So this is about how to run MongoDB service on Windows. That's it. 

One of my cousin's friends has asked for this post, hence I'm posting this. But long time ago I posted about how to install MongoDB as windows service. It is bit different.

So you can find the way to install MongoDB on windows from official link also.

  1. First of all you have to download MongoDB binary which is suitable for your processor architecture. I mean 32bit or 64bit.
  2. Then extract it to C: drive. You can select  any drive or any folder. I post this for beginners, because its easy to use C: drive.
  3. And then create a following folders in C: drive. You don't need to worry about capital simple letters. ;)
      • c:\data
      • c:\data\db
  4. Then open MongoDB folder and go to bin
  5. After that you can see few exe files. Please run mongod.exe
If it disappears please follow instructions carefully again. If you can see a black window on screen you have done it perfectly, Now your MongoDB is working properly!

March 18, 2013

MongoDB Sri Lanka User Group

Wow! It's a great pleasure to hear that we have a MongoDB User Group in Sri Lanka. I just sent a request  to join to MongoDB User Group page in facebook. I really worry about got so long time to join the community of MongoDB.

You can also join to Colombo MongoDB User Group from this link.

I really didn't know there are much more people in Sri Lanka, who is interested in MongoDB. I hope to join community and enjoy MongODB!!!

March 14, 2013

Do you want a colorful terminal

After moving to Ubuntu, I was looking for a way to make my terminal colorful. Because I really don't like mono color environments. Then I was searching "Enable Colors in Terminal". Then I found a very easy way to give colors to my odd terminal.
  1. Take a terminal window. Press Ctrl + Alt + T (We are going to give colors to the terminal from terminal.)
  2. Then type below command.  vi ~/.bashrc
  3. Then you will have vi editor. Then Press 'i' to start inserting.
  4. Find and remove # infront of below line or add it to that file. force_color_prompt=yes
  5. Then press Esc.
  6. Then type :wq
  7. And close your terminal and take a new terminal. 
Now you got colors!

March 13, 2013

Yes, It's our fault

Today our architect sent a mail to team with two links of blog posts. With the coming of NoSQL that developers think that they really don't need DBAs who objects each and every possible easiest way to solve the solution. And the other one is a post of Grant, which says that fault is on our hand.

When a DBA getting mature and having lot of experiences what happens is, they are trying to avoid problems which can occur in future. It's like cutting wings of developer birds. Then developers are getting into angry developers.


When we have up and running databases, DBAs know how difficult to make a change, how difficult to let developers to go home early. That's the way that developers looks at DBAs. When developers want to do a change they do all the designs and then send all queries to DBAs. And then say "Please now take care of it, it's your baby now!". 

With the time, angry devs are finding out a solution to get rid from DBAs mails. Angry developers are trying to destroy DBAs beautiful dreams with the help of NoSQL databases. But finally what will really happen is they will make angry stakeholders if they really don't know what is they are using.

Those NoSQL databases are like non-tested missiles. They may work very very well and achieve the target, or else that may fall into your side and may destroy your whole career life. NoSQL databases are babies. We should understand it. When we say that this is too much risky, people things that we don't like to change what we know or we are obsolete. 

And Big companies are looking forward for new technologies and new things. And developers most of the time they also hate new things. But they want to bypass permission stage like Grant says. Then they are going  with this awesome NoSQL databases. 

Myself and Shamil had so many discussions about the change that is comming towards us. What will happen to DevDBAs career. Some times NoSQL may be a another thing like ORDBMS. Perhaps it may be a relational like database. Some how part of this fault is on our hand because we are trying to deploy best things to production. And the other part of this fault is also on our hand because we are trying to defend the production.

For developer "Table joins", "WHERE clauses" are just another line like a declaring a variable on their programming language. But for DBAs its a table scan, its a table lock which hurts them and their bonuses.  Developers are not going to understand that their queries should work on production. That's why DBAs are coming to office.With DevOps some times this problem may solve in a good way. Because developers may have part of baby sitting with DevOps. Then they may start to realize how much we have saved their bonus. :)

March 12, 2013

Install MongoDB on Ubuntu using deb file

WoW! This is my first video that I have created. Today, right now I uploaded it to YouTube and I hope to create few more videos also. It seems funny!
So this videos describes how to install MongoDB on Ubuntu or on any debian using deb file(deb package). And you don't need to use apt-get install command to do this. In this method every configuration file creates on system without any matter and you don't need to create a user account for MongoDB also. 

Go MonGO!

March 10, 2013

Login to a Linux box

After the first day of linux training, I got IP, Username and Password for a linux box. But I really didn't know how to log in to a linux box with Credentials. Then I asked from few guys, unfortunately they also didn't know what is the way to log in to linux box.

Then I asked from the guy who was next to me. How to log in to this box, then he told you have to use putty for this. That's my first day of using putty. But I really didn't know that I'm using SSH. I'm writing this blog post because there may be people who is like me don't know how to log in to a Linux box. And Google here and there for it.

  1. So first what you need to do is you have to download putty. For that you can Google 'putty' then you can download it.Here's the link. http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
  2. Then run it!
  3. You will have a window like below. Enter the IP or host name on text box.
  1. Then Click Open.
  2. For the first time they should be a long message with Yes, No Cancel Buttons. Please press "Yes"
  3. Then Putty will ask for user name. Type user name and press enter.
  4. Then Putty prompts for password. Please type password and press enter.
  5. Here you go !!!! Now you have successfully logged in to your linux box using putty, enjoy shell!!! 

March 09, 2013

Do you like to surf with mobile devices?

I'm pretty much interested about Ubuntu Touch those days. Basically I'm interested about Ubuntu Mobile devices which is going to arrive to market in near future. To be frank I should say that, I'm interested in those devices because they can change the future of Ubuntu. But in this blog post what I'm going to discuss is not about Ubuntu Mobile devices. I'm going to talk about generic mobile devices.

With the arrival of smart phones, tablets, PDAs, EDAs people thought about buying a tablet instead of computers. Then they try to install whole lots of things into those small devices which has not much computing capability. Then after that they try to surf, try to send mails and try to do so many things with this devices. Then battery and the capacity of those devices avoids people of doing things. Then what happens is people starts to blame on poor mobile devices. :|

But my view is mobile devices are mobile devices, They are not laptops. Even the laptops can't perform like Desktops, how can you expect it from mobile devices. Although we come up with new technologies to save the power, or increase the battery life such things, you can't make mobile device a computer. You can't use it like a boss. You just have small screen to tap here and there. For me that is not going to work. 



So my recommendation is buy a computer when you need a computer. Buy a smart phone when you need a smart phone. Otherwise if you buy a smart phone when you need a computer, most probably you may have to give up smart phone and computer both! ;)

Ubuntu ටැබ්ලට්

Ubuntu Tablet එක Pre-Order කරන නිව්ස් එකක් omgubuntu එකේ දාලා තිබුනා. ඇත්තටම මමත් සයිට් එකේ එහෙට මෙහෙට ගිහින් බැලුවම මට හිතුනේ මේක බොරුවක් කියලා. $299 තමයි මේකේ දාලා තිබුනේ ඒවගේම ගාන වැඩිවෙන්නත් පුලුවන් කියලා කියනවා. කොහොම වුනත් සයිට් එකේ ෆිනිෂිං එක එහෙම බැලුවාම කාගේ හරි තනි කෙනෙක්ගේ සයිට් එකක් වගේ. ඒත් ප්‍රශ්නයකට තියෙන්නේ omgubuntu සයිට් එකෙත් මේක ගැන පෝස්ට් එකක් දාපු එක. ටැබ්ලට් සයිට් එකේ ලින්ක් එක පහල තියෙන්නේ.





මේ ටැබ්ලට් එක ගැන කතාව මෙහෙම යද්දි hp එකෙන් Pavilion 20 කියලා මොඩල් එකක් Ubuntu එක්ක මාර්කට් එකට දානවලු. ඇත්තටම මේක උබුන්ටු වල හෙට දවස ටිකක් හොද කරන වැඩක් වෙන්න පුලුවන්. මේ කම්පුටරය ගැන විස්තර මෙතනින් බලන්න.





March 05, 2013

Gmail පාව්ච්චි කරලා Scroogled වෙලාද?

මම මේ ලගකදි දැක්ක ලොකුම මඩ පාර තමා මේක. Microsoft එකෙන් Gmail වලට විරුද්ධව කරගෙන යන Campaign එකක් තමා Scroogled.com කියන්නේ. මේයාලා කියන්නේ Gmail ads ඩිස්ප්ලේ කරන්න අපේ හැම ඊමේල් එකක්ම කියවනවා කියන එක. මේක ලංකාවේ අයට ලොකු ප්‍රශ්නයක් නෑ. මොකද ලංකාවේ අයගේ (බහුතරය) Internet එකේ Privacy ගැන හිතන්නේ නැ. ඒත් US වල අයගෙන් 89% දන්නේ නෑලු මේ ඊමේල් ගුගල් එකෙන් කියවන වැඩේ. 88% කියන්නේ මේ ඊමේල් කියවන වැඩේ නරකයි කියලාලු. 
කොහොම වුනත් මේ scroogled සයිට් එකේ ජීමේල් එකේ වැරදි කියන ගමන් කරන්නේ, Outlook.com එක මාර්කට් කරන එක. අවුට්ලුක් කාගෙවත් මේල් කියවන්නේ නැලු ඇඩ්ස් ඩිස්ප්ලේ කරන්න කියලා කියනවා. කොහොමත් මේක මයික්‍රෝසෝෆ්ට් එකෙන් ගුගල් එකට කෙලින්ම ගහන මඩ පාරක්. ඒවගේම මේකේ ඇත්තකුත් තියනවා. ඒත් අපි Gmail එකවුන්ට් එකක් හදද්දි සමහර විට මේ කියවන දේවල් වලට කැමති වෙනවා ඇති (ඇති කියන්නේ කව්රුත් Privacy and Policy කියවන්නේ නැනේ). 

March 04, 2013

Evernote එකව්න්ට් තියනවා නම් Password Reset කරන්න

Evernote ගැන ගොඩක් අය දන්නවා ඇති. ගොඩක් ප්‍රසිද්ධ සේවාවක් තමා එවර්නෝට්. එවර්නොට් වල පාස්වර්ඩ් කව්රුහර් ඇක්සස් කරලා තියනවා කියලා. ඒක හන්දා හැමෝම පාස්වර්ඩ් මාරු කරන්න කියලා එවර් නෝට් එකේ නිවේදනයක් කරලා තියනවා. ඩේටා කිසිම දෙයකට හානියක් වෙලා නැලු. ඒවගේම පාස්වර්ඩ් හැෂ් කරලා salt කරලා තිබුනලු. ඒක හන්දා ලේසි වෙන එකකුත් නැලු බ්රේක් කරන්න. කෝකටත් ඔයාලගේ අකව්න්ට් තියනවා නම් පාස්වර්ඩ් මාරු කරන්න. ඒවගේම අනික් අකව්න්ට් වලත් ඒ පාස්වර්ඩ් එක තිබුනා නම් මාරු කරන්න.

http://blog.evernote.com/blog/2013/03/02/security-notice-service-wide-password-reset/