Restore of database fails - sql-server

I got the error message below while restoring the database from the shared folder.
Restore of database failed 'XYZ'. Modify file encountered operating system error 112 there is not enough space on the disk while attempting to expand the physical file.
The backup file size is 28 GB. Restore is to the H: drive having 500 GB of free space. How do I solve this?

Run the following command to get the file size of the backup and then you can check whether or not your drives have enough space available:
restore filelistonly FROM DISK='drive:\path\backup_file.bak'

Related

sql- move log file to another drive

i'm working on huge DB, and while insert\work with big files, log file increase to 60GB and over, and eat all my drive so it can't continue processing.
i tried shrink log file but it work afterwards, and while working it increase again so i thought to move the log file (only) to my 2nd drive where i got more space.
i tried by Detach and Attach but it didnt work , error :
An error occurred when attaching the database(s). Click the hyperlink
in the Message column for details.
i also tried manually by alter command:
ALTER DATABASE [databasename]
MODIFY FILE ( NAME = filename , FILENAME = "new file location and name");
but it make the DB "recovery pending" and i had to restore it back from backup.
any other options?
Since you restored from backup, you can add the MOVE command to your restore command to move the log file to a new drive during the restore.
USE [master]
GO
RESTORE DATABASE [YourDatabase] FROM DISK = 'c:\mssql\backup\Full.bak'
WITH CHECKSUM,
MOVE 'YourDatabase_Log' TO 'E:\newdir\Log.ldf',
RECOVERY, REPLACE;
In order to keep your log file from growing too much, you need to increase the frequency of your log backups, assuming you aren’t on SIMPLE RECOVERY MODEL. Shrinking without backing up is not going to do much, if anything at all. When you backup a log file, the committed transactions are backed up and cleared from the log, freeing up space. As you have witnessed your log file will continue to grow based on the workload. Thus, regular shrinking of the log file isn’t really going to help you.

Can't backup database when LOG_BACKUP file is full

The problem that I encounter, is that the LOG_BACKUP file of one of my databases is full. This is a SQL Server 2012 environemnt. The problem occurs because there is a limited space allocated for the log file. The space on the disk itself is sufficient to do a backup. Normally on test systems I would set the recovery mode from FULL to SIMPLE, do a shrink file, and set it back to FULL.
However, I am now working on another system and I would like to preserve the backup chain. So the next thing I try is to increase the allocated space for the log file. This does not work because of the 9002 message (LOG_BACKUP full). Also doing a full backup of the database does not work, with the same message.
As far as I can find, these are the options to clear your LOG_BACKUP file. How can I resolve this issue?

How to restore sybase (SAP ASE) .db and .log backup on a another system?

How can I restore (or read in a some decent form) a sybase backup that I've been given to be analyzed?
I have been given a backup from sybase database that contains a single .db and one .log file.
I'm new to sybase and I have no access to original system nor I have any information about the database structure that these files contain.
The thing I know is that backup is probably made with command
dbbackup -c "userid=xxx;password=xxx" -d -t -y D:\path\to\backup
I've been asked to analyze the content of the database and to do that I've set up a SAP ASE 16.0 on RedHat 7.
I have tried to restore the backup using the load database command but all I get is a error report:
Backup Server session id is: 17. Use this value when executing the
'sp_volchanged' system stored procedure after fulfilling any volume change
request from the Backup Server.
Backup Server: 4.10.2.1: Label validation error: first label not VOL1.
Backup Server: 6.31.2.4: Volume rejected.
Backup Server: 1.14.2.2: Unrecoverable I/O or volume error. This DUMP or LOAD
session must exit.
Backup Server: 6.32.2.3: /data/sybase/backup/adbname.db: volume not valid
or not requested (server: , session id: 17.)
Backup Server: 1.14.2.4: Unrecoverable I/O or volume error. This DUMP or LOAD
session must exit.
Msg 8009, Level 16, State 1:
Server 'ASE1', Line 1:
Error encountered by Backup Server. Please refer to Backup Server messages for
details.
the error indicates that the database backup file is not valid.
Are you sure that it is a Sybase ASE dump file. ".db" files look like more DB2 backup files than ASE backup files?
First, you didn't write the restore command for restoring dB and I think you used wrong command for getting backup.
Briefly, for getting backup of a Sybase db you have to write:
create backup
go
Backup files are stored in da\server\instance\dasd\backup\unique_backup_id .
And for load it you have to write:
restore backup "unique_backup_id"
go
If restore backup succeeds, the server automatically shuts down; you must manually restart it.
Resources is: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc36272.1570/html/commands/X16531.htm

Database drive size was overfilled due to log file how to fix it?

I had stuck with one of our team issue where database drive size was overfilled due to log file which was around 150 GB and there was no hope of making any space on server. So, they had detached the database and then deleted to log file. But, then they were then not able to attach the mdf file. I then tried to rebuild log file but it was too not successful as there was no clean shutdown in database. Has anyone gone through this problem and successfully recovered the database?
sp_attach_single_file_db followed by a DBCC CHECKDB should do the trick. Any uncommitted transactions that might still be in that log file will be lost.
If you have an offline database in your metadata, delete that one first with DROP DATABASE but make sure you have a backup of your MDF file.

Could not restore a database

I do not understand this error message:
There is insufficient free space on disk volume 'S:\' to create the database. The database requires 291.447.111.680 additional free bytes, while only 74.729.152.512 bytes are available.
It is true I have 74GB free on my disk S, but I'm trying to restore a backup file having only 2.4 GB.
Is it possible a backup of 2GB to fill 291 GB?
Later edit: Source database before backup has 52GB (data) + 225G (log).
You can use RESTORE FILELISTONLY FROM DISK = N'C:\Path\YourBackup.bak' to check the space used by the DB in the backup upon restoration. Basically, this will allow you to see how big it'll be, without actually restoring the backup.
You can restore the database on a separate drive. Let's say you are getting you don't have sufficient space on C: drive, then you can do it on another drive like D:\ , E:\ or anyone. You can do it like the below image

Resources