Hello,
I am trying to schedule complete backups of some of the databases that I
have on my database server using the Database Maintenance Plan. However,
when the DB Backup Job is run for backing up the database, it just keeps on
executing (status). There is no backup file created for any of the database
that I have chosen.
However, if I can manually backup each of the database by Right-clicking
each database in Enterprise Manager and choosing 'Backup Database'.
For some reason, the same backup process fails / takes very very long time
when I use a scheduled job created from the Database Maintenance Plan.
Any ideas?
Thanks
What's in the maintenance report? Any errors ? Where are you backing up
to ? Disk or Tape. If it is tape, did you check that the path to the
default backup directory exists ?
Markus
|||Sorry, that last comment should have been "IF yo backup to DISK (not
tape) check if the path exists"
M
|||I have the same problem (SQL7), except that the backup file is created (in
about a minute and a half) but the SQL Agent Job never completes. I have to
manually stop and restart SQL agent for the job status to return to "not
running". I have checked the backup and it is a valid file (restores in
about three minutes).
Job was created using Maintenance plan, backing up to device (filepath) on
the server.
The actual command in the job step is:
EXECUTE master.dbo.xp_sqlmaint N'-PlanID
153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
-BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
"BAK"'
"Vince Keller" wrote:
> Hello,
> I am trying to schedule complete backups of some of the databases that I
> have on my database server using the Database Maintenance Plan. However,
> when the DB Backup Job is run for backing up the database, it just keeps on
> executing (status). There is no backup file created for any of the database
> that I have chosen.
> However, if I can manually backup each of the database by Right-clicking
> each database in Enterprise Manager and choosing 'Backup Database'.
> For some reason, the same backup process fails / takes very very long time
> when I use a scheduled job created from the Database Maintenance Plan.
> Any ideas?
> Thanks
>
>
|||Follow up:
The problem persisted, so I removed the backup from the maintenance plan and
created it as a stand alone job. There are several ways to do this, the
simplest being to go to enterprise manage, expand your server, expand
Management, and and right-click on Backup. Select backup database, and make
sure that the schedule checkbox is selected (at the bottom of the dialogue).
Now the job runs fine. The remaining jobs of the orignial maintenance plan
show the same errant behavior, though... never quite completing.
"WD Rudman" wrote:
[vbcol=seagreen]
> I have the same problem (SQL7), except that the backup file is created (in
> about a minute and a half) but the SQL Agent Job never completes. I have to
> manually stop and restart SQL agent for the job status to return to "not
> running". I have checked the backup and it is a valid file (restores in
> about three minutes).
> Job was created using Maintenance plan, backing up to device (filepath) on
> the server.
> The actual command in the job step is:
> EXECUTE master.dbo.xp_sqlmaint N'-PlanID
> 153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
> -BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
> "BAK"'
> "Vince Keller" wrote:
Showing posts with label schedule. Show all posts
Showing posts with label schedule. Show all posts
Thursday, March 29, 2012
DB Backup Job for a Maintenance Plan taking a long time
Hello,
I am trying to schedule complete backups of some of the databases that I
have on my database server using the Database Maintenance Plan. However,
when the DB Backup Job is run for backing up the database, it just keeps on
executing (status). There is no backup file created for any of the database
that I have chosen.
However, if I can manually backup each of the database by Right-clicking
each database in Enterprise Manager and choosing 'Backup Database'.
For some reason, the same backup process fails / takes very very long time
when I use a scheduled job created from the Database Maintenance Plan.
Any ideas'
ThanksWhat's in the maintenance report? Any errors ? Where are you backing up
to ? Disk or Tape. If it is tape, did you check that the path to the
default backup directory exists ?
Markus|||Sorry, that last comment should have been "IF yo backup to DISK (not
tape) check if the path exists"
M|||I have the same problem (SQL7), except that the backup file is created (in
about a minute and a half) but the SQL Agent Job never completes. I have to
manually stop and restart SQL agent for the job status to return to "not
running". I have checked the backup and it is a valid file (restores in
about three minutes).
Job was created using Maintenance plan, backing up to device (filepath) on
the server.
The actual command in the job step is:
EXECUTE master.dbo.xp_sqlmaint N'-PlanID
153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
-BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
"BAK"'
"Vince Keller" wrote:
> Hello,
> I am trying to schedule complete backups of some of the databases that I
> have on my database server using the Database Maintenance Plan. However,
> when the DB Backup Job is run for backing up the database, it just keeps on
> executing (status). There is no backup file created for any of the database
> that I have chosen.
> However, if I can manually backup each of the database by Right-clicking
> each database in Enterprise Manager and choosing 'Backup Database'.
> For some reason, the same backup process fails / takes very very long time
> when I use a scheduled job created from the Database Maintenance Plan.
> Any ideas'
> Thanks
>
>|||Follow up:
The problem persisted, so I removed the backup from the maintenance plan and
created it as a stand alone job. There are several ways to do this, the
simplest being to go to enterprise manage, expand your server, expand
Management, and and right-click on Backup. Select backup database, and make
sure that the schedule checkbox is selected (at the bottom of the dialogue).
Now the job runs fine. The remaining jobs of the orignial maintenance plan
show the same errant behavior, though... never quite completing.
"WD Rudman" wrote:
> I have the same problem (SQL7), except that the backup file is created (in
> about a minute and a half) but the SQL Agent Job never completes. I have to
> manually stop and restart SQL agent for the job status to return to "not
> running". I have checked the backup and it is a valid file (restores in
> about three minutes).
> Job was created using Maintenance plan, backing up to device (filepath) on
> the server.
> The actual command in the job step is:
> EXECUTE master.dbo.xp_sqlmaint N'-PlanID
> 153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
> -BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
> "BAK"'
> "Vince Keller" wrote:
> > Hello,
> >
> > I am trying to schedule complete backups of some of the databases that I
> > have on my database server using the Database Maintenance Plan. However,
> > when the DB Backup Job is run for backing up the database, it just keeps on
> > executing (status). There is no backup file created for any of the database
> > that I have chosen.
> >
> > However, if I can manually backup each of the database by Right-clicking
> > each database in Enterprise Manager and choosing 'Backup Database'.
> >
> > For some reason, the same backup process fails / takes very very long time
> > when I use a scheduled job created from the Database Maintenance Plan.
> >
> > Any ideas'
> >
> > Thanks
> >
> >
> >
I am trying to schedule complete backups of some of the databases that I
have on my database server using the Database Maintenance Plan. However,
when the DB Backup Job is run for backing up the database, it just keeps on
executing (status). There is no backup file created for any of the database
that I have chosen.
However, if I can manually backup each of the database by Right-clicking
each database in Enterprise Manager and choosing 'Backup Database'.
For some reason, the same backup process fails / takes very very long time
when I use a scheduled job created from the Database Maintenance Plan.
Any ideas'
ThanksWhat's in the maintenance report? Any errors ? Where are you backing up
to ? Disk or Tape. If it is tape, did you check that the path to the
default backup directory exists ?
Markus|||Sorry, that last comment should have been "IF yo backup to DISK (not
tape) check if the path exists"
M|||I have the same problem (SQL7), except that the backup file is created (in
about a minute and a half) but the SQL Agent Job never completes. I have to
manually stop and restart SQL agent for the job status to return to "not
running". I have checked the backup and it is a valid file (restores in
about three minutes).
Job was created using Maintenance plan, backing up to device (filepath) on
the server.
The actual command in the job step is:
EXECUTE master.dbo.xp_sqlmaint N'-PlanID
153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
-BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
"BAK"'
"Vince Keller" wrote:
> Hello,
> I am trying to schedule complete backups of some of the databases that I
> have on my database server using the Database Maintenance Plan. However,
> when the DB Backup Job is run for backing up the database, it just keeps on
> executing (status). There is no backup file created for any of the database
> that I have chosen.
> However, if I can manually backup each of the database by Right-clicking
> each database in Enterprise Manager and choosing 'Backup Database'.
> For some reason, the same backup process fails / takes very very long time
> when I use a scheduled job created from the Database Maintenance Plan.
> Any ideas'
> Thanks
>
>|||Follow up:
The problem persisted, so I removed the backup from the maintenance plan and
created it as a stand alone job. There are several ways to do this, the
simplest being to go to enterprise manage, expand your server, expand
Management, and and right-click on Backup. Select backup database, and make
sure that the schedule checkbox is selected (at the bottom of the dialogue).
Now the job runs fine. The remaining jobs of the orignial maintenance plan
show the same errant behavior, though... never quite completing.
"WD Rudman" wrote:
> I have the same problem (SQL7), except that the backup file is created (in
> about a minute and a half) but the SQL Agent Job never completes. I have to
> manually stop and restart SQL agent for the job status to return to "not
> running". I have checked the backup and it is a valid file (restores in
> about three minutes).
> Job was created using Maintenance plan, backing up to device (filepath) on
> the server.
> The actual command in the job step is:
> EXECUTE master.dbo.xp_sqlmaint N'-PlanID
> 153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
> -BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
> "BAK"'
> "Vince Keller" wrote:
> > Hello,
> >
> > I am trying to schedule complete backups of some of the databases that I
> > have on my database server using the Database Maintenance Plan. However,
> > when the DB Backup Job is run for backing up the database, it just keeps on
> > executing (status). There is no backup file created for any of the database
> > that I have chosen.
> >
> > However, if I can manually backup each of the database by Right-clicking
> > each database in Enterprise Manager and choosing 'Backup Database'.
> >
> > For some reason, the same backup process fails / takes very very long time
> > when I use a scheduled job created from the Database Maintenance Plan.
> >
> > Any ideas'
> >
> > Thanks
> >
> >
> >
DB Backup Job for a Maintenance Plan taking a long time
Hello,
I am trying to schedule complete backups of some of the databases that I
have on my database server using the Database Maintenance Plan. However,
when the DB Backup Job is run for backing up the database, it just keeps on
executing (status). There is no backup file created for any of the database
that I have chosen.
However, if I can manually backup each of the database by Right-clicking
each database in Enterprise Manager and choosing 'Backup Database'.
For some reason, the same backup process fails / takes very very long time
when I use a scheduled job created from the Database Maintenance Plan.
Any ideas'
ThanksWhat's in the maintenance report? Any errors ? Where are you backing up
to ? Disk or Tape. If it is tape, did you check that the path to the
default backup directory exists ?
Markus|||Sorry, that last comment should have been "IF yo backup to DISK (not
tape) check if the path exists"
M|||I have the same problem (SQL7), except that the backup file is created (in
about a minute and a half) but the SQL Agent Job never completes. I have to
manually stop and restart SQL agent for the job status to return to "not
running". I have checked the backup and it is a valid file (restores in
about three minutes).
Job was created using Maintenance plan, backing up to device (filepath) on
the server.
The actual command in the job step is:
EXECUTE master.dbo.xp_sqlmaint N'-PlanID
153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
-BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
"BAK"'
"Vince Keller" wrote:
> Hello,
> I am trying to schedule complete backups of some of the databases that I
> have on my database server using the Database Maintenance Plan. However,
> when the DB Backup Job is run for backing up the database, it just keeps o
n
> executing (status). There is no backup file created for any of the databas
e
> that I have chosen.
> However, if I can manually backup each of the database by Right-clicking
> each database in Enterprise Manager and choosing 'Backup Database'.
> For some reason, the same backup process fails / takes very very long time
> when I use a scheduled job created from the Database Maintenance Plan.
> Any ideas'
> Thanks
>
>|||Follow up:
The problem persisted, so I removed the backup from the maintenance plan and
created it as a stand alone job. There are several ways to do this, the
simplest being to go to enterprise manage, expand your server, expand
Management, and and right-click on Backup. Select backup database, and make
sure that the schedule checkbox is selected (at the bottom of the dialogue).
Now the job runs fine. The remaining jobs of the orignial maintenance plan
show the same errant behavior, though... never quite completing.
"WD Rudman" wrote:
[vbcol=seagreen]
> I have the same problem (SQL7), except that the backup file is created (in
> about a minute and a half) but the SQL Agent Job never completes. I have
to
> manually stop and restart SQL agent for the job status to return to "not
> running". I have checked the backup and it is a valid file (restores in
> about three minutes).
> Job was created using Maintenance plan, backing up to device (filepath) on
> the server.
> The actual command in the job step is:
> EXECUTE master.dbo.xp_sqlmaint N'-PlanID
> 153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
> -BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
> "BAK"'
> "Vince Keller" wrote:
>
I am trying to schedule complete backups of some of the databases that I
have on my database server using the Database Maintenance Plan. However,
when the DB Backup Job is run for backing up the database, it just keeps on
executing (status). There is no backup file created for any of the database
that I have chosen.
However, if I can manually backup each of the database by Right-clicking
each database in Enterprise Manager and choosing 'Backup Database'.
For some reason, the same backup process fails / takes very very long time
when I use a scheduled job created from the Database Maintenance Plan.
Any ideas'
ThanksWhat's in the maintenance report? Any errors ? Where are you backing up
to ? Disk or Tape. If it is tape, did you check that the path to the
default backup directory exists ?
Markus|||Sorry, that last comment should have been "IF yo backup to DISK (not
tape) check if the path exists"
M|||I have the same problem (SQL7), except that the backup file is created (in
about a minute and a half) but the SQL Agent Job never completes. I have to
manually stop and restart SQL agent for the job status to return to "not
running". I have checked the backup and it is a valid file (restores in
about three minutes).
Job was created using Maintenance plan, backing up to device (filepath) on
the server.
The actual command in the job step is:
EXECUTE master.dbo.xp_sqlmaint N'-PlanID
153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
-BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
"BAK"'
"Vince Keller" wrote:
> Hello,
> I am trying to schedule complete backups of some of the databases that I
> have on my database server using the Database Maintenance Plan. However,
> when the DB Backup Job is run for backing up the database, it just keeps o
n
> executing (status). There is no backup file created for any of the databas
e
> that I have chosen.
> However, if I can manually backup each of the database by Right-clicking
> each database in Enterprise Manager and choosing 'Backup Database'.
> For some reason, the same backup process fails / takes very very long time
> when I use a scheduled job created from the Database Maintenance Plan.
> Any ideas'
> Thanks
>
>|||Follow up:
The problem persisted, so I removed the backup from the maintenance plan and
created it as a stand alone job. There are several ways to do this, the
simplest being to go to enterprise manage, expand your server, expand
Management, and and right-click on Backup. Select backup database, and make
sure that the schedule checkbox is selected (at the bottom of the dialogue).
Now the job runs fine. The remaining jobs of the orignial maintenance plan
show the same errant behavior, though... never quite completing.
"WD Rudman" wrote:
[vbcol=seagreen]
> I have the same problem (SQL7), except that the backup file is created (in
> about a minute and a half) but the SQL Agent Job never completes. I have
to
> manually stop and restart SQL agent for the job status to return to "not
> running". I have checked the backup and it is a valid file (restores in
> about three minutes).
> Job was created using Maintenance plan, backing up to device (filepath) on
> the server.
> The actual command in the job step is:
> EXECUTE master.dbo.xp_sqlmaint N'-PlanID
> 153F9792-4A76-44CD-944E-C581659E556D -To "Warren Rudman" -WriteHistory
> -BkUpMedia DISK -BkUpDB -UseDefDir -DelBkUps 1WEEKS -CrBkSubDir -BkExt
> "BAK"'
> "Vince Keller" wrote:
>
DB Backup and restoration
Hi, There,
I am going to schedule the live database backup and restoration to the
remote site on daily basis.
The correct procedure:
1. Sunday full db backup-->Restored on remote server
2. Daily differential backup from Monday to Saturday--> Restored on remote
server with the same squence.
3. Again database was sync with full db backup on the 2nd Sunday.
However, for some reason, the following actual procedure happen:
1. Daily DB full backup at 5:00AM in the morning
2. Daily Differential backup at 4:50AM bf the full backup happen
3. Restore the sunday full DB on remote site
4. Followed by daily differential back which happen at 4:50am daily.
Due to the huge side of the DB, I could not ship the daily DB to the remote
site. And I hv problem to restore those differential backup, so I am
wondering whether this is possible, if not, How can I achiev the same.
Thanks for any information!
Shermaine
I am not sure for what purpose you are restoring this database, but for
large database you can look for option of replication or logshipping
or mirroring instead of copy backup daily and restore it.
Regards
Amish Shah
http://shahamishm.tripod.com
xiaomei wrote:
> Hi, There,
> I am going to schedule the live database backup and restoration to the
> remote site on daily basis.
> The correct procedure:
> 1. Sunday full db backup-->Restored on remote server
> 2. Daily differential backup from Monday to Saturday--> Restored on remote
> server with the same squence.
> 3. Again database was sync with full db backup on the 2nd Sunday.
> However, for some reason, the following actual procedure happen:
> 1. Daily DB full backup at 5:00AM in the morning
> 2. Daily Differential backup at 4:50AM bf the full backup happen
> 3. Restore the sunday full DB on remote site
> 4. Followed by daily differential back which happen at 4:50am daily.
> Due to the huge side of the DB, I could not ship the daily DB to the remote
> site. And I hv problem to restore those differential backup, so I am
> wondering whether this is possible, if not, How can I achiev the same.
> Thanks for any information!
> Shermaine
|||Hi, Amish,
The reason is the production server and develop team located in different
country.
Some time the develop team need check the live database, however we did not
allow them to direct connect the the live server.
Replication and logshipping via internet is very cost solution, we are not
going to implement that for this purpose only. And due to the huge size of
the DB, it is not psossible for sync the full db backup on daily baisis.
I schedule to upload the daily differential backup to remote office server
daily, and the following day, they will restore the backup there.
The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
I only send the differential backup, will it works after the first time db
was sync with full db backup?
Thanks and best regards
Shermaine
"amish" wrote:
> I am not sure for what purpose you are restoring this database, but for
> large database you can look for option of replication or logshipping
> or mirroring instead of copy backup daily and restore it.
>
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> xiaomei wrote:
>
|||According to BOL
A differential backup is based on the most recent, preceding data
backup, which is base backup.A differential backup records only the
data that has changed since its full backup. Before restoring a
differential backup, you must restore its full backup
You can schedule log shipping or create script to zip all log backup of
day and copy to destination server and restore them.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:[vbcol=seagreen]
> Hi, Amish,
> The reason is the production server and develop team located in different
> country.
> Some time the develop team need check the live database, however we did not
> allow them to direct connect the the live server.
> Replication and logshipping via internet is very cost solution, we are not
> going to implement that for this purpose only. And due to the huge size of
> the DB, it is not psossible for sync the full db backup on daily baisis.
> I schedule to upload the daily differential backup to remote office server
> daily, and the following day, they will restore the backup there.
> The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
> I only send the differential backup, will it works after the first time db
> was sync with full db backup?
> Thanks and best regards
> Shermaine
>
> "amish" wrote:
>
>
>
|||Hi, Amish,
Does the Log shipping adopt the simliar technologies as differential backup?
I can schedule the log shipping, however, due to the daily DB full backup
happens on the live server, I aslo need sync the DB with full db backup
daily, because the transaction log also refer to last full db backup or
differential backup or earlier log backup. Else, the log could not be
restored.
Can you help to recommend some document of the difference of implement a log
shipping scheme and a differential bakcup solution, not very clear what are
the disavantages and benifit.
Thanks and regards
Shermaine
"amish" wrote:
> According to BOL
> A differential backup is based on the most recent, preceding data
> backup, which is base backup.A differential backup records only the
> data that has changed since its full backup. Before restoring a
> differential backup, you must restore its full backup
> You can schedule log shipping or create script to zip all log backup of
> day and copy to destination server and restore them.
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
>
sql
I am going to schedule the live database backup and restoration to the
remote site on daily basis.
The correct procedure:
1. Sunday full db backup-->Restored on remote server
2. Daily differential backup from Monday to Saturday--> Restored on remote
server with the same squence.
3. Again database was sync with full db backup on the 2nd Sunday.
However, for some reason, the following actual procedure happen:
1. Daily DB full backup at 5:00AM in the morning
2. Daily Differential backup at 4:50AM bf the full backup happen
3. Restore the sunday full DB on remote site
4. Followed by daily differential back which happen at 4:50am daily.
Due to the huge side of the DB, I could not ship the daily DB to the remote
site. And I hv problem to restore those differential backup, so I am
wondering whether this is possible, if not, How can I achiev the same.
Thanks for any information!
Shermaine
I am not sure for what purpose you are restoring this database, but for
large database you can look for option of replication or logshipping
or mirroring instead of copy backup daily and restore it.
Regards
Amish Shah
http://shahamishm.tripod.com
xiaomei wrote:
> Hi, There,
> I am going to schedule the live database backup and restoration to the
> remote site on daily basis.
> The correct procedure:
> 1. Sunday full db backup-->Restored on remote server
> 2. Daily differential backup from Monday to Saturday--> Restored on remote
> server with the same squence.
> 3. Again database was sync with full db backup on the 2nd Sunday.
> However, for some reason, the following actual procedure happen:
> 1. Daily DB full backup at 5:00AM in the morning
> 2. Daily Differential backup at 4:50AM bf the full backup happen
> 3. Restore the sunday full DB on remote site
> 4. Followed by daily differential back which happen at 4:50am daily.
> Due to the huge side of the DB, I could not ship the daily DB to the remote
> site. And I hv problem to restore those differential backup, so I am
> wondering whether this is possible, if not, How can I achiev the same.
> Thanks for any information!
> Shermaine
|||Hi, Amish,
The reason is the production server and develop team located in different
country.
Some time the develop team need check the live database, however we did not
allow them to direct connect the the live server.
Replication and logshipping via internet is very cost solution, we are not
going to implement that for this purpose only. And due to the huge size of
the DB, it is not psossible for sync the full db backup on daily baisis.
I schedule to upload the daily differential backup to remote office server
daily, and the following day, they will restore the backup there.
The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
I only send the differential backup, will it works after the first time db
was sync with full db backup?
Thanks and best regards
Shermaine
"amish" wrote:
> I am not sure for what purpose you are restoring this database, but for
> large database you can look for option of replication or logshipping
> or mirroring instead of copy backup daily and restore it.
>
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> xiaomei wrote:
>
|||According to BOL
A differential backup is based on the most recent, preceding data
backup, which is base backup.A differential backup records only the
data that has changed since its full backup. Before restoring a
differential backup, you must restore its full backup
You can schedule log shipping or create script to zip all log backup of
day and copy to destination server and restore them.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:[vbcol=seagreen]
> Hi, Amish,
> The reason is the production server and develop team located in different
> country.
> Some time the develop team need check the live database, however we did not
> allow them to direct connect the the live server.
> Replication and logshipping via internet is very cost solution, we are not
> going to implement that for this purpose only. And due to the huge size of
> the DB, it is not psossible for sync the full db backup on daily baisis.
> I schedule to upload the daily differential backup to remote office server
> daily, and the following day, they will restore the backup there.
> The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
> I only send the differential backup, will it works after the first time db
> was sync with full db backup?
> Thanks and best regards
> Shermaine
>
> "amish" wrote:
>
>
>
|||Hi, Amish,
Does the Log shipping adopt the simliar technologies as differential backup?
I can schedule the log shipping, however, due to the daily DB full backup
happens on the live server, I aslo need sync the DB with full db backup
daily, because the transaction log also refer to last full db backup or
differential backup or earlier log backup. Else, the log could not be
restored.
Can you help to recommend some document of the difference of implement a log
shipping scheme and a differential bakcup solution, not very clear what are
the disavantages and benifit.
Thanks and regards
Shermaine
"amish" wrote:
> According to BOL
> A differential backup is based on the most recent, preceding data
> backup, which is base backup.A differential backup records only the
> data that has changed since its full backup. Before restoring a
> differential backup, you must restore its full backup
> You can schedule log shipping or create script to zip all log backup of
> day and copy to destination server and restore them.
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
>
sql
DB Backup and restoration
Hi, There,
I am going to schedule the live database backup and restoration to the
remote site on daily basis.
The correct procedure:
1. Sunday full db backup-->Restored on remote server
2. Daily differential backup from Monday to Saturday--> Restored on remote
server with the same squence.
3. Again database was sync with full db backup on the 2nd Sunday.
However, for some reason, the following actual procedure happen:
1. Daily DB full backup at 5:00AM in the morning
2. Daily Differential backup at 4:50AM bf the full backup happen
3. Restore the sunday full DB on remote site
4. Followed by daily differential back which happen at 4:50am daily.
Due to the huge side of the DB, I could not ship the daily DB to the remote
site. And I hv problem to restore those differential backup, so I am
wondering whether this is possible, if not, How can I achiev the same.
Thanks for any information!
ShermaineI am not sure for what purpose you are restoring this database, but for
large database you can look for option of replication or logshipping
or mirroring instead of copy backup daily and restore it.
Regards
Amish Shah
http://shahamishm.tripod.com
xiaomei wrote:
> Hi, There,
> I am going to schedule the live database backup and restoration to the
> remote site on daily basis.
> The correct procedure:
> 1. Sunday full db backup-->Restored on remote server
> 2. Daily differential backup from Monday to Saturday--> Restored on remote
> server with the same squence.
> 3. Again database was sync with full db backup on the 2nd Sunday.
> However, for some reason, the following actual procedure happen:
> 1. Daily DB full backup at 5:00AM in the morning
> 2. Daily Differential backup at 4:50AM bf the full backup happen
> 3. Restore the sunday full DB on remote site
> 4. Followed by daily differential back which happen at 4:50am daily.
> Due to the huge side of the DB, I could not ship the daily DB to the remote
> site. And I hv problem to restore those differential backup, so I am
> wondering whether this is possible, if not, How can I achiev the same.
> Thanks for any information!
> Shermaine|||According to BOL
A differential backup is based on the most recent, preceding data
backup, which is base backup.A differential backup records only the
data that has changed since its full backup. Before restoring a
differential backup, you must restore its full backup
You can schedule log shipping or create script to zip all log backup of
day and copy to destination server and restore them.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
> Hi, Amish,
> The reason is the production server and develop team located in different
> country.
> Some time the develop team need check the live database, however we did not
> allow them to direct connect the the live server.
> Replication and logshipping via internet is very cost solution, we are not
> going to implement that for this purpose only. And due to the huge size of
> the DB, it is not psossible for sync the full db backup on daily baisis.
> I schedule to upload the daily differential backup to remote office server
> daily, and the following day, they will restore the backup there.
> The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
> I only send the differential backup, will it works after the first time db
> was sync with full db backup?
> Thanks and best regards
> Shermaine
>
> "amish" wrote:
> > I am not sure for what purpose you are restoring this database, but for
> > large database you can look for option of replication or logshipping
> > or mirroring instead of copy backup daily and restore it.
> > Regards
> > Amish Shah
> >http://shahamishm.tripod.com
> > xiaomei wrote:
> > > Hi, There,
> > > I am going to schedule the live database backup and restoration to the
> > > remote site on daily basis.
> > > The correct procedure:
> > > 1. Sunday full db backup-->Restored on remote server
> > > 2. Daily differential backup from Monday to Saturday--> Restored on remote
> > > server with the same squence.
> > > 3. Again database was sync with full db backup on the 2nd Sunday.
> > > However, for some reason, the following actual procedure happen:
> > > 1. Daily DB full backup at 5:00AM in the morning
> > > 2. Daily Differential backup at 4:50AM bf the full backup happen
> > > 3. Restore the sunday full DB on remote site
> > > 4. Followed by daily differential back which happen at 4:50am daily.
> > > Due to the huge side of the DB, I could not ship the daily DB to the remote
> > > site. And I hv problem to restore those differential backup, so I am
> > > wondering whether this is possible, if not, How can I achiev the same.
> > > Thanks for any information!
> > > Shermaine- Hide quoted text -- Show quoted text -|||Hi, Amish,
Does the Log shipping adopt the simliar technologies as differential backup?
I can schedule the log shipping, however, due to the daily DB full backup
happens on the live server, I aslo need sync the DB with full db backup
daily, because the transaction log also refer to last full db backup or
differential backup or earlier log backup. Else, the log could not be
restored.
Can you help to recommend some document of the difference of implement a log
shipping scheme and a differential bakcup solution, not very clear what are
the disavantages and benifit.
Thanks and regards
Shermaine
"amish" wrote:
> According to BOL
> A differential backup is based on the most recent, preceding data
> backup, which is base backup.A differential backup records only the
> data that has changed since its full backup. Before restoring a
> differential backup, you must restore its full backup
> You can schedule log shipping or create script to zip all log backup of
> day and copy to destination server and restore them.
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
> > Hi, Amish,
> > The reason is the production server and develop team located in different
> > country.
> > Some time the develop team need check the live database, however we did not
> > allow them to direct connect the the live server.
> >
> > Replication and logshipping via internet is very cost solution, we are not
> > going to implement that for this purpose only. And due to the huge size of
> > the DB, it is not psossible for sync the full db backup on daily baisis.
> > I schedule to upload the daily differential backup to remote office server
> > daily, and the following day, they will restore the backup there.
> >
> > The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
> > I only send the differential backup, will it works after the first time db
> > was sync with full db backup?
> >
> > Thanks and best regards
> > Shermaine
> >
> >
> >
> > "amish" wrote:
> > > I am not sure for what purpose you are restoring this database, but for
> > > large database you can look for option of replication or logshipping
> > > or mirroring instead of copy backup daily and restore it.
> >
> > > Regards
> > > Amish Shah
> > >http://shahamishm.tripod.com
> >
> > > xiaomei wrote:
> > > > Hi, There,
> > > > I am going to schedule the live database backup and restoration to the
> > > > remote site on daily basis.
> > > > The correct procedure:
> > > > 1. Sunday full db backup-->Restored on remote server
> > > > 2. Daily differential backup from Monday to Saturday--> Restored on remote
> > > > server with the same squence.
> > > > 3. Again database was sync with full db backup on the 2nd Sunday.
> >
> > > > However, for some reason, the following actual procedure happen:
> >
> > > > 1. Daily DB full backup at 5:00AM in the morning
> > > > 2. Daily Differential backup at 4:50AM bf the full backup happen
> > > > 3. Restore the sunday full DB on remote site
> > > > 4. Followed by daily differential back which happen at 4:50am daily.
> >
> > > > Due to the huge side of the DB, I could not ship the daily DB to the remote
> > > > site. And I hv problem to restore those differential backup, so I am
> > > > wondering whether this is possible, if not, How can I achiev the same.
> >
> > > > Thanks for any information!
> >
> > > > Shermaine- Hide quoted text -- Show quoted text -
>|||Log backup is backup of transaction logs.
Logshipping you have to first restore full backup and then all
consecutive transaction log backup. transaction log backup sequence
does not get affected by later on full backup and you dont need to
restore full backup again at destination.
First you should look at different type of backup in Books Online.
Then look at Logshipping. BOL has plenty of information for both.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 25, 8:37 am, xiaomei <xiao...@.discussions.microsoft.com> wrote:
> Hi, Amish,
> Does the Log shipping adopt the simliar technologies as differential backup?
> I can schedule the log shipping, however, due to the daily DB full backup
> happens on the live server, I aslo need sync the DB with full db backup
> daily, because the transaction log also refer to last full db backup or
> differential backup or earlier log backup. Else, the log could not be
> restored.
> Can you help to recommend some document of the difference of implement a log
> shipping scheme and a differential bakcup solution, not very clear what are
> the disavantages and benifit.
> Thanks and regards
> Shermaine
>
> "amish" wrote:
> > According to BOL
> > A differential backup is based on the most recent, preceding data
> > backup, which is base backup.A differential backup records only the
> > data that has changed since its full backup. Before restoring a
> > differential backup, you must restore its full backup
> > You can schedule log shipping or create script to zip all log backup of
> > day and copy to destination server and restore them.
> > Regards
> > Amish Shah
> >http://shahamishm.tripod.com
> > On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
> > > Hi, Amish,
> > > The reason is the production server and develop team located in different
> > > country.
> > > Some time the develop team need check the live database, however we did not
> > > allow them to direct connect the the live server.
> > > Replication and logshipping via internet is very cost solution, we are not
> > > going to implement that for this purpose only. And due to the huge size of
> > > the DB, it is not psossible for sync the full db backup on daily baisis.
> > > I schedule to upload the daily differential backup to remote office server
> > > daily, and the following day, they will restore the backup there.
> > > The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
> > > I only send the differential backup, will it works after the first time db
> > > was sync with full db backup?
> > > Thanks and best regards
> > > Shermaine
> > > "amish" wrote:
> > > > I am not sure for what purpose you are restoring this database, but for
> > > > large database you can look for option of replication or logshipping
> > > > or mirroring instead of copy backup daily and restore it.
> > > > Regards
> > > > Amish Shah
> > > >http://shahamishm.tripod.com
> > > > xiaomei wrote:
> > > > > Hi, There,
> > > > > I am going to schedule the live database backup and restoration to the
> > > > > remote site on daily basis.
> > > > > The correct procedure:
> > > > > 1. Sunday full db backup-->Restored on remote server
> > > > > 2. Daily differential backup from Monday to Saturday--> Restored on remote
> > > > > server with the same squence.
> > > > > 3. Again database was sync with full db backup on the 2nd Sunday.
> > > > > However, for some reason, the following actual procedure happen:
> > > > > 1. Daily DB full backup at 5:00AM in the morning
> > > > > 2. Daily Differential backup at 4:50AM bf the full backup happen
> > > > > 3. Restore the sunday full DB on remote site
> > > > > 4. Followed by daily differential back which happen at 4:50am daily.
> > > > > Due to the huge side of the DB, I could not ship the daily DB to the remote
> > > > > site. And I hv problem to restore those differential backup, so I am
> > > > > wondering whether this is possible, if not, How can I achiev the same.
> > > > > Thanks for any information!
> > > > > Shermaine- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
I am going to schedule the live database backup and restoration to the
remote site on daily basis.
The correct procedure:
1. Sunday full db backup-->Restored on remote server
2. Daily differential backup from Monday to Saturday--> Restored on remote
server with the same squence.
3. Again database was sync with full db backup on the 2nd Sunday.
However, for some reason, the following actual procedure happen:
1. Daily DB full backup at 5:00AM in the morning
2. Daily Differential backup at 4:50AM bf the full backup happen
3. Restore the sunday full DB on remote site
4. Followed by daily differential back which happen at 4:50am daily.
Due to the huge side of the DB, I could not ship the daily DB to the remote
site. And I hv problem to restore those differential backup, so I am
wondering whether this is possible, if not, How can I achiev the same.
Thanks for any information!
ShermaineI am not sure for what purpose you are restoring this database, but for
large database you can look for option of replication or logshipping
or mirroring instead of copy backup daily and restore it.
Regards
Amish Shah
http://shahamishm.tripod.com
xiaomei wrote:
> Hi, There,
> I am going to schedule the live database backup and restoration to the
> remote site on daily basis.
> The correct procedure:
> 1. Sunday full db backup-->Restored on remote server
> 2. Daily differential backup from Monday to Saturday--> Restored on remote
> server with the same squence.
> 3. Again database was sync with full db backup on the 2nd Sunday.
> However, for some reason, the following actual procedure happen:
> 1. Daily DB full backup at 5:00AM in the morning
> 2. Daily Differential backup at 4:50AM bf the full backup happen
> 3. Restore the sunday full DB on remote site
> 4. Followed by daily differential back which happen at 4:50am daily.
> Due to the huge side of the DB, I could not ship the daily DB to the remote
> site. And I hv problem to restore those differential backup, so I am
> wondering whether this is possible, if not, How can I achiev the same.
> Thanks for any information!
> Shermaine|||According to BOL
A differential backup is based on the most recent, preceding data
backup, which is base backup.A differential backup records only the
data that has changed since its full backup. Before restoring a
differential backup, you must restore its full backup
You can schedule log shipping or create script to zip all log backup of
day and copy to destination server and restore them.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
> Hi, Amish,
> The reason is the production server and develop team located in different
> country.
> Some time the develop team need check the live database, however we did not
> allow them to direct connect the the live server.
> Replication and logshipping via internet is very cost solution, we are not
> going to implement that for this purpose only. And due to the huge size of
> the DB, it is not psossible for sync the full db backup on daily baisis.
> I schedule to upload the daily differential backup to remote office server
> daily, and the following day, they will restore the backup there.
> The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
> I only send the differential backup, will it works after the first time db
> was sync with full db backup?
> Thanks and best regards
> Shermaine
>
> "amish" wrote:
> > I am not sure for what purpose you are restoring this database, but for
> > large database you can look for option of replication or logshipping
> > or mirroring instead of copy backup daily and restore it.
> > Regards
> > Amish Shah
> >http://shahamishm.tripod.com
> > xiaomei wrote:
> > > Hi, There,
> > > I am going to schedule the live database backup and restoration to the
> > > remote site on daily basis.
> > > The correct procedure:
> > > 1. Sunday full db backup-->Restored on remote server
> > > 2. Daily differential backup from Monday to Saturday--> Restored on remote
> > > server with the same squence.
> > > 3. Again database was sync with full db backup on the 2nd Sunday.
> > > However, for some reason, the following actual procedure happen:
> > > 1. Daily DB full backup at 5:00AM in the morning
> > > 2. Daily Differential backup at 4:50AM bf the full backup happen
> > > 3. Restore the sunday full DB on remote site
> > > 4. Followed by daily differential back which happen at 4:50am daily.
> > > Due to the huge side of the DB, I could not ship the daily DB to the remote
> > > site. And I hv problem to restore those differential backup, so I am
> > > wondering whether this is possible, if not, How can I achiev the same.
> > > Thanks for any information!
> > > Shermaine- Hide quoted text -- Show quoted text -|||Hi, Amish,
Does the Log shipping adopt the simliar technologies as differential backup?
I can schedule the log shipping, however, due to the daily DB full backup
happens on the live server, I aslo need sync the DB with full db backup
daily, because the transaction log also refer to last full db backup or
differential backup or earlier log backup. Else, the log could not be
restored.
Can you help to recommend some document of the difference of implement a log
shipping scheme and a differential bakcup solution, not very clear what are
the disavantages and benifit.
Thanks and regards
Shermaine
"amish" wrote:
> According to BOL
> A differential backup is based on the most recent, preceding data
> backup, which is base backup.A differential backup records only the
> data that has changed since its full backup. Before restoring a
> differential backup, you must restore its full backup
> You can schedule log shipping or create script to zip all log backup of
> day and copy to destination server and restore them.
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
> > Hi, Amish,
> > The reason is the production server and develop team located in different
> > country.
> > Some time the develop team need check the live database, however we did not
> > allow them to direct connect the the live server.
> >
> > Replication and logshipping via internet is very cost solution, we are not
> > going to implement that for this purpose only. And due to the huge size of
> > the DB, it is not psossible for sync the full db backup on daily baisis.
> > I schedule to upload the daily differential backup to remote office server
> > daily, and the following day, they will restore the backup there.
> >
> > The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
> > I only send the differential backup, will it works after the first time db
> > was sync with full db backup?
> >
> > Thanks and best regards
> > Shermaine
> >
> >
> >
> > "amish" wrote:
> > > I am not sure for what purpose you are restoring this database, but for
> > > large database you can look for option of replication or logshipping
> > > or mirroring instead of copy backup daily and restore it.
> >
> > > Regards
> > > Amish Shah
> > >http://shahamishm.tripod.com
> >
> > > xiaomei wrote:
> > > > Hi, There,
> > > > I am going to schedule the live database backup and restoration to the
> > > > remote site on daily basis.
> > > > The correct procedure:
> > > > 1. Sunday full db backup-->Restored on remote server
> > > > 2. Daily differential backup from Monday to Saturday--> Restored on remote
> > > > server with the same squence.
> > > > 3. Again database was sync with full db backup on the 2nd Sunday.
> >
> > > > However, for some reason, the following actual procedure happen:
> >
> > > > 1. Daily DB full backup at 5:00AM in the morning
> > > > 2. Daily Differential backup at 4:50AM bf the full backup happen
> > > > 3. Restore the sunday full DB on remote site
> > > > 4. Followed by daily differential back which happen at 4:50am daily.
> >
> > > > Due to the huge side of the DB, I could not ship the daily DB to the remote
> > > > site. And I hv problem to restore those differential backup, so I am
> > > > wondering whether this is possible, if not, How can I achiev the same.
> >
> > > > Thanks for any information!
> >
> > > > Shermaine- Hide quoted text -- Show quoted text -
>|||Log backup is backup of transaction logs.
Logshipping you have to first restore full backup and then all
consecutive transaction log backup. transaction log backup sequence
does not get affected by later on full backup and you dont need to
restore full backup again at destination.
First you should look at different type of backup in Books Online.
Then look at Logshipping. BOL has plenty of information for both.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 25, 8:37 am, xiaomei <xiao...@.discussions.microsoft.com> wrote:
> Hi, Amish,
> Does the Log shipping adopt the simliar technologies as differential backup?
> I can schedule the log shipping, however, due to the daily DB full backup
> happens on the live server, I aslo need sync the DB with full db backup
> daily, because the transaction log also refer to last full db backup or
> differential backup or earlier log backup. Else, the log could not be
> restored.
> Can you help to recommend some document of the difference of implement a log
> shipping scheme and a differential bakcup solution, not very clear what are
> the disavantages and benifit.
> Thanks and regards
> Shermaine
>
> "amish" wrote:
> > According to BOL
> > A differential backup is based on the most recent, preceding data
> > backup, which is base backup.A differential backup records only the
> > data that has changed since its full backup. Before restoring a
> > differential backup, you must restore its full backup
> > You can schedule log shipping or create script to zip all log backup of
> > day and copy to destination server and restore them.
> > Regards
> > Amish Shah
> >http://shahamishm.tripod.com
> > On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
> > > Hi, Amish,
> > > The reason is the production server and develop team located in different
> > > country.
> > > Some time the develop team need check the live database, however we did not
> > > allow them to direct connect the the live server.
> > > Replication and logshipping via internet is very cost solution, we are not
> > > going to implement that for this purpose only. And due to the huge size of
> > > the DB, it is not psossible for sync the full db backup on daily baisis.
> > > I schedule to upload the daily differential backup to remote office server
> > > daily, and the following day, they will restore the backup there.
> > > The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
> > > I only send the differential backup, will it works after the first time db
> > > was sync with full db backup?
> > > Thanks and best regards
> > > Shermaine
> > > "amish" wrote:
> > > > I am not sure for what purpose you are restoring this database, but for
> > > > large database you can look for option of replication or logshipping
> > > > or mirroring instead of copy backup daily and restore it.
> > > > Regards
> > > > Amish Shah
> > > >http://shahamishm.tripod.com
> > > > xiaomei wrote:
> > > > > Hi, There,
> > > > > I am going to schedule the live database backup and restoration to the
> > > > > remote site on daily basis.
> > > > > The correct procedure:
> > > > > 1. Sunday full db backup-->Restored on remote server
> > > > > 2. Daily differential backup from Monday to Saturday--> Restored on remote
> > > > > server with the same squence.
> > > > > 3. Again database was sync with full db backup on the 2nd Sunday.
> > > > > However, for some reason, the following actual procedure happen:
> > > > > 1. Daily DB full backup at 5:00AM in the morning
> > > > > 2. Daily Differential backup at 4:50AM bf the full backup happen
> > > > > 3. Restore the sunday full DB on remote site
> > > > > 4. Followed by daily differential back which happen at 4:50am daily.
> > > > > Due to the huge side of the DB, I could not ship the daily DB to the remote
> > > > > site. And I hv problem to restore those differential backup, so I am
> > > > > wondering whether this is possible, if not, How can I achiev the same.
> > > > > Thanks for any information!
> > > > > Shermaine- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
DB Backup and restoration
Hi, There,
I am going to schedule the live database backup and restoration to the
remote site on daily basis.
The correct procedure:
1. Sunday full db backup-->Restored on remote server
2. Daily differential backup from Monday to Saturday--> Restored on remote
server with the same squence.
3. Again database was sync with full db backup on the 2nd Sunday.
However, for some reason, the following actual procedure happen:
1. Daily DB full backup at 5:00AM in the morning
2. Daily Differential backup at 4:50AM bf the full backup happen
3. Restore the sunday full DB on remote site
4. Followed by daily differential back which happen at 4:50am daily.
Due to the huge side of the DB, I could not ship the daily DB to the remote
site. And I hv problem to restore those differential backup, so I am
wondering whether this is possible, if not, How can I achiev the same.
Thanks for any information!
ShermaineI am not sure for what purpose you are restoring this database, but for
large database you can look for option of replication or logshipping
or mirroring instead of copy backup daily and restore it.
Regards
Amish Shah
http://shahamishm.tripod.com
xiaomei wrote:
> Hi, There,
> I am going to schedule the live database backup and restoration to the
> remote site on daily basis.
> The correct procedure:
> 1. Sunday full db backup-->Restored on remote server
> 2. Daily differential backup from Monday to Saturday--> Restored on remot
e
> server with the same squence.
> 3. Again database was sync with full db backup on the 2nd Sunday.
> However, for some reason, the following actual procedure happen:
> 1. Daily DB full backup at 5:00AM in the morning
> 2. Daily Differential backup at 4:50AM bf the full backup happen
> 3. Restore the sunday full DB on remote site
> 4. Followed by daily differential back which happen at 4:50am daily.
> Due to the huge side of the DB, I could not ship the daily DB to the remo
te
> site. And I hv problem to restore those differential backup, so I am
> wondering whether this is possible, if not, How can I achiev the same.
> Thanks for any information!
> Shermaine|||Hi, Amish,
The reason is the production server and develop team located in different
country.
Some time the develop team need check the live database, however we did not
allow them to direct connect the the live server.
Replication and logshipping via internet is very cost solution, we are not
going to implement that for this purpose only. And due to the huge size of
the DB, it is not psossible for sync the full db backup on daily baisis.
I schedule to upload the daily differential backup to remote office server
daily, and the following day, they will restore the backup there.
The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
I only send the differential backup, will it works after the first time db
was sync with full db backup?
Thanks and best regards
Shermaine
"amish" wrote:
> I am not sure for what purpose you are restoring this database, but for
> large database you can look for option of replication or logshipping
> or mirroring instead of copy backup daily and restore it.
>
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> xiaomei wrote:
>|||According to BOL
A differential backup is based on the most recent, preceding data
backup, which is base backup.A differential backup records only the
data that has changed since its full backup. Before restoring a
differential backup, you must restore its full backup
You can schedule log shipping or create script to zip all log backup of
day and copy to destination server and restore them.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:[vbcol=seagreen]
> Hi, Amish,
> The reason is the production server and develop team located in different
> country.
> Some time the develop team need check the live database, however we did no
t
> allow them to direct connect the the live server.
> Replication and logshipping via internet is very cost solution, we are not
> going to implement that for this purpose only. And due to the huge size of
> the DB, it is not psossible for sync the full db backup on daily baisis.
> I schedule to upload the daily differential backup to remote office server
> daily, and the following day, they will restore the backup there.
> The DB full backup(5:00am) and differential backup (4:50am) happen daily,
if
> I only send the differential backup, will it works after the first time db
> was sync with full db backup?
> Thanks and best regards
> Shermaine
>
> "amish" wrote:
>
>
>
>
>
>
>|||Hi, Amish,
Does the Log shipping adopt the simliar technologies as differential backup?
I can schedule the log shipping, however, due to the daily DB full backup
happens on the live server, I aslo need sync the DB with full db backup
daily, because the transaction log also refer to last full db backup or
differential backup or earlier log backup. Else, the log could not be
restored.
Can you help to recommend some document of the difference of implement a log
shipping scheme and a differential bakcup solution, not very clear what are
the disavantages and benifit.
Thanks and regards
Shermaine
"amish" wrote:
> According to BOL
> A differential backup is based on the most recent, preceding data
> backup, which is base backup.A differential backup records only the
> data that has changed since its full backup. Before restoring a
> differential backup, you must restore its full backup
> You can schedule log shipping or create script to zip all log backup of
> day and copy to destination server and restore them.
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
>|||Log backup is backup of transaction logs.
Logshipping you have to first restore full backup and then all
consecutive transaction log backup. transaction log backup sequence
does not get affected by later on full backup and you dont need to
restore full backup again at destination.
First you should look at different type of backup in Books Online.
Then look at Logshipping. BOL has plenty of information for both.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 25, 8:37 am, xiaomei <xiao...@.discussions.microsoft.com> wrote:[vbcol=seagreen]
> Hi, Amish,
> Does the Log shipping adopt the simliar technologies as differential backu
p?
> I can schedule the log shipping, however, due to the daily DB full backup
> happens on the live server, I aslo need sync the DB with full db backup
> daily, because the transaction log also refer to last full db backup or
> differential backup or earlier log backup. Else, the log could not be
> restored.
> Can you help to recommend some document of the difference of implement a l
og
> shipping scheme and a differential bakcup solution, not very clear what ar
e
> the disavantages and benifit.
> Thanks and regards
> Shermaine
>
> "amish" wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
I am going to schedule the live database backup and restoration to the
remote site on daily basis.
The correct procedure:
1. Sunday full db backup-->Restored on remote server
2. Daily differential backup from Monday to Saturday--> Restored on remote
server with the same squence.
3. Again database was sync with full db backup on the 2nd Sunday.
However, for some reason, the following actual procedure happen:
1. Daily DB full backup at 5:00AM in the morning
2. Daily Differential backup at 4:50AM bf the full backup happen
3. Restore the sunday full DB on remote site
4. Followed by daily differential back which happen at 4:50am daily.
Due to the huge side of the DB, I could not ship the daily DB to the remote
site. And I hv problem to restore those differential backup, so I am
wondering whether this is possible, if not, How can I achiev the same.
Thanks for any information!
ShermaineI am not sure for what purpose you are restoring this database, but for
large database you can look for option of replication or logshipping
or mirroring instead of copy backup daily and restore it.
Regards
Amish Shah
http://shahamishm.tripod.com
xiaomei wrote:
> Hi, There,
> I am going to schedule the live database backup and restoration to the
> remote site on daily basis.
> The correct procedure:
> 1. Sunday full db backup-->Restored on remote server
> 2. Daily differential backup from Monday to Saturday--> Restored on remot
e
> server with the same squence.
> 3. Again database was sync with full db backup on the 2nd Sunday.
> However, for some reason, the following actual procedure happen:
> 1. Daily DB full backup at 5:00AM in the morning
> 2. Daily Differential backup at 4:50AM bf the full backup happen
> 3. Restore the sunday full DB on remote site
> 4. Followed by daily differential back which happen at 4:50am daily.
> Due to the huge side of the DB, I could not ship the daily DB to the remo
te
> site. And I hv problem to restore those differential backup, so I am
> wondering whether this is possible, if not, How can I achiev the same.
> Thanks for any information!
> Shermaine|||Hi, Amish,
The reason is the production server and develop team located in different
country.
Some time the develop team need check the live database, however we did not
allow them to direct connect the the live server.
Replication and logshipping via internet is very cost solution, we are not
going to implement that for this purpose only. And due to the huge size of
the DB, it is not psossible for sync the full db backup on daily baisis.
I schedule to upload the daily differential backup to remote office server
daily, and the following day, they will restore the backup there.
The DB full backup(5:00am) and differential backup (4:50am) happen daily, if
I only send the differential backup, will it works after the first time db
was sync with full db backup?
Thanks and best regards
Shermaine
"amish" wrote:
> I am not sure for what purpose you are restoring this database, but for
> large database you can look for option of replication or logshipping
> or mirroring instead of copy backup daily and restore it.
>
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> xiaomei wrote:
>|||According to BOL
A differential backup is based on the most recent, preceding data
backup, which is base backup.A differential backup records only the
data that has changed since its full backup. Before restoring a
differential backup, you must restore its full backup
You can schedule log shipping or create script to zip all log backup of
day and copy to destination server and restore them.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:[vbcol=seagreen]
> Hi, Amish,
> The reason is the production server and develop team located in different
> country.
> Some time the develop team need check the live database, however we did no
t
> allow them to direct connect the the live server.
> Replication and logshipping via internet is very cost solution, we are not
> going to implement that for this purpose only. And due to the huge size of
> the DB, it is not psossible for sync the full db backup on daily baisis.
> I schedule to upload the daily differential backup to remote office server
> daily, and the following day, they will restore the backup there.
> The DB full backup(5:00am) and differential backup (4:50am) happen daily,
if
> I only send the differential backup, will it works after the first time db
> was sync with full db backup?
> Thanks and best regards
> Shermaine
>
> "amish" wrote:
>
>
>
>
>
>
>|||Hi, Amish,
Does the Log shipping adopt the simliar technologies as differential backup?
I can schedule the log shipping, however, due to the daily DB full backup
happens on the live server, I aslo need sync the DB with full db backup
daily, because the transaction log also refer to last full db backup or
differential backup or earlier log backup. Else, the log could not be
restored.
Can you help to recommend some document of the difference of implement a log
shipping scheme and a differential bakcup solution, not very clear what are
the disavantages and benifit.
Thanks and regards
Shermaine
"amish" wrote:
> According to BOL
> A differential backup is based on the most recent, preceding data
> backup, which is base backup.A differential backup records only the
> data that has changed since its full backup. Before restoring a
> differential backup, you must restore its full backup
> You can schedule log shipping or create script to zip all log backup of
> day and copy to destination server and restore them.
> Regards
> Amish Shah
> http://shahamishm.tripod.com
> On Jan 23, 6:21 pm, xiaomei <xiao...@.discussions.microsoft.com> wrote:
>|||Log backup is backup of transaction logs.
Logshipping you have to first restore full backup and then all
consecutive transaction log backup. transaction log backup sequence
does not get affected by later on full backup and you dont need to
restore full backup again at destination.
First you should look at different type of backup in Books Online.
Then look at Logshipping. BOL has plenty of information for both.
Regards
Amish Shah
http://shahamishm.tripod.com
On Jan 25, 8:37 am, xiaomei <xiao...@.discussions.microsoft.com> wrote:[vbcol=seagreen]
> Hi, Amish,
> Does the Log shipping adopt the simliar technologies as differential backu
p?
> I can schedule the log shipping, however, due to the daily DB full backup
> happens on the live server, I aslo need sync the DB with full db backup
> daily, because the transaction log also refer to last full db backup or
> differential backup or earlier log backup. Else, the log could not be
> restored.
> Can you help to recommend some document of the difference of implement a l
og
> shipping scheme and a differential bakcup solution, not very clear what ar
e
> the disavantages and benifit.
> Thanks and regards
> Shermaine
>
> "amish" wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Tuesday, March 27, 2012
DaysOfWeek CheckBoxList
I have a checkboxlist of days of the week that I wish to be checked if
they are in the current schedule.
Is there a neater way of accomplishing this than the code I have at
present?
Dim recurrence As New WeeklyRecurrence
recurrence = CType(schedule.Definition.Item, WeeklyRecurrence)
If recurrence.DaysOfWeek.Sunday Then
cblScheduleWeeklyDays.Items.FindByValue(0).Selected = True
End If
If recurrence.DaysOfWeek.Monday Then
cblScheduleWeeklyDays.Items.FindByValue(1).Selected = True
End If
If recurrence.DaysOfWeek.Tuesday Then
cblScheduleWeeklyDays.Items.FindByValue(2).Selected = True
End If
If recurrence.DaysOfWeek.Wednesday Then
cblScheduleWeeklyDays.Items.FindByValue(3).Selected = True
End If
If recurrence.DaysOfWeek.Thursday Then
cblScheduleWeeklyDays.Items.FindByValue(4).Selected = True
End If
If recurrence.DaysOfWeek.Friday Then
cblScheduleWeeklyDays.Items.FindByValue(5).Selected = True
End If
If recurrence.DaysOfWeek.Saturday Then
cblScheduleWeeklyDays.Items.FindByValue(6).Selected = True
End IfObviously this would be better
cblScheduleWeeklyDays.Items.FindByValue(0).Selected =recurrence.DaysOfWeek.Sunday
cblScheduleWeeklyDays.Items.FindByValue(1).Selected =recurrence.DaysOfWeek.Monday
cblScheduleWeeklyDays.Items.FindByValue(2).Selected =recurrence.DaysOfWeek.Tuesday
cblScheduleWeeklyDays.Items.FindByValue(3).Selected =recurrence.DaysOfWeek.Wednesday
cblScheduleWeeklyDays.Items.FindByValue(4).Selected =recurrence.DaysOfWeek.Thursday
cblScheduleWeeklyDays.Items.FindByValue(5).Selected =recurrence.DaysOfWeek.Friday
cblScheduleWeeklyDays.Items.FindByValue(6).Selected =recurrence.DaysOfWeek.Saturday
Not very elegant I know, but less code.
I would prefer a for each ... construct
they are in the current schedule.
Is there a neater way of accomplishing this than the code I have at
present?
Dim recurrence As New WeeklyRecurrence
recurrence = CType(schedule.Definition.Item, WeeklyRecurrence)
If recurrence.DaysOfWeek.Sunday Then
cblScheduleWeeklyDays.Items.FindByValue(0).Selected = True
End If
If recurrence.DaysOfWeek.Monday Then
cblScheduleWeeklyDays.Items.FindByValue(1).Selected = True
End If
If recurrence.DaysOfWeek.Tuesday Then
cblScheduleWeeklyDays.Items.FindByValue(2).Selected = True
End If
If recurrence.DaysOfWeek.Wednesday Then
cblScheduleWeeklyDays.Items.FindByValue(3).Selected = True
End If
If recurrence.DaysOfWeek.Thursday Then
cblScheduleWeeklyDays.Items.FindByValue(4).Selected = True
End If
If recurrence.DaysOfWeek.Friday Then
cblScheduleWeeklyDays.Items.FindByValue(5).Selected = True
End If
If recurrence.DaysOfWeek.Saturday Then
cblScheduleWeeklyDays.Items.FindByValue(6).Selected = True
End IfObviously this would be better
cblScheduleWeeklyDays.Items.FindByValue(0).Selected =recurrence.DaysOfWeek.Sunday
cblScheduleWeeklyDays.Items.FindByValue(1).Selected =recurrence.DaysOfWeek.Monday
cblScheduleWeeklyDays.Items.FindByValue(2).Selected =recurrence.DaysOfWeek.Tuesday
cblScheduleWeeklyDays.Items.FindByValue(3).Selected =recurrence.DaysOfWeek.Wednesday
cblScheduleWeeklyDays.Items.FindByValue(4).Selected =recurrence.DaysOfWeek.Thursday
cblScheduleWeeklyDays.Items.FindByValue(5).Selected =recurrence.DaysOfWeek.Friday
cblScheduleWeeklyDays.Items.FindByValue(6).Selected =recurrence.DaysOfWeek.Saturday
Not very elegant I know, but less code.
I would prefer a for each ... construct
Labels:
accomplishing,
checkboxlist,
current,
database,
daysofweek,
microsoft,
mysql,
neater,
oracle,
schedule,
server,
sql
Saturday, February 25, 2012
Dates Query
Hi
We have a work schedule table in our database that comprises of an Employee
ID, a Start Date/Time and a Finish Date/Time.
We are trying to design a query that will return the record every Monday
that it is operational.
I.e. if a record existed with the following data:
Employee Start Date/Time Finish Date/Time
Smith 4th April 2005 10:00 26th April 2005 17:00
Jones 18th April 2005 12:00 18th April 2005 16:00
the data would be returned from the query as follows
Smith 4th April 2005
Smith 11th April 2005
Smith 18th April 2005
Smith 26th April 2005
Jones 18th April 2005
5 records returned
From this i will then be able to design a function that displays how many
hours were spent on the activity each w
.
Is there anyway of getting a query to do this, or is it something that i
will just have to do in VB with an array?
Thanks in advance for any help.You need a calendar table (see http://www.aspfaq.com/show.asp?id=2519) and
then it simply boils down to:
SELECT e.Employee, c.dt
FROM calendar c
INNER JOIN WorkSchedule ws
ON c.dt BETWEEN CONVERT(CHAR(8), ws.StartDate, 112) AND CONVERT(CHAR(8),
ws.EndDate, 112)
WHERE c.dayname = 'Monday'
Jacco Schalkwijk
SQL Server MVP
"Chris" <cw@.community.nospam> wrote in message
news:%23FlMZUBRFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Hi
> We have a work schedule table in our database that comprises of an
> Employee ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
.
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>|||Why should I consider using an auxiliary calendar table?
http://www.aspfaq.com/show.asp?id=2519
Example:
select ws.employee, ws.start
from work_schedule as ws inner join dbo.calendar as c
on c.dt >= convert(char(8), ws.start, 112) and c.dt < dateadd(day, 1,
convert(char(8), ws.finish, 112))
where c.dt = 'monday'
AMB
"Chris" wrote:
> Hi
> We have a work schedule table in our database that comprises of an Employe
e
> ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
.
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>|||Chris
My two cents
CREATE TABLE #dates
(
col CHAR(1) NOT NULL,
sdt DATETIME NOT NULL,
fdt DATETIME NOT NULL
)
INSERT INTO #dates VALUES ('A','20050404','20050426')
SELECT DISTINCT col,dt FROM
(
SELECT col,DATEADD(day,num,'20040331')dt FROM Numbers,#dates
WHERE num <31
) AS D WHERE DATEPART(w,dt)=1
--See Steve Kass's example to find a first,second... monday in the month
create function dbo.NthW
Day(
@.first datetime, -- First of the month of interest (no time part)
@.nth tinyint, -- Which of them - 1st, 2nd, etc.
@.dow tinyint -- Day of w
we want
) returns datetime as begin
-- Note: Returns a date in a later month if @.nth is too large
declare @.result datetime
set @.result = @.first + 7*(@.nth-1)
return @.result + (7 + @.dow - datepart(w
day,@.result))%7
end
go
-- Find the 5th Thursday of August, 2002
select dbo.NthW
Day('2002/08/01',5,5) as D
select datename(w
day,D) + space(1) + cast(D as varchar(20))
from (
select dbo.NthW
Day('2002/08/01',5,5) as D
) X
go
drop function NthW
Day
"Chris" <cw@.community.nospam> wrote in message
news:%23FlMZUBRFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Hi
> We have a work schedule table in our database that comprises of an
Employee
> ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
.
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>|||Thanks everyone
I had thought about creating a sort of calendar table, but didnt know
whether this was good practise, or the best way of doing it.
I guess it is.
Thanks again
Chris
"Chris" <cw@.community.nospam> wrote in message
news:%23FlMZUBRFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Hi
> We have a work schedule table in our database that comprises of an
> Employee ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
.
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>|||Thanks everyone
I had thought about creating a sort of calendar table, but didnt know
whether this was good practise, or the best way of doing it.
I guess it is.
Thanks again
Chris
"Chris" <cw@.community.nospam> wrote in message
news:%23FlMZUBRFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Hi
> We have a work schedule table in our database that comprises of an
> Employee ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
.
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>
We have a work schedule table in our database that comprises of an Employee
ID, a Start Date/Time and a Finish Date/Time.
We are trying to design a query that will return the record every Monday
that it is operational.
I.e. if a record existed with the following data:
Employee Start Date/Time Finish Date/Time
Smith 4th April 2005 10:00 26th April 2005 17:00
Jones 18th April 2005 12:00 18th April 2005 16:00
the data would be returned from the query as follows
Smith 4th April 2005
Smith 11th April 2005
Smith 18th April 2005
Smith 26th April 2005
Jones 18th April 2005
5 records returned
From this i will then be able to design a function that displays how many
hours were spent on the activity each w
Is there anyway of getting a query to do this, or is it something that i
will just have to do in VB with an array?
Thanks in advance for any help.You need a calendar table (see http://www.aspfaq.com/show.asp?id=2519) and
then it simply boils down to:
SELECT e.Employee, c.dt
FROM calendar c
INNER JOIN WorkSchedule ws
ON c.dt BETWEEN CONVERT(CHAR(8), ws.StartDate, 112) AND CONVERT(CHAR(8),
ws.EndDate, 112)
WHERE c.dayname = 'Monday'
Jacco Schalkwijk
SQL Server MVP
"Chris" <cw@.community.nospam> wrote in message
news:%23FlMZUBRFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Hi
> We have a work schedule table in our database that comprises of an
> Employee ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>|||Why should I consider using an auxiliary calendar table?
http://www.aspfaq.com/show.asp?id=2519
Example:
select ws.employee, ws.start
from work_schedule as ws inner join dbo.calendar as c
on c.dt >= convert(char(8), ws.start, 112) and c.dt < dateadd(day, 1,
convert(char(8), ws.finish, 112))
where c.dt = 'monday'
AMB
"Chris" wrote:
> Hi
> We have a work schedule table in our database that comprises of an Employe
e
> ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>|||Chris
My two cents
CREATE TABLE #dates
(
col CHAR(1) NOT NULL,
sdt DATETIME NOT NULL,
fdt DATETIME NOT NULL
)
INSERT INTO #dates VALUES ('A','20050404','20050426')
SELECT DISTINCT col,dt FROM
(
SELECT col,DATEADD(day,num,'20040331')dt FROM Numbers,#dates
WHERE num <31
) AS D WHERE DATEPART(w,dt)=1
--See Steve Kass's example to find a first,second... monday in the month
create function dbo.NthW
@.first datetime, -- First of the month of interest (no time part)
@.nth tinyint, -- Which of them - 1st, 2nd, etc.
@.dow tinyint -- Day of w
) returns datetime as begin
-- Note: Returns a date in a later month if @.nth is too large
declare @.result datetime
set @.result = @.first + 7*(@.nth-1)
return @.result + (7 + @.dow - datepart(w
end
go
-- Find the 5th Thursday of August, 2002
select dbo.NthW
select datename(w
from (
select dbo.NthW
) X
go
drop function NthW
"Chris" <cw@.community.nospam> wrote in message
news:%23FlMZUBRFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Hi
> We have a work schedule table in our database that comprises of an
Employee
> ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>|||Thanks everyone
I had thought about creating a sort of calendar table, but didnt know
whether this was good practise, or the best way of doing it.
I guess it is.
Thanks again
Chris
"Chris" <cw@.community.nospam> wrote in message
news:%23FlMZUBRFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Hi
> We have a work schedule table in our database that comprises of an
> Employee ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>|||Thanks everyone
I had thought about creating a sort of calendar table, but didnt know
whether this was good practise, or the best way of doing it.
I guess it is.
Thanks again
Chris
"Chris" <cw@.community.nospam> wrote in message
news:%23FlMZUBRFHA.3096@.TK2MSFTNGP12.phx.gbl...
> Hi
> We have a work schedule table in our database that comprises of an
> Employee ID, a Start Date/Time and a Finish Date/Time.
> We are trying to design a query that will return the record every Monday
> that it is operational.
> I.e. if a record existed with the following data:
>
> Employee Start Date/Time Finish Date/Time
> Smith 4th April 2005 10:00 26th April 2005 17:00
> Jones 18th April 2005 12:00 18th April 2005 16:00
> the data would be returned from the query as follows
> Smith 4th April 2005
> Smith 11th April 2005
> Smith 18th April 2005
> Smith 26th April 2005
> Jones 18th April 2005
> 5 records returned
> From this i will then be able to design a function that displays how many
> hours were spent on the activity each w
> Is there anyway of getting a query to do this, or is it something that i
> will just have to do in VB with an array?
>
> Thanks in advance for any help.
>
>
>
Subscribe to:
Posts (Atom)