Friday, 16 June 2017

Diffrence Between Big Endian Vs Little Endian

Little Endian means that the low-order byte of the number is stored in memory at the lowest address, and the high-order byte at the highest address. (The little end comes first.) For example, a 4 byte Long Int

Byte3 Byte2 Byte1 Byte0

will be arranged in memory as follows:
Base Address+0 Byte0
Base Address+1 Byte1
Base Address+2 Byte2
Base Address+3 Byte3

Linux, Windows use "Little Endian" byte order.


Big Endian means that the high-order byte of the number is stored in memory at the lowest address, and the low-order byte at the highest address. (The big end comes first.) Our LongInt, would then be stored as:

Base Address+0 Byte3
Base Address+1 Byte2
Base Address+2 Byte1
Base Address+3 Byte0

Solaris, HPUX, Apple Mac use "Big Endian" byte order.

In Oracle 10g, following SQL should tell you which operating systems follow which byte order,
select * from v$transportable_platform order by platform_id;
To transport tablespaces between OS with same byte orders (endianness), we don’t need conversion in other cases we do which can be done using RMAN. E.g. I need to transport a Tablespace from Linux (Little Endian) to Solaris (Big Endian)
RMAN> convert tablespace XXX to
platform ‘Solaris[tm] OE (64-bit)' 
db_file_name_convert '/app/oracle/oradata/mbs’,
'/app/oracle/rman_bkups';
Now this file can be copied over to the target Solaris system, and the rest of the steps are easy.

SQL> select * from v$transportable_platform order by platform_id;
PLATFORM_IDPLATFORM_NAMEENDIAN_FORMAT
1Solaris[tm] OE (32-bit)Big
2Solaris[tm] OE (64-bit)Big
3HP-UX (64-bit)Big
4HP-UX IA (64-bit)Big
5HP Tru64 UNIXLittle
6AIX-Based Systems (64-bit)Big
7Microsoft Windows IA (32-bit)Little
8Microsoft Windows IA (64-bit)Little
9IBM zSeries Based LinuxBig
10Linux IA (32-bit)Little
11Linux IA (64-bit)Little
12Microsoft Windows 64-bit for AMDLittle
13Linux 64-bit for AMDLittle
14HP Open VMSLittle
15Apple Mac OSBig

No comments:

Post a Comment