Saturday, May 5, 2012

Oracle DBA Tracking Center


For the code or questions: Please contact us at After-Hours Coders

When having to track multiple Oracle databases spread across multiple servers and tying the database to an application, it is difficult to follow all the instances.  This tool, is a comprehensive solution to have one common location for DBAs and other personnel in an IT department to know the status of their Oracle database instances.

The tool uses a SQL Server database, the SQL Server Integration Services ETL tool and the SQL Server Reporting Services reporting tool to compile and present the data.  You will need at least SQL Server Standard Edition to run the SSIS component.  

The design of the solution is meant to answer the following questions:

·         What are my Oracle databases?
·         On what server are they running?
·         What platform is the server?
·         What Oracle version are they?
·         When did the database last startup?

Through a minimum amount of data entry, you can add data to help find out:

·         What application is tied to this database?
·         Is it Production or Development?

This ETL can be scheduled to run as often as every couple of minutes to keep information up to date. 
What do You Need?:

·         SQL Server 2005 Standard Edition or Higher.  This is built in SQL Server 2008 R2.  Install with the Database Engine, Integration Services and Reporting Services.
·         Oracle 10 Client or higher on the same server or computer you will run the ETL package.

There is a database in SQL Server to store information about the Oracle databases. The database name is “DBTRACK” on a SQL Server database instance. When the ETL Runs to completion, updates can be viewed by a running a collection of SQL Server Reporting Services Reports.

Once installed, all you have to do is enter the Oracle instance or database. This tool does the rest!

Here is the ETL in SSIS:


There are two reports available:

The first is the “Applications” report that shows all applications and the related database and type, development or production as well as server.


The second report shows the detailed database information.  The parameters asks for application and type, but defaults to all.


For the code or questions:
Please contact us at After-Hours Coders





Thursday, March 8, 2012

Consulting Services


I’d like to inform people of my consulting services available.  We are available for consulting nationwide but can work onsite in limited engagements in the Milwaukee, Madison and Chicago areas. We are based in the Milwaukee area.

We can complete the bulk of your work offsite through remote connection or offline.

We specialize in:

SQL Server Databases:
  • SQL Server Database administration and Data Warehouses.
 Business Intelligence:
  • ·         Microsoft:
o   SQL Server Integration Services (SSIS)
o   SQL Server Reporting Services (SSRS)
  • ·         SAP:
o   SAP Crystal Reports
o   SAP Business Objects Enterprise

Please see my website for more information and details:

Thursday, October 6, 2011

Business Objects Enterprise Timeout



When running a new, very large report, I encountered this generic error in my Business Objects XI 3.1 SP2 environment using Infoview on IIS.  

“An error has occurred. Request timeout.”

Here are the steps to resolve the issue that I used on my Windows 2003 R2 Application Server.

Go into IIS (Start/Run/ inetmgr)

Right Click on the “default web site”, choose properties.

Bump up “Connection timeout” seconds to 900:

Tab over to Home Directory, configuration and options.  Update ASP Script Timeout to 900 seconds:



Finally, update the .NET settings in the Machine.Config file.  Please backup the current file before you begin!

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG

Add within the system.web section:


Save, exit.  Restart IIS by typing “iisreset” on the DOS command line.

Friday, September 2, 2011

Crystal Reports in JobBOSS

I was recently contracted to do some work for a local engineering and manufacturing firm who uses the JobBOSS application software. They needed some custom Crystal reports to be developed as their existing canned reports were good but not doing what they needed to.
After a few false starts, we were able to get some custom Crystal reports loaded. Here is some advice for developing Crystal reports with JobBOSS.
  • Have Crystal Reports at the site. It is expensive to have Crystal as I know, but you will save time in the long run to make the investment and to have it. If you know what you want, you can probably get away with the trial version, but only have 30 days to use it.
  • Know what you want reported. I deciphered the SQL from some of the existing reports by looking at the “(reportname)_rpt.htm” files on the JobBOSS server, then created a new report. JobBOSS support can share with you a schema of your tables. From there, decide what you want to report and bring in those tables through the “database expert” in Crystal. Drag and drop the fields into the report. Save it to the “User Defined” section of reporting in JobBOSS.
  • Have some basic reporting knowledge. Even with little reporting experience, with dragging and dropping, you will be able to quickly assemble a Crystal report. Snag a Crystal reports book or find one online.
In summary, I found it to be pretty easy to develop custom Crystal Reports with JobBOSS. You can also develop these reports to help decision making in your business!

Wednesday, August 24, 2011

Getting the E-mail name from Windows Active Directory (AD) code

Getting the E-mail name from Windows Active Directory (AD) code.

Recently I needed to get the e-mail address for a person to be outputted on a SSRS report. The user table did not have the actual address and the name would not be possible to concatenate somehow. What did I have? It was only the long Active Directory (AD) data. How can I parse through this to get the name and concatenate on the address for this report? We will want to use T-SQL to extract the “CN” which stands for “Common Names”.

Please walk through this example with me!

Say you have the field “distinguished Name” in your table with:

DistinguishedName
------------------------
CN=joe.smith,OU=factory,OU=Email,DC=companynet,DC=company,DC=com

The code you can use to extract ”joe.smith” and concatenate ‘@company.com” is:

SELECT SUBSTRING((LEFT(U.DistinguishedName, CHARINDEX(',', U.DistinguishedName + ',') -1)),4,LEN((LEFT(U.DistinguishedName, CHARINDEX(',', U.DistinguishedName + ',') -1)))) + '@company.com’ AS "Email Address"

FROM (table)

Your result will equal:

Email Address
-----------------
joe.smith@company.com

Friday, May 20, 2011

Moving SQL Server System Databases to New Drives

It may become necessary to move an already installed SQL Server from one file storage location to another. It is necessary to move the system and other databases. In this case, we are moving the databases from the M:\ drive LUN to three drives, separated by function. This equates to:

  • M:\sqlserver\backup to B:\
  • M:\sqlserver\data to D:\
  • M:\sqlserver\log to L:\

While this is entirely possible, it is necessary to follow a few steps below to cleanly move the SQL Server instance to have storage in a different location. This example uses SQL Server 2008R2, so be sure to take note of the version when clicking through the registry.


  • Start the SQL Server Configuration Manager located in the programs section , under the version of SQL Server.
  • Shutdown SQL Server Instance.
  • In Configuration Tools for SQL Server Instance, put this in for startup parameters:

-dD:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf;

-eD:\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG;

-lL:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf

  • In the registry:

o HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQLServer

Set default paths to:

B:\, L:\, D:\

o HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\Replication

Set Working Directory to:

D:\MSSQL10_50.MSSQLSERVER\MSSQL\repldata

o Change default location in registry for Data Root:

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SQL Server/100/MSSQL10_50.MSSQLSERVER/Setup/

Set SQLDataRoot to:

D:\MSSQL10_50.MSSQLSERVER\MSSQL

Set FullTextDefaultPath to:

D:\MSSQL10_50.MSSQLSERVER\MSSQL\FTData

  • Change default location for SQL Agent error file:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\SQLServerAgent/

Set ErrorLogFile:

M:\sqlserver\data\MSSQL10_50.MSSQLSERVER\MSSQL\Log\SQLAGENT.OUT

To

D:\ MSSQL10_50.MSSQLSERVER\MSSQL\Log\SQLAGENT.OUT

  • Update Dump Directory to :

D:\MSSQL10_50.MSSQLSERVER\MSSQL

  • Check all Directories in the SQL Configuration manager. As an example, Dump Directory should be set to: D:\MSSQL10_50.MSSQLSERVER\MSSQL\LOG\
  • Start upSQL Server Instance
  • Move Other System Databases:

USE master;

GO

--test change startup script in SQL Config MGR to point to new database/location.

SELECT name, physical_name AS CurrentLocation, state_desc

FROM sys.master_files

WHERE database_id = DB_ID('master');

GO

--MOVE SYSTEM DBs

--MOVE MODEL

USE master;

GO

SELECT name, physical_name AS CurrentLocation, state_desc

FROM sys.master_files

WHERE database_id = DB_ID(N'model');

ALTER DATABASE model MODIFY FILE ( NAME = modeldev, FILENAME = 'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\model.mdf' )

ALTER DATABASE model MODIFY FILE ( NAME = modellog , FILENAME = 'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\modellog.ldf' )

USE master;

GO

--MOVE MSDB

SELECT name, physical_name AS CurrentLocation, state_desc

FROM sys.master_files

WHERE database_id = DB_ID(N'msdb');

ALTER DATABASE msdb MODIFY FILE ( NAME = MSDBData , FILENAME = 'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\MSDBData.mdf' )

ALTER DATABASE msdb MODIFY FILE ( NAME = MSDBLog , FILENAME = 'D:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\MSDBLog.ldf' )

--MOVE TEMPDB

SELECT name, physical_name AS CurrentLocation

FROM sys.master_files

WHERE database_id = DB_ID(N'tempdb');

GO

USE master;

GO

ALTER DATABASE tempdb

MODIFY FILE (NAME = tempdev, FILENAME = 'D:\tempdb.mdf');

GO

ALTER DATABASE tempdb

MODIFY FILE (NAME = templog, FILENAME = 'D:\templog.ldf');

GO

  • Restart SQL Server Instance!
  • Check locations

--Check

SELECT name, physical_name AS CurrentLocation, state_desc

FROM sys.master_files

WHERE database_id = DB_ID('master');

GO

SELECT name, physical_name AS CurrentLocation, state_desc

FROM sys.master_files

WHERE database_id = DB_ID(N'model');

SELECT name, physical_name AS CurrentLocation, state_desc

FROM sys.master_files

WHERE database_id = DB_ID(N'msdb');

SELECT name, physical_name AS CurrentLocation

FROM sys.master_files

WHERE database_id = DB_ID(N'tempdb');

GO

  • Update Backups/Maintenance Jobs…they all point to the old location.
  • Remaining Databases, such as the Report Server databases, can be detached from the old location, copied to new location and attached.