SQL SERVER 2012 NDF, delete

  • Hola estimados, les comento el problema que tengo, tengo una base de datos en la cual la separaron en archivos mdf, ndf y ldf. Los ndf cuales los crearon en filegroup diferentes al Primary.

    Ahora lo que quiero es eliminar todos los archivos ndf y filegroup de esta forma solo quedariamos de la forma tradicional con el mdf y ldf, pero al eliminarlos me da un error de espacio el cual no e logrado superar y tampoco pueda eliminar los ndf ya que me dice que el archivo es unico en el grupo nose si a alguien ya le a ocurrido

  • Via google translate:

    Hello dear, I tell them the problem I have, I have a database in which they separated in mdf, NDF and LDF files. The NDF which different filegroup created in the Primary.

    Now what I want is to eliminate all ndf files and filegroup of this one would be left form of the traditional way with the mdf and ldf, but to eliminate them gives me an error of space which is not and managed to overcome and neither can eliminate the NDF since It tells me that the file is unique in the group nose if someone already has occurred

    You'll need to move any tables or indexes that are in the secondary filegroup to primary. then you'll be able to drop the file and then the filegroup. Something like

    via google

    Tendrá que mover las tablas o índices que se encuentran en el grupo de archivos secundaria a primaria. entonces usted será capaz de soltar el archivo y luego el grupo de archivos. Algo como:

    CREATE INDEX <index name and full definition>

    WITH (DROP_EXISTING = ON)

    ON [PRIMARY]

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • ¿Cuántos archivos ndf tienes? ¿Por qué quieres eliminarlos?

    How many ndf files do you have? Why do you want to drop them?

    John

  • ¿Por qué quieres poner una limitación al diseño de la base de datos? El tener distintos filegroups y archivos te permitirá tener un diseño físico más flexible y puede facilitar el mantenimiento cuando crezca.

    ¿Cuál error te muestra? ¿Cómo estás tratando de eliminar los archivos?

    Este artículo te puede ayudar para seguir el consejo de Gail: http://microsoftsqlsecret.fullblog.com.ar/mover-los-datos-de-las-tablas-de-un-filegroups-a-otro-sql-server.html

    De ser posible, trata de postear en inglés, ya que la mayoría de los expertos de aquí no hablan español (yo sí pero no soy experto).

    English:

    Why do you want to set a limit to your database design? Having different filegroups and files will allow you to have a more flexible physical design and can ease management when it grows.

    What error are you getting? How are you trying to delete the files?

    This article can help you to follow Gail's advice: http://microsoftsqlsecret.fullblog.com.ar/mover-los-datos-de-las-tablas-de-un-filegroups-a-otro-sql-server.html

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • in this case want to empty the NDF file, it gives me the error that does not contain enough space and it is because within a group and I have a file, wanting empty I can not pass the data to the primary file because it is in a different group only

    GilaMonster (7/27/2016)


    Via google translate:

    Hello dear, I tell them the problem I have, I have a database in which they separated in mdf, NDF and LDF files. The NDF which different filegroup created in the Primary.

    Now what I want is to eliminate all ndf files and filegroup of this one would be left form of the traditional way with the mdf and ldf, but to eliminate them gives me an error of space which is not and managed to overcome and neither can eliminate the NDF since It tells me that the file is unique in the group nose if someone already has occurred

    You'll need to move any tables or indexes that are in the secondary filegroup to primary. then you'll be able to drop the file and then the filegroup. Something like

    via google

    Tendrá que mover las tablas o índices que se encuentran en el grupo de archivos secundaria a primaria. entonces usted será capaz de soltar el archivo y luego el grupo de archivos. Algo como:

    CREATE INDEX <index name and full definition>

    WITH (DROP_EXISTING = ON)

    ON [PRIMARY]

  • Hola amigo tengo 7 grupos contando el Primary y dentro de cada grupo tengo un archivo ndf, quiero eliminarlos porque actualmente tengo un entorno de produccion dentro de una version Enterprisse de SQL y me es nesesario migrarlo a una version Standart, al buscar la informacion la version Standart no me soporta el degloce de archivo tengo que llegar a tener nada mas mis 2 archivos generales, 1 mdf y 1 ldf.

    Por ese motivo quiero vaciarlos y eliminarlos actualmente ya logre eliminar varios que estaban dentro de los mismo grupos pero al quedarme solamente con 1 archivo por grupo, ya no puedo vaciar para eliminarlos

    John Mitchell-245523 (7/27/2016)


    ¿Cuántos archivos ndf tienes? ¿Por qué quieres eliminarlos?

    How many ndf files do you have? Why do you want to drop them?

    John

  • drosa 15759 (7/27/2016)


    Hola amigo tengo 7 grupos contando el Primary y dentro de cada grupo tengo un archivo ndf, quiero eliminarlos porque actualmente tengo un entorno de produccion dentro de una version Enterprisse de SQL y me es nesesario migrarlo a una version Standart, al buscar la informacion la version Standart no me soporta el degloce de archivo tengo que llegar a tener nada mas mis 2 archivos generales, 1 mdf y 1 ldf.

    Por ese motivo quiero vaciarlos y eliminarlos actualmente ya logre eliminar varios que estaban dentro de los mismo grupos pero al quedarme solamente con 1 archivo por grupo, ya no puedo vaciar para eliminarlos

    Sí, te lo soporta. ¿Dónde buscaste esa información? Ambas ediciones soportan 32767 archivos y 32767 grupos de archivos. No necesitas cambiar nada.

    English summary: he says that he needs to migrate from Enterprise to Standard edition, but the latter only supports one mdf and one ldf. I explained that that isn't correct and that he should leave it alone.

    John

    Edit - corrected my Spanish

  • Hola quisiera regresar al diseño tradicional de un archivo mdf y un archivo ldf, para poder migrar de mi version enterprisse a una version standart de SQL.

    tenia alrededor de 28 archivos creados en la base de datos y empece a vaciar archivo por archivo hasta quedar ecatamente con 8, 1 archivo por cada uno de los grupos contenidos en mi base de datos.

    Al querer vaciar el ultimo archivo en cada grupo me da este error

    There is insufficient space in the filegroup to complete the emptyfile operation.

    y ya no puedo eliminarlo porque da error que el archivo contiene datos.

    Luis Cazares (7/27/2016)


    ¿Por qué quieres poner una limitación al diseño de la base de datos? El tener distintos filegroups y archivos te permitirá tener un diseño físico más flexible y puede facilitar el mantenimiento cuando crezca.

    ¿Cuál error te muestra? ¿Cómo estás tratando de eliminar los archivos?

    Este artículo te puede ayudar para seguir el consejo de Gail: http://microsoftsqlsecret.fullblog.com.ar/mover-los-datos-de-las-tablas-de-un-filegroups-a-otro-sql-server.html

    De ser posible, trata de postear en inglés, ya que la mayoría de los expertos de aquí no hablan español (yo sí pero no soy experto).

    English:

    Why do you want to set a limit to your database design? Having different filegroups and files will allow you to have a more flexible physical design and can ease management when it grows.

    What error are you getting? How are you trying to delete the files?

    This article can help you to follow Gail's advice: http://microsoftsqlsecret.fullblog.com.ar/mover-los-datos-de-las-tablas-de-un-filegroups-a-otro-sql-server.html

  • Douglas Rosa


    Hi I would like to go back to the traditional design of one mdf file and one ldf file, to be able to migrate my enterprise edition to a standard edition of SQL.

    I had around 28 files created in the database and I started to empty each file until I ended up with exactly 8, one file per filegroup in my database

    When I want to empty the last file in each group it gives me this error

    There is insufficient space in the filegroup to complete the emptyfile operation.

    I can no longer delete it because it gives me an error telling that the file has data.

    Como dijo John, no hay ninguna limitación en la edición Standard que impida que tengas varios archivos por base de datos. Inclusive en la edición Express es posible hacerlo.

    El problema es que estás utilizando DBCC SHRINKFILE with EMPTYFILE para vaciar los archivos pero lo que tienes que hacer es mover los objetos (tablas e índices) al filegroup PRIMARY como indica el artículo que incluí antes.

    Por cierto, el diseño de un solo archivo de datos no es "tradicional", sólo es el default. Lo común es que haya varios archivos de datos para facilitar la administración y, bajo ciertas condiciones, optimizar el rendimiento.

    As John said, there's no limitation in the Standard edition that prevents you from having multiple files per database. Even in the Express edition is possible.

    The problem is that you're using DBCC SHRINKFILE with EMPTYFILE to empty the files but what you need to do is to move the objects (tables and indexes) to the PRIMARY filegroup as stated in the article I included earlier.

    By the way, the design of a single data file is not "traditional", it's just the default. The common practice is to have multiple data files to ease management and, under certain circumstances, improve performance.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • he estado leyendo varios foros y eso me comentaban que al degradarlo no me aceptaba dichos archivos.

    Ahorita estoy descargando la version de sql server para probar levantar una nueva instancia y de esa forma levantar mi base de datos nuevamente.

    Tambien quisiera consultarles como podria montar o generar un informe el cual me diera el estado de salud de una instancia de sql server.

    Luis Cazares (7/27/2016)


    Douglas Rosa


    Hi I would like to go back to the traditional design of one mdf file and one ldf file, to be able to migrate my enterprise edition to a standard edition of SQL.

    I had around 28 files created in the database and I started to empty each file until I ended up with exactly 8, one file per filegroup in my database

    When I want to empty the last file in each group it gives me this error

    There is insufficient space in the filegroup to complete the emptyfile operation.

    I can no longer delete it because it gives me an error telling that the file has data.

    Como dijo John, no hay ninguna limitación en la edición Standard que impida que tengas varios archivos por base de datos. Inclusive en la edición Express es posible hacerlo.

    El problema es que estás utilizando DBCC SHRINKFILE with EMPTYFILE para vaciar los archivos pero lo que tienes que hacer es mover los objetos (tablas e índices) al filegroup PRIMARY como indica el artículo que incluí antes.

    Por cierto, el diseño de un solo archivo de datos no es "tradicional", sólo es el default. Lo común es que haya varios archivos de datos para facilitar la administración y, bajo ciertas condiciones, optimizar el rendimiento.

    As John said, there's no limitation in the Standard edition that prevents you from having multiple files per database. Even in the Express edition is possible.

    The problem is that you're using DBCC SHRINKFILE with EMPTYFILE to empty the files but what you need to do is to move the objects (tables and indexes) to the PRIMARY filegroup as stated in the article I included earlier.

    By the way, the design of a single data file is not "traditional", it's just the default. The common practice is to have multiple data files to ease management and, under certain circumstances, improve performance.

  • Douglas Rosa (7/27/2016)


    Tambien quisiera consultarles como podria montar o generar un informe el cual me diera el estado de salud de una instancia de sql server.

    Una de las formas más populares de hacerlo es usando sp_blitz. https://www.brentozar.com/blitz/

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply