from: http://blog.sqlauthority.com/2009/09/07/sql-server-importance-of-database-schemas-in-sql-server/

Beginning with SQL Server 2005, Microsoft introduced the concept of database schemas. A schema is now an independent entity- a container of objects distinct from the user who created those objects. Previously, the terms ‘user’ and ‘database object owner’ meant one and the same thing, but now the two are separate.

This concept of separation of ‘user’ and ‘object owner’ may be a bit puzzling the first time one encounters it. Perhaps an example may better illustrate the concept: In SQL Server 2000, a schema was owned by, and was inextricably linked to, only one database principal (a principal is any entity or object that has access to SQL Server resources, for example a user, role or a group). This meant that if, say, a user creates a table in the database, that user cannot be deleted without deleting the table or first transferring it to another user. But in SQL Server 2005 one can now simply create the table first and attach it to a schema, even without having created the user. This can be accomplished via the Transact-SQL statement below:

CREATE TABLE MySchema.MyTable (col1 int, col2 int)

Note that here ‘MySchema’ refers to the schema that owns ‘MyTable’, as contrasted to SQL Server 2000 in which for the same statement, ‘MySchema’ would have referred to the user who owns the table. This separation means objects and schemas can be created before users are added to the database. It also means a user can be dropped without specifically dropping the objects owned by that user. A schema can only be owned by one user at a time, but a single user can simultaneously own many schemas.

Default Schema

Because objects are no longer tied to the user creating them, users can now be defined with a default schema. The default schema is the first schema that is searched when resolving unqualified object names.

The default schema for a user can be defined by using the DEFAULT_SCHEMA option of the CREATE USER or ALTER USER commands. If no default schema is defined for a user account, SQL Server will assume dbo is the default schema. It is important note that if the user is authenticated by SQL Server via the Windows operating system, no default schema will be associated with the user. Therefore if the user creates an object, a new schema will be created and named the same as the user, and the object will be associated with that user schema, though not directly with the user. Read the rest of this entry »

from: http://www.macruby.org/documentation/gcd.html

Introduction

Historically, the Ruby language has been firmly founded in the single-processor paradigm. Mainline Ruby uses green threads to simulate multiprocessing in Ruby; unfortunately, it’s difficult to properly harness the power of multicore processors with green threads. In late 2009, MacRuby bridged Ruby threads to native threads and removed the Global Interpreter Lock. Recently, however, MacRuby took a step forward that no other Ruby implementation – indeed, no other dynamic language – has offered: support for Apple’s Grand Central Dispatch library.
Grand Central Dispatch, or GCD, is a technology designed to let programmers easily harness the power of multi-core processors. GCD hides the details of creating, managing, and destroying POSIX threads from the programmer, making it trivial to write programs that take full advantage of the power of multicore and multiprocessor systems. GCD is built into the foundations of Mac OS X, implemented in both the kernel and userspace, and is so remarkably efficient that it’s being used within system frameworks such as Cocoa and CoreFoundation.

Queues: The What and the Why

Queues, represented in MacRuby by the 

1
Dispatch::Queue

 class, are data structures that execute tasks. Under the hood, GCD maintains a pool of POSIX threads to which queues dispatch their tasks; GCD will grow and shrink this pool dynamically and distribute its threads evenly among available processors.
Queues can execute their tasks either concurrently or sequentially. All queues begin executing tasks in the order in which they were received, but concurrent queues can run many tasks at once, whereas serial queues wait for one to complete before starting the next. GCD provides three singleton concurrent queues and allows the creation any number of serial queues. Performing work on a queue is extremely easy:

# Create a new serial queue.
queue = Dispatch::Queue.new('org.macruby.examples.gcd')
# Synchronously dispatch some work to it.
queue.sync do
  puts 'Starting work!'
  sleep 1.0
  puts 'Done!'
end
# Asynchronously dispatch some work to it.
queue.async do
  puts 'Starting work!'
  sleep 1.0
  puts 'Done!'
end

If you paste this code into a running 

1
macirb

 prompt, you’ll see that the queue blocks until the task specified in the 

1
#sync

 block is finished, while task we specified in the block we passed to the 

1
#async

method is executed asynchronously in the background.

Queues have a number of advantages over POSIX threads or creating Ruby threads with 

1
Thread

: whereas threads are memory-intensive and very expensive to create and destroy, queues are extremely lightweight; one can easily create tens of thousands of queues at one time, which would be either impossible or prohibitively slow with POSIX threads. Additionally, GCD’s low-level implementation means that its thread pool takes advantage of system-wide load balancing that a hand-rolled thread pool cannot. Read the rest of this entry »

Leave A Comment, Written on May 6th, 2012 , Coding, PHP Tags: , , , ,

These instances could run on mobile, Windows, Mac, Linux, etc.

The system needs to be able to perform highly parallel computing with speed & efficiency, ideally take advantage of SSE, and ideally support CUDA/OpenCL.

I have considered the following:

Java – it is memory hungry and doesn’t run on Mac (not officially, anyway)
.Net – memory hungry; limited in platform scope; no native SSE
Delphi – not 64 bit; limited platform scope
C/C++ – not directly supported by Mac; complex to code; however it is ubiquitous
Objective-C – supported by Mac; appears to be supported elsewhere; works by passing messages, which is per my design requirements; don’t know much about it

Here is my run down of some options (in no particular order):

C/C++

If all you care about is performance (and nothing else), these will provide. Direct access to system level constructs, such as processor affinity and inline assembly can certainly have an impact on performance. However there a 2 main drawbacks to the C/C++ option. Firstly neither have a well defined memory model, so the memory model you are developing against is that of the CPU you are running the system on (if you don’t know what a memory model is how it applies to concurrent programming, then you shouldn’t be doing it). This ties you very tightly to a single platform. The second is the lack of a garbage collector, manual memory management is tricky (but doable) in the simple cases, with C++ a number of supporting utilities simplify the problem (e.g. auto pointers/smart pointers). When writing concurrent code it is an order of magnitude harder as the rules for should release a certain piece of memory become very hard to define. E.g. when a object is passed onto a different thread, who’s responsible for releasing it? If using C++ it’s important to ensure that you are using thread safe versions of the classes used to help manage memory. E.g. the boost smart pointer only supports the use of methods declared as “const” across different threads (e.g. dereferencing is OK), however non-const methods (e.g. assignment) are not thread safe.

Java

Java would be my recommendation, it has support on all of the platforms you mentioned (including mobile, e.g JavaME and Android) as well as CUDA support. Java has a well defined memory model that is consistent across platforms, a robust and mature JIT and optimiser, and number of good and improving garbage collectors. Most general purpose applications written in Java will run just as fast as their C/C++ counterparts. While it is a bit of memory hog, if you are doing HPC work you are most likely going to throw some decent hardware at the problem. Given that you can address 100s of GB on commodity hardware, the memory problem is less of an issue than it used to be. Mobile is the only real area where memory usage is constrained and the specialist runtime environments perform better in this respect (see above). The only main drawback for Java (from an HPC perspective) is the lack of pass by copy complex types (i.e. structs in C#) so all complex objects have to be heap allocated putting pressure on the GC. Escape analysis is supposed to help with this somewhat, however it is difficult to get it do work well in very general cases (note that it has jumped in and out of various revisions of the JDK recently).

Worth mentioning the broad language support (Scala and Groovy++ have pretty good performance profiles) and there are a number of message passing concurrent frameworks (actors, akka, kilim).

C#/.Net

Probably the most complete from a language perspective, especially if you include things like F# for approaching things in a functional manner. However you are generally pushed toward an MS platform if you want the best performance (and the mobile story here is not great either). Mono produces a pretty good platform feature wise (caveat: I’m a contributor) however they are still playing catch up with performance, e.g. an accurate, compacting collector has recently been added and is still a bit experimental.

Google Go

Very new, but interesting from the perspective that it is natively compiled (no jit overhead), but still has a strong runtime, memory model, garbage collector and direct support for CSP (concurrent sequential processing) features in the languages (channels). Probably has some ways to go, the development of a new GC has gotten under way but not surfaced yet and there is probably a lot more they can get out of the compiler.

Haskell and other functional languages

Not a lot of experience here, but some of the functional constructs such as immutability and persistent collections can be quite useful for building robust concurrent applications.

Leave A Comment, Written on April 30th, 2012 , C++, Coding, JAVA Tags: , , ,

from: http://www.sqlteam.com/article/sql-server-versions,

           http://sqlserverpedia.com/wiki/SQL_Server_Release_Date_Calendar

and I added a part of links and corrected the release date from Microsoft website, SQL Server versions between 6.5 and 2008 R2 are listed as table at the end of this topic. You could find some interests. Enjoy it~

 

T-SQL code for checking version: 

1
2
3
SELECT SERVERPROPERTY('productversion') AS VersionNumber,
SERVERPROPERTY ('productlevel') AS ProductLevel,
SERVERPROPERTY ('edition') AS Edition

You can determine what version SQL Server is running by running

Select @@version

@@Version is a system level variable that holds the current version. On my computer this returns

Microsoft SQL Server  2000 - 8.00.384 (Intel X86)
	May 23 2001 00:02:52
	Copyright (c) 1988-2000 Microsoft Corporation
	Standard Edition on Windows NT 5.0 (Build 2195: Service Pack 2)

The main version number is 8.00.384 which corresponds to SQL Server 2000 SP1. See below for a complete list of versions. It will also tell us the version of the operating system we’re running. In this case I’m running Windows 2000 (aka NT 5.0) Service Pack 2. You can find this same information in Enterprise Manager by right clicking on a server and choosing Properties. The version information is displayed in the General tab.

This information is pulled from the system extended procedure 

1
xp_msver

. You can call this stored procedure like

exec master..xp_msver

and it returns

Index  Name                             Internal_Value Character_Value                     

------ -------------------------------- -------------- ------------------------------
1      ProductName                      NULL           Microsoft SQL Server
2      ProductVersion                   524288         8.00.384
3      Language                         1033           English (United States)
4      Platform                         NULL           NT INTEL X86
5      Comments                         NULL           NT INTEL X86
6      CompanyName                      NULL           Microsoft Corporation
7      FileDescription                  NULL           SQL Server Windows NT
8      FileVersion                      NULL           2000.080.0384.00
9      InternalName                     NULL           SQLSERVR
10     LegalCopyright                   NULL           © 1988-2000 Microsoft ...
11     LegalTrademarks                  NULL           Microsoft® is a registered ...
12     OriginalFilename                 NULL           SQLSERVR.EXE
13     PrivateBuild                     NULL           NULL
14     SpecialBuild                     25165824       NULL
15     WindowsVersion                   143851525      5.0 (2195)
16     ProcessorCount                   1              1
17     ProcessorActiveMask              1              00000001
18     ProcessorType                    586            PROCESSOR_INTEL_PENTIUM
19     PhysicalMemory                   255            255 (267902976)
20     Product ID                       NULL           NULL

This is quite a bit of additional information. There really isn’t anything exciting in here that I can find but it’s there if you need it.

The following is SQL Server Version: Read the rest of this entry »

from: http://www.simple-talk.com/sql/database-administration/great-sql-server-debates-buffer-cache-hit-ratio/

Many years ago, when I first started working with SQL Server, there were a number of performance counters that were on the radar of all conscientious DBAs, and were used to track SQL Server performance and assess the general health of a server. One of those counters was SQLServer:Buffer Manager\Buffer Cache Hit Ratio, described as follows in the Books Online topic for the SQL Server:Buffer Manager Object:

“Percentage of pages found in the buffer cache without having to read from disk. The ratio is the total number of cache hits divided by the total number of cache lookups over the last few thousand page accesses. After a long period of time, the ratio moves very little. Because reading from the cache is much less expensive than reading from disk, you want this ratio to be high. Generally, you can increase the buffer cache hit ratio by increasing the amount of memory available to SQL Server.”

Commonly, this definition is interpreted like this: if the value of the Buffer Cache Hit Ratio (BCHR) counter is “high”, then SQL Server is efficiently caching the data pages in memory, reads from disk are relatively low, and so there is no memory bottleneck. Conversely, if the BCHR value is “low”, then this is a sure sign sign that SQL Server is under memory pressure and doing lots of physical disk reads to retrieve the required data. Prevailing wisdom suggests that “low” is less than 95% for OLTP systems, or less than 90% for OLAP or data warehouse systems.

This article will, I hope, convince you that this interpretation of the BCHR counter value is completely incorrect and very misleading. In fact, I will prove that it’s entirely possible for SQL Server to be under significant memory pressure while displaying a value for BCHR that, viewed in isolation, would lead a DBA to assume that SQL Server was in fine heath. At the same time, I’ll demonstrate that there are far better counters for tracing memory usage patterns in SQL Server and for diagnosing potential memory issues.

As a consultant, the BCHR is one performance counter that I never use in my work, and I stopped using it as soon as I discovered exactly why its value can be so misleading, and how misguided were the prevailing ideas about its meaning. Read the rest of this entry »

from: http://www.simple-talk.com/sql/ssis/working-with-variables-in-sql-server-integration-services/

SQL Server Integration Services (SSIS) supports two types of variables: system and user-defined. SSIS automatically generates the system variables when you create a package. That’s not the case for user-defined variables. You create them as needed when setting up your package. However, both variable types store data that tasks and containers can access during a package’s execution. In addition, package components can save data to user-defined variables during execution in order to pass that information onto other objects.

Variables are useful in a number of situations. You can bind them to Transact-SQL parameters in a Execute SQLtask, or use them to provide the iterative lists necessary to run a Foreach Loop task. SSIS variables can also be mapped to the variables used within a Script task or Script data flow component. And anywhere you can create a property expression, you can include user-defined or system variables. Event handlers, too, can make use of both types of variables.

Viewing Variables in SSIS

To view the variables available in an SSIS package, click the Variables option on the SSIS menu. This will open the Variables pane in the left part of your window. By default, the Variables pane displays only user-defined variables when you first open it, so if none have been defined on your package, the pane will be empty. However, at the top of the Variables pane you’ll find several buttons that let you control what information is displayed:

  • Add Variable: Adds a user-defined variable.
  • Delete Variable: Deletes the selected user-defined variable.
  • Show System Variables: Toggles between a list that includes system variables and one that does not. User-defined variables are blue, and system variables are gray.
  • Show All Variables: Toggles between a list that includes all variables and one that includes only those variables within the scope of the package or the selected container or task. The list will include system variables only if the Show System Variables option is selected.
  • Choose Variable Columns: Launches the Choose Variable Columns dialog box, where you can select which information is shown in the Variables pane. Read the rest of this entry »

cntask.net is proudly powered by WordPress and the Theme Adventure by Eric Schwarz
Entries (RSS) and Comments (RSS).

cntask.net

When you open your mind to the impossible, sometimes you find the truth.