m_tornBits fields in sql server page - sql-server

Every page in an mdf file(sql server) has a m_tornBits field in the page header.
Can anybody explain what this value means
here is an example of a page header : -
PAGE HEADER:
Page #0x1A198000
m_pageId = (1:135) m_headerVersion = 1 m_type = 1
m_typeFlagBits = 0x0 m_level = 0 m_flagBits = 0x2
m_objId = 3 m_indexId = 0 m_prevPage = (1:89)
m_nextPage = (0:0) pminlen = 46 m_slotCnt = 80
m_freeCnt = 2360 m_freeData = 7036 m_reservedCnt = 0
m_lsn = (8:213:7) m_xactReserved = 0 m_xdesId = (0:834)
m_ghostRecCnt = 0 m_tornBits = 822083793
here the tornbit field is 822083793
what does this mean?

From Technet: SQL Server 2000 I/O Basics
Torn I/O
Torn I/O is often referred to as a torn page in SQL Server documentation. A torn I/O occurs when a partial write takes place, leaving the data in an invalid state. SQL Server 2000/7.0 data pages are 8 KB in size. A torn data page for SQL Server occurs when only a portion of the 8 KB is correctly written to or retrieved from stable media.
m_tornBits contains the TORN or CHECKSUM validation value(s).
When the page is read from disk and PAGE_VERIFY protection is enabled for the database, the torn bits are audited.
You can find your answer here in this document (search for m_tornBits):
http://download.microsoft.com/download/4/7/a/47a548b9-249e-484c-abd7-29f31282b04d/SQLIOBasicsCh2.doc

Related

UDP hole punching is working with google colab but not other local nats

I'm making an p2p application with c. I made basic program which communicates peer by udp hole punching. Now my program works fine when I run a program from my PC an another from google colab.
But when tried it with my friend's pc which under another ISP (different ISP from mine) it doesn't work. Again if my friend tries it with google colab it works fine.
I tried stun test in my pc, colab, and my friends results are like these:
Mine:
test I = 1
test II = 0
test III = 0
test I(2) = 1
is nat = 1
mapped IP same = 1
hairpin = 0
preserver port = 1
Primary: Independent Mapping, Port Dependent Filter, preserves ports, no hairpin
Return value is 0x000017
colab:
test I = 1
test II = 0
test III = 0
test I(2) = 1
is nat = 1
mapped IP same = 1
hairpin = 1
preserver port = 1
Primary: Independent Mapping, Port Dependent Filter, preserves ports, will hairpin
Return value is 0x000007
my friend's:
test I = 1
test II = 0
test III = 0
test I(2) = 1
is nat = 1
mapped IP same = 1
hairpin = 0
preserver port = 1
Primary: Independent Mapping, Port Dependent Filter, preserves ports, no hairpin
Return value is 0x000017
I used ttl 255 where pinging with my fiends nat shows required ttl of 62. Is it the cause?Ping command shows ttl 112 for google colab. I'm currently trying this program from Bangladesh.

Get current Payara MaxHeapSize and MetaspaceSize

I have a running Payara 4 instance which I set the MaxHeapSize and MetaspaceSize as described here to be production ready. How can I check those values were correctly set?
You could check this using jmap -heap <pid> on the PID of the Payara process. jmap is contained in the JDK bin directory.
On JDK9+ you need to use jhsdb jmap --heap --pid <PID> to get the needed information.
The output should contain the needed information, e.g:
Heap Configuration:
MinHeapFreeRatio = 0
MaxHeapFreeRatio = 100
MaxHeapSize = 268435456 (256.0MB)
NewSize = 89128960 (85.0MB)
MaxNewSize = 89128960 (85.0MB)
OldSize = 179306496 (171.0MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB)

How can i get the logs of past months in postgres DB .

Issue :
Someone has added a junk column in one of my table.I want to figure it out from the logs as when and from where this activity has been performed.
Please Help regarding this issue.
Make sure enable logging in postgresql.conf
1.log_destination = 'stderr' #log_destination = 'stderr,csvlog,syslog'
2.logging_collector = on #need restart
3.log_directory = 'pg_log'
4.log_file_name = 'postgresql-%Y-%m-%d_%H%M%S.log'
5.log_rotation_age = 1d
6.log_rotation_size = 10MB
7.log_min_error_statement = error
8.log_min_duration_statement = 5000 # -1 = disable ; 0 = ALL ; 5000 = 5sec
9.log_line_prefix = '|%m|%r|%d|%u|%e|'
10.log_statment = 'ddl' # 'none' | 'ddl' | 'mod' | 'all'
#prefer 'ddl' because the log output will be 'ddl' and 'query min duration'
If you don't enable it, make sure enable it now.
if you don't have log the last attempt is pg_xlogdump your xlog file under pg_xlog and look for DDL

DBCC SHRINKFILE failing

I'm trying to shrink a database on a test system but the file won't get any smaller. The size of the mdf file is 47 GB and unused space is 38 GB. A lot of data was removed from the database hence the large amount of unused space.
The following error appears:
Start dbcc shrinkfile ( Olympus_dat, 46912 ) at 2015-07-23 15:27:19.300
DBCC SHRINKFILE: Page 1:6017543 could not be moved because it has not been formatted.
How can I fix this error?
SQL Server 2012 x64
Additional information.
The following queries return an error:
DBCC TRACEON(3604)
GO
DBCC page('Olympus', 1, 6017543, 1)
Go
DBCC TRACEOFF(3604)
GO
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
PAGE: (14440:908631589)
BUFFER:
BUF #0x0000000009682040
bpage = 0x00000002B46B8000 bhash = 0x0000000000000000 bpageno = (1:6017543)
bdbid = 6 breferences = 1 bcputicks = 0
bsampleCount = 0 bUse1 = 23548 bstat = 0x809
blog = 0x5adb215a bnext = 0x0000000000000000
PAGE HEADER:
Page #0x00000002B46B8000
m_pageId = (14440:908631589) m_headerVersion = 252 m_type = 226
m_typeFlagBits = 0xf9 m_level = 216 m_flagBits = 0xd676
m_objId (AllocUnitId.idObj) = -1238914908 m_indexId (AllocUnitId.idInd) = 23941
Metadata: AllocUnitId = 6738992698879115264 Metadata: PartitionId = 0
Metadata: IndexId = -1 Metadata: ObjectId = 0 m_prevPage = (35510:854211095)
m_nextPage = (61606:1041616947) pminlen = 43990 m_slotCnt = 27900
m_freeCnt = 40464 m_freeData = 34288 m_reservedCnt = 12643
m_lsn = (-257029635:1920476993:30788) m_xactReserved = 11969
m_xdesId = (25449:1820050307) m_ghostRecCnt = 61532 m_tornBits = -213551362
DB Frag ID = 1
Allocation Status
GAM (1:5623552) = ALLOCATED SGAM (1:5623553) = ALLOCATED
PFS (1:6017472) = 0x40 ALLOCATED 0_PCT_FULL DIFF (1:5623558) = NOT CHANGED
ML (1:5623559) = NOT MIN_LOGGED
CompressionInfo #0x00000000309682B0
CompressionInfo Raw Bytes
CompressionInfo size (in bytes) = 0 PageModCount = 50289 CI Header Flags =
DATA:
Slot 0, Offset 0x4ad2, Length 1, DumpStyle BYTE
Record Type = (COMPRESSED) EMPTY_GHOST_RECORD Record size = 1
CD Array
Record Memory Dump
000000003096EAD2: 05 .
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Please follow the steps given in the answer at the bottom of the page,
https://ask.sqlservercentral.com/questions/19676/dbcc-shrinkfile-error.html

APC needs restart to see changes

I have Apache2 with APC.
When I change something, I have to restart Apache to see the effect. I know 100% for sure it's because of APC.
What is wrong in my settings? (thanks for the help!)
extension=apc.so
apc.enabled = On
apc.optimization = 0
apc.shm_segments = 1
apc.shm_size = 2.6G
apc.ttl = 7200
apc.user_ttl = 720
apc.num_files_hint = 102400
apc.mmap_file_mask = /tmp/apc.XXXXXX
apc.enable_cli = 1
apc.cache_by_default = 1
apc.max_file_size = 220M
apc.stat = 0
You have apc.stat set to 0. This means APC will not check whether the file is modified when it's requested, it will always serve it from cache after the first compilation.
To fix you problem either remove apc.stat = 0 or change it back to default apc.stat = 1

Resources