Scrigroup - Documente si articole

     

HomeDocumenteUploadResurseAlte limbi doc
AccessAdobe photoshopAlgoritmiAutocadBaze de dateCC sharp
CalculatoareCorel drawDot netExcelFox proFrontpageHardware
HtmlInternetJavaLinuxMatlabMs dosPascal
PhpPower pointRetele calculatoareSqlTutorialsWebdesignWindows
WordXml


Restore manual

sql



+ Font mai mare | - Font mai mic



Restore manual

Restore o intreaga baza de date:

RESTORE DATABASE
[ FROM < backup_device > [ ,n ] ]
[ WITH
    [ RESTRICTED_USER ]
    [ [ , ] FILE = ]
    [ [ , ] PASSWORD = ]
    [ [ , ] MEDIANAME = ]
    [ [ , ] MEDIAPASSWORD = ]
    [ [ , ] MOVE 'logical_file_name' TO 'operating_system_file_name' ]
    [ ,n ]
    [ [ , ] KEEP_REPLICATION ]
    [ [ , ] ]
    [ [ , ] ]
    [ [ , ] ]
    [ [ , ] REPLACE ]
    [ [ , ] RESTART ]
    [ [ , ] STATS [ = percentage ] ]
]



Restore partial o baza de date

RESTORE DATABASE
    < file_or_filegroup > [ ,n ]
[ FROM < backup_device > [ ,n ] ]
[ WITH
    
    [ [ , ] FILE = ]
    [ [ , ] PASSWORD = ]
    [ [ , ] MEDIANAME = ]
    [ [ , ] MEDIAPASSWORD = ]
    [ [ , ] MOVE 'logical_file_name' TO 'operating_system_file_name' ]
    [ ,n ]
    [ [ , ] NORECOVERY ]
    [ [ , ] ]
    [ [ , ] ]
    [ [ , ] REPLACE ]
    [ [ , ] RESTRICTED_USER ]
    [ [ , ] RESTART ]
    [ [ , ] STATS [= percentage ] ]
]

Restore fisiere specifice sau filegroups

RESTORE DATABASE
    < file_or_filegroup > [ ,n ]
[ FROM < backup_device > [ ,n ] ]
[ WITH
    [ RESTRICTED_USER ]
    [ [ , ] FILE = ]
    [ [ , ] PASSWORD = ]
    [ [ , ] MEDIANAME = ]
    [ [ , ] MEDIAPASSWORD = ]
    [ [ , ] MOVE 'logical_file_name' TO 'operating_system_file_name' ]
    [ ,n ]
    [ [ , ] NORECOVERY ]
    [ [ , ] ]
    [ [ , ] ]
    [ [ , ] REPLACE ]
    [ [ , ] RESTART ]
    [ [ , ] STATS [ = percentage ] ]
]

Restore transaction log

RESTORE DATABASE
    < file_or_filegroup > [ ,n ]
[ FROM < backup_device > [ ,n ] ]
[ WITH
    [ RESTRICTED_USER ]
    [ [ , ] FILE = ]
    [ [ , ] PASSWORD = ]
    [ [ , ] MEDIANAME = ]
    [ [ , ] MEDIAPASSWORD = ]
    [ [ , ] MOVE 'logical_file_name' TO 'operating_system_file_name' ]
    [ ,n ]
    [ [ , ] NORECOVERY ]
    [ [ , ] ]
    [ [ , ] ]
    [ [ , ] REPLACE ]
    [ [ , ] RESTART ]
    [ [ , ] STATS [ = percentage ] ]
]

unde:

< backup_device > ::=
    
        | =
    

    }

si:

< file_or_filegroup > ::=
    

        |
        FILEGROUP =
    }

Exemple:

  • Restore intr-o baza de date noua pe acelasi server

RESTORE DATABASE nwind_new FROM DISK = 'c backupsnorthwindnwind.bak'

WITH

MOVE 'northwind' TO 'd:Program FilesMicrosoft SQL ServerDatanwind_new.mdf'

MOVE 'northwind_log' TO 'd:Program FilesMicrosoft SQL ServerDatanwind_new_log.ldf'

  • Restore partial

RESTORE FILELISTONLY

FROM DISK = 'd:backupsfilescomplete.bak'

  • Restore de transaction log, la un named transaction

-- aceasta este transactia caruia I se asociaza numele Demo

BEGIN TRAN Demo

UPDATE Customers

SET CITY = 'Hamburg'

WHERE NAME = 'Tony Munitz'

COMMIT TRAN Demo

-- restore la punctual Demo

RESTORE LOG NorthWind_Test

FROM DISK = 'd:backupsTLOG_23.BAK'

WITH STOPBEFOREMARK = 'Demo'

  • Restore de backup diferential

RESTORE DATABASE Nwind_New

FROM DISK = 'd:backupsnwindnwind_diff.bak'

WITH RECOVERY



Politica de confidentialitate | Termeni si conditii de utilizare



DISTRIBUIE DOCUMENTUL

Comentarii


Vizualizari: 1146
Importanta: rank

Comenteaza documentul:

Te rugam sa te autentifici sau sa iti faci cont pentru a putea comenta

Creaza cont nou

Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved