Sunday, September 30, 2012

SQL Log Shipping (What is and How to Do)

It is data base level high availability feature and its one method to keep entire database in different server, from this Transactional log backup will copied and applied on schedule basis.
Pre Requisites
1.       Primary and secondary database instance should running on domain accounts
2.       Both servers must have same collation setting
3.       Primary Database must be in either FULL or Bulk-Logged recovery model
4.       All SQL edition are support (Ent, Std,)
5.       Two folders need to create BACKUPS Folder (R/W to Primary site and Read permission for secondary site and COPY/RESTORE (R/W permission for secondary site)
Advantages of Log Shipping Configuration
1.       Database High Availability – But manually we have to make it availability (15 min Downtime )
2.       Offloading Report Activities
3.       Database version upgrade very easy
Log Shipping Architecture
Log shipping consists of three main operations:
  1. Back up the transaction log at the primary server instance. (BACKUP JOB)
  2. Copy the transaction log file to the secondary server instance. (COPY JOB)
  3. Restore the log backup on the secondary server instance. (RESTORE JOB)
The log can be shipped to multiple secondary server instances. In such cases, operations 2 and 3 are duplicated for each secondary server instance.
A log shipping configuration does not automatically fail over from the primary server to the secondary server. If the primary database becomes unavailable, any of the secondary databases can be brought online manually.
Configuring Log Shipping
1.       Create folders and grant permission
2.       Take full backup and restore in secondary server (
Manually or from wizard it can do
Restore Transaction log
3.       Secondary server database you can keep Standby mode or restore mode. (From Restoring mode – no reading and no writing access will apply
                Standby Mode with Disconnect users when restoring backups
                No Recovery Mode (Restoring Mode)
4.       Configure log shipping (Enable Log Shipping)
Configure Jobs
Configure Alerts
Configure linked servers

To configure log shipping
  1. Right click the database you want to use as your primary database in the log shipping configuration, and then click Properties.
  2. Under Select a page, click Transaction Log Shipping.
  3. Select the Enable this as a primary database in a log shipping configuration check box.
  4. Under Transaction log backups, click Backup Settings.
  5. In the Network path to the backup folder box, type the network path to the share you created for the transaction log backup folder.
  6. If the backup folder is located on the primary server, type the local path to the backup folder in the If the backup folder is located on the primary server, type a local path to the folder box. (If the backup folder is not on the primary server, you can leave this box empty.)
Important noteImportant
If the SQL Server service account on your primary server runs under the local system account, you must create your backup folder on the primary server and specify a local path to that folder.
  1. Configure the Delete files older than and Alert if no backup occurs within parameters.
  2. Note the backup schedule listed in the Schedule box under Backup job. If you want to customize the schedule for your installation, then click Schedule and adjust the SQL Server Agent schedule as needed.
  3. Microsoft SQL Server 2012 Enterprise supports backup compression. When creating a log shipping configuration, you can control the backup compression behavior of log backups by choosing one of the following options: Use the default server setting, Compress backup, or Do not compress backup. For more information, see Log Shipping Transaction Log Backup Settings.
  4. Click OK.
  5. Under Secondary server instances and databases, click Add.
  6. Click Connect and connect to the instance of SQL Server that you want to use as your secondary server.
  7. In the Secondary Database box, choose a database from the list or type the name of the database you want to create.
  8. On the Initialize Secondary database tab, choose the option that you want to use to initialize the secondary database.
NoteNote
If you choose to have Management Studio initialize the secondary database from a database backup, the data and log files of the secondary database are placed in the same location as the data and log files of the master database. This location is likely to be different than the location of the data and log files of the primary database. (Default Database Location)
  1. On the Copy Files tab, in the Destination folder for copied files box, type the path of the folder into which the transaction logs backups should be copied. This folder is often located on the secondary server.
  2. Note the copy schedule listed in the Schedule box under Copy job. If you want to customize the schedule for your installation, click Schedule and then adjust the SQL Server Agent schedule as needed. This schedule should approximate the backup schedule.
  3. On the Restore tab, under Database state when restoring backups, choose the No recovery mode or Standby mode option.
  4. If you chose the Standby mode option, choose if you want to disconnect users from the secondary database while the restore operation is underway.
  5. If you want to delay the restore process on the secondary server, choose a delay time under Delay restoring backups at least.
  6. Choose an alert threshold under Alert if no restore occurs within.
  7. Note the restore schedule listed in the Schedule box under Restore job. If you want to customize the schedule for your installation, click Schedule and then adjust the SQL Server Agent schedule as needed. This schedule should approximate the backup schedule.
  8. Click OK.
  9. Under Monitor server instance, select the Use a monitor server instance check box, and then click Settings.
Important noteImportant
To monitor this log shipping configuration, you must add the monitor server now. To add the monitor server later, you would need to remove this log shipping configuration and then replace it with a new configuration that includes a monitor server.

  1. Click Connect and connect to the instance of SQL Server that you want to use as your monitor server.
  2. Under Monitor connections, choose the connection method to be used by the backup, copy, and restore jobs to connect to the monitor server.
  3. Under History retention, choose the length of time you want to retain a record of your log shipping history.
  4. Click OK.
  5. On the Database Properties dialog box, click OK to begin the configuration process.

Monday, April 9, 2012

How To Change Desktop.ini file for Replace it from Backup File

Scenario : You already taken backup including Desktop.ini, now you want re-store old backup to same location, with existing ini file its not allow, for this you better to change current ini file and replace it from new one. Go to windows assembly and run below commands C:\Windows\assembly>attrib -r -h -s C:\Windows\assembly>rename Desktop.ini Desktop.initemp.bak C:\Windows\assembly>cd..

Monday, July 4, 2011

Facebook spam video links

Today we face The latest Facebook video spam may contain a title as
“ Dad Gеts Еmbarrassеd, Еntеrs Daughter’s Rοοm” and hope you know what it looks like:

When you click on any of these links(or kind of link), you will redirected to a malicious website, here it was: ofkffo.info,
Its look like a YouTube, like for video box with a Facebook.
Once you click the Jaa or open video link button twice, the spam video link starts spreading through your Facebook account, thus targeting your friends who are on live.
Its just a viral link that spreads through your Facebook account.

For Avoid this kind of issues
On Facebook, click on the small cross on top right corner of such links
to mark it as spam. Further, we recommend you to scan your computer
files for virus.

Sunday, May 1, 2011

What is SOX ?

What is Sarbanes-Oxley Act (SOX)? - Definition from Whatis.com

Sarbanes-Oxley Act (SOX)

The Sarbanes-Oxley Act of 2002 (often shortened to SOX) is legislation enacted in response to the high-profile Enron and WorldCom financial scandals to protect shareholders and the general public from accounting errors and fraudulent practices in the enterprise. The act is administered by the Securities and Exchange Commission (SEC), which sets deadlines for compliance and publishes rules on requirements. Sarbanes-Oxley is not a set of business practices and does not specify how a business should store records; rather, it defines which records are to be stored and for how long.

The legislation not only affects the financial side of corporations, it also affects the IT departments whose job it is to store a corporation's electronic records. The Sarbanes-Oxley Act states that all business records, including electronic records and electronic messages, must be saved for "not less than five years." The consequences for non-compliance are fines, imprisonment, or both. IT departments are increasingly faced with the challenge of creating and maintaining a corporate records archive in a cost-effective


FAQ: What is the impact of Sarbanes-Oxley on IT operations?


The following sections of Sarbanes-Oxley contain the three rules that affect the management of electronic records. The first rule deals with destruction, alteration, or falsification of records.



Sec. 802(a) "Whoever knowingly alters, destroys, mutilates, conceals, covers up, falsifies, or makes a false entry in any record, document, or tangible object with the intent to impede, obstruct, or influence the investigation or proper administration of any matter within the jurisdiction of any department or agency of the United States or any case filed under title 11, or in relation to or contemplation of any such matter or case, shall be fined under this title, imprisoned not more than 20 years, or both."

The second rule defines the retention period for records storage. Best practices indicate that corporations securely store all business records using the same guidelines set for public accountants.



Sec. 802(a)(1) "Any accountant who conducts an audit of an issuer of securities to which section 10A(a) of the Securities Exchange Act of 1934 (15 U.S.C 78j-1(a)) applies, shall maintain all audit or review workpapers for a period of 5 years from the end of the fiscal period in which the audit or review was concluded."

This third rule refers to the type of business records that need to be stored, including all business records and communications, including electronic communications.



Sec. 802(a)(2) "The Securities and Exchange Commission shall promulgate, within 180 days, such rules and regulations, as are reasonably necessary, relating to the retention of relevant records such as workpapers, documents that form the basis of an audit or review, memoranda, correspondence, communications, other documents, and records (including electronic records) which are created, sent, or received in connection with an audit or review and contain conclusions, opinions, analyses, or financial data relating to such an audit or review."