Installing SQL Server 2014 CTP1 – My experiences!

Hey Folks….Let me share my experiences with Installing SQL Server 2014 CTP1 which got released couple of weeks ago. It was pretty straightforward if you are already aware of Installing SQL Server 2008-2012(With few GOTCHAS).  I tried Installing on Windows Server 2008R2 and I got the below shown message.

1

So…now you know what you need to begin with. Then it did checked setup rules, then asked me to select the Version and blah blah, selected features without any Issues as shown below.

2

3

5

8

Here came the trouble. Setup process terminated right here asking for .Net framework 3.5 Sp1. Whoooops!

9

Well, I went ahead and enabled that feature and continued the setup. This time everything went well…

12

I’ve selected my data directories…From here on it’s just matter of clicking Next->Next. Viola! It’s done after 15 mins or so…

Note: Things to Remember:

  • Make sure you are running on required Service pack at minimum (in my case it was SP1 for Win 2008R2).
  • Enable .Net Frame Work 3.5 SP1 ahead of Installing SQL Server.
  • SQL Server 2014 CTP1 doesn’t support side-by-side Installations(Bummer, so you need a new machine(I built a new VM in my case) without any previous versions of SQL installed on it). Well, IMHO it’s always better to build a new VM for playing/testing/learning CTP’s or any new Softwares/Versions.
  • SQL Server 2014 CTP1 should be managed/connected using only SSMS which comes with SQL 2014 CTp1.
  • 64 Bit Only, 32 Bit guys….it’s time to move on  🙂
  • Also, I noticed when I double clicked on setup.exe,  the initial welcome screen still says  ”  SQL Server 2012 Setup! ” Well, this is CTp1, I personally consider this as CTP for a CTP at this stage 😀

Install it for yourself and get started playing with brand new features of SQL Server 2014 🙂 Have fun…….

SQL Server 2012 SP1 CU5 and 2008 SP3 CU12 got released

Microsoft released CU5 for SQL Server 2012 SP1 and CU12 for SQL Server 2008 SP3 yesterday.

You should be running on 2012 SP1 to be able to Install CU5 and on 2008SP3 to install CU12 respectively.

Get 2012 SP1 CU5 here and 2008 SP3 CU12 here.

 

An Insight on Contained Databases – SQL Server 2012

It’s been a long time SQL Server 2012 got released and many organizations are already using 2012 for hosting their production databases. In this blog post let us see one of the striking feature of SQL 2012, “Contained Database” which microsoft advertised a lot during the initial phases of 2012/DENALI.

One of the major advantages of contained Database(s) is, getting rid of User-Login Mapping Issues/Orphaned Users Issues and all that mess. Think about copying a database/Refreshing Lower environments Scenario, where we have to deal with mapping users/fixing Orphaned Users blah blah…. With contained Databases, all we have to do is, copy the database and Voila done…. Basically, in a contained Database, the user credentails are created and stored within the database, hence no dependency on mapping SID’s and Server level Logins. let’s see it in action….

Before doing anything, the very first step you have to do is to enable “contained database authentication” at Instance level. You can do this using GUI(SSMS) or T-SQL as shown below.

Step 1: Enable contained database authentication at Instance Level

1

As you can see above, it is enabled on my Instance. If not, you can use sp_configure to turn it ON as shown below…

2

or using GUI(Go to SQL Instance Properties->Advanced)

3

Step 2: Create a contained Database

From GUI, Right click on databases and “NewDatabase…”and in options tab you have to make “Containment Type” as “Partial”, click Ok and boom….you have created a Contained Database 🙂  See below…I created a database called “Contained_Tst” for this demo purpose.

4

Step 3: Creating Users/Connecting to Contained Database

Once done creating Contained Database, you can create those special users(Without login dependencies) inside the DB. They can be either SQL Auth or Windows accounts. Navigate to Users under Security inside the database and select “new User…” as shown below.

5

Now, Key is to select the appropriate option(See below)

6

I’ve selected SQL User with password, created user called “Contained_User”

7

Now we are done with creating User! It’s that simple….Now let’s see how to connect to contained Database using that account.

Using SSMS:

If you connect normally, you will be getting the below shown error.

8

So, what are we missing here? The key is to select the actual contained database manually which the user has access to…Go to connection properties and type in the database name manually(Drop down will/might be empty) and click ok. It should work now without any issues.

9

Once connected, you can see only the contained_tst database in the object explorer as expected and suser_sname() giving some GUID instead of the User Name.(See below)

10

When you try to access a different database on the Instance, you will get the below security context error…

11

Connecting to contained Database from SQLCMD:

You will be getting the same error as we got in SSMS if you try to connect without providing the database name(See below)

12

As soon as I tried providing the Database with -d switch, it worked as expected(see below)

13

Can a contained Database have normal Users?

Yes, it can have a combination of both with out any issues. So, how do we identify which Database users are Database Scoped(Contained Users) and which users are Instance Scoped(Normal DB users as we used to have in the past)?

In SYS.DATABASE_PRINCIPALS, we have columns(authentication_type and authentication_type_desc) which shows the type of authentication for database user(s) as well….

For demo purposes, I’ve created 2 more normal users (tst1 and tst2) besides contained_user. Now let’s see the results of sys.database_principals, shown below

14

As you can see tst_1 and tst_2 are Instance scored Users.

Can we convert/Migrate Normal Users to Contained Users? The Answer is Yes, by using “sp_migrate_user_to_contained“!

In this example, let’s migrate Tst_1 which we created above as a normal user to contained user within contained_Tst database. See below screenshot

15

Voilaaa…..Done!

Caution: Make sure not to disable login while migrating unless you really want to. Because, this login might have a user mapping in some other databases which will break things severely.

Hope this gives a decent amount of exposure on contained databases and what can be achieved making use of them.

SQLBuzz – 2012 in Review.

🙂 🙂 🙂 🙂 🙂 :)……………

Here’s an excerpt:
19,000 people fit into the new Barclays Center to see Jay-Z perform. This blog was viewed about 74,000 times in 2012. If it were a concert at the Barclays Center, it would take about 4 sold-out performances for that many people to see it.

Click here to see the complete report.

The operation failed because either the specified cluster node is not the owner of the group, or the node is not a possible owner of the group.

Let me share with you guys, an Error Message what I’ve encountered yesterday. Well, this is not a very detailed post but I hope this will help what to check for when you encounter this Error/Warning Message.

Okay, I was validating a brand new SQL Server Clustered Instance(two node) and I tried to failover the Instance to the other node. But when I try to initiate a failover, I got this Message saying “the operation failed because either the specified cluster node is not the owner of the group, or the node is not a possible owner of the group“.

What’s the Issue: The 2nd Node was not added into this Clustered Instance.(Add Node to Cluster piece was missed by whoever Installed this SQL Server Cluster)

How to Confirm?

Go to the 2nd node and look for SQL Server Binaries for respective Instance. Also you should be seeing SQL Server Instance Being Installed but in Offline Status(assuming this is your Secondary Node at this particular point of time) from your SQL Server Config Manager Oooor you can simply Open Failover Cluster Manager and check for Possible Owners(Not preferred Owners) for this Instance.

Once he added the missing node to the SQL Cluster, everything was back in business as expected.

I know it’s a Quick and a Dirty Post, But I hope this helps!