ALTER DATABASE AdventureWorks SET OFFLINE;

ALTER DATABASE AdventureWorks MODIFY FILE ( NAME = AdventureWorks2008R2_Data, FILENAME = 'D:\Database\AdventureWorks2008R2_Data.mdf' );
ALTER DATABASE AdventureWorks MODIFY FILE ( NAME = AdventureWorks2008R2_Log, FILENAME = 'D:\Database\AdventureWorks2008R2_log.LDF' );

ALTER DATABASE AdventureWorks SET ONLINE;

SELECT name, physical_name AS CurrentLocation, state_desc
FROM sys.master_files
WHERE database_id = DB_ID(N'AdventureWorks');