How to backup and restore HANA schema correctly? - hana

Version of SAP HANA Studio is 2.3.37
Require the correct steps to perform backup and recovery of a specific schema in SAP HANA STUDIO
Steps performed:
For backup, I selected the schema (Right Click->Export).
2.Selected the folder i wanted to take backup and clicked on "Finish".
Is this the right way of taking the schema backup??
If not, pls specify the correct way to tae backup.
Also pls specify the steps to perform recovery.

You can also use SQLScript EXPORT command:
EXPORT "HD_SCHEMA"."*" AS BINARY INTO '/usr/sap/HDB/HDB00/SCHEMATA' WITH REPLACE THREADS 8
however it is basically the same as the manual way you use. Though in HANA Studio export you can choose export in a more handy and straightforward way, which is a plus.
So you are doing it right.

Related

Teradata backup and restore

We want to take a BACKUP of our data in Teradata and
RESTORE it on another Teradata box. Is this possible, and if yes do we neeed to have same version of database on other teradata box? What are the tools available for this?
RESTORE it on Teradata Emulator perhaps running on Windows/Linux box. Is this possible, if not entirely at least few tables?
RESTORE it on Oracle Database, possible?
RESTORE it on Hadoop/Hive system, possible?
If this is still relevant:
Yes, you can. Make sure that system you're restoring backup to is the same version or higher. Most basic tool you can use - "arc" also known as arcmain. It is part of Teradata Tools and Utilities pack. But make sure you're using for restore very same version of ARC as you were using for backup. More advansed tools are: DSU from Teradata (or ABU in older versions), NetBackup from Symantec.
If by Emulator you mean Teradata VM - yes, again possible with same conditions mentioned in #1.
Not by backup-restore. It would be more export-import operation rather than backup-restore. And you need to use custom tools for it.
Same as #3. There is a tool called Teradata Connector for Hadoop that can help you with data movement between Teradata and Hadoop.

Microsoft SQL Server 2005 backup the database in *.sql

I work in a small company which is running M/S SQL Server 2005
Now our head office is asking me to give the whole database backup with the table schema in a single file of *.sql
please help me to backup my database in a *.sql including the table schema.
Thanks in advance.
Use SQL Server Management Studio
right click on your database and choose Generate scripts... and hit Next
choose Script entire database and all database objects and hit Next
choose Save to file and enter a path and a file name for your future sql script file. On the same screen choose Advanced and change the Types of data to script property value from Schema only to Schema and data. Hit OK. Hit Next.
and hit Next again.
You can download, install, and use SQL Server Management Studio that comes free with Microsoft® SQL Server® 2012 Express for that
I would go out and download Microsoft SQL Server Management Studio Express.
http://www.microsoft.com/en-us/download/details.aspx?id=8961
It is free. You will be able to connect to the database, drill down into Databases, right click and under Tasks, pick Backup Database. Make sure you pick full...CHoose Disk as the place you want to write it to and Execute...Look thru your options as well...
Hope this helps!
I’d go with the method peterm suggested but note that this also has flaws. Problem is that SSMS doesn’t order the scripts in correct execution order.
For example, it might happen that DDL for stored procedure P is before DDL for table T that is used in P.
All you need to do is to review your script and make sure there are no such cases. If there are you can try fixing this yourself or using some third party tool to generate script that is ordered correctly.

transfer SQL database (table and data)

iv created a database with some tables and populated them using SQL server 2008, i want to move the database to another machine, what would be the best way copy the database and recreate it in another location ??
by the way im connecting to localhost\SQLEXPRESS if thats important !!
thanks
Backup and restore is usually the simplest way. The only complexity you may encounter is that your may have to recreate and associate users on your target system.
Do a backup of your database and then restore it on another machine
Right click on your database in SSMS. Choose Tasks->Backup. Then choose your location and click ok. Take the backup file you create out of the folder it was in and put it into the same folder on your other computer. Then open SSMS on your other machine. Right click on the database folder and click Restore Database. Enter what you ant to name it, choose From Device and then find your file. Click OK and you are done.
I would use SQL Server backup and restore. I believe you can backup in SQLExpress (you just can't schedule one).
Right click your database, and select Tasks -> Backup. Do the backup.
On your other sql server instance create a database with the same name. And do Tasks -> restore -> database
If you have permissions to restore on the target database server then that is by far the best way to copy the database.
If you don't have permissions, then you'll want to connect to the source and target databases with Management Studio and Import the data from the source. If you have simple primary key only indices on your tables you can import by right clicking on the target database name, then select Tasks, then Import Data. A wizard will walk you through it.
You can practice by importing the data into a new database on your local machine first.
If you have more complex indices or functions, sprocs, and views, you'll want to create the new database first, before you import the data. Same procedure, but select Generate Scripts. The wizard will walk you through the necessary steps. Under script options you'll want to make sure you select True for Script Indexes.
Again you can practice by recreating and importing locally. Though if you create locally you'll need to give the database a new name.

What is the best way to transfer a table or tables from one SQL server to another?

I have been developing in VB.NET and SQL Server 2008 for a while now, but haven't got into live installs yet. In the database system I used be on it had the ability to archive multiple tables into a .dga file, as it was called. I could then restore the .dga file into another database or on another server.
I'm looking for the easiest way to accomplish something similar in SQL Server.
If you want to transfer specific tables, then using Data Transformation Services (right click on the database in SQL Server Management studio and select "Import Data" and it will bring the dialog up for it). Of course, this assumes that you have both databases available to you.
If you are comfortable with replacing the database as a whole, you can easily backup the database and then restore it into a new one through SQL Server Management studio (or through calling the appropriate SP).
I would go for one of the following :
From MS SQL Management Studio, right click on the database / Tasks / Generate scripts
From Visual Studio, in the Server Explorer tab, "publish to provider"
Both will launch a wizard allowing you to export the tables you want the way you want (including data or not, creation scripts or not, etc etc.)
If you want to move tabless without data, the simpliest thing is to script the tables you want and run the script.
We script all our db changes and commit them to subversion and then run them as part of the deplyment process.
If you want to put the whole database on prod including data (scrub out test records first!), then do a backup and restore onthe other server.
For future changes, wescript all our db changes and commit them to subversion and then run them as part of the deployment process. There also are tools that look at the structural differnces bewteen the two servers and creates scripts. REd-Gate's SQL Compare is really good for this.
In addition to HLGEM's suggestions, you can look into SSIS if this is an ongoing process.

How do I backup database from ServerGrid.com?

I have a hosting account with servergrid.com. I want to backup my database, they say I have to use Sql Server Integration Service to backup the database and I would need a commercial version of Sql Server management studio.
I have Sql Server 2005 Developer Edition. I have no idea how to do SSIS backup. I tried playing around with the Sql Server Integration Services Project in VS2005 .. but I failed.
Google also seems to have no step-by-step guide for Non-DBA's like me.
Can anybody point me to/write me a Step-by-Step instructions on how to backup database using SSIS? and also if possible how to restore the database again to the host
SSIS is not really a database backup tool.
If you have a fixed number of tables, you can export the data from SQL Server to comma-separated or raw files - i.e. do the data export using SSIS. It is easy to create such package using SSIS project if you have small number of tables. But if you have a lot of tables it is all manual process. Also it could be hard to automate this - every time you add/remove/change a table or a column, you have to regenerate the SSIS package used to export your data.
SSIS does only data export, so you need a separate tool to do metadata backup (table and stored proc definitions). You can export the metadata using Management Studio (simply script database to text file).
One can call these two tools together a poor man backup tool, but if you metadata changes often you'll probably want to use the real SQL backup tool. Not sure why the hosting guys say you have to use SSIS - maybe they don't want to give you backup permissions to ensure DB safety, but SSIS is not the simplest way to do database backup.
You have a local drive on this machine, correct?
Get access to the sql prompt, through their tools or sqlcmd.
BACKUP DATABASE MYDB TO DISK = 'E:\backups\mydb.bak'
Then FTP that file offsite.
Otherwise, forget these creeps that make you use SSIS to perform tasks that can be done with one line of text.