Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Looking for Sybase Serial Number on RAW Volume

4 posts in Backup and Recovery Last posting was on 2011-07-26 15:45:31.0Z
Christoph London Posted on 2011-07-11 10:59:50.0Z
Sender: 4848.4e1ad753.1804289383@sybase.com
From: Christoph London
Newsgroups: sybase.public.ase.backup+recovery
Subject: Looking for Sybase Serial Number on RAW Volume
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4e1ad7a6.4853.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 11 Jul 2011 03:59:50 -0700
X-Trace: forums-1-dub 1310381990 10.22.241.41 (11 Jul 2011 03:59:50 -0700)
X-Original-Trace: 11 Jul 2011 03:59:50 -0700, 10.22.241.41
Lines: 6
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.backup+recovery:4163
Article PK: 48247

Hi there, I am trying to find the unique Sybase Serial
Number
with octal dump on a Raw Volume, if anyone knows it off the
top , that would be great. I lost some devices and I am
trying identify if they are a file system or Sybase DB ...
Thanks!


Bret Halford Posted on 2011-07-11 16:52:33.0Z
From: Bret Halford <bret@sybase.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version: 1.0
Newsgroups: sybase.public.ase.backup+recovery
Subject: Re: Looking for Sybase Serial Number on RAW Volume
References: <4e1ad7a6.4853.1681692777@sybase.com>
In-Reply-To: <4e1ad7a6.4853.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4e1b2a51$1@forums-1-dub>
Date: 11 Jul 2011 09:52:33 -0700
X-Trace: forums-1-dub 1310403153 10.22.241.152 (11 Jul 2011 09:52:33 -0700)
X-Original-Trace: 11 Jul 2011 09:52:33 -0700, vip152.sybase.com
Lines: 37
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.backup+recovery:4164
Article PK: 48248


On 7/11/2011 4:59 AM, Christoph London wrote:
> Hi there, I am trying to find the unique Sybase Serial
> Number
> with octal dump on a Raw Volume, if anyone knows it off the
> top , that would be great. I lost some devices and I am
> trying identify if they are a file system or Sybase DB ...
> Thanks!

I haven't heard of such a "serial number".

There are some repeating patterns in the data you could look for,
though. ASE databases are organized as a series of pages.
Hopefully you know if the server was using 2, 4, 8 or 16k pages.

Each page has a page header. The beginning of the header has
4 4-byte int values: page number, next page, previous page, and
object id.

So the first 4 bytes of each page is the page number,
assuming the page size was 2K, every 2048 bytes you should
see an a value that increments by 1 (for at least the first
512 pages, as databases are usually altered for at least
a full MB at a time).


Another pattern is that starting with the first page (page 0), every 256
pages is an allocation page. The 4th field in is the object id, which
for an allocation page is 99 (0x63).

In general, with the exception of the master device, ASE data starts at
offset 0 on the device. So first check 12 bytes in from the
start of the device and see if the 4 bytes there match an unsigned INT
value of 0x63. (this would be 0x0000 0063 or 0x6300 0000 depending
on whether your platform is big or little endian). If so, skip ahead
256 pages * (page size in bytes) bytes and see if you see the same 0x63
value there. If so, then this is likely an ASE device.


Christoph London Posted on 2011-07-11 21:41:57.0Z
Sender: 5a68.4e1b6d2c.1804289383@sybase.com
From: Christoph London
Newsgroups: sybase.public.ase.backup+recovery
Subject: Re: Looking for Sybase Serial Number on RAW Volume
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4e1b6e25.5a84.1681692777@sybase.com>
References: <4e1b2a51$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 11 Jul 2011 14:41:57 -0700
X-Trace: forums-1-dub 1310420517 10.22.241.41 (11 Jul 2011 14:41:57 -0700)
X-Original-Trace: 11 Jul 2011 14:41:57 -0700, 10.22.241.41
Lines: 55
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.backup+recovery:4165
Article PK: 48249

Hi there, this is perfect, I am happy with a unique pattern
as well, as long as there
something I know that is relative to being Sybase. I was
going on the assumption
that Sybase like Oracle stamps a Serial Number / ID on the
Database Files (Volumes)
which I could spot.

Thanks again, I will look this up on my Sybase Devices now.
It's useful to know,
in the event they get "lost on the SAN".

c

> On 7/11/2011 4:59 AM, Christoph London wrote:
> > Hi there, I am trying to find the unique Sybase Serial
> > Number
> > with octal dump on a Raw Volume, if anyone knows it off
> > the top , that would be great. I lost some devices and I
> > am trying identify if they are a file system or Sybase
> > DB ... Thanks!
>
> I haven't heard of such a "serial number".
>
> There are some repeating patterns in the data you could
> look for, though. ASE databases are organized as a series
> of pages. Hopefully you know if the server was using 2, 4,
> 8 or 16k pages.
>
> Each page has a page header. The beginning of the header
> has 4 4-byte int values: page number, next page, previous
> page, and object id.
>
> So the first 4 bytes of each page is the page number,
> assuming the page size was 2K, every 2048 bytes you should
> see an a value that increments by 1 (for at least the
> first 512 pages, as databases are usually altered for at
> least a full MB at a time).
>
>
> Another pattern is that starting with the first page (page
> 0), every 256 pages is an allocation page. The 4th field
> in is the object id, which for an allocation page is 99
> (0x63).
>
> In general, with the exception of the master device, ASE
> data starts at offset 0 on the device. So first check 12
> bytes in from the start of the device and see if the 4
> bytes there match an unsigned INT value of 0x63. (this
> would be 0x0000 0063 or 0x6300 0000 depending on whether
> your platform is big or little endian). If so, skip ahead
> 256 pages * (page size in bytes) bytes and see if you see
> the same 0x63 value there. If so, then this is likely an
> ASE device.
>


Jason L. Froebe [TeamSybase] Posted on 2011-07-26 15:45:31.0Z
From: "Jason L. Froebe [TeamSybase]" <jason.froebe@gmail.com>
Organization: TeamSybase
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version: 1.0
Newsgroups: sybase.public.ase.backup+recovery
Subject: Re: Looking for Sybase Serial Number on RAW Volume
References: <4e1b2a51$1@forums-1-dub> <4e1b6e25.5a84.1681692777@sybase.com>
In-Reply-To: <4e1b6e25.5a84.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4e2ee11b@forums-1-dub>
Date: 26 Jul 2011 08:45:31 -0700
X-Trace: forums-1-dub 1311695131 10.22.241.152 (26 Jul 2011 08:45:31 -0700)
X-Original-Trace: 26 Jul 2011 08:45:31 -0700, vip152.sybase.com
Lines: 28
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.backup+recovery:4168
Article PK: 48252


On 7/11/2011 4:41 PM, Christoph London wrote:
> Hi there, this is perfect, I am happy with a unique pattern
> as well, as long as there
> something I know that is relative to being Sybase. I was
> going on the assumption
> that Sybase like Oracle stamps a Serial Number / ID on the
> Database Files (Volumes)
> which I could spot.
>
> Thanks again, I will look this up on my Sybase Devices now.
> It's useful to know,
> in the event they get "lost on the SAN".
>
> c

I haven't used raw devices for some time but you are correct. When disk
init is run, there is a chunk of data that is written for
initialization. IIRC, it is platform specific on what is exactly
written (remembering from 10+ years ago).

The easiest way is to create a raw device, zero it out with dd and
/dev/zero, then disk init it. Examine the raw device (first 1MB) for
any changes. Add a db to it, then examine again to determine if this
data structure changed and if so, what exactly remained the same. You
could conceivably use this as the 'signature'.

jason