Installing DB

sabzam
Member Posts: 1,149
Hi Everbody,
Is it possible in some way or another to install a db when having the .mdf file only?
Is it possible in some way or another to install a db when having the .mdf file only?
0
Comments
-
you need at least the mdf and ndf file.0
-
Hi,
You just need the mdf file.
Create a new Query.
Attach the Database by SQL Statement with Option Rebuild_Log.
Lukas0 -
Sorry, remembered it wrong.
Create DATABASE [mee]
ON Filename = 'c:\.....'
FOR ATTACH_REBUILD_LOG
Lukas0 -
This option does not work if for multiple data files.....
And Navision creates two data files.
RunningCreate DATABASE mee ON (NAME='mee',FILENAME='C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\tada_Data.mdf') FOR ATTACH_REBUILD_LOG
will give you an errorMsg 5120, Level 16, State 5, Line 1 Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\tada_1_Data.ndf". Operating system error 2: "2(The system cannot find the file specified.)". File activation failure. The physical file name "C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\tada_Log.ldf" may be incorrect. Msg 1813, Level 16, State 2, Line 1 Could not open new database 'mee'. CREATE DATABASE is aborted.
0 -
[Topic moved from 'NAV 2009' forum to 'SQL General' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi,
I hope you solved the Problem.
If not, then you should use as second Parameter
FILEGROUP to attach the NDF-File
Lukas0 -
The solution that I find works is.
sp_attach_single_file_db @dbname= 'new_Demo Database NAV (6-0)', @physname= 'C:\Program Files (x86)\Microsoft Dynamics NAV\60\Database - Copy\Demo Database NAV (6-0)_Data.mdf'
You need to ensure that the SQL server user have correct permissions to 'C:\Program Files (x86)\Microsoft Dynamics NAV\60\Database - Copy\' or where you put the db files. I'm using 'NETWORK SERVICE" as the SQL server user account, the NAV will use this account by default when doing demo installation.
To set permission
1. Open propertie for the directory.
2. Click secyrity tab
3. Click advance
4. Click edit
5. If the SQL server user are not pressent press add and pick the user else select the SQL server user and click edit
6. Change the permission according to the picture
7. Click OK
8. Click Ok
9. Click OK
10. Click OK“This posting is provided "AS IS" with no warranties, and confers no rights.”
Peter Wibeck
Software Development Engineer in Test
Dynamics NAV Server and Installer team
http://blog.wibeck.org/0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions