Showing posts with label transfer. Show all posts
Showing posts with label transfer. Show all posts

Tuesday, March 27, 2012

automating a database restoration

Is there anyway to automate a daily database restoration?
In short i'm looking to transfer a copy of a database from one site's server
to a 2nd sites each day.
Due to bandwidth limitaions on the link between sites, i cannot do this from
enterprise manager.
What i'm looking to do is to backup site #1's server each night, run a
scheduled task to rar up the database ( to reduce it's size) then run a
script to copy it to site #2.
I'm trying to find out if it's possible from within SQL to schedule a
restoration each day from the transfered & unrar'ed backup from site #1.
Any ideas if this is possible
TIA
Fred
1) Log shipping (database on the targer site is read-only)
2) Replicatiion (Snapshot) very easy to perform
3) Write a SP to restore given .BAK file on the target server, make sure
that old db on the target will be deleted first.
"Fred Bloggs" <fredb@.hotmailp.com> wrote in message
news:8805F959-42CF-48FC-85B3-5CB4931D8BD6@.microsoft.com...
> Is there anyway to automate a daily database restoration?
> In short i'm looking to transfer a copy of a database from one site's
> server to a 2nd sites each day.
> Due to bandwidth limitaions on the link between sites, i cannot do this
> from enterprise manager.
> What i'm looking to do is to backup site #1's server each night, run a
> scheduled task to rar up the database ( to reduce it's size) then run a
> script to copy it to site #2.
> I'm trying to find out if it's possible from within SQL to schedule a
> restoration each day from the transfered & unrar'ed backup from site #1.
> Any ideas if this is possible
> TIA
|||You also will use automated task of the operating system to create a shared
resource, and copy the backup from site #1 to Site #2. And then with sql
server create a job to restore a database from site#2
Regards,
"Zarko Jovanovic" wrote:

> Fred Bloggs wrote:
> it is possible. one idea:
> - make a shared folder on site B
> - make an account that will be used to access folder
> - set permissions on a share and on a folder to write
> - make a job on site A to:
> - backup
> - rar (using xp_cmdshell)
> - net use (xp_cmdshell) the share using the account
> - copy to share (xp_cmdshell)
> - net use /delete (xp_cmdshell)
> - make a job on site B to:
> - unRAR (xp_cmdshell)
> - restore
> schedule job on site B to appropriate time so you're sure job on site A
> is finished! or better use waitfor (search for "waitfor" on google) to
> signal job to start
>
sql

automating a database restoration

Is there anyway to automate a daily database restoration?
In short i'm looking to transfer a copy of a database from one site's server
to a 2nd sites each day.
Due to bandwidth limitaions on the link between sites, i cannot do this from
enterprise manager.
What i'm looking to do is to backup site #1's server each night, run a
scheduled task to rar up the database ( to reduce it's size) then run a
script to copy it to site #2.
I'm trying to find out if it's possible from within SQL to schedule a
restoration each day from the transfered & unrar'ed backup from site #1.
Any ideas if this is possible
TIAFred
1) Log shipping (database on the targer site is read-only)
2) Replicatiion (Snapshot) very easy to perform
3) Write a SP to restore given .BAK file on the target server, make sure
that old db on the target will be deleted first.
"Fred Bloggs" <fredb@.hotmailp.com> wrote in message
news:8805F959-42CF-48FC-85B3-5CB4931D8BD6@.microsoft.com...
> Is there anyway to automate a daily database restoration?
> In short i'm looking to transfer a copy of a database from one site's
> server to a 2nd sites each day.
> Due to bandwidth limitaions on the link between sites, i cannot do this
> from enterprise manager.
> What i'm looking to do is to backup site #1's server each night, run a
> scheduled task to rar up the database ( to reduce it's size) then run a
> script to copy it to site #2.
> I'm trying to find out if it's possible from within SQL to schedule a
> restoration each day from the transfered & unrar'ed backup from site #1.
> Any ideas if this is possible
> TIA|||Fred Bloggs wrote:
> Is there anyway to automate a daily database restoration?
> In short i'm looking to transfer a copy of a database from one site's
> server to a 2nd sites each day.
> Due to bandwidth limitaions on the link between sites, i cannot do this
> from enterprise manager.
> What i'm looking to do is to backup site #1's server each night, run a
> scheduled task to rar up the database ( to reduce it's size) then run a
> script to copy it to site #2.
> I'm trying to find out if it's possible from within SQL to schedule a
> restoration each day from the transfered & unrar'ed backup from site #1.
> Any ideas if this is possible
> TIA
it is possible. one idea:
- make a shared folder on site B
- make an account that will be used to access folder
- set permissions on a share and on a folder to write
- make a job on site A to:
- backup
- rar (using xp_cmdshell)
- net use (xp_cmdshell) the share using the account
- copy to share (xp_cmdshell)
- net use /delete (xp_cmdshell)
- make a job on site B to:
- unRAR (xp_cmdshell)
- restore
schedule job on site B to appropriate time so you're sure job on site A
is finished! or better use waitfor (search for "waitfor" on google) to
signal job to start|||You also will use automated task of the operating system to create a shared
resource, and copy the backup from site #1 to Site #2. And then with sql
server create a job to restore a database from site#2
Regards,
"Zarko Jovanovic" wrote:
> Fred Bloggs wrote:
> > Is there anyway to automate a daily database restoration?
> > In short i'm looking to transfer a copy of a database from one site's
> > server to a 2nd sites each day.
> >
> > Due to bandwidth limitaions on the link between sites, i cannot do this
> > from enterprise manager.
> > What i'm looking to do is to backup site #1's server each night, run a
> > scheduled task to rar up the database ( to reduce it's size) then run a
> > script to copy it to site #2.
> >
> > I'm trying to find out if it's possible from within SQL to schedule a
> > restoration each day from the transfered & unrar'ed backup from site #1.
> >
> > Any ideas if this is possible
> >
> > TIA
> it is possible. one idea:
> - make a shared folder on site B
> - make an account that will be used to access folder
> - set permissions on a share and on a folder to write
> - make a job on site A to:
> - backup
> - rar (using xp_cmdshell)
> - net use (xp_cmdshell) the share using the account
> - copy to share (xp_cmdshell)
> - net use /delete (xp_cmdshell)
> - make a job on site B to:
> - unRAR (xp_cmdshell)
> - restore
> schedule job on site B to appropriate time so you're sure job on site A
> is finished! or better use waitfor (search for "waitfor" on google) to
> signal job to start
>

Automatically Transfer logins/users to a script file

For DR purposes, I need to have a job that automatically scripts out the
creation of the logins and users for a database.
Looked at using sp_helprevlogin, but that is for different versions of SQL.
Looked at SCPTXFR to script out MASTER, but it is not including the logins,
only users.
Anyone have any ideas?
Hi
"Kristen" wrote:

> For DR purposes, I need to have a job that automatically scripts out the
> creation of the logins and users for a database.
> Looked at using sp_helprevlogin, but that is for different versions of SQL.
> Looked at SCPTXFR to script out MASTER, but it is not including the logins,
> only users.
> Anyone have any ideas?
Have you looked at DMO and the logins collection?
John
|||No....I will look into that. Thanks!
"John Bell" wrote:

> Hi
> "Kristen" wrote:
>
> Have you looked at DMO and the logins collection?
> John
|||Can you think of another way that does not entail alot of programming?
"John Bell" wrote:

> Hi
> "Kristen" wrote:
>
> Have you looked at DMO and the logins collection?
> John
|||Hi
"Kristen" wrote:

> Can you think of another way that does not entail alot of programming?
>
I would expect the DMO to take less then 12 lines of code!
I don't reallty see why you have an issue with sp_help_rev_login, it will
reside in the master database and have the same interface regardless of SQL
Server version!
Why not just backup the system databases?
John
|||> I would expect the DMO to take less then 12 lines of code!
I'm not certain how well DMO handles SID number and password, so make sure you verify this. Based on
for what purpose you want this script, it might be very important for the logins to have the same
SID and pwd as in the originating SQL Server, so make sure you check that DMO does it the right way.
This is, btw, the beauty of using sp_help_revlogin.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:8B6C82C3-6A1E-4EE0-B6FF-B5385176DA9F@.microsoft.com...
> Hi
> "Kristen" wrote:
>
> I would expect the DMO to take less then 12 lines of code!
> I don't reallty see why you have an issue with sp_help_rev_login, it will
> reside in the master database and have the same interface regardless of SQL
> Server version!
> Why not just backup the system databases?
> John
>

Automatically Transfer logins/users to a script file

For DR purposes, I need to have a job that automatically scripts out the
creation of the logins and users for a database.
Looked at using sp_helprevlogin, but that is for different versions of SQL.
Looked at SCPTXFR to script out MASTER, but it is not including the logins,
only users.
Anyone have any ideas?Hi
"Kristen" wrote:
> For DR purposes, I need to have a job that automatically scripts out the
> creation of the logins and users for a database.
> Looked at using sp_helprevlogin, but that is for different versions of SQL.
> Looked at SCPTXFR to script out MASTER, but it is not including the logins,
> only users.
> Anyone have any ideas?
Have you looked at DMO and the logins collection?
John|||No....I will look into that. Thanks!
"John Bell" wrote:
> Hi
> "Kristen" wrote:
> > For DR purposes, I need to have a job that automatically scripts out the
> > creation of the logins and users for a database.
> > Looked at using sp_helprevlogin, but that is for different versions of SQL.
> > Looked at SCPTXFR to script out MASTER, but it is not including the logins,
> > only users.
> > Anyone have any ideas?
> Have you looked at DMO and the logins collection?
> John|||Can you think of another way that does not entail alot of programming?
"John Bell" wrote:
> Hi
> "Kristen" wrote:
> > For DR purposes, I need to have a job that automatically scripts out the
> > creation of the logins and users for a database.
> > Looked at using sp_helprevlogin, but that is for different versions of SQL.
> > Looked at SCPTXFR to script out MASTER, but it is not including the logins,
> > only users.
> > Anyone have any ideas?
> Have you looked at DMO and the logins collection?
> John|||Hi
"Kristen" wrote:
> Can you think of another way that does not entail alot of programming?
>
I would expect the DMO to take less then 12 lines of code!
I don't reallty see why you have an issue with sp_help_rev_login, it will
reside in the master database and have the same interface regardless of SQL
Server version!
Why not just backup the system databases?
John|||> I would expect the DMO to take less then 12 lines of code!
I'm not certain how well DMO handles SID number and password, so make sure you verify this. Based on
for what purpose you want this script, it might be very important for the logins to have the same
SID and pwd as in the originating SQL Server, so make sure you check that DMO does it the right way.
This is, btw, the beauty of using sp_help_revlogin.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:8B6C82C3-6A1E-4EE0-B6FF-B5385176DA9F@.microsoft.com...
> Hi
> "Kristen" wrote:
>> Can you think of another way that does not entail alot of programming?
> I would expect the DMO to take less then 12 lines of code!
> I don't reallty see why you have an issue with sp_help_rev_login, it will
> reside in the master database and have the same interface regardless of SQL
> Server version!
> Why not just backup the system databases?
> John
>

Automatically Transfer logins/users to a script file

For DR purposes, I need to have a job that automatically scripts out the
creation of the logins and users for a database.
Looked at using sp_helprevlogin, but that is for different versions of SQL.
Looked at SCPTXFR to script out MASTER, but it is not including the logins,
only users.
Anyone have any ideas?Hi
"Kristen" wrote:

> For DR purposes, I need to have a job that automatically scripts out the
> creation of the logins and users for a database.
> Looked at using sp_helprevlogin, but that is for different versions of SQL
.
> Looked at SCPTXFR to script out MASTER, but it is not including the logins
,
> only users.
> Anyone have any ideas?
Have you looked at DMO and the logins collection?
John|||No....I will look into that. Thanks!
"John Bell" wrote:

> Hi
> "Kristen" wrote:
>
> Have you looked at DMO and the logins collection?
> John|||Can you think of another way that does not entail alot of programming?
"John Bell" wrote:

> Hi
> "Kristen" wrote:
>
> Have you looked at DMO and the logins collection?
> John|||Hi
"Kristen" wrote:

> Can you think of another way that does not entail alot of programming?
>
I would expect the DMO to take less then 12 lines of code!
I don't reallty see why you have an issue with sp_help_rev_login, it will
reside in the master database and have the same interface regardless of SQL
Server version!
Why not just backup the system databases?
John|||> I would expect the DMO to take less then 12 lines of code!
I'm not certain how well DMO handles SID number and password, so make sure y
ou verify this. Based on
for what purpose you want this script, it might be very important for the lo
gins to have the same
SID and pwd as in the originating SQL Server, so make sure you check that DM
O does it the right way.
This is, btw, the beauty of using sp_help_revlogin.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:8B6C82C3-6A1E-4EE0-B6FF-B5385176DA9F@.microsoft.com...
> Hi
> "Kristen" wrote:
>
> I would expect the DMO to take less then 12 lines of code!
> I don't reallty see why you have an issue with sp_help_rev_login, it will
> reside in the master database and have the same interface regardless of SQ
L
> Server version!
> Why not just backup the system databases?
> John
>|||If you contact me, I will share a script. It will script logins,
users, system and database role membership, and indiviudal grants with
passwords preserved in SQL Server 2005.
Terry

automatically stop/restart sql service

I would like to be able to automatically stop a sql service running on sql
2005 express, use a script to transfer files over to another server and
restart the service automatically.
Any ideas of how I can do this?
You can use a batch file that does a net stop, copy and net start. Schedule
it with task scheduler.
Jason Massie
Web: http://statisticsio.com
RSS: http://feeds.feedburner.com/statisticsio
"pete0085" <pete0085@.discussions.microsoft.com> wrote in message
news:63C59DBE-8BBF-4967-BFB4-EDEF3DA0B84C@.microsoft.com...
>I would like to be able to automatically stop a sql service running on sql
> 2005 express, use a script to transfer files over to another server and
> restart the service automatically.
> Any ideas of how I can do this?
|||When it does a copy and it's only copying one file, not the entire directory.
The directory has 4 folders and 1 readme file and it's copying the readme
file.
Any ideas?
"Jason Massie" wrote:

> You can use a batch file that does a net stop, copy and net start. Schedule
> it with task scheduler.
>
> --
> Jason Massie
> Web: http://statisticsio.com
> RSS: http://feeds.feedburner.com/statisticsio
> "pete0085" <pete0085@.discussions.microsoft.com> wrote in message
> news:63C59DBE-8BBF-4967-BFB4-EDEF3DA0B84C@.microsoft.com...
>
>
|||xcopy /S
Documentation for the other switches is available by running xcopy /?
Jason Massie
Web: http://statisticsio.com
RSS: http://feeds.feedburner.com/statisticsio
"pete0085" <pete0085@.discussions.microsoft.com> wrote in message
news:752C5BDF-A76C-48E3-8D9F-013739AE87AE@.microsoft.com...[vbcol=seagreen]
> When it does a copy and it's only copying one file, not the entire
> directory.
> The directory has 4 folders and 1 readme file and it's copying the readme
> file.
> Any ideas?
> "Jason Massie" wrote:
sql

automatically stop/restart sql service

I would like to be able to automatically stop a sql service running on sql
2005 express, use a script to transfer files over to another server and
restart the service automatically.
Any ideas of how I can do this?You can use a batch file that does a net stop, copy and net start. Schedule
it with task scheduler.
Jason Massie
Web: http://statisticsio.com
RSS: http://feeds.feedburner.com/statisticsio
"pete0085" <pete0085@.discussions.microsoft.com> wrote in message
news:63C59DBE-8BBF-4967-BFB4-EDEF3DA0B84C@.microsoft.com...
>I would like to be able to automatically stop a sql service running on sql
> 2005 express, use a script to transfer files over to another server and
> restart the service automatically.
> Any ideas of how I can do this?|||When it does a copy and it's only copying one file, not the entire directory.
The directory has 4 folders and 1 readme file and it's copying the readme
file.
Any ideas?
"Jason Massie" wrote:
> You can use a batch file that does a net stop, copy and net start. Schedule
> it with task scheduler.
>
> --
> Jason Massie
> Web: http://statisticsio.com
> RSS: http://feeds.feedburner.com/statisticsio
> "pete0085" <pete0085@.discussions.microsoft.com> wrote in message
> news:63C59DBE-8BBF-4967-BFB4-EDEF3DA0B84C@.microsoft.com...
> >I would like to be able to automatically stop a sql service running on sql
> > 2005 express, use a script to transfer files over to another server and
> > restart the service automatically.
> >
> > Any ideas of how I can do this?
>
>|||xcopy /S
Documentation for the other switches is available by running xcopy /?
--
Jason Massie
Web: http://statisticsio.com
RSS: http://feeds.feedburner.com/statisticsio
"pete0085" <pete0085@.discussions.microsoft.com> wrote in message
news:752C5BDF-A76C-48E3-8D9F-013739AE87AE@.microsoft.com...
> When it does a copy and it's only copying one file, not the entire
> directory.
> The directory has 4 folders and 1 readme file and it's copying the readme
> file.
> Any ideas?
> "Jason Massie" wrote:
>> You can use a batch file that does a net stop, copy and net start.
>> Schedule
>> it with task scheduler.
>>
>> --
>> Jason Massie
>> Web: http://statisticsio.com
>> RSS: http://feeds.feedburner.com/statisticsio
>> "pete0085" <pete0085@.discussions.microsoft.com> wrote in message
>> news:63C59DBE-8BBF-4967-BFB4-EDEF3DA0B84C@.microsoft.com...
>> >I would like to be able to automatically stop a sql service running on
>> >sql
>> > 2005 express, use a script to transfer files over to another server and
>> > restart the service automatically.
>> >
>> > Any ideas of how I can do this?
>>

Wednesday, March 7, 2012

AUTOMATE PROCESS

Hi

Currentyl after i transfer the data from another database(source) to datawarehouse. I need to click on the "process" button in order to see the latest result. Do it have a command or way to do it programmatically or using the SSIS to do it?

Anyone please point me the link for me to do the automate process ?

Thanks in advance for anyone provide me some clue.

There are plenty of different options

SSIS has an SSAS processing task.

You could script the processing from SSMS as an XML/A command and schedule it from SQL Agent or using the ascmd sample that was released with SP2.

You could write a .Net app using the AMO to initiate the processing.

|||

Hi Darren,

You again Smile . And thank again for the pointing.

And i found more details explaination on this,

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230156&SiteID=1

Just provide for those are interested. And is worked and simple.

Thanks

|||Yep me again . That's exactly what I had in mind.

Sunday, February 19, 2012

Auto_Increment?

Hi all.

I'm trying to transfer a mysql file to mssql. Is there a field type of auto increment in mssql.
If not is there anyway to make a field auto increment in the SQL Studio express?

Thanks in advance for help with this!
Ron

In Microsoft SQL, you set the column's "Identity Specification" equal to Yes