I m getting an error,during creating a new database from Power Shell...

SuD
Member Posts: 102
C:\WINDOWS\system32> New-NAVDatabase -FilePath C:\Dynamics.90.W1.42815.DVD\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\90\Database\Demo Database N
AV(9-0).bak -DatabaseName NavBase -DatabaseServer RAYMUNDO\NAVDEMO
New-NAVDatabase : A positional parameter cannot be found that accepts argument 'Dynamics'.
At line:1 char:1
+ New-NAVDatabase -FilePath C:\Dynamics.90.W1.42815.DVD\SQLDemoDatabase ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-NAVDatabase], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Dynamics.Nav.Management.Cmdlets.NewNavDatabase
AV(9-0).bak -DatabaseName NavBase -DatabaseServer RAYMUNDO\NAVDEMO
New-NAVDatabase : A positional parameter cannot be found that accepts argument 'Dynamics'.
At line:1 char:1
+ New-NAVDatabase -FilePath C:\Dynamics.90.W1.42815.DVD\SQLDemoDatabase ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-NAVDatabase], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Dynamics.Nav.Management.Cmdlets.NewNavDatabase
0
Best Answers
-
Use Quotes around the value of the 'FilePath' parameter.Jan Veenendaal5
-
DatabaseServer is the name of your SQL server (probably: RAYMUNDO )
DatabaseInstance is the name of the SQL Server instance (probably: NAVDEMO )
ServiceAccount is the name of the account that is running the SQL Server service; you probably can forget this parameter.Jan Veenendaal5 -
This looks like the system wants to create the database file on a non-existent location.
I don't know about NAV2016, but in the NAV2017 version the New-NAVDatabase cmdlet has parameters to define where to create the database:
New-NAVDatabase -DestinationPath "x"
- or -
New-NAVDatabase -DataFilesDestinationPath "x" -LogFilesDestinationPath "y"
The first line sets the folder for datafiles and logfiles to a single location, with the second line you can set different locations for data files and log files.
Use just one of these lines.
Make sure that your SQL Server service account has access to the location you set.Jan Veenendaal5
Answers
-
Use Quotes around the value of the 'FilePath' parameter.Jan Veenendaal5
-
Use Quotes around the 'FilePath' parameter.
Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.0 -
Now i m getting another error,saying
C:\WINDOWS\system32> New-NAVDatabase -FilePath 'C:\DynamicsNAVW116\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft
Dynamics NAV\90\Database\Demo Database NAV (9-0).bak' -DatabaseName MyNavOriginal -DatabaseServer RAYMUNDO\NAVDEMO
New-NAVDatabase : Database restore operation failed due to the following error returned by SQL Server:
Directory lookup for the file "S:\Depot\NAV90\NavDatabases\W1\Demo Database NAV (9-0)_Data.mdf" failed with the
operating system error 3(The system cannot find the path specified.).
File 'Demo Database NAV (9-0)_Data' cannot be restored to 'S:\Depot\NAV90\NavDatabases\W1\Demo Database NAV
(9-0)_Data.mdf'. Use WITH MOVE to identify a valid location for the file.
Directory lookup for the file "S:\Depot\NAV90\NavDatabases\W1\Demo Database NAV (9-0)_Log.ldf" failed with the
operating system error 3(The system cannot find the path specified.).
File 'Demo Database NAV (9-0)_Log' cannot be restored to 'S:\Depot\NAV90\NavDatabases\W1\Demo Database NAV
(9-0)_Log.ldf'. Use WITH MOVE to identify a valid location for the file.
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
RESTORE DATABASE is terminating abnormally.
At line:1 char:1
+ New-NAVDatabase -FilePath 'C:\DynamicsNAVW116\SQLDemoDatabase\CommonA ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [New-NAVDatabase], NavCommandException
+ FullyQualifiedErrorId : RAYMUNDO\NAVDEMO,Microsoft.Dynamics.Nav.Management.Cmdlets.NewNavDatabase
Can u suggest me,passing value to the parameters?
-DatabaseInstance =
-DatabaseServer =
-ServiceAccount =
Thanks in advance
0 -
DatabaseServer is the name of your SQL server (probably: RAYMUNDO )
DatabaseInstance is the name of the SQL Server instance (probably: NAVDEMO )
ServiceAccount is the name of the account that is running the SQL Server service; you probably can forget this parameter.Jan Veenendaal5 -
It is saying file is not located on the path you have provided.
DatabaseInstance - You can check it in Services.msc
Database Sever: The name of your PC(Server)
Service Account: Varies.
What do you want to do? Do you want to restore the database from .bak file??
If yes then
-Get the bak file and restore it from SQL Management studio.Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.0 -
Jan_Veenendaal wrote: »DatabaseServer is the name of your SQL server (probably: RAYMUNDO )
DatabaseInstance is the name of the SQL Server instance (probably: NAVDEMO )
ServiceAccount is the name of the account that is running the SQL Server service; you probably can forget this parameter.
New-NAVDatabase : The device is not ready.0 -
This looks like the system wants to create the database file on a non-existent location.
I don't know about NAV2016, but in the NAV2017 version the New-NAVDatabase cmdlet has parameters to define where to create the database:
New-NAVDatabase -DestinationPath "x"
- or -
New-NAVDatabase -DataFilesDestinationPath "x" -LogFilesDestinationPath "y"
The first line sets the folder for datafiles and logfiles to a single location, with the second line you can set different locations for data files and log files.
Use just one of these lines.
Make sure that your SQL Server service account has access to the location you set.Jan Veenendaal5
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