I am really really new to SQL Server, I know how to do a query and other simple stuff and recently my company was bought by another one, we had a Cube Server which was accessed by a excel file via olap using the analysis services from sql server 2008 it was updated by an .abf file, first day after the sale the former server was retired, and everything I have access to is this .abf file used to update the cube, I installed sql server 2008 enterprise edition and I'm trying to restore the file to a new database via the analysis services since the only instructions I received from the old IT department is that is needed to be restored via analysis services. I searched online for some solutions and came across several articles and none of the steps worked for me because they required a already configured database and they were only restoring a backup. I'm thinking I need the .mdf file first so I can recreate the database as is and then I can update it via the .abf file, can someone point me in the right direction?
Since you have the .ABF file, there are a couple options to restore this as a new database. You can either create a new database with the same name, then restore this database from the .ABF file with the AllowOverwrite option set to true. You can also restore directly to a new database by right-clicking the SSAS instance and selecting Restore... From here, specify the backup file name and just enter the name of the database and this will be created as a new cube. This name must be a new database name, as if an existing cube is specified it will be overwritten. Either approach can be done through an XMLA command in SSMS and an example of this is below.
<Restore xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<File>C:\YourFilePath\YourCubeBackupFile.abf</File>
<DatabaseName>TargetOrNewDatabaseName</DatabaseName>
<AllowOverwrite>true</AllowOverwrite>
</Restore>
Try attaching the database with the mdf file in the sql server 2008.
Related
I'm working on taking a on-premise server that works with SQL Server 2019 and migrating this to the cloud. The data right now is not the important thing, but rather the schema since this is a proof of concept. The main issue is that the on-premise server uses filestream to sometimes handle files. This will have to change in the future as refactoring and application updates take place.
The easiest way I thought would be to generate a schema .sql script from the old db and run that in the new environment, but this generated a TON of errors (25k).
Most of the errors include:
Failed permissions in database 'master'
Not finding certain objects in the new clean DB
Extended properties are not permitted on an object or it doesn't exist
Invalid data types
Database doesn't exist or permission not allowed
Filestream feature is disabled
So this probably won't work as a drop in solution to get the schema migrated to the new db. I've heard about AWS DMS (data migration service), but I don't know a lot about this. I'm asking, what tools could I look into to migrate over to RDS when RDS doesn't support features native to SQL Server?
One way to import schema is through the generated scripts wizard. You will have to manually tweak some things to make filestream and the local configuration of the sql server work nicely with aws RDS.
Generate and Publish Scripts Guide
Go to the source database
Right click the database in the menu on
the left (Object Explorer) Tasks>Generate Scripts
Select All tables,
procedures, etc.. except for filestream tables.
In the Scripts wizard pop up under Set Scripting Options, choose to make a .sql file, under advanced options, choose Schema Only. This will generate a script with only meta data for the tables and not the data in them
Generate the file.
Copy the .sql file over to the
EC2 instance (probably the Bastion Host) that is connected to the
RDS instance.
Open MS SQL Management Studio and right click on the
top most object in the Object Explorer and open a new query.
Copy and paste the code inside the .sql file into the query window.
Change the file path location of the data and log file to be
D:\rdsdbdata\DATA\TEST_AWS.mdf and D:\rdsdbdata\DATA\TEST_AWS_Log.ldf
respectively. Any other file location will not be recognized by RDS
and will fail to create the table.
Comment or remove the lines of code that include:
a. ALTER DATABASE [TEST_AWS] SET TRUSTWORTHY OFF
b. ALTER DATABASE [TEST_AWS] SET HONOR_BROKER_PRIORITY
c. ALTER DATABASE [TEST_AWS] SET DB_CHAINING OFF Creating global users
d. FileStream
Execute the Script
Consider adding towards the top of the script DROP DATABASE [TEST_AWS] before the creation of the new database just in case you need to run the script multiple times to find the errors. This will save you from overwriting errors or having a unfinished table in memory.
I want to backup some specific data of SQL database by using vb.net code. In fact i want to save this file as .BAK file and then i want to restore it.
I couldn't find anything. all the solutions in the web was about full backup of database and there was not any method to backup some tables via code.
SQL Server does not permit backing up a single table. Full stop. No provision is made for this whatsoever.
It does permit restoring a single table from a complete backup, but this does not seem to be what you want.
I'm trying to backup a live database to my computer and I can't find the option to do it. I'm connecting to it using Microsoft SQL Server Management Studio 2008 R2. I'm a MySQL monkey, so I'm used to being able to backup to .sql files and move them around.
Anyone have any idea how I can create a file backup of the database? I've found the backup option which only backs up on the server, or the export, which seems to only allow a single table, or code an SQL query, which I'm not too sure on, short of putting in something like SHOW TABLES;
Anyone have any ideas? I'm limited to readonly access for various reasons, nothing bad, promise!
You will only be able to backup the database to a location the service account for SQL has access to. If you have access to a central share on the server/network that you can access and the service can, you might backup to that location and then browse from your computer to pull it down.
If you are just wanting the database structure you could script the database out to a file. This would let you save it locally. If you also want the data though doing a full backup is the quickest way I know of.
EDIT
I would use the T-SQL BACKUP comand and include WITH COPY_ONLY to backup the database, since you stated this is a "live" database. If a scheduled job is performing backups against the database and you break in to do an additional one you will effect the backup recovery chain of the database. Using the COPY_ONLY will allow you to get a backup of the database without requiring it in the event of a recovery need.
You can also create sql dumps with Management Studio.
Right-click the database and select Tasks - Generate Scripts. This will open a wizard that allows you to select what the dump should include (e.g. tables, indices, views, ...).
Make sure you set "Script Data" to true if you want your dump to include inserts.
You can enter a valid UNC path in the Backup option.
I need to copy the contents (tables, views, procs, DATA, etc.) of a SQL Server database and copy it to another SQL Server database. I need to do this entirely in a script as I am not able to carry over files to the destination web server. Using Microsoft SQL Server Management Studio, how can I accomplish this?
Note: The database I am copying to will have the same name and be completely empty.
You can script the database schema and data using SSMS
Right click on the database. Choose tasks....then choose generate sql scripts.
Specify all objects. Then in the options menu choose at the bottom to generate scripts for data.
Below are some links that will be helpful
http://blog.sqlauthority.com/2007/08/21/sql-server-2005-create-script-to-copy-database-schema-and-all-the-objects-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/
http://blog.sqlauthority.com/2007/11/16/sql-server-2005-generate-script-with-data-from-database-database-publishing-wizard/
You can backup the database and restore to any instance you'd like. Since I don't like posting the "how to" when I learned it someplace else originally - here's the MSDN describing the process.
http://msdn.microsoft.com/en-us/library/ms187048.aspx
It is how we do things in our production environment. We back up and restore to our other instances.
The easiest way would be to restore from a backup, but since you can't copy files to the file system, the Copy database wizard will do this.
http://msdn.microsoft.com/en-us/library/ms188664.aspx
I've got a backup made using the regular SQL Server 2005 backup command. Is there a way to restore just a single table, not the whole DB?
Restore the whole database to another machine (or temporary database), then copy the table seems like the easiest to me.
This is not natively supported in SSMS but it’s possible using third party tools.
Apart from Red Gate (great tools btw) you can try SQL Diff (restore object) and SQL Data Diff (restore data) from ApexSQL.
Disclaimer: I’m not affiliated with ApexSQL but we are their customers and use their tools
The unit of backup and recovery in SQL Server is the database (it is the outer boundary of referential integrity).
Red Gate has some pretty good tools for row-level restore (SQL Data Compare and SQL Backup), but they come at a price.
Detach the current database then restore the database with the date of the tbl you need to a new location (make a sub folder) to put it in keep it separate from your production databases, then restore the database to that sub folder, when completed find the tbl you need and script it to a create script file save to a file, your done with the database delete it then reattached the original one, now scroll down to the tbl you want to restore and script it to a create file (this is a backup only) now delete the tbl, make sure your database is selected and the active one next load the the scripted file you just created with the other database in the query analyzer and run it, it should report successful now check to see if your tbl has been replaced. your done