How to create DB in all servers by using one single server

  • Dear Members,

    my requirement like this

    i have total 40 Servers, now i have to create one DB in one server then it should reflect in all servers i.e automatically that DB should create in all servers..

    Guys could please help me to sort out this issue

  • Can you do this manually or so you need this to be an automated process?

    Interactive:

    - How to: Execute Statements Against Multiple Servers Simultaneously (SQL Server Management Studio)

    Programmatic:

    - Learn How to Run PowerShell Scripts Against Multiple Computers

    - I believe RedGate has a multi-server query tool as well that can be run unattended

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • actual requirement is automatic but it is helpful to me ,if you can tell both ways

  • Konuri Dinesh (9/28/2012)


    actual requirement is automatic but it is helpful to me ,if you can tell both ways

    Well I already gave you two ways you could achieve the creation of the same database in 40 instances programmatically. There are countless other ways as well.

    In re-reading your post however, maybe I am misunderstanding. Are you needing to create the database for use, or is your requirement to create one database on a primary database instance and have that database be Replicated or Log Shipped to the other 39 instances?

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • I think your task is complicated, in this instance, by the fact that you need to be local to the SQL Server when accessing the file system, which a CREATE DATABASE would require implicitly.

  • Steve Hendricks (9/28/2012)


    ...by the fact that you need to be local to the SQL Server when accessing the file system, which a CREATE DATABASE would require implicitly.

    Not exactly. Yes, creating a new database implies new files will be created on disk but the database engine (and by extension the SQL Server service account) handles the creation of those files for us. CREATE DATABASE is a T-SQL statement and file system access to the server itself is not required of the caller.

    CREATE DATABASE (Transact-SQL)

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • not for log shipping and replication. i need to use that database

  • Konuri Dinesh (9/28/2012)


    not for log shipping and replication. i need to use that database

    Is the requirement is to be taken literally? Say you have 40 instances named as Instance1 through Instance40. Do they want to be able to log into any of them, create a database, and have that database automatically created on the other 39? Or will there be 1 instance designated as the one where all databases will be created and that instance will be the only one to need to know about the other 39 instances to create those databases?

    If the requirement is less than literal then will you or someone be receiving a request to create 40 databases? This seems more realistic and what the links I originally showed help you do.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • i hope CMS(centralized management server) feature full fill this requirement

  • Konuri Dinesh (10/4/2012)


    i hope CMS(centralized management server) feature full fill this requirement

    It could. You can open a multi-query window against a CMS folder. You can also iterate over CMS registered servers from PowerShell.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Konuri Dinesh (9/27/2012)


    Dear Members,

    my requirement like this

    i have total 40 Servers, now i have to create one DB in one server then it should reflect in all servers i.e automatically that DB should create in all servers..

    Guys could please help me to sort out this issue

    Is this an exact replica of the database (ie all objects) or just an empty database of the same name?

  • you can use central management server...you need to create a group in that and add all the servers you want to reflect..thats the easiest process..

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

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