SQL 2012 :: DBCC CHECK DB Outcome - DB Refresh

Oct 22, 2015

I created sql job using maintenance plan to run DBCC Checkdb for all databases. But I didn't choose the option Ignore databases where the state is not online. If any db is restoring the same time as DBCC Check db job running, is check db job fails?

View 1 Replies


ADVERTISEMENT

Refresh Dbcc Sqlperf(logspace)

Mar 23, 2001

Hi,
I have to monitor log.
I am using dbcc sqlperf(logspace).
I need to refresh it evry 15-20min.to monitor the growth(ofcourse in %)of log files.
How is this possible if I do think of 'automating' it?
TIA
pd

View 1 Replies View Related

Dbcc Check

Aug 17, 2004

When i have to abort the DBCC CHECK because of too long runtime, is it making a full rollback ?
I did it and it stopped immediately.

dajm

View 1 Replies View Related

Check Fragmentation Without DBCC

Nov 21, 2007

Hi All,
I want to check the fragmentation for a table. But I do not have permissions to run DBCC commands on that server. Do we have any other method to identify the health of the table?

Thanks a lot.

Mannu.

View 4 Replies View Related

DB Engine :: DBCC Check DB Failed

Jun 9, 2015

Recently one of our DB went to suspect mode, we have resolved it(repair_allow_dataloss) and DB came online but when we fire CheckDB on that it is throwing following error

Msg 7985, Level 16, State 2, Line 2
System table pre-checks: Object ID 3. Could not read and latch page (1:355) with latch type SH. Check statement terminated due to unrepairable error.
DBCC results for 'xxxxxxx'.
Msg 5233, Level 16, State 98, Line 2
Table error: alloc unit ID 196608, page (1:355). The test (IS_OFF (BUF_IOERR, pBUF->bstat)) failed. The values are 12716041 and -4.
CHECKDB found 0 allocation errors and 1 consistency errors not associated with any single object.
CHECKDB found 0 allocation errors and 1 consistency errors in database 'xxxxxxx'.

And error log is also continuously popping the below message

Error:

824,
Severity: 24,
State: 2.
SQL
Server detected a logical consistency-based
I/O

[code]....

View 7 Replies View Related

Database Fails Dbcc Check Db With Multiple Errors

May 1, 2014

I am not a DBA but have responsibility for a particular MSSQL 2008 R2 file server running a particular application.how to solve a database consistency check problem.The database fails dbcc checkdb with multiple 8903 errors. Unfortunately this was not discovered until well after any good backups were deleted. The good news is that the DB otherwise seems fine. We have experienced zero problems with the DB or the applications. Running the checkdb with the "repair_allow_data_loss" option does not fix the problem.

However, I would still like to fix the problem. Using a popular SQL recovery product I am able to recover the database.The original, vendor designed and supplied DB, has 2 file groups, and three files (MDF, NDF, LDF). The output of the recovery process produces 1 file group and 2 files (MDF and LDF). Vendor says they cannot support me since the recovered DB is 'non-standard' according to their design.

I am able to set up a new, blank version of the vendors database on another dev system with the proper file and filegroup structure. How can I get the data moved/copied from the recovered (MDF/LDF) database into the dev database (MDF, NDF, LDF). I've tried the import/export function but it fails (I can rerun and give details if necessary).

View 1 Replies View Related

SQL 2012 :: SSAS Pivot Refresh

Jul 18, 2014

I had a pivot to pull data from cube previously.The pivot had certain measures which are now set as invisible measures at the cube level itself.After the cube publish,i just reconnected my pivot to the cube so that the new measures and dimensions are shown in the field list.

I just tried refreshing the pivot with my old measures(which are now set as invisible) and it allowed me to refresh.How can this be possible if the measure itself is set as invisible at cube level?

View 1 Replies View Related

Converting Sp Outcome

Jan 21, 2004

Hi all,

i have an stored procedure that returns a value, i want to convert that value into smallmoney, is this possible and i yes how?

here is my code:

CREATE proc CP_avgloss_total
@mID varchar(10),
@startdate datetime,
@enddate datetime

as
select

case

((sum(playtime))/ 3600)
when 0
then 0
else ((sum(vtp)-(sum(moneyout)))/100) / ((sum(playtime))/ 3600)
end avgloss
from dbo.total
where
machineID = @mID
and convert(varchar,njdate,121)
between convert(varchar,@startdate,121)
and convert(varchar,@enddate,121)

GO

The value that needs to convert is avgloss

Hope someone can help me with this.
Cheers Wim

View 5 Replies View Related

SQL 2012 :: Column Store Index Refresh

Aug 20, 2015

When we use Partition switch and load the data to a table, can we refresh the indexes for specific partition, so that we don't need to rebuild / refresh for complete is this possible ?

View 1 Replies View Related

Unexpected Outcome When Exporting Views..

Jan 30, 2004

Something weird happened tonight.. here's the deal. I have two databases exactly the same.. one is for dev, one's for live data.

Anyway, the live DB had an outdated view.. so I exported from the dev DB to the live.. just copying that one view over (using "copy objects" in the export DTS wizard). Very oddly, it actually copied over the data in the tables referenced by the view! Not good, cuz I told my coworkers I'd leave the data in the tables alone :( How do I copy a view over, but just the view definition, and NOT the actual table data??

Thanks

View 4 Replies View Related

SQL 2012 :: Optimal Settings For DBCC Checks?

Aug 5, 2014

I have a VM set up for offloading DBCC checks. Specs are below. I've read through this, but I'm not seeing the performance gains by enabling the trace flags and using the physical only switch.

Is the whole drawback that I'm on SATA storage? Is there a VM configuration with the CPU I can/should change? I've been playing with MAXDOP trying to see if I can get any benefits but I'm not seeing a much.

wait_type wait_time_spctrunning_pct
CXPACKET 561191.4228.7128.71
OLEDB 387136.7619.8148.52
PAGEIOLATCH_SH 340674.5817.4365.95
TRACEWRITE 321598.8416.4682.41

[code].....

View 9 Replies View Related

SQL 2012 :: DBCC CHECKDB Runs On All Our Databases

Dec 2, 2014

Every night all our DBCC CHECKDB runs on all our databases. The trouble is one of them is very large and the database is inaccessible whilst this runs. DBCC CHECKDB (dbname) WITH physical_only executed by user found 0 errors and repaired 0 errors. Elapsed time: 0 hours 24 minutes 46 seconds

This normally happens fairly shortly after the backup, and normally (but not always) after a series of these entries in the log.SQL Server has encountered 7976 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [D:Program FilesMicrosoft SQL ServerMSSQL11. MSSQLSERVERMSSQ LDATA empdb.mdf] in database [tempdb] (2).Would this cause SQL to automatically run a CheckDB.

View 9 Replies View Related

SQL 2012 :: Rollback Of DBCC CheckDB Stuck

Oct 6, 2015

DBCC CHECKDB was affecting performance. Screens were hanging, timeouts, etc.

So I made the unfortunate decision of Killing the 2 processes.

I keep checking the percent complete and they are stuck at 33% and 17%.

Will I have to restart the SQL Server Service?

Are they any other options?

View 3 Replies View Related

SQL 2012 :: DB Setting That Affects DBCC Checkident (reseed)?

Apr 23, 2014

I have encountered an anomaly. The dbcc checkident(reseed) command behaves differently on two SQL servers.

In both cases, I am deleting from (not truncating) data in two tables, due to foreign key constraints. (I am truncating other tables, the issue is not with those tables, only with the deleted-from tables.) On one server, I need to use dbcc checkident(reseed,0) so that when I insert fresh data, it begins with identity key #1. According to MS documentation, that appears to be the correct behavior, when data has been deleted from a table, rather than truncated.

However, on the other server, I need to use dbcc checkident(reseed,1); if I use ...(reseed,0) on that server, it begins inserting data with identity key #0.

This is consistent, repeatable behavior on both servers.

View 4 Replies View Related

SQL 2012 :: Use Of Running DBCC Free Session Cache?

Feb 12, 2015

What is the use of running DBCC FREESESSIONCACHE.

How frequently can we do this on all the databases.

What happens if we schedule to run it every 1min.

Are there any advantages/disadvantages of running this on all databases.

View 5 Replies View Related

SQL Server 2012 :: How To Determine Metadata On DBCC Results

May 26, 2015

I can find many examples of loading DBCC results into tables. They all begin with a create table statement defining the results. My question is , other than trial and error, is there a way to determine what data types will be returned. Sure you can say that first element looks like an integer, but is it really a bigint, and that text string can be varchar(max) but will char(2) work.

I'm not looking for an answer for a specific DBCC function, but rather a generic way I can determine the characteristics of any DBCC result set.

I tried

SELECT *
INTO #tmp
FROM OPENROWSET('SQLOLEDB',
'Server=ray;Trusted_Connection=Yes;Database=Ed_sandbox',
'Set FmtOnly OFF; DBCC loginfo WITH tableresults ')

but I got back

Msg 11527, Level 16, State 1, Procedure sp_describe_first_result_set, Line 1

The metadata could not be determined because statement 'DBCC loginfo WITH tableresults' does not support metadata discovery.

View 1 Replies View Related

SQL Server 2012 :: Run DBCC Inside Stored Proc Using EXECUTE AS

Mar 18, 2014

I am a SysAdmin on a test/dev SQL instance. Other non-sysadmin users (developers) need the ability to execute DBCC commands like the following:

DBCC FREESYSTEMCACHE ('ALL') WITH MARK_IN_USE_FOR_REMOVAL
OR
DBCC FREEPROCCACHE

I tried creating a store proc in a user database and granting those non-sysadmin users EXECUTE permission on it as so:

CREATE PROC spFreeSystemCache
WITH EXECUTE AS 'sa'
AS
DBCC FREESYSTEMCACHE ('ALL') WITH MARK_IN_USE_FOR_REMOVAL
GO

When I try to create this proc, I get the following error:

Msg 102, Level 15, State 1, Procedure spFreeSystemCache, Line 2
Incorrect syntax near 'sa'.

Ok, so I can't EXECUTE AS sa...

View 5 Replies View Related

SQL 2012 :: DBCC CheckDB Output File With Date Stamp

Jul 8, 2015

I would like to know if it is possible to date stamp the output file for the DBCC integrity check?

The following cmd works fine however I tried different ways to date stamp the output file with no luck.

sqlcmd -U backup -P Password -S Server -Q"DBCC CHECKDB('DatabaseName') WITH ALL_ERRORMSGS" -o"G:LOGSDBCCResults.txt"

View 5 Replies View Related

SQL 2012 :: How To Check RI Integrity

Jun 1, 2015

I have a database in the 3rd normalized form. There is a need to load rows into a child table. To avoid having to drop RI, an ALTER TABLE WITH NOCHECK is being used. I am looking for a way to verify the integrity after the load is complete. After the load an ALTER TABLE WITH CHECK will be executed. Can I used DBCC to verify, that no orphaned child rows were loaded? If so, which parms would I have to use with DBCC?

View 0 Replies View Related

SQL 2012 :: How To Check Execution Plan Of A CTE

Jul 4, 2014

We have got a query for fine tuning and it is using lot of CTE ,how can i check the execution plan of that?

CREATE VIEW Mercy
AS
with ADR
as
(
SELECT urpx.RoleID ,
urx.UserID
FROM [DBA].dbo.URPX WITH ( NOLOCK )
INNER JOIN [DBA].dbo.URX WITH ( NOLOCK ) ON urpx.RoleID = urx.RoleID
WHERE PermissionID = '1'
),
SDR
as
(

-- Collect the roles that a configured with Sales Team Create permission

-- This will include Sales Director , Suite Admin,

SELECT urpx.RoleID
FROM [DBA].dbo.URPX WITH ( NOLOCK )
INNER JOIN [DBA].dbo.URX WITH ( NOLOCK ) ON urpx.RoleID = urx.RoleID
LEFT OUTER JOIN ADR ON ADR.UserID = urx.UserID
WHERE ADR.RoleID IS NULL
AND PermissionID='2'
)

View 6 Replies View Related

SQL 2012 :: Check If Particular Stored Procedure Is Recompiling Or Not

Mar 23, 2014

I want to know, Is it possible to check a particular stored procedure is recompiling or not?

View 7 Replies View Related

SQL Server 2012 :: How To Check Which Row / Column Truncated

May 16, 2014

Table Temporary (Staging) - 400.000 rows and 200 columns.

When i done insert from temporary table to target, i have this:

Msg 8152, Level 16, State 13, Line 9

String or binary data would be truncated.

The statement has been terminated.

How can i check which row/column truncated?

View 9 Replies View Related

SQL 2012 :: Script To Check DB Names Against Jobs

Aug 1, 2014

As part of my backup routine, I have a SQL job for each DB which which is called "DB-NAME - Backup Job"

I need to put a script together to check that each database has a backup job associated to it.

select * From sys.sysdatabases where name not in ('msdb','model', 'master', 'Tempdb', 'DBA') order by name desc

select * from msdb.dbo.sysjobs order by name desc

I know all the details i need are in there, but i cant figure out the best way to tackle it. Do I need to do a cursor to go through each DB name, put it into a variable, then select the job name where name like '$variable%' ?

View 7 Replies View Related

SQL 2012 :: Anyway To Check If Server Is Having Disk Latency

Oct 1, 2014

Is there anyway to check if server is having disk latency or IO issues?Found below in SQL error log

Date10/1/2014 8:28:58 AM
LogSQL Server (Current - 10/1/2014 12:00:00 AM)

Sourcespid10s

Message
SQL Server has encountered 8500 occurrence(s) of I/O requests taking longer than 15 seconds to complete on file [D:Fin.mdf] in database [Fin] (5). The OS file handle is 0x0000000000001368. The offset of the latest long I/O is: 0x0001104a7da000

View 1 Replies View Related

SQL 2012 :: How To Create Check Constraint On A View

Mar 12, 2015

I want to create a check constraint on a table but the constraint values depend upon another table column as well, now one possible way is to create a function to check the column value. But I don’t want to use the function.

Can I do this in a view if so then how can I achieve this.

View 5 Replies View Related

SQL Server 2012 :: Check To See If Job Has Finished Before Job Starts?

Jun 23, 2015

I have a job I want to run everyday but before this job starts and I want to check and see if another job has completed before I start this job. i would like to do this in the job steps in SSMS. step 1 is job 'xxxxxxx' running if no go to step 2 if yes exit

View 3 Replies View Related

SQL 2012 :: Run Scheduled Task And Check For Completion

Nov 6, 2015

I am looking to create a Stored Procedure that simply runs a Scheduled Task that they knows when the job has completed.

To call the Job I am using:

EXEC msdb.dbo.sp_start_job @job_name='MY_JOB_NAME'

As a next step is there a way to check if the Scheduled Job has completed and keep checking until the job completes via a query?

View 1 Replies View Related

SQL Server 2012 :: How To Check Column Name In Case Sensitive

Apr 21, 2014

I have a table called SrcReg which is having a column name called IsSortSeqNo smallint. I am mapping this column in SSIS and the problem comes when I try to execute against different database which has this table but the column name as ISSortSeqNo. I mean both databases having same name but one with upper case. So SSIS fails executing due to meta validation issue.Is there any way to check whether the column name is in small case or upper case through query?

View 8 Replies View Related

SQL 2012 :: How To Check Errors When Database Is Configured In AlwaysOn

Dec 15, 2014

how to check the errors when a database is configured in Always on in sql 2012?

View 1 Replies View Related

SQL 2012 :: Select Statement - Check For All Same ID And Return Records

Jan 9, 2015

My example data as this:

ID code1 code2
1 a m
1 b n
1 c T
2 d m
2 e n
2 f n
3 g m
3 h n
3 i T

I would like to have a select stmt that check for all same ID and code2 does not contain T, then return the records

For example data: the query should return
2 d m
2 e n
2 f n

Is it possible to do this?

View 9 Replies View Related

SQL Server 2012 :: Check To See If Columns Are NOT NULL In A Record

Jun 25, 2015

I am looking for the best way to check to see if any columns are still NULL in a record. I have a form that gets filled out by users and the values entered into TableA. There are 6 columns in the table, 5 are responses and column6 indicates if the record is complete. So I want a way to see if all of the first 5 columns are NOT NULL and, if so, mark column6 with a 1.

I am thinking this would be a good thing for a trigger on INSERT or UPDATE to check to see if the first 5 columns are filled in and then mark the record as complete.

View 5 Replies View Related

SQL Server 2012 :: Check Records Which Have Negative Capacity Value

Jul 17, 2015

I have a table with a column Capacity which is char(10) and gets populated from user files. I want to check records which have negative Capacity value. So i first checked if its numeric and then for negative.

select * from table WHERE ISNUMERIC(LTRIM(RTRIM(Capacity))) = 1 AND Capacity < 0

BUT still it checks for char fields too giving errors like - Conversion failed when converting the varchar value 'asdf ' to data type int.

View 9 Replies View Related

SQL Server 2012 :: Check Completion Status Of Recovery?

Aug 14, 2015

I have a database In Recovery.

Where do I check the completion status of the recovery?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved