לוגו אתר Fresh          
 
 
  אפשרות תפריט  ראשי     אפשרות תפריט  צ'אט     אפשרות תפריט  מבזקים     אפשרות תפריט  צור קשר     חץ שמאלה ‎print ‎"Hello World!"; if‎ ‎not rules.‎know ‎then rules.‎read(); חץ ימינה  

לך אחורה   לובי הפורומים > מחשבים > תכנות ובניית אתרים
שמור לעצמך קישור לדף זה באתרי שמירת קישורים חברתיים
תגובה
 
כלי אשכול חפש באשכול זה



  #2  
ישן 04-07-2007, 14:28
  DCD DCD אינו מחובר  
 
חבר מתאריך: 17.05.05
הודעות: 7,321
בתגובה להודעה מספר 1 שנכתבה על ידי nadavdb שמתחילה ב "העתקת מסדי נתונים SQL Server 2005"

אני לא מבין הרבה ב- SQL SERVER או בכלל בהעתקה מהירה של מידע במסדי נתונים, אבל אולי הטיפים הבאים יעזרו:

http://www.databasejournal.com/feat...cle.php/3095511

עריכה:

אולי גם השאילתה הבאה תעזור לך:

קוד:
create proc usp_copy_db_backup_files @copyd varchar(200)= null as /************************************************** ******************** Author: Gregory A. Larsen Date: 08/27/2003 Description: This stored procedure will copy database backups to a secondary location for disaster recovery purpose. When the proc runs it will copy any database backup that has been created in the last 72 hours, provided the backup does not already exist in the alternative directory. ************************************************** *********************/ set nocount on declare @tmp varchar(200) declare @cmd varchar(2000) declare @oldcmd varchar(2000) if @copyd is null begin raiserror('No copy directory provided',16,1) Print 'Usage:usp_copy_db_backup_files @copyd=<directory for backup files>' return end -- create tables to hold file lists create table #filelist1 (output varchar(250)) create table #filelist2 (output varchar(250)) -- create temp table to hold commands to execute create table #commands (cmd varchar(2000)) set nocount on -- get a list of the physical device name for all backups that where -- created in the last 72 hours. insert into #filelist1 select physical_device_name from msdb.dbo.backupmediafamily join msdb.dbo.backupset on msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id where backup_start_date > dateadd(hour,-72,getdate()) --build dir command set @tmp = 'dir /b ' + rtrim(@copyd) + '\*.*' --get a list of the backup file that exist at alternative location insert into #filelist2 exec master.dbo.xp_cmdshell @tmp -- generate a copy command for all backup -- files that have yet to be copied. insert into #commands select 'copy "' + rtrim(#filelist1.output) + '" ' + rtrim(@copyd) from #filelist1 left join #filelist2 on reverse(substring(reverse(#filelist1.output),1, charindex('\',reverse(#filelist1.output))-1)) = #filelist2.output where #filelist2.output is null --are there backups that need to be copied if (select count(*) from #commands) > 0 begin -- loop throught the commands and copy one file a time. set @oldcmd = '' select top 1 @cmd = cmd from #commands order by cmd while @cmd <> @oldcmd begin -- copy backup to other location print @cmd exec master.dbo.xp_cmdshell @cmd set @oldcmd=@cmd -- get next command to process select top 1 @cmd = cmd from #commands where @oldcmd < cmd order by cmd end end -- remove temporary files used. drop table #filelist1, #filelist2, #commands


היא נלקחה מהעמוד:

http://www.databasejournal.com/feat...cle.php/3628501

נערך לאחרונה ע"י DCD בתאריך 04-07-2007 בשעה 14:37.
תגובה ללא ציטוט תגובה עם ציטוט חזרה לפורום
תגובה

כלי אשכול חפש באשכול זה
חפש באשכול זה:

חיפוש מתקדם
מצבי תצוגה דרג אשכול זה
דרג אשכול זה:

מזער את תיבת המידע אפשרויות משלוח הודעות
אתה לא יכול לפתוח אשכולות חדשים
אתה לא יכול להגיב לאשכולות
אתה לא יכול לצרף קבצים
אתה לא יכול לערוך את ההודעות שלך

קוד vB פעיל
קוד [IMG] פעיל
קוד HTML כבוי
מעבר לפורום



כל הזמנים המוצגים בדף זה הם לפי איזור זמן GMT +2. השעה כעת היא 12:04

הדף נוצר ב 0.04 שניות עם 12 שאילתות

הפורום מבוסס על vBulletin, גירסא 3.0.6
כל הזכויות לתוכנת הפורומים שמורות © 2025 - 2000 לחברת Jelsoft Enterprises.
כל הזכויות שמורות ל Fresh.co.il ©

צור קשר | תקנון האתר