Tip T303 -Detaching And Reattaching Databases; To Detach The Cisco Tms Database Using Osql; To Attach The Cisco Tms Database Using Osql; Extra Reference Links - Cisco TMS SQL DATABASE Configuration Manual

Table of Contents

Advertisement

TIP T303 –Detaching and reattaching databases
Cisco TMS Versions
All
A set of database files can be detached from a SQL server, which frees up the files and later attached to
the same SQL server or another. Detaching and reattaching is another way to move a database between
servers. There cannot be any active connections to the database to detach it from a SQL server

To detach the Cisco TMS database using osql

osql –E –S servername –Q "sp_detach_db 'tmsng'"
Once detached, the database files, tmsng.mdf and tmsng_log.ldf are now free to be copied, moved, etc.

To attach the Cisco TMS database using osql.

Put the tmsng.mdf file in the data directory of the SQL server, e.g. C:\Program Files\Microsoft SQL
Server\MSSQL\Data\MSSQL.1\MSSQL\Data\tmsng.mdf
osql –E –S servername –Q "sp_attach_db database 'tmsng', 'C:\Program
Files\Microsoft SQL Server\MSSQL\Data\MSSQL.1\MSSQL\Data\tmsng.mdf'"

Extra reference links

How to manage the SQL Server Desktop Engine (MSDE 2000) or SQL Server 2005 Express Edition by
using the osql utility
Cisco TMS Database Knowledge Tips
SQL Server Versions
SQL 2000 – All Versions
MSDE 2000 – All Versions
SQL 2005 – All Versions
SQL 2005 Express – All Versions
Tips category – Maintaining/Upkeep
Page 27 of 35

Advertisement

Table of Contents
loading

Table of Contents