Quantcast
Channel: SQL Server Database Engine forum
Viewing all 15264 articles
Browse latest View live

SQL Server 2012 not auto-shrinking logfile

$
0
0

We recently deployed SQL Server 2012 Standard on a Server 2008 R2 SP1 machine and, for the most part, everything behaves the same as SQL 2008 R2 (no surprise there). However, one issue I've been experiencing is that the transaction logs will not automatically shrink like they do in SQL 2008 R2. The database recovery model is set to full, and we have full backups running weekly and transaction log backups running every 12 hours. The transaction log backups work fine, but the files themselves never shrink. Autoshrink is set to true. If I manually run a shrink operation on the transaction log files, it works like a charm - it just shrank the 29GB file down to 3GB. Why does the transaction log not automatically shrink anymore?

Microsoft SQL Server 2012 - 11.0.2100.60 (X64)  

Windows Server 2008 R2 SP1 (Build 7601: Service Pack 1)


Sql server 2008 Partition Master and Child tables monthly require downtime to add a new partition every month and delete old partition

$
0
0
 

Hi Team,

Please help me in this regard!!

I have a master and child tables with Foreign key relation,  I want to table partition both Master and Child tables monthly basic.

Question 1: To add a new partition every month, downtime is required?  Disable foreign key relation and do SPLIT?

Question 2: If Master table is portioned every month and Child is referencing Master table, on every month SPLIT, downtime is required?  Can a non-partitioned child table refer partitioned master table?

Thanks,

Areef

KB2895494 doesn't seem to work in SQL2012 SP1 CU8

$
0
0

KB2895494 was raised as part of SQL2012 SP1 CU7 to stop a memory leak caused by theMEMOBJ_COMPILE_ADHOC memory object not releasing memory. The KB includes a query:-

select type, sum(pages_in_bytes)/1024.0/1024.00 'Mem in MB', count (*) 'row count' from sys.dm_os_memory_objects where type like '%MEMOBJ_COMPILE_ADHOC%' group by type;

When this query is run over a period of time the Mem in MB and row count goes up and up.

We run CU6 and did not install CU7 but now we are installing CU8 and when I run this query on a CU8 server these numbers continue to climb just like they do on a CU6 build server.

Can somebody confirm that it did work in CU7 and is anybody else seeing this behaviour?

It is showing in both a failover cluster and an Availability Group cluster.

Thanks

Chris

Intellisense is lazy?

$
0
0

Sql2k8 SSMS intellisense is lazy ot it seems so.

After have created an TSQL object my intellisense does not advert its existence.

 

Even after refresh at Sql Server database, intellisense does not show me that object.

 

What am I missing here?

Obviously after stop the Sql Server show it.

It is not useful at all, when you create some object, intellisense must work as Visual Studio intellisense, don't you?

Thanks in advance for any input or thought on that,


Primary platform is Windows 7 Ultimate 64 bit along with VS 2012/Sql2k8 for WPF/SilverLight projects.

Difference between Database Master key and Database Encryption key

$
0
0

Can some one explain the difference beween  Database Matser Key and Database Encryption key ?I know for TDE, you need Database Encryption Key but DMLK is not needed.







Database mirroring question

$
0
0

Hi All,

I have few questions regarding Database mirroring.

I am just comparing log shipping and database mirroring. In log shipping, everything is handled via sql agent jobs i.e. "LS_" jobs which takes backup, copy backup and restore it on secondary server. This is what happens in case of log shipping.

On the other hand, in Database Mirroring, the log records or log stream is sent to the Mirror server and thus maintaining a hot standby database for Principal database.

I have below questions regarding database mirroring.

1) Who is responsible for moving those transaction log records from Principal database to mirror database? I mean, who or which thread is going to read those log records on Principal and move to Mirror database ?  I just know the fact that communication happens via endpoints but who is responsible for reading and transferring those log records to the partner server?

2) Secondly, why can't I have the database which is participating in database mirroring as SIMPLE recovery model? In Log shipping we take transaction log backups and there is a reason of why we need to put the database in FULL recovery model but if I consider DB mirroring, sql server is reading the transaction log directly and if that is the case why can't I just have database in SIMPLE recovery model?  Why should I need the database to be in Full recovery model for database mirroring?

3) Thirdly, on the Mirror side, which thread / who is responsible for constant replaying those log records/changes to the Mirrored database? In log shipping I know for the fact, constant restore of log backups does the replay on the Secondary server but in case of database mirroring , who does this ?

4) Finally, can I have a different database name for my Mirror database? Are there any known implications doing so?

Thanks in Advance.

Purging the data older than 1 year

$
0
0

I have a requirement to purge data older than 1 year.

Table has 5 billion rows and delete about 4 billion rows in batches.

there is no primary key or indexes on table.

There is column Datetime and i created nonclustered index on table and planning to purge data based on that column.

Any help in preparing the script to purge data in batches older than 1 year.

Thanks,

Ron.

Restart Cluster instance

$
0
0

Hi all

  2 servers are in cluster,now i need to restart the one instance.is it possible to restart only one instance.it has any impact in other cluster instance.

here i am attaching my cluster details.

here i need to restart the dbserv2 instance only.


Thanks - SelvaKumarSubramaniam.Please MARK AS ANSWER, if my answer is useful to U.


database migration question

$
0
0

SQL server A----Database AA

SQL Server B---Database BB

Do database migration:

I backup database AA on sql server A--create aa.back file

then I copy aa.bak file to Server B and restore aa.bak as BB(Overwrite database BB there).

I want to make sure that new database BB(restore from aa.bak) will have all the same as old database BB there--security, store procedure.........

How to do it?want to know the best way.Now, I have to compare each piece. That's too much work.

SQL Server Agent Error

$
0
0

we are constantly getting this error from event log: what is the remedy.

Unable to read local eventlog (the parameter is incorrect)

Issue using Tools->Options->Result to Text to customize column delimiter

$
0
0

Hi all,

I need to export a large dataset (greater than 6 GB) to text file.

Since the dataset contains special characters, I cannot use Import and Export Wizard to export it into text file. (Error Message).

So I used Tools --> Options --> Result to Text. However, I cannot actually customize the delimiter.

First of all, I can only enter one character as the delimiter, and thus no character combination allowed.

Secondly, I entered # and ^ as the customized delimiter. Neither of them worked. The delimiter is always | (pipe), which does not work well for my dataset.

Does anybody have the same experience? Please help.

Thanks.

Is there a SQL Server 2012 SP2 planned?

$
0
0
I have been waiting to install some of the cumulative updates for SQL Server 2012 waiting on a SP2.   Does anyone know if and when SP2 might be coming out?

sql server Services account information

$
0
0

hi team,

we are paling to change the sql server "Services Account", here what are the steps we can flows, i know how can change server account.

if in case after changing the services account any problems are happen. if problem happen how we can resolve the issues.

 

Estimates freed space after index rebuild

$
0
0

Hello ,

is there a way to estimate the space freed by index rebuild in sql 2008 R2 ?

thanks

how to get comma seperated values for a single column

$
0
0

Hi all,

I have procedure which has cols like scopeid ,sprintname ,sprintid,highlevelitem,etc

now,if suppose 1 scopeid there are 5 highlevel items and in that 3 highlevelitems have 1sprintname(sp1) and other 2 highlevelitems has other sprintname(sp2)..

now in my procedure i implemented logic coalesce() to get sprintnames as commaseperated for single scopeid..

but the problem is when i implemented coalsce() i'am getting all sprints for single scopeid..in my db for many scopeid's i have only 1 sorintname....but my logic returns output as singlescopeid with mutliplesprints and this is same for all scope's in a project

(actually project has multpile scope's)..

please help me to get appropriate sprint for scopeid and comma seperated values should come correctly..

my coalesce() is:

STUFF((
SELECT COALESCE(CHAR(10)+CONVERT(VARCHAR,SPP.Name )+',', '') 
FROM	Sprint SPP LEFT JOIN sprint_tasks SPT on SPP.sprintid=SPT.sprintid AND SPT.sprintscopeid=SP.scopeid
where SPP.ProjectID =SP.ProjectID FOR XML PATH('')), 1, 1, '') as SprintName


lucky


Changing from dev to standard edition causes "Could not obtain information about Windows NT group/user error code 0x6e."

$
0
0

Hello,

We recently upgrade our SQL Server 2012 SP1 (64bit) dev edition to standard edition, after we purchased the required licence and it was deployed in production.

Since the edition change, we are now receiving the following error, with some of our jobs, which have an e-mail step in them, which is causing the jobs to fail.

Msg 14661,Level 16, State 1, Procedure sp_send_dbmail, Line 517

Query execution failed: Msg 15404, Level 16, State 19, Server BL-SVR15, Line 1

Could not obtain information about Windows NT group/user 'BLUELIZARD\savaa', error code 0x6e.

Any ideas how to fix this issue? We were also having a similar error, when executing the jobs, but changing the job owner to SA has fixed this issue.

Thanks,

Andy.

Possible to decrypt DMK with SMK after database restore?

$
0
0

Hello all,

       Is it possible to decrypt the master key or decrypt the symmetric keys the master key is used to encrypt without knowing the master key password?  I have a backup of the database itself and a SMK backup from the database.  The master key in the backed up database is encrypted by the SMK.

Thanks!

Question on asymmetric key

$
0
0




create asymmetric key AsymKey1 with algorithm = RSA_2048 encryption by password = 'MyPassword$'

The above command creates asymmetric key pair - a public key and a private key. So the private key is protected by the supplied password. My question is - how is the public key protected ? No passowrd ?

Further,  I create a symmetric key SymKey1 and protect it with above created  asymmetric key AsymKey1 and use SymKey1 to encrypt a table column (update existing varbinary(max) column).  Now how do a user , LoginA  use the public key of AsymKey1 to open the SymKey1 so that data can be inserted into the clumn and encrypted ?

what permissions are required for LoginA to insert encrypted data ?

If  LoginB needs permissions to read the encrypted data, I know it will need view definition permissions on  SymKey1 and control permissions on AsymKey1.





Get Notification When SqlConnection Pool Count change

$
0
0

Hello All

I use Following Query To check ConnectionPool Count:

SELECT COUNT(*)FROM(SELECT host_process_id FROM sys.dm_exec_sessions WHERE PROGRAM_NAME = 'MyApplicationName' GROUP BY host_process_id) AS A

this Connection Pool Count changes when User Login, Or Network Failure Or ReConnect Or Laptop Goes to Sleep Mode Or Again Connected etc.

I want some kind of general event notification When This Connection Pool Count Change.

Is there any thing that I can Use in General case? I thought about specific solution But THere are lots of cases when Connection Pool Count change. I want to get Notification in some General Case where all kind of cases covered in my cs file.

So can anybody please help me to solve this issue?

Thanking you in advance..

Regards

Vipul

SQL Server 2012 Undetected Deadlock in a table with only one row

$
0
0

  We have migrated our SQL 2000 Enterprise Database to SQL 2012 Enterprise few days ago.
  This is our main database, so most of the applications access it.
  The day after the migration, when users started to run tasks, the database access started to experiment a total failure.
  That is, all processes in the SQL 2k12 database were in lock with each other. This is a commom case of deadlock, but the Database Engine was unable to detect it.
  After some research, we found that the applications were trying to access a very simple table with only one row. This table has a number that is restarted every day and is used to number all the transactions made against the system.   So, client applications start a new transaction, get the current number, increment it by one and commit the transaction.
  The only solution we found was to kill all user processes in SQL Server every time this situation occurs (no more than 5 minutes when all clients are accessing the database).
  No client application was changed in this migration and this process was working very well for the last 10 years.
  The problem is that SQL 2k12 is unable to handle this situation compared to SQL 2k.
  It seems to occurs with other tables too, but as this is an "entry table" the problem occurs with it first.
  I have searched internet and some suggest some workarounds like using table hints to completely lock the table at the begining of the transaction, but it can't be used to other tables.
  Does anyone have heard this to be a problem with SQL 2k12? Is there any fixes to make SQL 2k12 as good as SQL 2k?
Viewing all 15264 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>