--建立一個名叫"puma"的DB
1 | USE [master] |
2 | GO |
3 | CREATE DATABASE [puma] ON PRIMARY |
4 | ( NAME = N 'puma' , FILENAME = N 'D:\DB\puma.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) |
5 | LOG ON |
6 | ( NAME = N 'puma_log' , FILENAME = N 'D:\DB\puma_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) |
7 | GO |
--備份"puma"DB
1 | BACKUP DATABASE puma TO DISK = 'D:\DB\puma.bak' |
2 | GO |
--還原"puma"DB到新的DB"puma2"
1 | RESTORE DATABASE puma2 |
2 | FROM DISK = 'D:\DB\puma.bak' |
3 | WITH |
4 | MOVE 'puma' TO 'D:\DB\puma2.mdf' , |
5 | MOVE 'puma_log' TO 'D:\DB\puma2_log.ldf' , |
6 | REPLACE ; |
7 | GO |
沒有留言:
張貼留言