Thursday, January 20, 2011

Simple script to backup all SQL Server databases

DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name

SET @path = 'C:\Backup\'

SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)

DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb')

OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name

WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + @name + '_' + @fileDate + '.BAK'
BACKUP DATABASE @name TO DISK = @fileName

FETCH NEXT FROM db_cursor INTO @name
END

CLOSE db_cursor
DEALLOCATE db_cursor

SQL SERVER – Restore Database Backup using SQL Script (T-SQL)

Database YourDB has full backup YourBaackUpFile.bak. It can be restored using following two steps.

Step 1: Retrive the Logical file name of the database from backup.
RESTORE FILELISTONLY
FROM DISK = 'D:BackUpYourBaackUpFile.bak'
GO

Step 2: Use the values in the LogicalName Column in following Step.
----Make Database to single user Mode
ALTER DATABASE YourDB
SET SINGLE_USER WITH
ROLLBACK IMMEDIATE


----Restore Database
RESTORE DATABASE YourDB
FROM DISK = 'D:BackUpYourBaackUpFile.bak'
WITH MOVE 'YourMDFLogicalName' TO 'D:DataYourMDFFile.mdf',
MOVE 'YourLDFLogicalName' TO 'D:DataYourLDFFile.ldf'

/*If there is no error in statement before database will be in multiuser
mode.
If error occurs please execute following command it will convert
database in multi user.*/
ALTER DATABASE YourDB SET MULTI_USER
GO


I found the above answer for the following link
http://blog.sqlauthority.com/2007/02/25/sql-server-restore-database-backup-using-sql-script-t-sql/

Monday, January 17, 2011

How can I export or see a summary of all IE settings (everything in internet options)?

click on start - run. Type gpedit.msc. Navigate to Local computer policy -> Computer Configuration -> Administrative Templates -> Windows Components -> Internet Explorer.

right click on Internet Explorer and you can export all the settings.

Friday, January 14, 2011

cannot create command for data source datasource1 2005

looked through the rsreportserver.config files, and they did indeed
include the SQL extension as this points out:
http://blogs.msdn.com/selvar/archive/20 ... erver.aspx

So that wasn't it, yet my test system had always worked. Upon closer
inspection, I noticed that my (non-working) production system had this line
under the SemanticQuery section:

Type="Microsoft.ReportingServices.SemanticQueryEngine.Sql.SqlSQCommand,Microsoft.ReportingServices.SemanticQueryEngine" />

Yet my test system (working) had this line:
Type="Microsoft.ReportingServices.SemanticQueryEngine.Sql.MSSQL.MSSqlSQCommand,Microsoft.ReportingServices.SemanticQueryEngine/">

Note the small differences between the two. It's correct on the blgo entry
above, but incorrect in my file! Since these were not hand-edited, I've no
idea why one is different. My only guess is that the test system was SQL 2005
SP2, then upgraded to SP3. Whereas I had installed SP3 on the production
system before installing SCOM...

Anyway, changing the line to the one that included the "MSSQL.MSSql" seems
to have fixed the problem.


Thnaks you

http://graycloud.com/operations-manager/audit-reports-not-running-odd-entry-rsreportserver-confi-t31479.html

how to tell if SP2 installed ?

Run the following code in Query Editor, it'll tell you if SP2 of SQL Server
is installed.

select serverproperty('ProductLevel')

Wednesday, January 12, 2011

Estimating the Size of your Database Backups

The sp_spaceused system stored procedure will show how much reserved space there is in the database. This is roughly equivalent to the size that the backup will be when it completes.

USE SQLCLR_Examples
GO
EXEC sp_spaceused @updateusage = 'true'

database_name database_size unallocated space

------------------------------------- ------------------ ------------------

SQLCLR_Examples 6031.50 MB 4326.55 MB


reserved data index_size unused

------------------ ------------------ ------------------ ------------------

988624 KB 944216 KB 43200 KB 1208 KB


I create a backup with the following command:

BACKUP DATABASE [SQLCLR_Examples]
TO DISK = N'D:\SQLCLR_Examples.bak'
WITH NOFORMAT, NOINIT,
NAME = N'SQLCLR_Examples-Full Database Backup',
SKIP, NOREWIND, NOUNLOAD, STATS = 10

Then look at its size with the following command:

SELECT CONVERT(VARCHAR, CONVERT(DECIMAL(18,1), backup_size/1024))+ ' KB' [Backup Size]
FROM msdb.dbo.backupset
WHERE database_name = 'SQLCLR_Examples'
AND backup_finish_date > DATEADD(hh, -1, GETDATE())



Backup Size

---------------------------------

993573.5 KB


So you can see from this demonstration that the size of the backup is roughly equal to the reserved space in the database from sp_spaceused. The updateusage parameter is sometimes needed to account for changes that have occured but are not yet reflected in the usage stats for the database.

I have found the following for the
http://jmkehayias.blogspot.com/2008/12/estimating-size-of-your-database.html

Thanks.

Determine Free Disk Space in SQL Server with T-SQL Code

Problem
At our organization we need to check for a minimum amount of free space before proceeding with some processes that run on SQL Server 2000, 2005 and 2008 SQL Server instances. Do you know of a way to find out the free disk space and then fail the process if it does not meet the minimum requirements? Can you provide some sample code?

Solution
Checking for free disk space before proceeding with a process is a wise move if disk space is tight or a high percentage of the drive is needed for the process. It is disconcerting to have a process run for hours only to fail towards the end of the process due to insufficient disk space. Although a few different options are available to check for disk space (CLR, WMI, PowerShell, etc.) in SQL Server, let's see how we can use the xp_fixeddrives extended stored procedure which is available in SQL Server 2000 to 2008.


--------------------------------------------------------------------------------

Sample Stored Procedure to Assess the Free Disk Space on a SQL Server Disk Drive

In the sample stored procedure below, it is accepting a parameter for the minimum amount of megabytes (MB) free on a specific disk drive, then executing the master.sys.xp_fixeddrives extended stored procedure into a temporary table. Once the data is in the temporary table the current amount of free disk space is compared to the minimum amount of free disk space to determine if the process should continue or raise an error.

One item to keep in mind is that between SQL Server 2000 and SQL Server 2005/2008 the owner for the xp_fixeddrives extended stored procedure changed. In SQL Server 2000, xp_fixeddrives was owned by dbo and in SQL Server 2005/2008 the owner is sys. Due to this ownership change, two stored procedures are provided below. One for SQL Server 2005/2008 and a second for SQL Server 2000.

*** NOTE *** - SQL Server 2008 and 2005 Version
CREATE PROCEDURE dbo.spExec_SufficientDiskSpace @MinMBFree int, @Drive char(1) AS
/*
----------------------------------------------------------------------------
-- Object Name: dbo.spExec_SufficientDiskSpace
-- Project: Admin Scripts
-- Business Process: Monthly Sales Reports
-- Purpose: Validate sufficient disk space
-- Detailed Description: Validate sufficient disk space based on based on the
-- @MBfree and @Drive parameters
-- Database: Admin
-- Dependent Objects: master.sys.xp_fixeddrives
-- Called By: Admin Scripts
-- Upstream Systems: Unknown
-- Downstream Systems: Unknown
--
--------------------------------------------------------------------------------------
-- Rev | CMR | Date Modified | Developer | Change Summary
--------------------------------------------------------------------------------------
-- 001 | N\A | 03.05.2009 | MSSQLTips | Original code
--
*/
SET NOCOUNT ON
-- 1 - Declare variables
DECLARE @MBfree int
DECLARE @CMD1 varchar(1000)
-- 2 - Initialize variables
SET @MBfree = 0
SET @CMD1 = ''
-- 3 - Create temp tables
CREATE TABLE #tbl_xp_fixeddrives
(Drive varchar(2) NOT NULL,
[MB free] int NOT NULL)
-- 4 - Populate #tbl_xp_fixeddrives
INSERT INTO #tbl_xp_fixeddrives(Drive, [MB free])
EXEC master.sys.xp_fixeddrives
-- 5 - Initialize the @MBfree value
SELECT @MBfree = [MB free]
FROM #tbl_xp_fixeddrives
WHERE Drive = @Drive
-- 6 - Determine if sufficient fre space is available
IF @MBfree > @MinMBFree
BEGIN
RETURN
END
ELSE
BEGIN
RAISERROR ('*** ERROR *** - Insufficient disk space.', 16, 1)
END
-- 7 - DROP TABLE #tbl_xp_fixeddrives
DROP TABLE #tbl_xp_fixeddrives
SET NOCOUNT OFF
GO



*** NOTE *** - SQL Server 2000 Version
CREATE PROCEDURE dbo.spExec_SufficientDiskSpace @MinMBFree int, @Drive char(1) AS
/*
----------------------------------------------------------------------------
-- Object Name: dbo.spExec_SufficientDiskSpace
-- Project: Admin Scripts
-- Business Process: Monthly Sales Reports
-- Purpose: Validate sufficient disk space
-- Detailed Description: Validate sufficient disk space based on based on the
-- @MBfree and @Drive parameters
-- Database: Admin
-- Dependent Objects: master.sys.xp_fixeddrives
-- Called By: Admin Scripts
-- Upstream Systems: Unknown
-- Downstream Systems: Unknown
--
--------------------------------------------------------------------------------------
-- Rev | CMR | Date Modified | Developer | Change Summary
--------------------------------------------------------------------------------------
-- 001 | N\A | 03.05.2009 | MSSQLTips | Original code
--
*/
SET NOCOUNT ON
-- 1 - Declare variables
DECLARE @MBfree int
DECLARE @CMD1 varchar(1000)
-- 2 - Initialize variables
SET @MBfree = 0
SET @CMD1 = ''
-- 3 - Create temp tables
CREATE TABLE #tbl_xp_fixeddrives
(Drive varchar(2) NOT NULL,
[MB free] int NOT NULL)
-- 4 - Populate #tbl_xp_fixeddrives
INSERT INTO #tbl_xp_fixeddrives(Drive, [MB free])
EXEC master.dbo.xp_fixeddrives
-- 5 - Initialize the @MBfree value
SELECT @MBfree = [MB free]
FROM #tbl_xp_fixeddrives
WHERE Drive = @Drive
-- 6 - Determine if sufficient fre space is available
IF @MBfree > @MinMBFree
BEGIN
RETURN
END
ELSE
BEGIN
RAISERROR ('*** ERROR *** - Insufficient disk space.', 16, 1)
END
-- 7 - DROP TABLE #tbl_xp_fixeddrives
DROP TABLE #tbl_xp_fixeddrives
SET NOCOUNT OFF
GO


I found the above from the

http://www.mssqltips.com/tip.asp?tip=1706

Thanks

Monday, January 3, 2011

PMP Practice test

http://certification.about.com/od/projectmanagement/a/pmpcert.htm

http://certification.about.com/od/projectmanagement/a/pmpcert_2.htm

PMP validity

Yes, the certification expires after 3 years. One can renew it by submitting 60 PDU's before the completion of the 3rd year, it then gets renewed for 3 more years.

With Best Regards,

Sandhya
www.pmsoft.com



Further I found,
There are five categories under which you can earn PDUs. Those categories include:

* Category 1: Formal Academic Education
* Category 2: Professional Activities and Self-Directed Learning
* Category 3: Courses offered by PMI Registered Education Providers or Components
* Category 4: Courses Offered by Other Education Providers
* Category 5: Volunteer Service to Professional or Community Organizations

Any comment on this, like your preferred category etc


Thanks
http://projectmanagement.ittoolbox.com/groups/career/projectmanagement-career/pmp-validity-3775426

What are the eligibility criterian to become a PM?

The Project Management Professional (PMP) program is the formal
Certification of Project Managers. This program helps to ensure the highest
professional and ethical standards within the community of practicing
Project Management Professionals.

Eligibility Criteria
To complete the PMP Certification process, candidates must satisfy all
requirements in one of two categories.
Category 1: With a baccalaureate degree
PMP candidates must:
1.Document at least three calendar years experience in project management
(during the past six years), including at least 4,500 hours experience
within the five recognized project management process groups.
2. Document at least 35 contact hours of formal training in project
management.
3. Pass the PMP Certification Exam.
Category 2: Without a baccalaureate degree PMP candidates must:
1. Document at least five calendar years experience in project management
(within the past eight years), including at least 7,500 hours experience
within the five recognized project management process groups.
2. Document at least 35 contact hours of formal training in project
management.
3. Pass the PMP Certification Exam.

Applying
The PMP Application can be completed either online (at www.pmi.org) or with
paper
forms.
The Application consists of three sections:
PMP Certification Examination Application Form
This section consists of three pages and includes all of your general
information: name,
address, contact information, educational background. This section can be
completed quickly.
Project Management Education Form
This section is a one-page form that asks you to document your 35 contact
hours in project management training. This section can be completed quickly.
Project Management Experience Verification Form
This section uses a two-page form to document each of your projects during
your experience period. This is the most time-consuming portion of the
Application. It involves doing some spadework gathering all the information
necessary to complete this section.
Summarize your project management experience, include the project names, and
companies for whom you did the projects.

Your Certification Fee must accompany your application (credit card only if
online). The fee is $405 for PMI members, $555 for non-members.

PMI takes around 10 to 14 working days to process your Application.
Once your Application is approved, you will receive an eligibility letter
with identification code and detailed testing information. You must take
your exam within six months.
Application Forms are available for review and/or download anytime at
www.pmi.org.
Caution: Be thorough, accurate and honest with your Application information.
To help maintain quality and integrity in the PMP Certification Program, PMI
audits a significant percentage of accepted Certification Applications. It's
best to assume that your application will be one of them.
The audit process involves formal verification by your employer(s) and
schools. It is best not to exaggerate any of your application information.
If invalid information is found during the audit process, you will be
stripped of your Certification. If you do not quite
meet any of the eligibility criteria, it is best to wait until you can
honestly satisfy the criteria before applying.

Thanks
Sumit
Cisco Systemz

Thnaks
http://projectmanagement.ittoolbox.com/groups/career/projectmanagement-career/what-are-the-eligibility-criterian-to-become-a-pm-891296

How do I know I am ready for the PMP exam?

Recently, I received a question of how does one know they are ready for the PMP exam. My best assessment for you is to first understand the earned value formulas (more than memorize) and are able to map out from memory the process groups and knowledge areas. I would then recommend taking some sample test questions. Use the test as a tool to identify the areas which need improvement. When you are above 80% for the practice exams, you should be in good shape for the test. Some good free sample test questions can be found online at the following sites:
Ա.http://www.oliverlehmann.com/pmp-self-test/75-free-questions.htm - These are good questions, and it is offered as a great assessment tool.
Բ.http://www.certgear.com/products/preview/pmp_certification/index.html - Check out the bottom of the page for the download.
Գ.http://www.pmstudy.com/enroll.asp - For this test, plan on taking a Saturday or Sunday Morning and sitting through the exam as if in a practice session.
Դ.http://www.transcender.com/demos/#PMI - Trancender always has good test questions. Goes great with morning coffee.
Ե.http://www.pmtests.com/packs.php - A free test is available for one day, so plan ahead and make the most of it.
Good Luck in your pursuits! If you are interested in reading a little further on project management, please check out:
Ա.Twelve Rules for Project Management Success
Բ.Quick Risk Management Checklist
Գ.PMI's Earned Value Management Definitions and Formulas
Դ.Anticlue's Project Management Wisdom

Thanks

http://www.anticlue.net/archives/000923.htm

Top 10 Reasons NOT to Use Project Management

10. Our customers really love us, so they don't care if our products are late and don't work.

9. Organizing to manage projects isn't compatible with our culture, and the last thing we need around this place is change.

8. All our projects are easy, and they don't have cost, schedule, and technical risks anyway.

7. We aren't smart enough to implement project management without stifling creativity and offending our technical geniuses.

6. We might have to understand our customers' requirements and document a lot of stuff, and that is such a bother.

5. Project management requires integrity and courage, so they would have to pay me extra.

4. Our bosses won't provide the support needed for project management; they want us to get better results through magic.

3. We'd have to apply project management blindly to all projects regardless of size and complexity, and that would be stupid.

2. I know there is a well-developed project management body of knowledge, but I can't find it under this mess on my desk.

1. We figure it's more profitable to have 50% overruns than to spend 10% on project management to fix them.

The above is read for the following link
http://www.hyperthot.com/proj_2.htm. Thanks