|
|
FAQ: Relocate Database
In a default installation the database will be stored in
"C:\Program Files\Microsoft SQL Server\MSSQL$PKNOW\Data" (path will vary with
language of OS). This is the default path where MSDE stores the databases.
If you want to move the database to another folder on the same server this can
be done with SQL statements of MSDE / MS SQL Server. Follow
this procedure (run it on the server where powerKNOW is installed):
- Stop access to powerKNOW database
There are serveral ways to do this:
- Unpluck the server from the LAN
- Stop the IIS Web-Service (if running under IIS)
- Stop the Cassini Service (if running under Cassini)
- ...
- Backup
You never know for sure: Therefore make a backup of the server.
- Make a backup of the database with SQL-Statement 'BACKUP'
You will have to use the MSDE utility 'osql' for this. This is the command
to execute:
osql -E -S ?SERVER?\pKnow -Q "BACKUP DATABASE pKnowDb TO DISK='?PATHBACKUP?'"
You will have to substitute the followinmg terms:
?SERVER? = Name of the server the MSDE / SQL Server is running on
?PATHBACKUP? = Full path of the backupfile
Assume you are working on server WZVV and you want to save the backup in
file c:\temp\backupfile this will become:
osql -E -S WZVV\pKnow -Q "BACKUP DATABASE pKnowDb TO DISK='c:\temp\backupfile'"
The command has to be executed from a DOS-Box or from "Start > Run".
Do not omit the single and double quotes !!
- Restore the database giving the new location
This is the command for restore:
osql -E -S ?SERVER?\pKnow -Q "RESTORE DATABASE pKnowDb FROM
DISK='?PATHBACKUP?' WITH MOVE 'pKnowDb' TO '?PATHDEST?\pKnowDb.mdf',
MOVE 'pKnowDb_Log' TO '?PATHDEST?\pKnowDb_Log.ldf'"
You will have to substitute the followinmg terms:
?SERVER? = Name of the server the MSDE / SQL Server is running on
?PATHBACKUP? = Full path of the backupfile
?PATHDEST? = Path of the existing folder the database should be moved to
Assume you are working on server WZVV, backupfile is c:\temp\backupfile and
you want to move the database to c:\temp this will become:
osql -E -S WZVV\pKnow -Q "RESTORE DATABASE pKnowDb FROM
DISK='c:\temp\backupfile'
WITH MOVE 'pKnowDb' TO 'c:\temp\pKnowDb.mdf',
MOVE 'pKnowDb_Log' TO 'c:\temp\pKnowDb_Log.ldf'"
The command has to be executed from a DOS-Box or from "Start > Run".
Do not omit the single and double quotes !!
After running this command your database should be remove from the
original location and should now exist in the destination location given.
- Re-Enable access to powerKNOW database
|
|
|
|
|
|