Skip to main content

Posts

How to add multiple log files in SQL Database

Below query can create ldf file.Its creating second ldf file on Testdb Database. You can create as many as you want. USE [master] GO ALTER DATABASE [TestDb] ADD LOG FILE ( NAME = N'TestDB_Log2', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008R2\MSSQL\DATA\Testdb_Log2.ldf' , SIZE = 1024KB , FILEGROWTH = 10%) GO I Hope this could be your expected solution.

How to patch service pack for sql server clustering?

Patch the passive node first then reboot the node and then fail over instance on that node and then in similar manner patch the other node. This you can apply for sql 2008 and above. In SQL Server 2012, there is a Cluster Aware Update that will automatically Update all the nodes. Start applying the service pack on the passive node and then failover the instance to passive node after the installation is over on the passive node now start applying the service pack on active node and again fail-over the node. On SQL Server 2008/ 2008R2 : Apply patches/hot-fixes on passive node(N2) first then reboot the server. once the passive node(N2) is up, fail-over the resources from active node(N1) to passive node(N2), perform the same steps on N1 node and fail-over the resources from N2 to N1. On SQL Server 2005 : Apply patches/hot-fixes only on active node(N1), same will be applied on passive node(N2) too. On SQL Server 2005 we need down time during this activity. But on SQL server 2008/2008R2 we

How to add files to logshipped SQL database?

Run log back up job on primary server and disable backup job to make sure not to run any backup jobs further until we enable again. check the log back ups if there are any need to be restored on secondary db, restore them if any until all the log backups complete. Then disable the log shipping add mdf-ldf file take a log backup and restore the same on secondary database them enable log shipping and enable backup job as well. If the drives and path exist on secondary log shipping will not break, if the drives are different obviously log shipping will fail.u have to disable all jobs in primary make sure that in between no backups will happen. restore that log file backup with move option. If the path of both files are same it wont break logshipping. If.If path is different then manually restore that particular log backup with move option.

What is latches in sql server

Microsoft SQL Server provides counters to monitor internal SQL Server resource called latches.Monitoring the latches to determine user activity and resource usage can help you to identify performance bottlenecks like Average Latch Wait Time,Waits/sec We can monitor the performance by using cpu usage and memory usage what is use of latch. Latches are light weight locks which SQL server acquires for pages in buffer. Latch is a synchronization mechanism between threads.Latch protects access to in memory data structures. latches are lightweight as compare to locks. the best example to understand latch is TEMP DB LATCH CONTENTION.

SQL Server Build version

This is a list of ll SQL Server Build versions till Year 2014 6.50.201 SQL Server 6.5 RTM 6.50.213 SQL Server 6.5 SP1 6.50.240 SQL Server 6.5 SP2 6.50.258 SQL Server 6.5 SP3 6.50.281 SQL Server 6.5 SP4 6.50.415 SQL Server 6.5 SP5 6.50.416 SQL Server 6.5 SP5a SQL Server 6.5 7.00.0623 SQL Server 7 RTM 7.00.0699 SQL Server 7 SP1 7.00.0842 SQL Server 7 SP2 7.00.0961 SQL Server 7 SP3 7.00.1063 SQL Server 7 SP4 SQL Server 7 8.00.0194 SQL Server 2000 RTM 8.00.0384 SQL Server 2000 SP1 8.00.0534 SQL Server 2000 SP2 8.00.0760 SQL Server 2000 SP3 8.00.2039 SQL Server 2000 SP4 SQL Server 2000 9.00.1399 SQL Server 2005 RTM 9.00.2047 SQL Server 2005 SP1 9.00.3042 SQL Server 2005 SP2 9.00.3042.01 SQL Server 2005 "SP2a" 9.00.3054 SQL Server 2005 KB934458 9.00.3077 SQL Server 2005 Security Update 9.00.3152 SQL Server 2005 SP2 Cumulative Hotfix 9.00.3161 SQL Server 2005 SP2 CU1 9.00.3175 SQL Server 2005 SP2 CU2 9.00.3186 SQL Server 2005 SP2 CU3 9.00.3200

Error no:1418 on Mirroring in SQL

The server network address "xxxxx" can not be reached or does not exist. Check the network address name and reissue the command. Pls check endpoints on all servers using SELECT * FROM sys.endpoints If 1418 error: check it these, duplicate end points exists, tcp/ip enabled or not, check editions principal and mirror, windows firewall off, check login not created in mirror instance. How to delete duplicate end points if exists ? IF EXISTS (SELECT * FROM sys.endpoints e WHERE e.name = N'EndPoint_name') DROP ENDPOINT [EndPoint_name] GO

SQL Error on running of Enterprise portal ,sharepoint site

I am getting following SQL Error on running of Enterprise portal ,sharepoint site Could you advice solution on this error. Unknown SQL Exception 10054 occured. Additional error information from SQL Server is included below. A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.) Possible solution: An error has occurred while establishing a connection to the server. When connecting to SQL Serve and this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.)

Reason for application is running slow from a DBA side in SQL

There might be some reasons behind it: 1. Blocking situation 2. lack of userfull indexes 3. Lack of updated statistics 4. deadlock situation 5. network issue 6.Check the status of query.It can be either of two reasons.Either external or internal factor.External factors are resource crunches .Internal factors are because of missing index, invalid cache plan, fragmentation,so on.Starting point to identify higher level and then do a deep dive into particular area.

Why we go for Replication in SQL

Log shipping, mirroring & replication are various types of HA (high availability) features. Each of them have their own set of pros and cons and various sets of features. Hence there is no compulsion and requirement to implement all of them. Rather the decision to choose them is driven by business requirement and at times the resources available for use. Db mirroring and log shipping are database level HA the replication is object level HA. If you have SSRS, then go for replication, never keep OLTP database to fetch SSRS reports. Replication is never a DR lets take an example that for your reporting environment you habe used transactional replication. On the reporting database server for best performance you build plenty of indexes which are not required on the OLTP environment therefore I believe clustering mirroring and log shipping are the best option always have a powerful backup strategy that will always help you.

Move Reporting server database instance from one server to another in SQL Server

Following the steps below to Move Reporting server database instance from one server to another in SQL Server 2005,2008,2012 etc 1. Take the backup report server and report server temp db and restore in another server. ( if you want to move db also) 2. In the new server open reporting service configuration manage and re configure with new server details and start again. 3. Remove the encryption keys . Then reports will work from new server.

Committed and uncommitted data in Log Backup in SQL

Transaction log backup captures the transaction log which contains a record of all committed or uncommitted transactions. In full recovery model, some time log file getting full that and first we will check log bak taken r not the we ill take log backup then it will clear all committed transaction from log file this will happen if have doubt create on database do some bulk(select into or insert into) trans and check log file size and take t log back then compare sizes. Transaction log is a physical file in which SQL server stores the details of all transactions and data modifications performed on the database.In the event of of disaster, that causes SQL server to shutdown unexpectedly (Power failure/hardware failure), the transaction log is used to bring the database in a consistent state while restarting the server.On restarting the server, database goes through the recovery process.During this recovery process , the transaction log is used to make sure that all committed transaction

What is nolock in SQL Server

Nolock is nothing but it decrease the concurrency of busy system. When there is nolock for data then that data can be taken by another transaction. Reads the dirty page irrespective to the isolation level. (Not in all scenario). NOLOCK is used in SELECT queries as query hint, it functions the same way as READ UNCOMITTED isolation level where dirty reads are possible. It is highly recommended for all applications where Performance and concurrency is vital and dirty reads takes a backseat. Like in non-banking and web based applications it is much used, and also in internal web applications used in back-office by multiple users. We can use NOLOCK in all non-financial and non-payment related transactions most of the times. Every domain and case needs to be verified.

What is the use of sqlserver browser service?

Sql browser service is used to connect to a instance within the server. It runs at the OS LEVEL of architecture. Sql server browser service is used by sql server for named instance name resolution and for server name listing. i.e., for default instance default port will be 1433 and for named instance port will be dynamically allocated to provide the named instance port details browser service is used.

Function of functional keys on keyboards

Default ports in computer,network peripherals

Software configuration,installation

what is difference between configuration and installation of software? Answer: Software installation is a process in which we set up software ready for execution usually done by a installer. while configuration includes to set up a complete environment in which discussed software can execute. or simply we can say installation is a sub set of configuration.

Unexpected growth of sql log file in sql 2008

The log file size grows and takes all free space sometimes.  Sometimes it works OK. Following advice may help you to handle the situation I may be mistaken, but I seem to remember a problem with a previous version of SQL doing this when some other process was interfering with the database files, like a system backup, antivirus scan, system updates or a fragment. When the process interferes with the SQL directory, the log files grew out of control until the hard drive filled up.  If you are running something like this, be sure to exclude your database directories from it. If you have a different server handling a function like this, exclude the db directories or server all together. You could put these database In full recovery and set transaction log backups or set up a job that runs DBCC Shrink file. and schedule it to run prior to mid-night. But you should read through the error log and event logs to determine the cause of the problem.

Important SQL Questions for Exam Preparation

1. Which of the following queries can you use to search for employees with the pattern 'A_B' in their names? A. SELECT last_name FROM employees WHERE last_name LIKE '%A\_B%' ESCAPE '\\'; B. SELECT last_name FROM employees WHERE last_name LIKE '%A_B%' ESCAPE; C. SELECT last_name FROM employees WHERE last_name LIKE 'A_B%' ESCAPE '%'; D. SELECT last_name FROM employees WHERE last_name LIKE '%A\_B%' ESCAPE '\'; 2. The number of records in a table emp is given by statement A. Select total(*) from emp; B. Select count(*) from emp; C. Select sum(*) from emp; D. Select total from emp; 3. Write a query to Display the Name and studentid of all Students of branch CSE and ECE in alphabetical order by name. 4. Can you use the SQL JOIN and SQL HAVING clauses in one SQL statement? A .Yes. B . No. C . It depends. D . Don't know 5. # Which four are valid Oracle constraint types? A.

Major Indian Software and Services Companies List

A G Technologies Pvt Ltd, Mumbai ERP, IT enabled services, web enablement, application development A P Technosis Ltd, Noida Software development (Java, VB, ASP), Offshore services, Consultancy Aalayance Ecom Services Pvt Ltd, Bangalore Enterprise Application Integration, Object Technologies, Public Key Infrastructure, Software development and testing ABO Software Private Limited, New Delhi Electronic Commerce, Electronic Data Interchange, Telecomm-unication - X.25, Frame Relay, Object Oriented Programming Accel Software Solutions Limited, Chennai Software Development, IT Training, IT Enabled Services, E-Biz Solutions Accenture Services Pvt. Ltd., Mumbai Project deliver, Custom application development, Application management & conversion, Creation of client-specific facilities Access Networks India Pvt Ltd, Trichy Protocol development, CTI development, CRM systems, operational support systems for telecom service providers Ace Software Exports Ltd, Rajkot Database Creation, Software