Codechef4u is a community for computer professionals,by computer professionals,just like you; who loves sharing and helping each others,Join them
Share your post

SQL server 2016 Transfer Maintenance Plan from One Server to Another

 Hi this is Vaibhav Shringi, This is my 3rd article on SQL server 2016, in this article, will explain in detail how to transfer maintenance plan from one server to another.

In the following example, I will use two servers NMK135 and VS12345 for explanation and sample users Vadmin and nmk12345.

Transfer Maintenance Plan from One Server to Another

1. Connect to Source Integration server

Connect to Integration Services in SQL Server Management Studio (Where Maintenance plan already present Say SERVER-1)


2. Export Maintenance plan package from SERVER-1.

Connect with appropriate permissions and export the “DBMaintenancePlan” package.


3. Select Package Location as File System and browse for Package path to save “DBMaintenancePlan.dtsx” file.

4. Save and OK to complete the export process in SERVER-1.

5. Transfer the newly exported file to new server file system (say SERVER-2).

6. Transfer any required Rebuild Indexes and UpdateStatistics SPs from SERVER-1 to SERVER-2(if any).

7. Connect to Integration Services of SERVER-2. (use step 1). Import the previously exported package.


8. Connect to Database Engine of SERVER-2


9. Verify imported Maintenance Plan on SERVER-2.


10. Modify Plan to change some config entries.


11. Follow below steps ONLY IF WANT TO change Job Schedule Timing.

Click on Calendar button present right side of “Schedule” tab. Change appropriately and save the changes.


Below Step 12 to 14 are for “Nightly_DB_maintenance” Subplan.

Click on Nightly_DB_maintenance Subplan to see below screen.


12. Verify Rebuild and update statistics tasks.

13. Verify Database Backup Location and database names.

      => Double click on “Full Backup Database task”.
      => Verify Folder location.


14. Verify Backup File Cleanup Period.

     => Double click on “CleanUp BackUp Files”.
     => Verify File Age. (Prefer to have 2 weeks) 


Below Step 15 is for “Every2Hrs_DB_Tran_Bkp” Subplan.

Click on Nightly_DB_maintenance Subplan to see below screen


15. Verify Transactional backup location and databases names.

      =>Double click on “Back Up Database Task”
      =>Verify Folder location. 



16. Save the Maintenance plan and close it. 

How to VERIFY Maintenance Plan Jobs?

VERIFY Maintenance Plan Jobs:

1. Open property window of both the jobs (right click on Job name)

  a. DBMaintenancePlan.Every2Hrs_DB_Tran_Bkp
  b. DBMaintenancePlan.Nightly_DB_Maintenance


2. Job owner:

    => If face any access related issue with Vadmin then change Job owner to “SA”.
    => We are facing this issue in VS12345 because of SQL agent service default configuration. 

3. Review Schedule Time etc.


धन्यवाद मित्रो !! 

Thanks Friends


Enums in TypeScript

Enums 

In computer programming, an enumerated type (also called enumeration, enum, or factor in the R programming language, and a categorical variable in statistics) is a data type consisting of a set of named values called elements, members, enumeral, or enumerators of the type(reference wikipedia.org).

Enum allows us to create set of named constants, common use is we can create distinct cases. TypeScript provides both numeric and string-based enums.

We can create three types of enum  in typescript following examples will explain in details , how to create enums.


1. Numeric enums

We will start with numeric enums, an enum can be defined using the enum keyword.

Enum Visibility
    {
        None=1,
        Hidden,
        Visible
    };

Above, we have a numeric enum where Up is initialized with 1. All the following members are auto-incremented from that point on. In other words, Visibility.None has the value 1, Hidden has 2, Visible has 3.

enum Visibility
{
    None,
    Hidden,
    Visible
};

Here, None would have the value 0Hidden would have 1, etc. This auto-incrementing behavior is useful for cases where we might not care about the member values themselves, but do care that each value is distinct from other values in the same enum.

How to use it:

Using an enum is simple: just access any member as a property off the enum itself, and declare types using the name of the enum, check following example where we used enum to set text display mode.

Example:

function
setVisibiity(recipient: string, message: Visibility): void {
    // ...
}

setVisibiity("Aditya Balaji Kendre", Visibility.Visible)


2. String enums

In a string enum, each member must be constant-initialized with a string literal, or with another string enum member.

How to use it:

function
SetUserFevColor(recipient: string, userColorChoice: Colors): void {
    // ...some typescript custom code
}
 
SetUserFevColor("Ajay Balaji Kendre", Colors.Green);
 


3. Heterogeneous enums

Technically enums can be mixed with string and numeric members,but its recommended to avoid Heterogeneous enums except must require case.

Example:

enum
UpdatedData  {
    No = 0,
    Yes="YES"
}