Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Monday, March 26, 2012

Question on where the MDX is deployed to by BIDS Helper

Hi, all experts here,

As we are enabled to deploy the calculation MDX scripts by installing BIDS Helper. But why there is no options for us to decide where the MDX scripts will be deployed to? And where can I find those deployed MDX scripts? Thanks a lot in advance and I am confused and I am looking forward to hearing from you shortly for your help. (Assume I am right, to my understanding, with capability to deploy the calculated MDX scripts we are then able to reuse them?)

With best regards,

Yours sincerely,

Helen999888 wrote:

But why there is no options for us to decide where the MDX scripts will be deployed to?

Because It is deployed to the server and database that is specified in the deployment settings of your project. Which should be the same server that the cube was deployed to in the first place.

Helen999888 wrote:

And where can I find those deployed MDX scripts?

The MDX script is the calculation script that you find in the calculations tab of the cube designer. The deploy calculations feature pushes changes from your client machine up onto the server.

Helen999888 wrote:

(Assume I am right, to my understanding, with capability to deploy the calculated MDX scripts we are then able to reuse them?)

No, the MDX calculations are not persisted anywhere, the xmla alter commands are sent directly to the target server specified in the deployment settings for your project. The xmla command is targeted at a specific DatabaseID and CubeID and usually the calculations would be fairly specific to the structure of the cube.

The main advantage to using the deploy MDX script feature is that it is very quick if you know that all you have done is to make a change to the MDX script.

|||

Hi, Darren,

Thanks very much for your kind advices.

As you advised, all the point of using this feature is to quickly deploy changes of calculations to the analysis services database for the specific cube? Thanks a lot.

With best regards,

Yours sincerely,

Wednesday, March 21, 2012

Question on sqlmaint scripts

New to SQL Server.

I am looking at some legacy sqlmaint scripts.

If I don't see the switches

ReblIdx

or

UpdOptiStats

Does that mean that there are no database reorgs and no update system
catalog statistics being done?

The rebuild index switch is SQL Server speak for a reorg correct?

Thanks in advance.

GerryIf by "The rebuild index switch is SQL Server speak for a reorg correct?" you mean reorganinzing the data pages similiar to what a dbcc shrinkdatabase does then the answer is no.

The -ReblIdx switch refers to rebuilding indexes.

From BOL: -RebldIdx free_space

Specifies that indexes on tables in the target database should be rebuilt by using the free_space percent value as the inverse of the fill factor. For example, if free_space percentage is 30, then the fill factor used is 70. If a free_space percentage value of 100 is specified, then the indexes are rebuilt with the original fill factor value.

best regards|||I am trying to determine if any reorgs have been done. What flag/switch in the sqlmaint should I be looking for?

Question on sqlmaint scripts

New to SQL Server.
I am looking at some legacy sqlmaint scripts.
If I don't see the switches
ReblIdx
or
UpdOptiStats
Does that mean that there are no database reorgs and no update system
catalog statistics being done?
The rebuild index switch is SQL Server speak for a reorg correct?
Thanks in advance.
Gerry> Does that mean that there are no database reorgs and no update system
> catalog statistics being done?
The easiest way to find out is to run a Profiler trace.
But, if the switches aren't specified, then the operations will not be perfo
rmed. Btw, if you
rebuild the indexes, then there is no reason to also update statistics.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DataPro" <datapro01@.yahoo.com> wrote in message
news:1166124228.815216.74360@.n67g2000cwd.googlegroups.com...
> New to SQL Server.
> I am looking at some legacy sqlmaint scripts.
> If I don't see the switches
> ReblIdx
> or
> UpdOptiStats
>
> Does that mean that there are no database reorgs and no update system
> catalog statistics being done?
> The rebuild index switch is SQL Server speak for a reorg correct?
> Thanks in advance.
> Gerry
>

Question on sqlmaint scripts

New to SQL Server.
I am looking at some legacy sqlmaint scripts.
If I don't see the switches
ReblIdx
or
UpdOptiStats
Does that mean that there are no database reorgs and no update system
catalog statistics being done?
The rebuild index switch is SQL Server speak for a reorg correct?
Thanks in advance.
Gerry> Does that mean that there are no database reorgs and no update system
> catalog statistics being done?
The easiest way to find out is to run a Profiler trace.
But, if the switches aren't specified, then the operations will not be performed. Btw, if you
rebuild the indexes, then there is no reason to also update statistics.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DataPro" <datapro01@.yahoo.com> wrote in message
news:1166124228.815216.74360@.n67g2000cwd.googlegroups.com...
> New to SQL Server.
> I am looking at some legacy sqlmaint scripts.
> If I don't see the switches
> ReblIdx
> or
> UpdOptiStats
>
> Does that mean that there are no database reorgs and no update system
> catalog statistics being done?
> The rebuild index switch is SQL Server speak for a reorg correct?
> Thanks in advance.
> Gerry
>

Tuesday, March 20, 2012

question on recovery sql server 2000

Hi
I am using SQL 2000 std edition and hence using custom scripts to
restore the DB using standby file. I am backing up T-LOGs every 30 mins on
production and copying them on a network location which is accessible to
standby machine.
I run a job on standby machine which applies the transaction logs every 30
mins by checking in backmediaset & backupmediafamily tables of Production. DB
is running in read only and is working.
Question : In case my Production machine goes down and does not come up how
can I start the Standby "with data loss" if it has already appiled the last
T-logs generated on production.
Since Produciton (primary) is down I can not backup the last T-log.
Thanks
Mangesh
From BOL
This example sets up the MyNwind database on a standby server. The database
can be used in read-only mode between restore operations.
-- Restore the initial database backup on the standby server.
USE master
GO
RESTORE DATABASE MyNwind
FROM MyNwind_1
WITH STANDBY = 'c:\undo.ldf'
GO
-- Apply the first transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH STANDBY = 'c:\undo.ldf'
GO
-- Apply the next transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH STANDBY = 'c:\undo.ldf'
GO
-- Repeat for each transaction log backup created on the
-- primary server.
-- Time elapses.. .. ..
-- The primary server has failed. Back up the
-- active transaction log on the primary server.
BACKUP LOG MyNwind
TO MyNwind_log3
WITH NO_TRUNCATE
GO
-- Apply the final (active) transaction log backup
-- to the standby server. All preceding transaction
-- log backups must have been already applied.
RESTORE LOG MyNwind
FROM MyNwind_log3
WITH STANDBY = 'c:\undo.ldf'
GO
-- Recover the database on the standby server,
-- making it available for normal operations.
RESTORE DATABASE MyNwind
WITH RECOVERY
GO
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
> Hi
> I am using SQL 2000 std edition and hence using custom scripts to
> restore the DB using standby file. I am backing up T-LOGs every 30 mins on
> production and copying them on a network location which is accessible to
> standby machine.
> I run a job on standby machine which applies the transaction logs every 30
> mins by checking in backmediaset & backupmediafamily tables of Production.
DB
> is running in read only and is working.
> Question : In case my Production machine goes down and does not come up
how
> can I start the Standby "with data loss" if it has already appiled the
last
> T-logs generated on production.
> Since Produciton (primary) is down I can not backup the last T-log.
> Thanks
> Mangesh
>
|||So you are continuously doing RESTORE WITH STANDBY? And you now wand to make the database fully
accessible? If so:
RESTORE DATABASE dbname WITH RECOVERY
No actual restore is performed, only the recovery work to get it out of standby mode.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in message
news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
> Hi
> I am using SQL 2000 std edition and hence using custom scripts to
> restore the DB using standby file. I am backing up T-LOGs every 30 mins on
> production and copying them on a network location which is accessible to
> standby machine.
> I run a job on standby machine which applies the transaction logs every 30
> mins by checking in backmediaset & backupmediafamily tables of Production. DB
> is running in read only and is working.
> Question : In case my Production machine goes down and does not come up how
> can I start the Standby "with data loss" if it has already appiled the last
> T-logs generated on production.
> Since Produciton (primary) is down I can not backup the last T-log.
> Thanks
> Mangesh
>
|||Yes. I am doing a continuous restoration of my standby database using standby
file.
Thanks for help.
"Tibor Karaszi" wrote:

> So you are continuously doing RESTORE WITH STANDBY? And you now wand to make the database fully
> accessible? If so:
> RESTORE DATABASE dbname WITH RECOVERY
> No actual restore is performed, only the recovery work to get it out of standby mode.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in message
> news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
>
>

question on recovery sql server 2000

Hi
I am using SQL 2000 std edition and hence using custom scripts to
restore the DB using standby file. I am backing up T-LOGs every 30 mins on
production and copying them on a network location which is accessible to
standby machine.
I run a job on standby machine which applies the transaction logs every 30
mins by checking in backmediaset & backupmediafamily tables of Production. D
B
is running in read only and is working.
Question : In case my Production machine goes down and does not come up how
can I start the Standby "with data loss" if it has already appiled the last
T-logs generated on production.
Since Produciton (primary) is down I can not backup the last T-log.
Thanks
MangeshFrom BOL
This example sets up the MyNwind database on a standby server. The database
can be used in read-only mode between restore operations.
-- Restore the initial database backup on the standby server.
USE master
GO
RESTORE DATABASE MyNwind
FROM MyNwind_1
WITH STANDBY = 'c:\undo.ldf'
GO
-- Apply the first transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH STANDBY = 'c:\undo.ldf'
GO
-- Apply the next transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH STANDBY = 'c:\undo.ldf'
GO
-- Repeat for each transaction log backup created on the
-- primary server.
--
-- Time elapses.. .. ..
--
-- The primary server has failed. Back up the
-- active transaction log on the primary server.
BACKUP LOG MyNwind
TO MyNwind_log3
WITH NO_TRUNCATE
GO
-- Apply the final (active) transaction log backup
-- to the standby server. All preceding transaction
-- log backups must have been already applied.
RESTORE LOG MyNwind
FROM MyNwind_log3
WITH STANDBY = 'c:\undo.ldf'
GO
-- Recover the database on the standby server,
-- making it available for normal operations.
RESTORE DATABASE MyNwind
WITH RECOVERY
GO
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
> Hi
> I am using SQL 2000 std edition and hence using custom scripts to
> restore the DB using standby file. I am backing up T-LOGs every 30 mins on
> production and copying them on a network location which is accessible to
> standby machine.
> I run a job on standby machine which applies the transaction logs every 30
> mins by checking in backmediaset & backupmediafamily tables of Production.
DB
> is running in read only and is working.
> Question : In case my Production machine goes down and does not come up
how
> can I start the Standby "with data loss" if it has already appiled the
last
> T-logs generated on production.
> Since Produciton (primary) is down I can not backup the last T-log.
> Thanks
> Mangesh
>|||So you are continuously doing RESTORE WITH STANDBY? And you now wand to make
the database fully
accessible? If so:
RESTORE DATABASE dbname WITH RECOVERY
No actual restore is performed, only the recovery work to get it out of stan
dby mode.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in me
ssage
news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
> Hi
> I am using SQL 2000 std edition and hence using custom scripts to
> restore the DB using standby file. I am backing up T-LOGs every 30 mins on
> production and copying them on a network location which is accessible to
> standby machine.
> I run a job on standby machine which applies the transaction logs every 30
> mins by checking in backmediaset & backupmediafamily tables of Production.
DB
> is running in read only and is working.
> Question : In case my Production machine goes down and does not come up h
ow
> can I start the Standby "with data loss" if it has already appiled the las
t
> T-logs generated on production.
> Since Produciton (primary) is down I can not backup the last T-log.
> Thanks
> Mangesh
>|||Yes. I am doing a continuous restoration of my standby database using standb
y
file.
Thanks for help.
"Tibor Karaszi" wrote:

> So you are continuously doing RESTORE WITH STANDBY? And you now wand to ma
ke the database fully
> accessible? If so:
> RESTORE DATABASE dbname WITH RECOVERY
> No actual restore is performed, only the recovery work to get it out of st
andby mode.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message
> news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
>
>

question on recovery sql server 2000

Hi
I am using SQL 2000 std edition and hence using custom scripts to
restore the DB using standby file. I am backing up T-LOGs every 30 mins on
production and copying them on a network location which is accessible to
standby machine.
I run a job on standby machine which applies the transaction logs every 30
mins by checking in backmediaset & backupmediafamily tables of Production. DB
is running in read only and is working.
Question : In case my Production machine goes down and does not come up how
can I start the Standby "with data loss" if it has already appiled the last
T-logs generated on production.
Since Produciton (primary) is down I can not backup the last T-log.
Thanks
MangeshFrom BOL
This example sets up the MyNwind database on a standby server. The database
can be used in read-only mode between restore operations.
-- Restore the initial database backup on the standby server.
USE master
GO
RESTORE DATABASE MyNwind
FROM MyNwind_1
WITH STANDBY = 'c:\undo.ldf'
GO
-- Apply the first transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH STANDBY = 'c:\undo.ldf'
GO
-- Apply the next transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH STANDBY = 'c:\undo.ldf'
GO
-- Repeat for each transaction log backup created on the
-- primary server.
--
-- Time elapses.. .. ..
--
-- The primary server has failed. Back up the
-- active transaction log on the primary server.
BACKUP LOG MyNwind
TO MyNwind_log3
WITH NO_TRUNCATE
GO
-- Apply the final (active) transaction log backup
-- to the standby server. All preceding transaction
-- log backups must have been already applied.
RESTORE LOG MyNwind
FROM MyNwind_log3
WITH STANDBY = 'c:\undo.ldf'
GO
-- Recover the database on the standby server,
-- making it available for normal operations.
RESTORE DATABASE MyNwind
WITH RECOVERY
GO
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
> Hi
> I am using SQL 2000 std edition and hence using custom scripts to
> restore the DB using standby file. I am backing up T-LOGs every 30 mins on
> production and copying them on a network location which is accessible to
> standby machine.
> I run a job on standby machine which applies the transaction logs every 30
> mins by checking in backmediaset & backupmediafamily tables of Production.
DB
> is running in read only and is working.
> Question : In case my Production machine goes down and does not come up
how
> can I start the Standby "with data loss" if it has already appiled the
last
> T-logs generated on production.
> Since Produciton (primary) is down I can not backup the last T-log.
> Thanks
> Mangesh
>|||So you are continuously doing RESTORE WITH STANDBY? And you now wand to make the database fully
accessible? If so:
RESTORE DATABASE dbname WITH RECOVERY
No actual restore is performed, only the recovery work to get it out of standby mode.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in message
news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
> Hi
> I am using SQL 2000 std edition and hence using custom scripts to
> restore the DB using standby file. I am backing up T-LOGs every 30 mins on
> production and copying them on a network location which is accessible to
> standby machine.
> I run a job on standby machine which applies the transaction logs every 30
> mins by checking in backmediaset & backupmediafamily tables of Production. DB
> is running in read only and is working.
> Question : In case my Production machine goes down and does not come up how
> can I start the Standby "with data loss" if it has already appiled the last
> T-logs generated on production.
> Since Produciton (primary) is down I can not backup the last T-log.
> Thanks
> Mangesh
>|||Yes. I am doing a continuous restoration of my standby database using standby
file.
Thanks for help.
"Tibor Karaszi" wrote:
> So you are continuously doing RESTORE WITH STANDBY? And you now wand to make the database fully
> accessible? If so:
> RESTORE DATABASE dbname WITH RECOVERY
> No actual restore is performed, only the recovery work to get it out of standby mode.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in message
> news:72D84926-67E3-4A3F-A011-E5F5A6ACA8CC@.microsoft.com...
> > Hi
> >
> > I am using SQL 2000 std edition and hence using custom scripts to
> > restore the DB using standby file. I am backing up T-LOGs every 30 mins on
> > production and copying them on a network location which is accessible to
> > standby machine.
> >
> > I run a job on standby machine which applies the transaction logs every 30
> > mins by checking in backmediaset & backupmediafamily tables of Production. DB
> > is running in read only and is working.
> >
> > Question : In case my Production machine goes down and does not come up how
> > can I start the Standby "with data loss" if it has already appiled the last
> > T-logs generated on production.
> > Since Produciton (primary) is down I can not backup the last T-log.
> >
> > Thanks
> > Mangesh
> >
> >
>
>

Wednesday, March 7, 2012

Question on generating SQL scripts using Enterprise Manager

Hi,

I was using enterprise manager to generate a script for my DB. I
scripted only my tables and views and in Options I picked all the
options EXCEPT "script Primary Keys, Foreign Keys and Constraits " (
which I was going to script seperately ). I noticed that the the
generated file still had all FKs and PKs scripted. When I additionally
unchecked the "script Full-Text indexes" option, it worked as expected.
Any idea why the full-text option causes all constraints to be
scripted. Using SQL server 2000.

Thanksdrdeadpan (vkat01-nospam@.yahoo.com) writes:
> I was using enterprise manager to generate a script for my DB. I
> scripted only my tables and views and in Options I picked all the
> options EXCEPT "script Primary Keys, Foreign Keys and Constraits " (
> which I was going to script seperately ). I noticed that the the
> generated file still had all FKs and PKs scripted. When I additionally
> unchecked the "script Full-Text indexes" option, it worked as expected.
> Any idea why the full-text option causes all constraints to be
> scripted. Using SQL server 2000.

Sounds like a bug.

It would be interesting to see a repro. That is a complete database script
with at most three tables with all these features, and when scripted in
EM displays all these problems. I doubt that the bug will ever be fixed
in Enterprise Manager, but since I'm on the SQL 2005 beta, I would like
to test if the problem is there as well.

By the way, did your tables actually have any full-text indexes?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks Erland for your response.

No, we have NO full text indexes defined. Our tables have a rather
large number of columns so rather than pasting the script here ,I
tested it again. This time I picked 3 tables to be scripted with the
following options.

Script Database
Script database users and database roles
Script object-level permissions
Script indexes
Script full-text indexes.

The above options once again scripted all PKs and FKs even though it
was not requested.

I reran the script without the full-text scripting option and it works
fine i.e no Pks and FKs. SO, I guess it is prefectly reproducable on
Sql Server 2000. I just wanted to make sure I was'nt seeing things.
Great website BTW.

DrD|||drdeadpan (vkat01-nospam@.yahoo.com) writes:
> No, we have NO full text indexes defined. Our tables have a rather
> large number of columns so rather than pasting the script here ,I
> tested it again. This time I picked 3 tables to be scripted with the
> following options.
> Script Database
> Script database users and database roles
> Script object-level permissions
> Script indexes
> Script full-text indexes.
> The above options once again scripted all PKs and FKs even though it
> was not requested.

You don't have to post your actual tables. It's enough to post a few
tables for which the problem appears.

Anyway, I was able to reproduce the problem in SQL 2000, but when I did
a quick test in SQL 2005, no constraints were brought it.

As I mentioned earlier, the likelyhood that this will be fixed in SQL2000
is about nil.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Question on generating SQL scripts using Enterprise Manager

Hi,

I was using enterprise manager to generate a script for my DB. I
scripted selected my tables and views and in Options I picked all the
options. I noticed that the
generated file does not include FKs, EXTs or PKs scripted.
Any idea why the full-text options are not scripting the constraints?
Using SQL server 2000.

Thanks(chawes40@.yahoo.com) writes:
> I was using enterprise manager to generate a script for my DB. I
> scripted selected my tables and views and in Options I picked all the
> options. I noticed that the
> generated file does not include FKs, EXTs or PKs scripted.
> Any idea why the full-text options are not scripting the constraints?
> Using SQL server 2000.

Did the database actually have any full-text indexes? I tried to reproduce
the problem according your description, and my script included PKs and
FKs. But I don't even have full-text installed on my machine.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Question on db maintenance scripts

Relatively new to SQL Server, running both 2000 and 2005.

I have to set up database maintenance scripts, db and log backups, optimizations etc in batch files so that they can be run by an external scheduler.

When I produce a script from the SQL Server database maintenance wizards and save it off in a bat file, the script will not work when run manually, probably due to the difference in syntax.

I have some examples of backup scripts using sqlmaint.exe, but can't find anything on how to script optimization/reorg jobs so that they can be run by an external scheduler.

Can anybody point me to any docs or guidance on how to produce backup and reorg scripts that can be run externally?

Thanks in advance.
GerryIt sounds like you want to use the osql utility. Go to BOL and look it up uner the index tab. When you double-click on the index utility, chose the "osql utility" under the Command Pronpt Utilities.

Question on db maintenance scripts

Relatively new to SQL Server, running both 2000 and 2005.
I have to set up database maintenance scripts, db and log backups,
optimizations etc in batch files so that they can be run by an external
scheduler.
When I produce a script from the SQL Server database maintenance
wizards and save it off in a bat file, the script will not work when
run manually, probably due to the difference in syntax.
I have some examples of backup scripts using sqlmaint.exe, but can't
find anything on how to script optimization/reorg jobs so that they can
be run by an external scheduler.
Can anybody point me to any docs or guidance on this?
Thanks in advance.
Gerry
Tibor:
Thanks for the advice. I will do that.
On 2005 we have a scheduler (Control M) running business processing
jobs outside of SQL Server and I will have to schedule jobs that are
dependent on these jobs finishing.
How would you approach a db maintenance job that was job dependent?
Tibor Karaszi wrote:
> I suggest you skip the scripting part and read up on sqlmaint.exe. So instead of calling
> xp_sqlmaint, which in turn call sqlmaint.exe, you call sqlmaint.exe directly. this gives you much
> better control and options.
> 2005 is another story, where a maint plan is an SSIS job, but you can just let the Wizard and
> designer create package for you and schedule a job using DTEXEC.EXE to execute that package.
>
|||Tibor:
I have to empty certain tables every evening. and that emptying task is
dependent on another job finishing.
I'm thinking an sql statement...but with something like this is
sqlmaint.exe used or should I be looking at osql utility or something
else.
Thanks in advance
Gerry
Tibor Karaszi wrote:[vbcol=seagreen]
>
> Not sure I understand your question, as Control M apparently already has that feature. Can you
> elaborate?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "DataPro" <datapro01@.yahoo.com> wrote in message
> news:1164735316.116658.270460@.j44g2000cwa.googlegr oups.com...
|||Tibor Karaszi wrote:
> Yes, you can use OSQL.EXE with either an input file or specify the TUNCATE TABLE or DELETE command
> using the /Q switch for OSQL.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
Thanks much

Saturday, February 25, 2012

Question on db maintenance scripts

Relatively new to SQL Server, running both 2000 and 2005.
I have to set up database maintenance scripts, db and log backups,
optimizations etc in batch files so that they can be run by an external
scheduler.
When I produce a script from the SQL Server database maintenance
wizards and save it off in a bat file, the script will not work when
run manually, probably due to the difference in syntax.
I have some examples of backup scripts using sqlmaint.exe, but can't
find anything on how to script optimization/reorg jobs so that they can
be run by an external scheduler.
Can anybody point me to any docs or guidance on this?
Thanks in advance.
GerryI suggest you skip the scripting part and read up on sqlmaint.exe. So instea
d of calling
xp_sqlmaint, which in turn call sqlmaint.exe, you call sqlmaint.exe directly
. this gives you much
better control and options.
2005 is another story, where a maint plan is an SSIS job, but you can just l
et the Wizard and
designer create package for you and schedule a job using DTEXEC.EXE to execu
te that package.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DataPro" <datapro01@.yahoo.com> wrote in message
news:1164723926.064627.125300@.l12g2000cwl.googlegroups.com...
> Relatively new to SQL Server, running both 2000 and 2005.
> I have to set up database maintenance scripts, db and log backups,
> optimizations etc in batch files so that they can be run by an external
> scheduler.
> When I produce a script from the SQL Server database maintenance
> wizards and save it off in a bat file, the script will not work when
> run manually, probably due to the difference in syntax.
> I have some examples of backup scripts using sqlmaint.exe, but can't
> find anything on how to script optimization/reorg jobs so that they can
> be run by an external scheduler.
> Can anybody point me to any docs or guidance on this?
> Thanks in advance.
> Gerry
>|||Tibor:
Thanks for the advice. I will do that.
On 2005 we have a scheduler (Control M) running business processing
jobs outside of SQL Server and I will have to schedule jobs that are
dependent on these jobs finishing.
How would you approach a db maintenance job that was job dependent?
Tibor Karaszi wrote:
> I suggest you skip the scripting part and read up on sqlmaint.exe. So inst
ead of calling
> xp_sqlmaint, which in turn call sqlmaint.exe, you call sqlmaint.exe direct
ly. this gives you much
> better control and options.
> 2005 is another story, where a maint plan is an SSIS job, but you can just
let the Wizard and
> designer create package for you and schedule a job using DTEXEC.EXE to exe
cute that package.
>|||> How would you approach a db maintenance job that was job dependent?
Not sure I understand your question, as Control M apparently already has tha
t feature. Can you
elaborate?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DataPro" <datapro01@.yahoo.com> wrote in message
news:1164735316.116658.270460@.j44g2000cwa.googlegroups.com...
> Tibor:
> Thanks for the advice. I will do that.
> On 2005 we have a scheduler (Control M) running business processing
> jobs outside of SQL Server and I will have to schedule jobs that are
> dependent on these jobs finishing.
> How would you approach a db maintenance job that was job dependent?
>
> Tibor Karaszi wrote:
>|||Tibor:
I have to empty certain tables every evening. and that emptying task is
dependent on another job finishing.
I'm thinking an sql statement...but with something like this is
sqlmaint.exe used or should I be looking at osql utility or something
else.
Thanks in advance
Gerry
Tibor Karaszi wrote:[vbcol=seagreen]
>
> Not sure I understand your question, as Control M apparently already has t
hat feature. Can you
> elaborate?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "DataPro" <datapro01@.yahoo.com> wrote in message
> news:1164735316.116658.270460@.j44g2000cwa.googlegroups.com...|||Yes, you can use OSQL.EXE with either an input file or specify the TUNCATE T
ABLE or DELETE command
using the /Q switch for OSQL.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DataPro" <datapro01@.yahoo.com> wrote in message
news:1164801015.266092.235400@.l12g2000cwl.googlegroups.com...
> Tibor:
>
> I have to empty certain tables every evening. and that emptying task is
> dependent on another job finishing.
> I'm thinking an sql statement...but with something like this is
> sqlmaint.exe used or should I be looking at osql utility or something
> else.
> Thanks in advance
> Gerry
>
> Tibor Karaszi wrote:
>|||Tibor Karaszi wrote:
> Yes, you can use OSQL.EXE with either an input file or specify the TUNCATE
TABLE or DELETE command
> using the /Q switch for OSQL.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
Thanks much

Question on db maintenance scripts

Relatively new to SQL Server, running both 2000 and 2005.
I have to set up database maintenance scripts, db and log backups,
optimizations etc in batch files so that they can be run by an external
scheduler.
When I produce a script from the SQL Server database maintenance
wizards and save it off in a bat file, the script will not work when
run manually, probably due to the difference in syntax.
I have some examples of backup scripts using sqlmaint.exe, but can't
find anything on how to script optimization/reorg jobs so that they can
be run by an external scheduler.
Can anybody point me to any docs or guidance on this?
Thanks in advance.
GerryI suggest you skip the scripting part and read up on sqlmaint.exe. So instead of calling
xp_sqlmaint, which in turn call sqlmaint.exe, you call sqlmaint.exe directly. this gives you much
better control and options.
2005 is another story, where a maint plan is an SSIS job, but you can just let the Wizard and
designer create package for you and schedule a job using DTEXEC.EXE to execute that package.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DataPro" <datapro01@.yahoo.com> wrote in message
news:1164723926.064627.125300@.l12g2000cwl.googlegroups.com...
> Relatively new to SQL Server, running both 2000 and 2005.
> I have to set up database maintenance scripts, db and log backups,
> optimizations etc in batch files so that they can be run by an external
> scheduler.
> When I produce a script from the SQL Server database maintenance
> wizards and save it off in a bat file, the script will not work when
> run manually, probably due to the difference in syntax.
> I have some examples of backup scripts using sqlmaint.exe, but can't
> find anything on how to script optimization/reorg jobs so that they can
> be run by an external scheduler.
> Can anybody point me to any docs or guidance on this?
> Thanks in advance.
> Gerry
>|||Tibor:
Thanks for the advice. I will do that.
On 2005 we have a scheduler (Control M) running business processing
jobs outside of SQL Server and I will have to schedule jobs that are
dependent on these jobs finishing.
How would you approach a db maintenance job that was job dependent?
Tibor Karaszi wrote:
> I suggest you skip the scripting part and read up on sqlmaint.exe. So instead of calling
> xp_sqlmaint, which in turn call sqlmaint.exe, you call sqlmaint.exe directly. this gives you much
> better control and options.
> 2005 is another story, where a maint plan is an SSIS job, but you can just let the Wizard and
> designer create package for you and schedule a job using DTEXEC.EXE to execute that package.
>|||> How would you approach a db maintenance job that was job dependent?
Not sure I understand your question, as Control M apparently already has that feature. Can you
elaborate?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DataPro" <datapro01@.yahoo.com> wrote in message
news:1164735316.116658.270460@.j44g2000cwa.googlegroups.com...
> Tibor:
> Thanks for the advice. I will do that.
> On 2005 we have a scheduler (Control M) running business processing
> jobs outside of SQL Server and I will have to schedule jobs that are
> dependent on these jobs finishing.
> How would you approach a db maintenance job that was job dependent?
>
> Tibor Karaszi wrote:
>> I suggest you skip the scripting part and read up on sqlmaint.exe. So instead of calling
>> xp_sqlmaint, which in turn call sqlmaint.exe, you call sqlmaint.exe directly. this gives you much
>> better control and options.
>> 2005 is another story, where a maint plan is an SSIS job, but you can just let the Wizard and
>> designer create package for you and schedule a job using DTEXEC.EXE to execute that package.
>>
>|||Tibor:
I have to empty certain tables every evening. and that emptying task is
dependent on another job finishing.
I'm thinking an sql statement...but with something like this is
sqlmaint.exe used or should I be looking at osql utility or something
else.
Thanks in advance
Gerry
Tibor Karaszi wrote:
> > How would you approach a db maintenance job that was job dependent?
>
> Not sure I understand your question, as Control M apparently already has that feature. Can you
> elaborate?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "DataPro" <datapro01@.yahoo.com> wrote in message
> news:1164735316.116658.270460@.j44g2000cwa.googlegroups.com...
> > Tibor:
> >
> > Thanks for the advice. I will do that.
> >
> > On 2005 we have a scheduler (Control M) running business processing
> > jobs outside of SQL Server and I will have to schedule jobs that are
> > dependent on these jobs finishing.
> >
> > How would you approach a db maintenance job that was job dependent?
> >
> >
> > Tibor Karaszi wrote:
> >> I suggest you skip the scripting part and read up on sqlmaint.exe. So instead of calling
> >> xp_sqlmaint, which in turn call sqlmaint.exe, you call sqlmaint.exe directly. this gives you much
> >> better control and options.
> >>
> >> 2005 is another story, where a maint plan is an SSIS job, but you can just let the Wizard and
> >> designer create package for you and schedule a job using DTEXEC.EXE to execute that package.
> >>
> >>
> >|||Yes, you can use OSQL.EXE with either an input file or specify the TUNCATE TABLE or DELETE command
using the /Q switch for OSQL.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DataPro" <datapro01@.yahoo.com> wrote in message
news:1164801015.266092.235400@.l12g2000cwl.googlegroups.com...
> Tibor:
>
> I have to empty certain tables every evening. and that emptying task is
> dependent on another job finishing.
> I'm thinking an sql statement...but with something like this is
> sqlmaint.exe used or should I be looking at osql utility or something
> else.
> Thanks in advance
> Gerry
>
> Tibor Karaszi wrote:
>> > How would you approach a db maintenance job that was job dependent?
>>
>> Not sure I understand your question, as Control M apparently already has that feature. Can you
>> elaborate?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "DataPro" <datapro01@.yahoo.com> wrote in message
>> news:1164735316.116658.270460@.j44g2000cwa.googlegroups.com...
>> > Tibor:
>> >
>> > Thanks for the advice. I will do that.
>> >
>> > On 2005 we have a scheduler (Control M) running business processing
>> > jobs outside of SQL Server and I will have to schedule jobs that are
>> > dependent on these jobs finishing.
>> >
>> > How would you approach a db maintenance job that was job dependent?
>> >
>> >
>> > Tibor Karaszi wrote:
>> >> I suggest you skip the scripting part and read up on sqlmaint.exe. So instead of calling
>> >> xp_sqlmaint, which in turn call sqlmaint.exe, you call sqlmaint.exe directly. this gives you
>> >> much
>> >> better control and options.
>> >>
>> >> 2005 is another story, where a maint plan is an SSIS job, but you can just let the Wizard and
>> >> designer create package for you and schedule a job using DTEXEC.EXE to execute that package.
>> >>
>> >>
>> >
>|||Tibor Karaszi wrote:
> Yes, you can use OSQL.EXE with either an input file or specify the TUNCATE TABLE or DELETE command
> using the /Q switch for OSQL.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
Thanks much