36 Chambers – The Legendary Journeys: Execution to the max!

February 28, 2011

The Future Of Health Care

Filed under: Curmudgeonliness — Kevin Feasel @ 7:31 pm

With Obamacare waiting in the wings, it’s a good idea to see what it’s going to look like.  Fortunately(?), we can draw upon the experience of the UK’s National Health System.

The moral of the story?  Out-and-out neglect, “bewildering disregard” of patients, and a terrible picture of our future.  As John Hinderaker points out, “‘casual indifference’ and ‘bewildering disregard’ describe most government service.”  That’s a bit unfair, but there are institutional incentives stacked against people who depend upon government services.

It’s enough to make me wish Dr. John Crippen were back.  Instead, we only get a taste of some of his archives.

February 27, 2011

In The Papers: Economic Conditions and US National Security

Filed under: Economics, In The Papers — Kevin Feasel @ 3:05 pm

Martin Feldstein presented, in 2009, a review of contemporary US economic policy in a speech entitled Economic Conditions and US National Security in the 1930s and Today.  This speech is noteworthy, I believe, because we have a prominent macroeconomist trying to describe the lay of the land but, in this process, seems to have some problems keeping the story straight.

Feldstein argues that the current recession was caused by the general underpricing of risk (2), but that policy officials know better now (3).  I would respond by saying that with legislation like Dodd-Frank, I wonder if they really do know better…

Then, Feldstein lays out certain fiscal choices made in the 1930s versus those today.  For example, the Hoover administration doubled taxes between 1929 and 1932, and Roosevelt then raised them yet again in 1936 (5).  These, more than the Smoot-Hawley tariff, were responsible for dragging out the Great Depression, he argues.  In our own times, the “stimulus” package offered by President Obama was a failure even from a Keynesian perspective (5-6), and that’s a hard thing to do given that a “stimulus” from the Keynesian perspective is usually little more than the government equivalent of the final round of Supermarket Sweep.  One of the stupid provisions in this is the “Buy American” clause.  What’s awesome is that it likely violates international trade agreements (8).

Then, add on other bad ideas which have been proposed, such as cap and trade.  This would be a tax increase, which is about the worst thing you could do in a recession.  Also, there have been talks of export subsidies, which could exacerbate trade conflicts with China, India, and other countries (9).

Another area where I firmly disagree with Feldstein, and where he shows his Keynesian roots, is when he argues that military assistance and re-mobilization rescued the US economy during World War II (12).  Robert Higgs was one of the first people to take apart this fallacy, but the idea is so widespread that others, like Steve Horwitz, need to keep making the point.  If you don’t want to read articles, check out a post that Horwitz made, in which he posts newspaper advertisements that Mike McPhillips found.  These are advertisements for a company which sold electronic devices—stoves, refrigerators, washers, water heaters, etc.—during the 1940s.  In these ads, you can see things get worse and worse, as people find it harder than before to purchase products.  At one point, you can’t even purchase new products any longer and the company recommends their customers to service the devices so they would last longer.  Eventually, they give their advertising space to the government for war propaganda.  This is not the type of thing you should see if war really did get America out of the Great Depression.  But now, back to your regularly scheduled paper…

So tax increases are bad, as Feldstein pointed out earlier.  But in the same paper, he argues that the government should raise taxes to increase defense spending (19), presumably so we can get the same benefits as we saw in the 1940s—fewer and fewer products available to people because the government is taking it all.  So which is it:  are taxes bad, or are they good?  Or does it depend upon what the government will use the taxes for?  Feldstein notes that entitlement spending increases has caused the deficit to go up (19), but he does not mention this as a good thing, so presumably he is not in favor of ever-increasing entitlement spending.  This seems like a contradiction here, to put it lightly.

February 26, 2011

In The Papers: Coordination Neglect

Filed under: Economics, In The Papers, Programming & Work — Kevin Feasel @ 7:12 pm

Chip Heath and Nancy Staudenmayer see a problem in economic literature.  There is plenty of literature on agent problems—trying to get the incentives of workers aligned with those of management—but little on the concept of coordination neglect.  They try to remedy this in Coordination Neglect:  How Lay Theories of Organizing Complicate Coordination in Organizations.

Abstract:

We argue that organizations often fail to organize effectively because
individuals have lay theories about organizing that lead to coordination
neglect. We unpack the notion of coordination neglect and describe
specific cognitive phenomena that underlie it. To solve the coordination
problem, organizations must divide a task and then integrate the
components. Individuals display shortcomings that may create problems
at both stages. First, lay theories often focus more on division of labor
than on integration. We discuss evidence that individuals display partition
focus (i.e. they focus on partitioning the task more than on integration)
and component focus (i.e. they tend to focus on single components of a
tightly interrelated set of capabilities, particularly by investing to create
highly specialized components). Second, when individuals attempt to
reintegrate a task, they often fail to use a key mechanism for integration:
ongoing communication. Individuals exhibit inadequate communication
because the ‘curse of knowledge’ makes it difficult to take the perspective
of another and communicate effectively. More importantly, because
specialists find it especially difficult to communicate with each other, the
general problem of communication will often be compounded by
insufficient translation.

Something I like in this paper is that many of their examples hit the technical and computing world, making it easier for me to apply it directly to my work.  They point out that developers organize in ways that slow themselves down (156).  The problem is not that the actors, be they developers or any other group of individuals, are not motivated to work, but rather that they tend to organize poorly (156).  This is because an organization divides a problem into sub-tasks and assigns parts to individuals (159).  Upon trying to re-integrate the task, the organization runs into problems, as the pieces don’t really fit together.  When you add in specialists, you make the problem even worse:  different specialists have different languages and even Weltanschauungs, so trying to get these people to coordinate is difficult (159).

The authors point out two business focuses which cause problems.  The first is partition focus:  a focus on partitioning the task rather than integrating the components (161).  The reason why firms do this is obvious:  problems need to be solved by different people in different groups with different skills, so it makes intuitive sense to split the problem out and give it to the people who can handle the problem best.  In the software world, they argue that you can see one example of this problem with interfaces.  When you partition a problem out, developers will tend to create interfaces to allow other groups to communicate with the group’s components.  These interfaces tend to be overly complex and more numerous than necessary (161) because people did not partition with the explicit concept of putting the pieces back together in the end; instead, they kind of assume that if you partition things out, you can stack the blocks on top of each other and it will all work out just fine.

In reality, these partitions are crude and we can see the need to make “unanticipated changes to the original inadequate design” (162).  When it comes time to put the pieces together, we see that integration has been neglected, as noted above—teams did not coordinate on assembling the parts, so the job becomes significantly more difficult (164).

The other business focus is a component focus, in which people focus on one part of an inter-related process.  The authors use the example of Xerox here as a case study.  In this case, top managers failed to coordinate the Xerox innovations of the 1970s (personal computers, mice, and other productivity-enhancing devices) with marketing, sales, manufacturing, and finance (167-168).  Part of this was because of physical distance—the Xerox labs were in Palo Alto, California, whereas Xerox management was on the east coast.  More importantly, though, nobody saw the “big picture” and helped the component groups integrate their findings.

Another example of this is DuPont.  In their case, they took the wrong lesson from their nylon experience in the 1930s.  They focused on research instead of figuring out how components worked together (169).  With nylon, they already had a number of components already in place, so when the basic research came up with a suitable artificial fabric, they were able to manufacture it in quantity at high quality, sell it to clothing manufacturers, market the product, and handle all of the other requirements for success.  They ignored the chain and spent most of their resources on basic research, and paid for it for decades after.

Another example of organizational discoordination comes from product diversification.  People see the advantage of economies of scope quite well, but ignore the negatives.  If you manufacture cheese at a factory and you have some amount of slack, it can make some sense also to manufacture butter, milk, and other dairy goods.  You already have experience in the field, already get most of the necessary raw materials, and could assign some of your staff members to the project.  It’s win-win, right?  Well, not necessarily.  The new processes will add complexity to management, procurement, production, and other departments.  Furthermore, there will be additional overhead, bringing in more employees with different skill sets, purchasing more capital equipment, and possibly needing to re-train some people to perform different processes.  In many cases, when not done correctly, this can actually result in reduced value (170).

The authors sum this up by noting that ineffective teams tend to be “element-focused,” whereas successful teams are “system-focused” (172).  Element focus can be brought about by inadequate communication (174).  Managers systematically understate the importance of communication in large tasks (175), so we tend to see unrealistic expectations take hold.  For example, bringing on a new developer for a project should be easy, right?  Show them where the documentation and the source control repository are and away they go!  In reality, you have some fairly significant costs.  There will be a cost of training the new person, both in terms of time and money.  The current developers will need to take time out of their schedule to bring the new guy up to speed and build up the informal layers of knowledge which do not exist in documentation, including code style, project conceptualization, and ways in which the teams coordinate.  In many cases, the authors argue that the increase in this communication cost is greater than the savings from being able to partition the tasks with the new person (175).

Unfortunately, when things fail, people tend to attribute failure to agency problems.  When people miss “obvious” messages and don’t “connect the dots” the way someone thinks they should, one might jump to the conclusion that these people are lazy or just not trying very hard (179), even when the problem is related to integration.  This is akin to the tourist who speaks louder when people don’t understand* (182).

There are a few interesting conclusions that I have taken from this.  Informal networks are useful and important (176 & 183), but do not make up for the lack of official channels.  These channels are important for making sure that people are on the same page.  One of the case studies in the article was to take a number of MBA students (in a course) and have them compete to create a Lego person.  They had as much time as needed to create a plan, and then would race to complete the project starting at a specific time.  The authors found systemic coordination problems when people tried to partition out the arms and legs and trunk and head.  When people put the thing together, they had trouble fitting the parts together because nobody thought of the connections between all of the parts (163-164).  If you want to get ahead at an organization, this is probably a great way to do it, especially in IT.  In IT, you often see most of the pieces of an organization and can see the data flows inside and between departments.  Often times, this is similar data being used to draw different conclusions (made worse when the numbers aren’t quite the same!).  We find comfort in remaining walled off from different groups and trying to avoid those other people as much as we can, but this has the long-run effect of making things worse for everybody.  Instead, we should take a lead role in integrating.  In this case, I mean “we” both in terms of IT acting in conjunction with different departments, as well as individual practitioners acting within IT.  Build up those informal networks, tear down the communication barriers, and try to get “the big picture.”  Most people focus on the very narrow portions that constitute their jobs.  Instead of that, find the gaps between jobs and work on filling those in.  This will make you more valuable to the organization (as well as to future organizations you work at) and will increase the likelihood that organizational products will go well.

* – To be fair, I see the benefit to doing this.  By speaking louder, slower, and more clearly, even if a person does not know the language, they may be able to pull out enough pieces to give an answer.  Hand gestures also help a lot…

February 25, 2011

In The Papers: Interest Over Time

Filed under: Catallactics, Economics, In The Papers — Kevin Feasel @ 6:05 pm

Smita Roy has an outstanding article detailing the history of how philosophers and economists have thought of the concept of interest, entitled Historical Evolution of Interest and Its Analysis in Economic Literature.  This is easily the best paper I have read in the past year (or possibly more), so expect a long post.

Abstract:

This paper focuses on the emergence of the phenomenon of interest in human history and the analysis of the concept in economic literature. The concept of interest is closely associated with the concept of capital in economic theory and theories of capital have deeply influenced theories on interest. While the justification of interest on money loans formed the core of initial theories on interest, focus later on shifted on what made possible this payment of interest on money loans. Again, twentieth century has seen a sharp distinction between monetary and non-monetary theories of interest

The author begins by noting that “credit preceded coinage by over two thousand years,” and the concept of credit emerged even before barter was established (2).  Despite this, a real concept of interest is relatively recent.  In most economic literature, the idea of interest is a return on capital, with an intense debate during the 17th and 18th century on whether “dead” money earns interest (2).  Before this discussion, though, came the idea of “contract interest,” which is the idea of a payment greater than the principal for a commodity or monetary loan (3).  This was usually frowned upon for religious or philosophical reasons (4), and for this reason, it wasn’t until the 12th century that we really see any discussion of the topic, and no defenses before the 16th century (4).

Despite this relative lack of discussion, the author notes that we do see the development of financial and capital-based institutions that would in turn engender interest.  We see currency standardization early on to solve the problem of exact payment in kind.  Many of these currencies were physical goods, such as grains, dates, olives, or animals (5).  In lending out these physical commodities, the lender could then expect a return greater than the investment.  Lend out a cow for several years and you can demand two cows in return, because the cow can give birth to new calves.  Going further down this road, in India, Kautilya’s “Arthashastra” discusses risk premia, and in 1356 Florence, we see an early capital market in the Monte Commune (6).

This all happened in spite of religious decrees against “usury.”  The case against interest came down to three ideas in the Catholic church:  the idea that money is “barren” (unlike animals or grains, as above); that the lender sells the use of money apart from the money itself; and that the lender sells time, which belongs to the borrower (7-8).  These arguments did not apply to lending durable goods, so you could see some level of lending in the form of physical goods.

Naturally, people try to get around these limitations, and so scholars figured out a trick to get around the prohibitions:  the concept of “intereo,” which means “to be lost.”  Interest, according to scholars, was not a premium for another person’s use of my property, but rather a payment for the loss of my ability to use my property (8).  There were other methods developed as well, including annuities, using land as a mortgage, setting up bills of exchange, and even having partnership arrangements (9), all of which served the same goal but in different ways.  Like many other things in economics, “interest was a practical reality before theories arrived to support it” (10), so the theories were developed to explain why something is the case, rather than coming up with a great new idea and trying to implement it.  This led to a number of competing theories on interest.

Classical economics had several theories on what interest was.  Most of these theories required the underpinning of the labor theory of value and that labor was the sole source of “surplus value” (defined as Revenue – Costs) (12).  In these classical works, as a result, you often see the concept of interest conflated with the concept of profit, especially in Nassau Senior and David Ricardo (13).  At this point, the author delves into a number of the theories, but also introduces Eugen von Böhm-Bawerk’s critiques of these theories.  The author considers Böhm-Bawerk the fulcrum point for interest analysis, as you can cleanly split the history of interest thinking into two categories:  what happened before his analysis, and what happened after (16).

Classical theories and how Böhm-Bawerk tore them apart (17-21):

Theory Well-Known Proponent(s) Critique
“Productivity” theories: Assume surplus value exists (which implies the labor theory of value). In this case, interest is the return on this value. Most classical economists after Adam Smith, especially Jean-Baptiste Say The labor theory of value is wrong. Because of this, productivity-based theories of interest are untenable.
“Use” theories: Interest is the cost of using capital employed during a period of production. The substance of the capital + the use of capital = the value of capital. Karl Menger (according to Böhm-Bawerk; this is controversial). J.B. Say, Friedrich Hermann The marginal return to capital is due to the disposal of real capital over time, and this disposal is not an economic good. Destruction via use is not valuable, but rather is costly.
“Abstinence” theories: Interest is a reward for abstaining from consumption. Nassau Senior No real definition of what “abstinence” really is. Proponents tend to use the term in several different ways.
“Labor” theories: interest is payment earned by the capital owner’s previous labor. Capital is a stock of previously-used labor. James Mill Interest is a payment over and above the cost of capital. The cost of capital itself is the value of its stored labor.
“Exploitation” theories: Interest is expropriated surplus value Karl Marx Labor theory of value does not hold. This concept also ignores the time element involved: wages are paid out before the revenue comes in (if it ever comes in).

After laying down the law on all of these theories, Böhm-Bawerk describes his own theory.  His idea of interest is that there are two independent components:  the subjective time preference of economic agents, and an objective “average period of production” (22).  Economists after Böhm-Bawerk tend to adhere to one of the two points, but not both.  This has caused a bifurcation between the “psychological” schools (including the Austrian school) and the “Neoclassical” schools.

After Böhm-Bawerk, we can see this split occur over time.  Frank Knight and John Bates Clark thought of capital as including land, natural agents, and all other intangible rights to income (23), and interest was the return on all of these.  Irving Fisher started out with a similar belief to Böhm-Bawerk, that interest is time preference + “investment opportunity,” but later discourse had him basically abandon the time preference portion of his theory (23).  Fisher also thought that he could define time preference as “impatience,” and saw it as a combination of the size, time shape, and probability of a person’s income stream, whereas the investment opportunity idea is the ability to shift from one income stream to another given an agent’s current resources (28).  Later Neoclassical economists (such as Frank Knight) dropped the “impatience” part and kept the productivity theory (29).

On the other hand, Frank Fetter and Ludwig von Mises argued that Böhm-Bawerk made a big mistake by adding the objective portion to his theory, and instead, should have stuck with an entirely subjective, time preference-based theory of interest (24).  They argued that interest is based on time preferences alone.  Time preferences, according to the authors, is the discounting of future goods against present goods.  Humans prefer to satisfy their desires now as opposed to later, so any push to get them to satisfy these later requires something in return.  The notion of “contract interest,” according to Fetter, is a recent phenomenon compared to time preference interest (33).  He considers the interest from time preferences as economic interest, and it is the difference in value between like goods available at different times (33).

Fetter breaks things down even further, arguing that there were three basic stages of interest development (35).  In the first stage, we see immediate gratification, which requires a theory of wants and marginal utility.  People have to be able to determine how best to satisfy their needs, and begin to think at the margin rather than at the average.  After this, we see more durable tools being used, which requires a theory of rents.  People need to be able to get a return on their tools and property, so they charge rent for other people to use them.  Finally, we see exchange over time between non-synchronous events.  This requires a theory of discounting and capitalization, which leads to interest.

Mises, on the other hand, defines capital as “the sum of the money equivalent of all assets less the sum of the money equivalent of all liabilities as devoted at a definite date to the running of the operations of a specific business unit” (36).  This differs from the idea of capital goods, which are the produced means of production.  From this point, Mises, comes on the idea of originary interest, which is the ratio of value of current versus future want satisfaction (36).  This determines the demand for and supply of capital and capital goods (37).

The author ends this discussion with some information on monetary funds theories.  The two described are loanable funds and liquidity preference theories.  The loanable funds theory says that the supply and demand for “claims” on loanable funds or interest-bearing securities defines the notion of interest (38), and liquidity preference is based on the desire to hold cash, where the interest rate is what equilibrates this market (39).

Again, this was a very interesting paper, but it is quite long and detailed.  I try to scratch the surface of these papers, describe some of the findings, and interject my own thoughts, so I recommend reading the paper in full to get much more information on this topic.

February 24, 2011

Socialism Thursday

Filed under: Curmudgeonliness — Kevin Feasel @ 7:05 pm

Bryan Caplan wonders if Communism was nothing more than the largest cargo cult ever.  I’m not quite convinced, not because I think it’s wrong, but because I think it isn’t limited to Communism.  I see it instead, as some of the commenters do, as endemic in the concept of government “planning” in general.  At best, the “planners” chase after simplifications of “what makes a good economy” (Steel!  Cloth!), or more ephemeral concepts (NGDP!).  They do this by necessity because it is impossible to process all of the local, subjective, conjectural, and conditional information which disbursed humans have, and so are utterly incapable of matching the harmony of open, interpersonal transaction.

As a jumping-off point for my next topic, MernaMoose in the comments couldn’t do any better:

“As a true Marxist, Mao genuinely sought to create a class-less society. This is what he was after more than anything else. Whereas Stalin’s purges were largely (or entirely) to insure his own grip on power, Mao was after more than that.

“Mao’s perpetual frustration was the fact that in order to impose a class-free society, he needed an organization to impose it. Because you realize, there has never been a “class-free” society in nature, and there never will be.

“What Mao proved beyond all doubt, is that a class-free society cannot be created even in a lab beaker. Because the organizations he created to impose his beloved class-free condition, inevitably led to a hierarchical structure and ohmyGOD no, we’ve got class distinctions all over again.”

I just got finished reading Eugen Richter’s book Pictures of the Socialistic Future.  It’s a very entertaining novel of a Socialist who finds his dreams of a Socialist Germany consummated, and slowly realizes that it has become a nightmare.  The translation is outstanding and Richter is a prophet.  Richter wrote this while a member of Parliament in Germany.  He regularly asked the Socialist members of Parliament tough questions—who would take out the garbage in a socialistic system?  Where would people live?  How would people exchange goods?  Why would people work at all?—and followed the socialists’ responses to their logical conclusion.

More than 50 years before socialism took over part of Germany, Richter predicted the anti-emigration policy (including murdering people trying to leave the country), the major decrease in productivity, the burdensome deficits, the secret police, and the starvation and wanton pain and suffering caused by a government which has decided it can handle peoples’ lives better than they can.

Richter also points out the contortions to which socialists put themselves when they try to create their classless society.  On the one hand, workers became socialists because they were promised “the fruits of their labors.”  On the other hand, a “fair” society obviously could not pay certain people more than others simply by accident of job position; that would re-create a class society!  Similarly, you can’t allow people to save money because those savings could become capital, which would re-create a class society!  And so on.

Caplan, from whom I first learned about this book (and who wrote the introduction for the current edition), has more.

February 23, 2011

Chuga Chuga [Train Wreck]

Filed under: Curmudgeonliness — Kevin Feasel @ 7:54 pm

A number of states, including Ohio, Wisconsin, and Florida, have rejected federal funding for “high-speed” rail.  Note that this is “high-speed” in that, at least in Ohio’s case, it would have averaged nearly 39 miles per hour.

So what’s a Transportation Secretary to do?  Stay the course!  LaHood is threatening to move the rail dollars to some other state stupid enough to take on big losses.  Given the number of states which are having significant budgetary problems, I doubt there will be many takers.  Maybe LaHood should offer this money back as a voluntary budget cut.  It’s not that much money in the grand scheme of things, but every bit helps.

And, because this has turned into an Anti-Planner link-fest, here he is on why high-speed rail isn’t even that good an idea in the one area where it could theoretically possibly be profitable, and a note that rail problems are endemic all around the world, including China.

It’s funny how “Progressive” thinkers cling so steadfastly to 19th-century modes of transportation and ideas (which they barely understand).  As noted wunderkind Ezra Klein would say, that’s like 100 years old and junk.

PS:  Iowahawk is awesome.

February 22, 2011

What The Budget Gets You

Filed under: Economics — Kevin Feasel @ 7:50 pm

$3.73 trillion can get you a lot.  There is no legitimate reason for the government to spend this much money, and considering that tax revenues are expected to be approximately $2 trillion, nearly 50% of the budget will be financed through debt.

Finding Databases Without Full Backups

Filed under: Database Administration — Kevin Feasel @ 6:46 pm

As a production DBA, the first, second, and third jobs are to make sure that your backup and restoration process is working correctly.  Everything else is secondary to this mission.  In our case, we use Idera’s SQLsafe for backing up our most important SQL Server instances.  For our particular setup, we have a full backup for each database that runs nightly, and log backups which run very often throughout the day.

We also use Visual Studio 2010 to maintain and deploy database projects.  In Visual Studio 2010, there is an option to always drop and re-create a database upon deployment.  If you do this, though, your backup chain is broken, so transaction log backups will fail until the next full backup occurs.  Because I set up SQLsafe (and SQL Server maintenance plans for the other instances) to e-mail me when any plans fail, I often will get dozens of e-mails brought about by developers re-deploying their databases in the development environment.

Because there is no built-in functionality to take just-in-time full backups for servers which are missing a full backup, I decided to come up with my own script.

The core of the script is:

select
 d.name
from
 sys.databases d
 left outer join msdb.dbo.backupset bs
   on d.name = bs.database_name
   and bs.backup_finish_date > d.create_date
   and bs.type = 'D'
where
 bs.backup_set_id is null
 and d.recovery_model_desc <> 'SIMPLE'

Whenever Visual Studio does a drop and re-creation of a database, the database creation date gets updated.  If there is no full backup (type of “D”), the upcoming transaction log backup will fail.

Then, for SQLsafe, I updated the transaction log backup SQL Agent job the tool creates* to look like the following.  Note that this requires xp_cmdshell in order to work.

declare @DatabaseList varchar(1000);
declare @CommandToRun varchar(1750);
select @DatabaseList =
 SUBSTRING
 (
   (
     select
       ' ' + d.name
     from
       sys.databases d
       left outer join msdb.dbo.backupset bs
         on d.name = bs.database_name
         and bs.backup_finish_date > d.create_date
         and bs.type = 'D'
     where
       bs.backup_set_id is null
       and d.recovery_model_desc <> 'SIMPLE'
     for xml path('')
   ),
   2,
   1000
 );

if (LEN(@DatabaseList) > 0)
begin
 select @CommandToRun = 'C:\"Program Files"\Idera\SQLsafe\SQLsafeCmd.exe Backup ' 
  + @DatabaseList + ' "BACKUPLOCATION_AND_FILENAME" 
    -BackupName "Just-In-Time Full backup" -Server SERVERNAME -NoPrompt';

 exec xp_cmdshell @CommandToRun;
end

In the query above, I’m using “for xml path” to create a space-delimited list of databases, as that is the format that SQLsafe uses.  For example, if databases db1, db2, db3, and db4 are all missing full backups, it will spit out “db1 db2 db3 db4″ as the result.

Also note that the @CommandToRun is missing some extra parameters that I took out.  If you are using SQLsafe, check a script of your policy and use the parameters they provide.

If you are not using SQLsafe, you can modify this concept to work with a standard backup statement.  The advantage here is that you don’t even need xp_cmdshell to do it:

declare @DatabaseList nvarchar(1000);

select @DatabaseList =
 SUBSTRING
 (        
   (
     select
       N'; BACKUP DATABASE ' + quotename(d.name) + ' TO DISK = N''C:\Backups\' 
       + d.name + CONVERT(NVARCHAR(8), CURRENT_TIMESTAMP, 112) + '.bak'''
     from
       sys.databases d
       left outer join msdb.dbo.backupset bs
         on d.name = bs.database_name
         and bs.backup_finish_date > d.create_date
         and bs.type = 'D'
     where
       bs.backup_set_id is null
       and d.recovery_model_desc <> 'SIMPLE'
     for xml path('')
   ),
   3,
   1000
 );
 
exec sp_executesql @DatabaseList;

Again, this gets a delimited list of databases which do not have full backups and makes a just-in-time full backup.  This also won’t fix all of your backup problems—for example, if you delete the .bak file, this can’t tell; also, if you clear out the backup history, you could have a false positive scenario—but if you have a very active development team, it will at least reduce the number of annoying “You can’t run a transaction log backup until you run a full backup first” e-mails that you receive, and that’s worth the effort…

* – Yeah, I know this isn’t a great idea, but I don’t change the policy very much and I do have a feature request in with Idera, so hopefully a future version will make it so that I don’t have to do this…


	

February 21, 2011

Nation Shocked By Human Nature

Filed under: Curmudgeonliness — Kevin Feasel @ 7:46 pm

This Onion article isn’t the funniest they’ve ever done, but it does bring up a good point:   people are loathe to admit the concept of human nature into discussion, and when they do, they try to paper over the implications.  And woe be unto those who actually try to bring it up

When Honesty Hurts

Filed under: Curmudgeonliness, Economics — Kevin Feasel @ 7:42 pm

Tim Geithner is asked whether President Obama’s budget reduces the debt at any point, and he gives the correct answer:  no, it does not.  Obama is entirely out of his league here and it’s funny listening to him try to break out the austerity line and pretend that he’s anything other than a big-spender (of other peoples’ money).

Older Posts »

The Silver is the New Black Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 96 other followers