Navision Backup through SQL company wise

sameer_79
Member Posts: 39
Dear All,
i have navision 4 DB with 2 companies,i want to take only one company but through SQL not Nav client,it is possible???
Regards
i have navision 4 DB with 2 companies,i want to take only one company but through SQL not Nav client,it is possible???
Regards
0
Comments
-
Well, to accomplish this you need to have 3 or 4 Filegroups in SQL Server:
1) PRIMARY (Standard); contains system objects
2) Filegroup Company A; to store all tables from company A
3) Filegroup Company B; to store all tables from company B
4) Filegroup Common; to store all tables which are common for all companies
Then you could move all tables into the specific filegreoups:
- DROP all Non-Clustered-Indexes (NCI)
- DROP Clustered-Index using MOVE TO clause to transfer the data into the new filegroup
- CREATE Clustered-Index in new filegroup
- CREATE all Non-Clustered-Index in new filegroup
(of course there's NO chance to do this with NAV - you need to createTSQL scripts)
Then you could use the BACKUP DATABASE command using the FILEGROUP specification; hence you could backup just a single company. But to grant data integrity, you always have to save multiple FG; for example:
PRIMARY + COMPANY_A + COMMON
or
PRIMARY + COMPANY_B + COMMON
Then be aware, that whenever you change/save a table in "Object Designer" indexes could be reset to the default FG.
So, YES - technically it is possible to save just one company, but this requires a LOT of effort and SQL programming.
I'd say it's easier to use the native NAV backup ... :-k
Last but not least: why do you want to do this?Jörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0 -
Didn't Rashed (ara3n) create a program to do this and then shared it on Mibuso? I am pretty sure I saw something, but not sure if in downloads or blogs or tips and tricks.David Singleton0
-
0
-
Ah! Haven't seen this before! Nice! =D>
So you just copy the data into a new database. But this could also mean a huge workload on large databases. Also, you have to repeat this process completely from the scratch with ever Company Backup you want to create.
IMHO for a "one shot" solution this is great (e.g. for setting up a Test-DB or something), for a permanent solution I guess this is not really feasible ... especially, as you CANNOT restore such a backup into the real live database.
So again, it depends on the purpose ...Jörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0 -
pdj wrote:stryk wrote:as you CANNOT restore such a backup into the real live database.
If you need to restore, you need to 1) restore the "One_Company_DB" from the SQL BAK, then transfer the data back into the real DB.
Again, for a small database this might be OK, but for a large system I'd say this is way too much effort ...Jörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0
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