Am writing my article after a very long time. I have been caught up with some other works.
Ok, lets see some interesting facts about tempdb.
Background of Tempdb Database:
TempDB is one of the system database which is used to store the temporary tables or temporary data.
A table can be declared as temp table by adding '#' symbol in the front of the table name.
Temp table will hold a session value appended, For each user a temp table can be created with a session id appended to its name - Unique to identify the tables. Internally, SQL Server will take care of this.
Actions for Tempdb full problem:
Considering, My scenario - Tempdb is full. In this case,
1. Check the feasibility to restart the server. If there is no major impact, restart the server. So that, the database will be freed up and it will more room to get other new tables.
Some times, we are familiar with the below error message.
Description: The LOG FILE FOR DATABASE 'tempdb' IS FULL.
Back up the TRANSACTION LOG FOR the DATABASE TO freeup SOME LOG SPACE
select * from sys.database_files
The above query will get the results as below,
Now, since the log file is full and there is no room to extend further. In that case, we can advise the database to point the file to another location. Below is the query to achieve the same.
The file "templog" has been modified in the system catalog. The new path will be used the next time the database is started.
Cheers,
Venkatesan Prabu .J
No comments:
Post a Comment