ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Create SQL History Database

    IT Discussion
    server 2012 sql server sql server 2012 sql server management studio database backup restore
    5
    13
    2.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gjacobseG
      gjacobse
      last edited by

      Background

      Server 2012 running SQL Server 2012 Management Studio 11.0.5343.0

      The vendor software uses SQL for the DB. Each year they create a sub DB as a history file. The 'new' procedure is to create a backup of the DB, then restore it into the history DB.

      The backup goes off without much of an issue. However restore does not. The process should create a new DB leaving the original DB in a active state. However, the restore puts the original into a 'Restoring' state. I connected to support and the resolution was to then go to the original DB and restore it from the backup just made.

      0_1459980304024_2016-04-05 08_56_40-NTG - SSI-SQL01 - Connected.png

      1 Reply Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        So this is resolved now?

        1 Reply Last reply Reply Quote 0
        • gjacobseG
          gjacobse
          last edited by

          Not as I would like no. I don't see why you need to restore the original DB if you made a back up copy of it to create a history DB.

          1 Reply Last reply Reply Quote 0
          • J
            Jason Banned
            last edited by Jason

            What script are you running to take the backup? A backup doesn't require a restore. Did you modify the backup so it's not touching the original when restored? Sounds like it might be still referencing the original DB

            Also if this is just histrocial backups why does it actively need to be in SQL as a DB? That's just using more memory even if the DB isn't used.

            gjacobseG 1 Reply Last reply Reply Quote 1
            • C
              Carnival Boy
              last edited by

              Yeah, I get this as well and haven't resolved yet. Hopefully someone on here will have the answer.

              You don't need to restore from backup to get the original on-line, you just need to execute "RESTORE DATABASE DB1 WITH RECOVERY". This is what I used and it seemed to work fine - this wasn't on a production server though, so I can't guarantee anything.

              1 Reply Last reply Reply Quote 1
              • gjacobseG
                gjacobse @Jason
                last edited by

                @Jason said:

                What script are you running to take the backup? A backup doesn't require a restore. Did you modify the backup so it's not touching the original when restored? Sounds like it might be still referencing the original DB

                Also if this is just histrocial backups why does it actively need to be in SQL as a DB? That's just using more memory even if the DB isn't used.

                No script running. No modification of the backup,

                JaredBuschJ 1 Reply Last reply Reply Quote 0
                • JaredBuschJ
                  JaredBusch @gjacobse
                  last edited by

                  @gjacobse said:

                  @Jason said:

                  What script are you running to take the backup? A backup doesn't require a restore. Did you modify the backup so it's not touching the original when restored? Sounds like it might be still referencing the original DB

                  Also if this is just histrocial backups why does it actively need to be in SQL as a DB? That's just using more memory even if the DB isn't used.

                  No script running. No modification of the backup,

                  You are doing it wrong in management studio.

                  1 Reply Last reply Reply Quote 0
                  • C
                    Carnival Boy
                    last edited by

                    ^^ helpful...

                    JaredBuschJ 1 Reply Last reply Reply Quote 0
                    • JaredBuschJ
                      JaredBusch @Carnival Boy
                      last edited by

                      @Carnival-Boy said:

                      ^^ helpful...

                      Sorry, emergency bowel issues.... /wtb cyborg body.

                      Anyway, in management studio, you are likely not setting the right options. Are you restoring directly to the new DB or are you making a backup first and then restoring the backup? It sounds like the former.

                      1 Reply Last reply Reply Quote 1
                      • C
                        Carnival Boy
                        last edited by

                        In my case, when doing the restore I renamed the database and changed the location, and er, that's about it. There may be another setting that I missed, but I don't know what.
                        Instructions here look like pretty much what I did https://technet.microsoft.com/en-us/library/ms186390(v=sql.110).aspx

                        1 Reply Last reply Reply Quote 0
                        • gjacobseG
                          gjacobse
                          last edited by

                          Turns out the directions they vendor sent us were incomplete / wrong.

                          it's done and over with.

                          1 Reply Last reply Reply Quote 1
                          • C
                            Carnival Boy
                            last edited by

                            Care to explain? It may help me out.

                            1 Reply Last reply Reply Quote 0
                            • gjacobseG
                              gjacobse
                              last edited by

                              In this case, it was a matter of the settings during the restore.

                              Under GENERAL you had to select your source and destination as normal. Destination was changed so that it was the new History file. Under FILES you updated the DB and LOG files to reflect the new DB, otherwise you would over write the originals.

                              This is where they borked it. They didn't mention FILES only going to OPTIONS, and there is where they mentioned updating the file names. The main discovery was that you need to uncheck LEAVE Source database in the restoring state.

                              When I emailed them about removing the 'borked' databases I had created the called me back. I mentioned it to the fellow and we had a short discussion on the matter where he took notes and agreed that the directions were incorrect. When I got to the part about unchecking LEAVE Source database in the restoring state he mentioned that he uncheck Take tail-log backup before restore

                              Hope this helps.

                              0_1460118217976_2016-04-08 08_22_29-NTG - SSI-SQL01 - Connected.png

                              1 Reply Last reply Reply Quote 1
                              • 1 / 1
                              • First post
                                Last post