Hi Folks,
I need to access the MSSQL data in Oracle.
For that i need to first create the data source (ODBC Connection) to the MSSQL server on UNIX. Can anybody help me in creating the ODBC connection.
Thanks,
AmitI think you find what you're looking for at DataDirect (http://www.datadirect.com/products/odbc/index.ssp).
Showing posts with label folks. Show all posts
Showing posts with label folks. Show all posts
Wednesday, March 21, 2012
ODBC connection - lost tables
I have a SQL Server database that I connect a front end to using an ODBC connection. Our LAN folks upgraded the server recently and now I can no longer see any of the tables through the ODBC connection that the user used for login has permission in SQL Server Enterprise Manager to see - throught the ODBC connection the user can only see things like:
dbo.spt_datatype_info
dbo.spt_datatype_info_ext
dbo.spt_fallback_db
dbo.spt_fallback_dev
dbo.spt_fallback_usg
.
.
.
INFORMATION_SCHEMA.CHECK_CONSTRAINTS
INFORMATION_SCHEMA.COLUMN_DOMAIN_USAGE
etc.
I've tried deleting the user for the connection and re-establishing it with owner permissions. I've tried deleting the dsn and re-establishing that as well but nothing so far.
Please help!!!Sounds like your default database for the user is master...
is it?
Can you edit the connection and look?|||Do you mean throught the ODBC Administrator or through SQL Server Enterprise manager?|||If you're connecting a client to sql server...it'll be on the client...
And since you're seeing the INFORMATION_SCHEMA views...they live in master...
You'll need to change the default database to where your data is, I think (only sometimes, mind you)|||I'm not sure how to change the master on my client machine - could you walk me through that?
I sit next to some Oracle folks and from what they know of SQL Server there is a master dbase with sub dbases - the one I'm accessing being a sub dbase. The master dbase peers into the subs through views. It sounds to them as though the master dbase doesn't have the proper permission to see all the tables or perhaps the view is incorrect. Is this close to what you are talking about?|||You control the default database when you create the dsn - look at your dsn settings for default database (it defaults to master).|||Hold on...don't listen to the Oracle guys...different world
been there...
there are no "Sub" databases..there are instances (a word they should know) in sql2k...
Hold on...I'm on win2k ok?
go to start>Settings>control panel
2xclick on data sources
Find your dsn...2x click on or configure...
Go 2 or 3 clicks on NEXT...you should see the default db...
btw...how do you distribute the odbc to the clients?|||You are the man!!! I found the default database and that was it. Thank you very much!
For those of you reading and don't know where that is on Windows 2K and XP open your ODBC Administrator -> add a User DSN -> select a driver (in this case SQL) -> type in a name and a server, description is optional -> set up authentication as needed -> at the top of the next screen is where you change your default database -> leave default settings on the next screen -> test and you're done.|||Great...and good luck...
But how do you plan to distribute the connection?|||Actually what I have is a document in a shared folder that walks the user through the ODBC setup. All users login to the dbase with the same user info and their data access is controlled through the front end. Not the best solution but the data isn't sensative and the cost was zero since me and another guy set it up in-house.
Thanks again!sql
dbo.spt_datatype_info
dbo.spt_datatype_info_ext
dbo.spt_fallback_db
dbo.spt_fallback_dev
dbo.spt_fallback_usg
.
.
.
INFORMATION_SCHEMA.CHECK_CONSTRAINTS
INFORMATION_SCHEMA.COLUMN_DOMAIN_USAGE
etc.
I've tried deleting the user for the connection and re-establishing it with owner permissions. I've tried deleting the dsn and re-establishing that as well but nothing so far.
Please help!!!Sounds like your default database for the user is master...
is it?
Can you edit the connection and look?|||Do you mean throught the ODBC Administrator or through SQL Server Enterprise manager?|||If you're connecting a client to sql server...it'll be on the client...
And since you're seeing the INFORMATION_SCHEMA views...they live in master...
You'll need to change the default database to where your data is, I think (only sometimes, mind you)|||I'm not sure how to change the master on my client machine - could you walk me through that?
I sit next to some Oracle folks and from what they know of SQL Server there is a master dbase with sub dbases - the one I'm accessing being a sub dbase. The master dbase peers into the subs through views. It sounds to them as though the master dbase doesn't have the proper permission to see all the tables or perhaps the view is incorrect. Is this close to what you are talking about?|||You control the default database when you create the dsn - look at your dsn settings for default database (it defaults to master).|||Hold on...don't listen to the Oracle guys...different world
been there...
there are no "Sub" databases..there are instances (a word they should know) in sql2k...
Hold on...I'm on win2k ok?
go to start>Settings>control panel
2xclick on data sources
Find your dsn...2x click on or configure...
Go 2 or 3 clicks on NEXT...you should see the default db...
btw...how do you distribute the odbc to the clients?|||You are the man!!! I found the default database and that was it. Thank you very much!
For those of you reading and don't know where that is on Windows 2K and XP open your ODBC Administrator -> add a User DSN -> select a driver (in this case SQL) -> type in a name and a server, description is optional -> set up authentication as needed -> at the top of the next screen is where you change your default database -> leave default settings on the next screen -> test and you're done.|||Great...and good luck...
But how do you plan to distribute the connection?|||Actually what I have is a document in a shared folder that walks the user through the ODBC setup. All users login to the dbase with the same user info and their data access is controlled through the front end. Not the best solution but the data isn't sensative and the cost was zero since me and another guy set it up in-house.
Thanks again!sql
Friday, March 9, 2012
Occasional Authentication Failure
This is an interesting problem. I've never seen this in 5+ years of SQL Server work.
I just started a new job and the folks tell me this happens once a month or so.
We use Trusted Connections for the bulk of work. For some reason one of the multiple SQL Servers we run will just stop recognizing trusted connections. Out of the blue you will just start getting the "Cannot associate user (null) with a trusted connecti
on". The server will log an error indicating it can't find the Domain Controller. The strange thing is only 1 of our SQL Server boxes are affected. There are at least 3 other machines that don't have this issue.
Reboot the server and it's fixed. But, obviously we don't like bouncing production servers. These are running on Server 2003.
I was curious if anyone had seen this before.
Well usually when it says Null as the user , it is a problem with Windows
Authentication itself, not a SQL issue
Check this article :
How to troubleshoot connectivity issues in SQL Server 2000
http://support.microsoft.com/default...b;en-us;827422
HTH
Dylan
"Shawn Brock" <Shawn Brock@.discussions.microsoft.com> wrote in message
news:B62E0490-D630-4378-A3B9-FE36378221CE@.microsoft.com...
> This is an interesting problem. I've never seen this in 5+ years of SQL
Server work.
> I just started a new job and the folks tell me this happens once a month
or so.
> We use Trusted Connections for the bulk of work. For some reason one of
the multiple SQL Servers we run will just stop recognizing trusted
connections. Out of the blue you will just start getting the "Cannot
associate user (null) with a trusted connection". The server will log an
error indicating it can't find the Domain Controller. The strange thing is
only 1 of our SQL Server boxes are affected. There are at least 3 other
machines that don't have this issue.
> Reboot the server and it's fixed. But, obviously we don't like bouncing
production servers. These are running on Server 2003.
> I was curious if anyone had seen this before.
I just started a new job and the folks tell me this happens once a month or so.
We use Trusted Connections for the bulk of work. For some reason one of the multiple SQL Servers we run will just stop recognizing trusted connections. Out of the blue you will just start getting the "Cannot associate user (null) with a trusted connecti
on". The server will log an error indicating it can't find the Domain Controller. The strange thing is only 1 of our SQL Server boxes are affected. There are at least 3 other machines that don't have this issue.
Reboot the server and it's fixed. But, obviously we don't like bouncing production servers. These are running on Server 2003.
I was curious if anyone had seen this before.
Well usually when it says Null as the user , it is a problem with Windows
Authentication itself, not a SQL issue
Check this article :
How to troubleshoot connectivity issues in SQL Server 2000
http://support.microsoft.com/default...b;en-us;827422
HTH
Dylan
"Shawn Brock" <Shawn Brock@.discussions.microsoft.com> wrote in message
news:B62E0490-D630-4378-A3B9-FE36378221CE@.microsoft.com...
> This is an interesting problem. I've never seen this in 5+ years of SQL
Server work.
> I just started a new job and the folks tell me this happens once a month
or so.
> We use Trusted Connections for the bulk of work. For some reason one of
the multiple SQL Servers we run will just stop recognizing trusted
connections. Out of the blue you will just start getting the "Cannot
associate user (null) with a trusted connection". The server will log an
error indicating it can't find the Domain Controller. The strange thing is
only 1 of our SQL Server boxes are affected. There are at least 3 other
machines that don't have this issue.
> Reboot the server and it's fixed. But, obviously we don't like bouncing
production servers. These are running on Server 2003.
> I was curious if anyone had seen this before.
Labels:
authentication,
database,
failure,
folks,
interesting,
ive,
job,
microsoft,
mysql,
occasional,
oracle,
server,
sql
Occasional Authentication Failure
This is an interesting problem. I've never seen this in 5+ years of SQL Ser
ver work.
I just started a new job and the folks tell me this happens once a month or
so.
We use Trusted Connections for the bulk of work. For some reason one of the
multiple SQL Servers we run will just stop recognizing trusted connections.
Out of the blue you will just start getting the "Cannot associate user (nu
ll) with a trusted connecti
on". The server will log an error indicating it can't find the Domain Contr
oller. The strange thing is only 1 of our SQL Server boxes are affected. T
here are at least 3 other machines that don't have this issue.
Reboot the server and it's fixed. But, obviously we don't like bouncing pro
duction servers. These are running on Server 2003.
I was curious if anyone had seen this before.Well usually when it says Null as the user , it is a problem with Windows
Authentication itself, not a SQL issue
Check this article :
How to troubleshoot connectivity issues in SQL Server 2000
http://support.microsoft.com/defaul...kb;en-us;827422
HTH
Dylan
"Shawn Brock" <Shawn Brock@.discussions.microsoft.com> wrote in message
news:B62E0490-D630-4378-A3B9-FE36378221CE@.microsoft.com...
> This is an interesting problem. I've never seen this in 5+ years of SQL
Server work.
> I just started a new job and the folks tell me this happens once a month
or so.
> We use Trusted Connections for the bulk of work. For some reason one of
the multiple SQL Servers we run will just stop recognizing trusted
connections. Out of the blue you will just start getting the "Cannot
associate user (null) with a trusted connection". The server will log an
error indicating it can't find the Domain Controller. The strange thing is
only 1 of our SQL Server boxes are affected. There are at least 3 other
machines that don't have this issue.
> Reboot the server and it's fixed. But, obviously we don't like bouncing
production servers. These are running on Server 2003.
> I was curious if anyone had seen this before.
ver work.
I just started a new job and the folks tell me this happens once a month or
so.
We use Trusted Connections for the bulk of work. For some reason one of the
multiple SQL Servers we run will just stop recognizing trusted connections.
Out of the blue you will just start getting the "Cannot associate user (nu
ll) with a trusted connecti
on". The server will log an error indicating it can't find the Domain Contr
oller. The strange thing is only 1 of our SQL Server boxes are affected. T
here are at least 3 other machines that don't have this issue.
Reboot the server and it's fixed. But, obviously we don't like bouncing pro
duction servers. These are running on Server 2003.
I was curious if anyone had seen this before.Well usually when it says Null as the user , it is a problem with Windows
Authentication itself, not a SQL issue
Check this article :
How to troubleshoot connectivity issues in SQL Server 2000
http://support.microsoft.com/defaul...kb;en-us;827422
HTH
Dylan
"Shawn Brock" <Shawn Brock@.discussions.microsoft.com> wrote in message
news:B62E0490-D630-4378-A3B9-FE36378221CE@.microsoft.com...
> This is an interesting problem. I've never seen this in 5+ years of SQL
Server work.
> I just started a new job and the folks tell me this happens once a month
or so.
> We use Trusted Connections for the bulk of work. For some reason one of
the multiple SQL Servers we run will just stop recognizing trusted
connections. Out of the blue you will just start getting the "Cannot
associate user (null) with a trusted connection". The server will log an
error indicating it can't find the Domain Controller. The strange thing is
only 1 of our SQL Server boxes are affected. There are at least 3 other
machines that don't have this issue.
> Reboot the server and it's fixed. But, obviously we don't like bouncing
production servers. These are running on Server 2003.
> I was curious if anyone had seen this before.
Labels:
authentication,
database,
failure,
folks,
interesting,
job,
microsoft,
mysql,
occasional,
oracle,
server,
sql
Wednesday, March 7, 2012
Obtaining statistical data in MSDB db
Dear folks,
I would like have available statistical data concerning our scheduled DTS.
Up to date I am be able to store and to see some data using sysjobs and
sysjobhistory tables in MSDB database, i.e, I obtain variables such as last
execution, time inverted and owner, as well as owner or version id. That's
fine and very useful but I would need more accurate information in order to
create statistics with the total of time inverted per each DTS during the
last two w
s (for instance) or be able to desing a "production map" and
therefore, to schedule better our DTS, covering spaces in terms of time and
avoiding bottlenecks or issues which sometimes are causing headaches to all
the developers.
How could I do such thing? I am seeing these aforementioned tables but the
info stored is the last day.
select run_date,run_duration,run_status,step_na
me from sysjobhistory where
step_name
in('__ABS_PasarDiarioaHistorico')
I see this:
20050805 2855 1 __ABS_PasarDiarioaHistor
ico
20050806 2518 1 __ABS_PasarDiarioaHistor
ico
20050807 148 1 __ABS_PasarDiarioaHistori
co
20050808 6 1 __ABS_PasarDiarioaHistorico
20050809 2113 1 __ABS_PasarDiarioaHistor
ico
20050810 3205 1 __ABS_PasarDiarioaHistor
ico
20050811 3355 1 __ABS_PasarDiarioaHistor
ico
But, July executions where on earth are?
Any though/comment/advice will be welcomed.
Regards,I've done this query which is solving any doubts:
SELECT run_date, run_duration, case MSDB..sysjobschedules.freq_type
when 4 then 'Daily'
when 8 then 'W
ly'
when 16 then 'Monthly'
when 32 then 'once'
end
FROM MSDB..sysjobhistory inner join MSDB..sysjobschedules
on MSDB..sysjobhistory.step_name = MSDB..sysjobschedules.name
WHERE STEP_NAME IN('__ABS_EliminarHistorico') ORDER BY 1
*** __ABS_EliminarHistorico is one of our DTS.
"Enric" wrote:
> Dear folks,
> I would like have available statistical data concerning our scheduled DTS.
> Up to date I am be able to store and to see some data using sysjobs and
> sysjobhistory tables in MSDB database, i.e, I obtain variables such as las
t
> execution, time inverted and owner, as well as owner or version id. That's
> fine and very useful but I would need more accurate information in order t
o
> create statistics with the total of time inverted per each DTS during the
> last two w
s (for instance) or be able to desing a "production map" and
> therefore, to schedule better our DTS, covering spaces in terms of time an
d
> avoiding bottlenecks or issues which sometimes are causing headaches to al
l
> the developers.
> How could I do such thing? I am seeing these aforementioned tables but the
> info stored is the last day.
> select run_date,run_duration,run_status,step_na
me from sysjobhistory where
> step_name
> in('__ABS_PasarDiarioaHistorico')
> I see this:
> 20050805 2855 1 __ABS_PasarDiarioaHistor
ico
> 20050806 2518 1 __ABS_PasarDiarioaHistor
ico
> 20050807 148 1 __ABS_PasarDiarioaHistori
co
> 20050808 6 1 __ABS_PasarDiarioaHistorico
> 20050809 2113 1 __ABS_PasarDiarioaHistor
ico
> 20050810 3205 1 __ABS_PasarDiarioaHistor
ico
> 20050811 3355 1 __ABS_PasarDiarioaHistor
ico
>
> But, July executions where on earth are?
>
> Any though/comment/advice will be welcomed.
> Regards,|||Enric
select convert(varchar(22), j.name) as job_name
, case freq_type -- Daily, w
ly, Monthly
when 1 then 'Once'
when 4 then 'Daily'
when 8 then 'Wk ' -- For w
ly, add in the days of the w
+ case freq_interval & 2 when 2 then 'M' else '' end -- Monday
+ case freq_interval & 4 when 4 then 'Tu' else '' end -- Tuesday
+ case freq_interval & 8 when 8 then 'W' else '' end -- etc
+ case freq_interval & 16 when 16 then 'Th' else '' end
+ case freq_interval & 32 when 32 then 'F' else '' end
+ case freq_interval & 64 when 64 then 'Sa' else '' end
+ case freq_interval & 1 when 1 then 'Su' else '' end
when 16 then 'Mthly on day ' + convert(varchar(2), freq_interval) -- Monthly
on a particular day
when 32 then 'Mthly ' -- The most complicated one, "every third Friday of
the month" for example
+ case freq_relative_interval
when 1 then 'Every First '
when 2 then 'Every Second '
when 4 then 'Every Third '
when 8 then 'Every Fourth '
when 16 then 'Every Last '
end
+ case freq_interval
when 1 then 'Sunday'
when 2 then 'Monday'
when 3 then 'Tuesday'
when 4 then 'Wednesday'
when 5 then 'Thursday'
when 6 then 'Friday'
when 7 then 'Saturday'
when 8 then 'Day'
when 9 then 'W
day'
when 10 then 'W
end day'
end
when 64 then 'Startup' -- When SQL Server starts
when 128 then 'Idle' -- Whenever SQL Server gets bored
else 'Err' -- This should never happen
end as schedule
, case freq_subday_type -- FOr when a job funs every few seconds, minutes or
hours
when 1 then 'Runs once at:'
when 2 then 'every ' + convert(varchar(3), freq_subday_interval) + '
seconds'
when 4 then 'every ' + convert(varchar(3), freq_subday_interval) + '
minutes'
when 8 then 'every ' + convert(varchar(3), freq_subday_interval) + ' hours'
end as frequency
-- All the subsrings are because the times are stored as an integer with no
leading zeroes
-- i.e. 0 means midnight, 13000 means half past one in the morning
(01:30:00)
, substring (right (stuff (' ', 1, 1, '000000') +
convert(varchar(6),active_start_time), 6), 1, 2)
+ ':'
+ substring (
right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_start_time),
6) ,3 ,2)
+ ':'
+ substring (
right (stuff (' ', 1, 1, '000000') + convert(varchar(6),active_start_time),
6) ,5 ,2) as start_at
,case freq_subday_type
when 1 then NULL -- Ignore the end time if not a recurring job
else substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6),
active_end_time), 6), 1, 2)
+ ':'
+ substring (
right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_end_time),
6) ,3 ,2)
+ ':'
+ substring (
right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_end_time),
6) ,5 ,2) end as end_at
from sysjobs j
join sysJobSchedules s
on j.job_id = s.job_id
order by j.name, start_at
"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:E8350DF7-6624-465B-888A-78FDE5899FBB@.microsoft.com...
> I've done this query which is solving any doubts:
> SELECT run_date, run_duration, case MSDB..sysjobschedules.freq_type
> when 4 then 'Daily'
> when 8 then 'W
ly'
> when 16 then 'Monthly'
> when 32 then 'once'
> end
> FROM MSDB..sysjobhistory inner join MSDB..sysjobschedules
> on MSDB..sysjobhistory.step_name = MSDB..sysjobschedules.name
> WHERE STEP_NAME IN('__ABS_EliminarHistorico') ORDER BY 1
> *** __ABS_EliminarHistorico is one of our DTS.
> "Enric" wrote:
>|||Thanks so much Uri, it's amazing, just a quick and powerful response.
"Uri Dimant" wrote:
> Enric
> select convert(varchar(22), j.name) as job_name
> , case freq_type -- Daily, w
ly, Monthly
> when 1 then 'Once'
> when 4 then 'Daily'
> when 8 then 'Wk ' -- For w
ly, add in the days of the w
> + case freq_interval & 2 when 2 then 'M' else '' end -- Monday
> + case freq_interval & 4 when 4 then 'Tu' else '' end -- Tuesday
> + case freq_interval & 8 when 8 then 'W' else '' end -- etc
> + case freq_interval & 16 when 16 then 'Th' else '' end
> + case freq_interval & 32 when 32 then 'F' else '' end
> + case freq_interval & 64 when 64 then 'Sa' else '' end
> + case freq_interval & 1 when 1 then 'Su' else '' end
> when 16 then 'Mthly on day ' + convert(varchar(2), freq_interval) -- Month
ly
> on a particular day
> when 32 then 'Mthly ' -- The most complicated one, "every third Friday of
> the month" for example
> + case freq_relative_interval
> when 1 then 'Every First '
> when 2 then 'Every Second '
> when 4 then 'Every Third '
> when 8 then 'Every Fourth '
> when 16 then 'Every Last '
> end
> + case freq_interval
> when 1 then 'Sunday'
> when 2 then 'Monday'
> when 3 then 'Tuesday'
> when 4 then 'Wednesday'
> when 5 then 'Thursday'
> when 6 then 'Friday'
> when 7 then 'Saturday'
> when 8 then 'Day'
> when 9 then 'W
day'
> when 10 then 'W
end day'
> end
> when 64 then 'Startup' -- When SQL Server starts
> when 128 then 'Idle' -- Whenever SQL Server gets bored
> else 'Err' -- This should never happen
> end as schedule
> , case freq_subday_type -- FOr when a job funs every few seconds, minutes
or
> hours
> when 1 then 'Runs once at:'
> when 2 then 'every ' + convert(varchar(3), freq_subday_interval) + '
> seconds'
> when 4 then 'every ' + convert(varchar(3), freq_subday_interval) + '
> minutes'
> when 8 then 'every ' + convert(varchar(3), freq_subday_interval) + ' hours
'
> end as frequency
> -- All the subsrings are because the times are stored as an integer with n
o
> leading zeroes
> -- i.e. 0 means midnight, 13000 means half past one in the morning
> (01:30:00)
> , substring (right (stuff (' ', 1, 1, '000000') +
> convert(varchar(6),active_start_time), 6), 1, 2)
> + ':'
> + substring (
> right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_start_time
),
> 6) ,3 ,2)
> + ':'
> + substring (
> right (stuff (' ', 1, 1, '000000') + convert(varchar(6),active_start_time)
,
> 6) ,5 ,2) as start_at
> ,case freq_subday_type
> when 1 then NULL -- Ignore the end time if not a recurring job
> else substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6),
> active_end_time), 6), 1, 2)
> + ':'
> + substring (
> right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_end_time),
> 6) ,3 ,2)
> + ':'
> + substring (
> right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_end_time),
> 6) ,5 ,2) end as end_at
> from sysjobs j
> join sysJobSchedules s
> on j.job_id = s.job_id
> order by j.name, start_at
> "Enric" <Enric@.discussions.microsoft.com> wrote in message
> news:E8350DF7-6624-465B-888A-78FDE5899FBB@.microsoft.com...
>
>
I would like have available statistical data concerning our scheduled DTS.
Up to date I am be able to store and to see some data using sysjobs and
sysjobhistory tables in MSDB database, i.e, I obtain variables such as last
execution, time inverted and owner, as well as owner or version id. That's
fine and very useful but I would need more accurate information in order to
create statistics with the total of time inverted per each DTS during the
last two w
therefore, to schedule better our DTS, covering spaces in terms of time and
avoiding bottlenecks or issues which sometimes are causing headaches to all
the developers.
How could I do such thing? I am seeing these aforementioned tables but the
info stored is the last day.
select run_date,run_duration,run_status,step_na
me from sysjobhistory where
step_name
in('__ABS_PasarDiarioaHistorico')
I see this:
20050805 2855 1 __ABS_PasarDiarioaHistor
ico
20050806 2518 1 __ABS_PasarDiarioaHistor
ico
20050807 148 1 __ABS_PasarDiarioaHistori
co
20050808 6 1 __ABS_PasarDiarioaHistorico
20050809 2113 1 __ABS_PasarDiarioaHistor
ico
20050810 3205 1 __ABS_PasarDiarioaHistor
ico
20050811 3355 1 __ABS_PasarDiarioaHistor
ico
But, July executions where on earth are?
Any though/comment/advice will be welcomed.
Regards,I've done this query which is solving any doubts:
SELECT run_date, run_duration, case MSDB..sysjobschedules.freq_type
when 4 then 'Daily'
when 8 then 'W
when 16 then 'Monthly'
when 32 then 'once'
end
FROM MSDB..sysjobhistory inner join MSDB..sysjobschedules
on MSDB..sysjobhistory.step_name = MSDB..sysjobschedules.name
WHERE STEP_NAME IN('__ABS_EliminarHistorico') ORDER BY 1
*** __ABS_EliminarHistorico is one of our DTS.
"Enric" wrote:
> Dear folks,
> I would like have available statistical data concerning our scheduled DTS.
> Up to date I am be able to store and to see some data using sysjobs and
> sysjobhistory tables in MSDB database, i.e, I obtain variables such as las
t
> execution, time inverted and owner, as well as owner or version id. That's
> fine and very useful but I would need more accurate information in order t
o
> create statistics with the total of time inverted per each DTS during the
> last two w
> therefore, to schedule better our DTS, covering spaces in terms of time an
d
> avoiding bottlenecks or issues which sometimes are causing headaches to al
l
> the developers.
> How could I do such thing? I am seeing these aforementioned tables but the
> info stored is the last day.
> select run_date,run_duration,run_status,step_na
me from sysjobhistory where
> step_name
> in('__ABS_PasarDiarioaHistorico')
> I see this:
> 20050805 2855 1 __ABS_PasarDiarioaHistor
ico
> 20050806 2518 1 __ABS_PasarDiarioaHistor
ico
> 20050807 148 1 __ABS_PasarDiarioaHistori
co
> 20050808 6 1 __ABS_PasarDiarioaHistorico
> 20050809 2113 1 __ABS_PasarDiarioaHistor
ico
> 20050810 3205 1 __ABS_PasarDiarioaHistor
ico
> 20050811 3355 1 __ABS_PasarDiarioaHistor
ico
>
> But, July executions where on earth are?
>
> Any though/comment/advice will be welcomed.
> Regards,|||Enric
select convert(varchar(22), j.name) as job_name
, case freq_type -- Daily, w
when 1 then 'Once'
when 4 then 'Daily'
when 8 then 'Wk ' -- For w
+ case freq_interval & 2 when 2 then 'M' else '' end -- Monday
+ case freq_interval & 4 when 4 then 'Tu' else '' end -- Tuesday
+ case freq_interval & 8 when 8 then 'W' else '' end -- etc
+ case freq_interval & 16 when 16 then 'Th' else '' end
+ case freq_interval & 32 when 32 then 'F' else '' end
+ case freq_interval & 64 when 64 then 'Sa' else '' end
+ case freq_interval & 1 when 1 then 'Su' else '' end
when 16 then 'Mthly on day ' + convert(varchar(2), freq_interval) -- Monthly
on a particular day
when 32 then 'Mthly ' -- The most complicated one, "every third Friday of
the month" for example
+ case freq_relative_interval
when 1 then 'Every First '
when 2 then 'Every Second '
when 4 then 'Every Third '
when 8 then 'Every Fourth '
when 16 then 'Every Last '
end
+ case freq_interval
when 1 then 'Sunday'
when 2 then 'Monday'
when 3 then 'Tuesday'
when 4 then 'Wednesday'
when 5 then 'Thursday'
when 6 then 'Friday'
when 7 then 'Saturday'
when 8 then 'Day'
when 9 then 'W
when 10 then 'W
end
when 64 then 'Startup' -- When SQL Server starts
when 128 then 'Idle' -- Whenever SQL Server gets bored
else 'Err' -- This should never happen
end as schedule
, case freq_subday_type -- FOr when a job funs every few seconds, minutes or
hours
when 1 then 'Runs once at:'
when 2 then 'every ' + convert(varchar(3), freq_subday_interval) + '
seconds'
when 4 then 'every ' + convert(varchar(3), freq_subday_interval) + '
minutes'
when 8 then 'every ' + convert(varchar(3), freq_subday_interval) + ' hours'
end as frequency
-- All the subsrings are because the times are stored as an integer with no
leading zeroes
-- i.e. 0 means midnight, 13000 means half past one in the morning
(01:30:00)
, substring (right (stuff (' ', 1, 1, '000000') +
convert(varchar(6),active_start_time), 6), 1, 2)
+ ':'
+ substring (
right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_start_time),
6) ,3 ,2)
+ ':'
+ substring (
right (stuff (' ', 1, 1, '000000') + convert(varchar(6),active_start_time),
6) ,5 ,2) as start_at
,case freq_subday_type
when 1 then NULL -- Ignore the end time if not a recurring job
else substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6),
active_end_time), 6), 1, 2)
+ ':'
+ substring (
right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_end_time),
6) ,3 ,2)
+ ':'
+ substring (
right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_end_time),
6) ,5 ,2) end as end_at
from sysjobs j
join sysJobSchedules s
on j.job_id = s.job_id
order by j.name, start_at
"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:E8350DF7-6624-465B-888A-78FDE5899FBB@.microsoft.com...
> I've done this query which is solving any doubts:
> SELECT run_date, run_duration, case MSDB..sysjobschedules.freq_type
> when 4 then 'Daily'
> when 8 then 'W
> when 16 then 'Monthly'
> when 32 then 'once'
> end
> FROM MSDB..sysjobhistory inner join MSDB..sysjobschedules
> on MSDB..sysjobhistory.step_name = MSDB..sysjobschedules.name
> WHERE STEP_NAME IN('__ABS_EliminarHistorico') ORDER BY 1
> *** __ABS_EliminarHistorico is one of our DTS.
> "Enric" wrote:
>|||Thanks so much Uri, it's amazing, just a quick and powerful response.
"Uri Dimant" wrote:
> Enric
> select convert(varchar(22), j.name) as job_name
> , case freq_type -- Daily, w
> when 1 then 'Once'
> when 4 then 'Daily'
> when 8 then 'Wk ' -- For w
> + case freq_interval & 2 when 2 then 'M' else '' end -- Monday
> + case freq_interval & 4 when 4 then 'Tu' else '' end -- Tuesday
> + case freq_interval & 8 when 8 then 'W' else '' end -- etc
> + case freq_interval & 16 when 16 then 'Th' else '' end
> + case freq_interval & 32 when 32 then 'F' else '' end
> + case freq_interval & 64 when 64 then 'Sa' else '' end
> + case freq_interval & 1 when 1 then 'Su' else '' end
> when 16 then 'Mthly on day ' + convert(varchar(2), freq_interval) -- Month
ly
> on a particular day
> when 32 then 'Mthly ' -- The most complicated one, "every third Friday of
> the month" for example
> + case freq_relative_interval
> when 1 then 'Every First '
> when 2 then 'Every Second '
> when 4 then 'Every Third '
> when 8 then 'Every Fourth '
> when 16 then 'Every Last '
> end
> + case freq_interval
> when 1 then 'Sunday'
> when 2 then 'Monday'
> when 3 then 'Tuesday'
> when 4 then 'Wednesday'
> when 5 then 'Thursday'
> when 6 then 'Friday'
> when 7 then 'Saturday'
> when 8 then 'Day'
> when 9 then 'W
> when 10 then 'W
> end
> when 64 then 'Startup' -- When SQL Server starts
> when 128 then 'Idle' -- Whenever SQL Server gets bored
> else 'Err' -- This should never happen
> end as schedule
> , case freq_subday_type -- FOr when a job funs every few seconds, minutes
or
> hours
> when 1 then 'Runs once at:'
> when 2 then 'every ' + convert(varchar(3), freq_subday_interval) + '
> seconds'
> when 4 then 'every ' + convert(varchar(3), freq_subday_interval) + '
> minutes'
> when 8 then 'every ' + convert(varchar(3), freq_subday_interval) + ' hours
'
> end as frequency
> -- All the subsrings are because the times are stored as an integer with n
o
> leading zeroes
> -- i.e. 0 means midnight, 13000 means half past one in the morning
> (01:30:00)
> , substring (right (stuff (' ', 1, 1, '000000') +
> convert(varchar(6),active_start_time), 6), 1, 2)
> + ':'
> + substring (
> right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_start_time
),
> 6) ,3 ,2)
> + ':'
> + substring (
> right (stuff (' ', 1, 1, '000000') + convert(varchar(6),active_start_time)
,
> 6) ,5 ,2) as start_at
> ,case freq_subday_type
> when 1 then NULL -- Ignore the end time if not a recurring job
> else substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6),
> active_end_time), 6), 1, 2)
> + ':'
> + substring (
> right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_end_time),
> 6) ,3 ,2)
> + ':'
> + substring (
> right (stuff (' ', 1, 1, '000000') + convert(varchar(6), active_end_time),
> 6) ,5 ,2) end as end_at
> from sysjobs j
> join sysJobSchedules s
> on j.job_id = s.job_id
> order by j.name, start_at
> "Enric" <Enric@.discussions.microsoft.com> wrote in message
> news:E8350DF7-6624-465B-888A-78FDE5899FBB@.microsoft.com...
>
>
Monday, February 20, 2012
Objects related to DB
Hi Folks,
I suppose should exist a way to find the relationship between all external
objects (logins, dts, jobs, ...) with one database. I mean, the objects
related\attached with database.
That is because we have to take off several databases including objects
related.
Of course we have the respective documentation of the relationships but in
the past several engineers did mistakes and they missed the removement of
some object related...So, we got sql server with dirty objects.
The idea is to make a kind of script that checks all external objects
related to database before to delete it.
Thanks in advance.HI ,
You could try a documentation tool like my SQL Scribe Documentation Builder.
There a 14 day trial . Document the entire system , the documentation
details logins, jobs and other server elements as well as the schema details
http://www.geckoware.com.au/Content.aspx?Doc_id=1001
-
Greg O
SQL Server Documentation the easy way
SQL 2000, SQL 2005 the best is back
http://www.geckoware.com.au/Content.aspx?Doc_id=1001
"Jaisol" <jaisol@.QUITARMEhotmail.com> wrote in message
news:eNYZB%23WrHHA.4180@.TK2MSFTNGP04.phx.gbl...
> Hi Folks,
> I suppose should exist a way to find the relationship between all external
> objects (logins, dts, jobs, ...) with one database. I mean, the objects
> related\attached with database.
> That is because we have to take off several databases including objects
> related.
> Of course we have the respective documentation of the relationships but in
> the past several engineers did mistakes and they missed the removement of
> some object related...So, we got sql server with dirty objects.
> The idea is to make a kind of script that checks all external objects
> related to database before to delete it.
> Thanks in advance.
>
I suppose should exist a way to find the relationship between all external
objects (logins, dts, jobs, ...) with one database. I mean, the objects
related\attached with database.
That is because we have to take off several databases including objects
related.
Of course we have the respective documentation of the relationships but in
the past several engineers did mistakes and they missed the removement of
some object related...So, we got sql server with dirty objects.
The idea is to make a kind of script that checks all external objects
related to database before to delete it.
Thanks in advance.HI ,
You could try a documentation tool like my SQL Scribe Documentation Builder.
There a 14 day trial . Document the entire system , the documentation
details logins, jobs and other server elements as well as the schema details
http://www.geckoware.com.au/Content.aspx?Doc_id=1001
-
Greg O
SQL Server Documentation the easy way
SQL 2000, SQL 2005 the best is back
http://www.geckoware.com.au/Content.aspx?Doc_id=1001
"Jaisol" <jaisol@.QUITARMEhotmail.com> wrote in message
news:eNYZB%23WrHHA.4180@.TK2MSFTNGP04.phx.gbl...
> Hi Folks,
> I suppose should exist a way to find the relationship between all external
> objects (logins, dts, jobs, ...) with one database. I mean, the objects
> related\attached with database.
> That is because we have to take off several databases including objects
> related.
> Of course we have the respective documentation of the relationships but in
> the past several engineers did mistakes and they missed the removement of
> some object related...So, we got sql server with dirty objects.
> The idea is to make a kind of script that checks all external objects
> related to database before to delete it.
> Thanks in advance.
>
Objects related to DB
Hi Folks,
I suppose should exist a way to find the relationship between all external
objects (logins, dts, jobs, ...) with one database. I mean, the objects
related\attached with database.
That is because we have to take off several databases including objects
related.
Of course we have the respective documentation of the relationships but in
the past several engineers did mistakes and they missed the removement of
some object related...So, we got sql server with dirty objects.
The idea is to make a kind of script that checks all external objects
related to database before to delete it.
Thanks in advance.HI ,
You could try a documentation tool like my SQL Scribe Documentation Builder.
There a 14 day trial . Document the entire system , the documentation
details logins, jobs and other server elements as well as the schema details
http://www.geckoware.com.au/Content.aspx?Doc_id=1001
-
Greg O
SQL Server Documentation the easy way
SQL 2000, SQL 2005 the best is back
http://www.geckoware.com.au/Content.aspx?Doc_id=1001
"Jaisol" <jaisol@.QUITARMEhotmail.com> wrote in message
news:eNYZB%23WrHHA.4180@.TK2MSFTNGP04.phx.gbl...
> Hi Folks,
> I suppose should exist a way to find the relationship between all external
> objects (logins, dts, jobs, ...) with one database. I mean, the objects
> related\attached with database.
> That is because we have to take off several databases including objects
> related.
> Of course we have the respective documentation of the relationships but in
> the past several engineers did mistakes and they missed the removement of
> some object related...So, we got sql server with dirty objects.
> The idea is to make a kind of script that checks all external objects
> related to database before to delete it.
> Thanks in advance.
>
I suppose should exist a way to find the relationship between all external
objects (logins, dts, jobs, ...) with one database. I mean, the objects
related\attached with database.
That is because we have to take off several databases including objects
related.
Of course we have the respective documentation of the relationships but in
the past several engineers did mistakes and they missed the removement of
some object related...So, we got sql server with dirty objects.
The idea is to make a kind of script that checks all external objects
related to database before to delete it.
Thanks in advance.HI ,
You could try a documentation tool like my SQL Scribe Documentation Builder.
There a 14 day trial . Document the entire system , the documentation
details logins, jobs and other server elements as well as the schema details
http://www.geckoware.com.au/Content.aspx?Doc_id=1001
-
Greg O
SQL Server Documentation the easy way
SQL 2000, SQL 2005 the best is back
http://www.geckoware.com.au/Content.aspx?Doc_id=1001
"Jaisol" <jaisol@.QUITARMEhotmail.com> wrote in message
news:eNYZB%23WrHHA.4180@.TK2MSFTNGP04.phx.gbl...
> Hi Folks,
> I suppose should exist a way to find the relationship between all external
> objects (logins, dts, jobs, ...) with one database. I mean, the objects
> related\attached with database.
> That is because we have to take off several databases including objects
> related.
> Of course we have the respective documentation of the relationships but in
> the past several engineers did mistakes and they missed the removement of
> some object related...So, we got sql server with dirty objects.
> The idea is to make a kind of script that checks all external objects
> related to database before to delete it.
> Thanks in advance.
>
Subscribe to:
Posts (Atom)