How to backup the Xmldata table in sql server 2016

  • Hi All,

    My table have 2000000 records and size 60GB .when i take backup it will take time 60 min My backu query is using INTO statemet

    Select id,name,xmldata INTO new_tablename from tablename

    How to reduce the time...please help me.

    Regards

    Pols

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • If you're copying 60GB from one place to another, then it's not going to be quick - and how slow it is will depend on your hardware.  Do you really need to copy the whole table - can you not just merge the changes into what is already there?  Have you considered replication or something like that?

    John

  • i am using same database that is duplicate of another table ....

     

    table don't have the any indexs it is use only transaction purpose like only insert statement when i create index insert is slow and deadlock the table.The same table i am using report generation that time report generation take time more that time i create backup table then i can create index and generate report fast.

  • Can the database be set to the BULK LOGGED recovery model?  If not, can we put this table in a new, single table database that can?

    Also, how up to date does the new copy of the table need to be?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I am using the query is

    SELECT id,name,xmldata INTO New_Table Name from TableName

  • polo.csit wrote:

    I am using the query is

    SELECT id,name,xmldata INTO New_Table Name from TableName

    Yep... you said that from the git.  Can you answer my previous questions so I can best help you do this?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Database is Full Recovery Model...it is not possible to change Bulk logged recovery model

  • polo.csit wrote:

    Database is Full Recovery Model...it is not possible to change Bulk logged recovery model

    My other question, which has still been unanswered is... can we create another database for the new table you want and point a synonym at it so that we can use the simple recovery model for this "throw away" table

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • created new database it is also take time more....

  • Your backup, to a table in same database, is it for migration/upgrade purposes?

    (If so, maybe set database to single user mode, first.)

    Otherwise is it possible to use the builtin database backup?

  • polo.csit wrote:

    created new database it is also take time more....

    Maybe the way you're doing it.  Answer my previous question, please.  You'll be amazed at how fast we can make stuff.  Better yet, you'll be amazed at how little impact it will have on the original database and how little log file it'll all create.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • jonas.gunnarsson 52434 wrote:

    Your backup, to a table in same database, is it for migration/upgrade purposes?

    (If so, maybe set database to single user mode, first.)

    Otherwise is it possible to use the builtin database backup?

    Heh... nah... it's because they're having problems with reporting issues against a table with a lot of "transactions".  Look back in the posts.  We've already been through this with the OP.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Database is full recovery model.when copy the table in single table also take time more and copy of the table is INTO statement.

  • polo.csit wrote:

    Database is full recovery model.when copy the table in single table also take time more and copy of the table is INTO statement.

    We keep going in circles.  I already know that.  I asked you if we could create another database and you responded that it would take too long and I'm telling you it won't.  If you would just answer my questions instead of prejudging them, maybe I could help you do this in literally milliseconds of down time.

    So... one more time...

    1. Are we allowed to create a working database that can be in the simple recovery mode
    2. If so, can we put the copy of the table there and use a synonym to point to it from the original database?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 15 posts - 1 through 15 (of 15 total)

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