Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE DATABASE BDARCOR
- ON PRIMARY
- (
- NAME=ARCORDATA,
- FILENAME='C:\ARCOR\SRVLIMA\DATA\ARCORDATA.NDF',
- SIZE=5MB,
- MAXSIZE=50MB,
- FILEGROWTH=10%
- ),
- FILEGROUP[FGLOGISTICA]
- (
- NAME=ARCORDATA2,
- FILENAME='C:\ARCOR\SRVICA\DATA\ARCORDATA2.NDF',
- SIZE=5MB,
- MAXSIZE=50MB,
- FILEGROWTH=10%
- ),
- FILEGROUP[FGVENTAS]
- (
- NAME=ARCORDATA3,
- FILENAME='C:\ARCOR\SRVTUMBES\DATA\ARCORDATA3.NDF',
- SIZE=5MB,
- MAXSIZE=50MB,
- FILEGROWTH=10%
- )
- LOG ON
- (
- NAME=ARCORLOG,
- FILENAME='C:\ARCOR\SRVLIMA\DATA\ARCORLOG.LDF',
- SIZE=5MB,
- MAXSIZE=50MB,
- FILEGROWTH=10%
- )
- GO
- ----
- USE BDARCOR
- SELECT * FROM SYS.filegroups
- GO
- ---Modificar la BD para agregar un datafile a un determinado filegroup
- ALTER DATABASE BDARCOR
- ADD FILE
- (
- NAME=ARCORDATA22,
- FILENAME='C:\ARCOR\SRVICA\DATA\ARCORDATA22.NDF',
- SIZE=5MB,
- MAXSIZE=50MB,
- FILEGROWTH=10%
- )
- TO FILEGROUP [FGLOGISTICA]
- GO
- -------------------------------------------------------
- ALTER DATABASE BDARCOR
- ADD FILE
- (
- NAME=ARCORDATA33,
- FILENAME='C:\ARCOR\SRVTUMBES\DATA\ARCORDATA33.NDF',
- SIZE=5MB,
- MAXSIZE=50MB,
- FILEGROWTH=10%
- ),
- (
- NAME=ARCORDATA333,
- FILENAME='C:\ARCOR\SRVTUMBES\DATA\ARCORDATA333.NDF',
- SIZE=5MB,
- MAXSIZE=50MB,
- FILEGROWTH=10%
- )
- TO FILEGROUP [FGVENTAS]
- GO
- -------------------------------------------------------
- --MODIFICAR LA BASE DE DATOS PARA CREAR UN FILEGROUP
- ALTER DATABASE BDARCOR
- ADD FILEGROUP [FGPRODUCCION]
- GO
- --MODIFICAR LA BASE DE DATOS PARA AGREGAR UN DATAFILE AL NUEVO FILEGROUP
- ALTER DATABASE BDARCOR
- ADD FILE
- (
- NAME=ARCORDATA4,
- FILENAME='C:\ARCOR\SRVLIMA\DATA\ARCORDATA4.NDF',
- SIZE=5MB,
- MAXSIZE=50MB,
- FILEGROWTH=10%
- )
- TO FILEGROUP[FGPRODUCCION]
- GO
- --MODIFICAR LA BD PARA ELIMINAR UN DATAFILE
- --OJO QUE ESTO SOLO FUNCIONA SI NO CONTIENE DATOS (ESTA VACIO), SINO HABRA ERRORES
- ALTER DATABASE BDARCOR
- REMOVE FILE ARCORDATA333
- GO
- --MODIFICAR LA BD PARA CAMBIAR LA UBICACION DE UN DATAFILE
- --DE ICA A LIMA
- ALTER DATABASE BDARCOR
- MODIFY FILE
- (
- NAME=ARCORDATA2,
- FILENAME='C:\ARCOR\SRVLIMA\DATA\ARCORDATA2.NDF'
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement