Thursday, May 26, 2011

Solaris 10 disk mirroring using Solaris Volume Manager

 

Below are the steps to do disk mirroring using SVM.

  • My primary Disk: c0t0d0s0
  • My Second Disk:c0t1d0s0

 

1. Copy the partition table of the first disk to second disk(mirror disk)

bash-3.00# prtvtoc /dev/rdsk/c0t0d0s0 >/vtoc.bak
bash-3.00# fmthard -s /vtoc.bak /dev/rdsk/c0t1d0s0

2. Creating state database replicas on each disk

bash-3.00# metadb -a -f -c 3 c0t0d0s7
bash-3.00# metadb -a -f -c 3 c0t1d0s7

3. Check the state database

bash-3.00# metadb
        flags           first blk       block count
     a        u         16              8192            /dev/dsk/c0t0d0s7
     a        u         8208            8192            /dev/dsk/c0t0d0s7
     a        u         16400           8192            /dev/dsk/c0t0d0s7
     a        u         16              8192            /dev/dsk/c0t1d0s7
     a        u         8208            8192            /dev/dsk/c0t1d0s7
     a        u         16400           8192            /dev/dsk/c0t1d0s7

A state database replica contains configuration and state information about the meta devices.

4.Create the root slice mirror and its first sub-mirror 

bash-3.00# metainit -f d10 1 1 c0t0d0s0
d10: Concat/Stripe is setup
bash-3.00# metainit -f d20 1 1 c0t1d0s0
d20: Concat/Stripe is setup
bash-3.00# metainit d0 -m d10
d0: Mirror is setup

5. Next we need to run metaroot to prepare /etc/vfstab and /etc/system (do this only for the root slice)

Take a backup before run metaroot command

bash-3.00# cp vfstab vfstab.orig
bash-3.00# cp system system.orig


bash-3.00# metaroot d0

6. create swap slice mirror and its first sub-mirror

bash-3.00# metainit -f d11 1 1 c0t0d0s1
d11: Concat/Stripe is setup
bash-3.00# metainit -f d21 1 1 c0t1d0s1
d21: Concat/Stripe is setup
bash-3.00# metainit d1 -m d11
d1: Mirror is setup

7. Now my HOME partition

bash-3.00# metainit -f d12 1 1 c0t0d0s3
d12: Concat/Stripe is setup
bash-3.00# metainit -f d22 1 1 c0t1d0s3
d22: Concat/Stripe is setup
bash-3.00# metainit d2 -m d12
d2: Mirror is setup

 

8. My VAR partition

bash-3.00# metainit -f d13 1 1 c0t0d0s4
d13: Concat/Stripe is setup
bash-3.00# metainit -f d23 1 1 c0t1d0s4
d23: Concat/Stripe is setup
bash-3.00# metainit d3 -m d13
d3: Mirror is setup

 

9. My OPT partition

bash-3.00# metainit -f d14 1 1 c0t0d0s5
d14: Concat/Stripe is setup
bash-3.00# metainit -f d24 1 1 c0t1d0s5
d24: Concat/Stripe is setup
bash-3.00# metainit d4 -m d14
d4: Mirror is setup

10. Modify vfstab to mount all mirrors after boot.
The entry for the root device (/) has already been altered by the metaroot command we executed before.

#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/md/dsk/d1  -       -       swap    -       no      -
/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      -
/dev/md/dsk/d3  /dev/md/rdsk/d3 /var    ufs     1       no      -
/dev/md/dsk/d2  /dev/md/rdsk/d2 /home   ufs     2       yes     -
/dev/md/dsk/d4  /dev/md/rdsk/d4 /opt    ufs     2       yes     -
/devices        -       /devices        devfs   -       no      -
sharefs -       /etc/dfs/sharetab       sharefs -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -

11.Reboot the system


bash-3.00#lockfs -fa
bash-3.00# sync;sync;init 6

12. Now Attach the sub-mirrors to all mirrors

bash-3.00# metattach d0 d20
d0: submirror d20 is attached
bash-3.00# metattach d1 d21
d1: submirror d21 is attached
bash-3.00# metattach d2 d22
d2: submirror d22 is attached
bash-3.00# metattach d3 d23
d3: submirror d23 is attached
bash-3.00# metattach d4 d24
d4: submirror d24 is attached

 

You can use metastat to track the mirroring progress

bash-3.00#metastat

Tuesday, May 10, 2011

Networker free reporting tool NSR_REPORTER

 

NSR Reporter is an excellent free Networker reporting tool developed by Thierry Faidherbe, you can download it from below link.

http://users.skynet.be/networker_reporter/index.html

You can see the full documentation of this tool on above link and also the author is very supportive, you will definitely get answer for your mails.

I am running this tool weekly basis and configured to send the tabular report in an excel sheet to the management, I will explain it below. I am using blat.exe here for sending the attachment.

1. Install NSR_REPORTER

2. Go to NRU500\data\servername\config folder and open the file smtp_daily_excel_report_by_user.txt

3. Add your servers in the file as below, I have arranged my clients based on roles.

You can add on below format

servername1;outputfilename1

servername2;outputfilename2

So it will create report for my servers on separate excel sheets based on outputfilename

For Example:-

###DB Servers -–> output file name will be as nsr_reporter_servername_status_for_DBServers.xls###
sqlsrev1;DBServers
sqlserv2;DBServers
oraclesrv1:DBServers

### File server--> output file name will be nsr_reporter_servername_status_for_FileServers.xls###
Fileserv1;FileServers
FileServ2;FileServers


### Web Servers-->output file name will be nsr_reporter_servername__status_for_WebServers.xls ###
Web1;WebServers
Web2;WebServers

4. Run the reporting tool

NSR_REPORTER_5.0.exe -s bkpserv -q "1 week ago" -D MM/DD/YYYY -graph -nodns –noicmp

5.After it completed successfully  you can see the report file under C:\NRU500\data\servername\export folder

here it’s the content of my file nsr_reporter_servername__status_for_WebServers.xls

image

It will have client summary tab and detailed tab.

6.Now download and install blat.exe

blat -install <smart hostname>

Create a .bat file to send the mail as below format

blat.exe -to user1@company.com, user2@company.com -subject "Weekly Backup Report" -f fromaddress@company.com -attach C:\NRU500data\servername\export\nsr_reporter_servername__status_for_WebServers.xls

7. Schedule the nsr_reporter script and .bat file for sending mail using windows scheduler task according to your requirements.

Thursday, May 5, 2011

Redirecting an Exchange 2010 standalone server snapshot backup to another database or to the recovery database (RDB)

This topic describes how to redirect a snapshot backup of an Exchange 2010 standalone server to another database or the recovery database (RDB). To redirect an Exchange 2010 standalone server snapshot backup to the recovery Database

1. The database or the recovery database must already exist.

To restore to the RDB, create the RDB on an Exchange server, if necessary and leave the RDB dismounted

To create recovery database, logon to Exchange Management Shell and execute the following command

New-MailboxDatabase -Recovery -Name RDB1 -Server EXCH-MBCH-SRV

Or

New-MailboxDatabase -Recovery -Name RDB -Server EXCH-MBCH-SRV

-EdbFilePath "C:\Recovery\RDB\RDB.EDB" -LogFolderPath "C:\Recovery\RDB"

clip_image002

You can see the Recovery DB on Exchange GUI now

clip_image004

1. Open the Backup, Archive, and Restore.

2. Click File > Specify NetBackup Machines and Policy Type.

3. Select  Policy type MS-Exchange-Server

clip_image008

4. Click File > Select Files and Folders to Restore > from Normal Backup

5. From the NetBackup History pane, select one of the following:

· The last full backup, or

· The last full backup and all subsequent differential backups, or

· The last full backup and the last cumulative backup

6. In the All Folders pane, expand Microsoft Information Store.

7. Select the database you want to restore.

8. Click Actions > Restore.

clip_image010

9. Change the destination path to another database or to the RDB:

· Click the General tab.

· Select Restore everything to a different location.

In the Destination box, provide the name of the alternate database you want to restore to. Or provide the name of the RDB you previously created. Exchange 2010 does not automatically redirect a database to its RDB, if it exists.

clip_image012

10. Click the Microsoft Exchange tab.

clip_image014

11. Check Commit after last backup set is restored.

If you choose to restore backup images separately, you must check Commit after last backup set is restored only when you restore the last incremental backup set.

13 Click Start Restore.

clip_image016

Restore Mailbox from Recovery Database

After restoring the database backup into recovery database we can move the required mailbox into exchange database. To perform this identify the required mailbox and perform proper backup before starting the mailbox restore.

Launch the Exchange Management Shell and execute the following commands

Restore-Mailbox -Identity <mail box name> -RecoveryDatabase RDB

Example:

Redirecting an Exchange 2010 Database Availability Group (DAG) snapshot backup to another database or to the recovery database (RDB)

To redirect an Exchange 2010 snapshot backup to another database or to the recovery database

1. Manually suspend replication. This step applies for any snapshot provider you use

2. Perform all steps of Exchange 2010 standalone server explained above.