What is Endian?
Endian is the storage method of multi-byte data types in memory. In other words, it determines the byte order of the data. There are two kinds of endian, Little and Big.
Little Endian
The data is stored little end first. That is, the firs byte is the biggest.
Big Endian
The data is stored big end first. That is, the first byte is the smallest.
For example ;
Assume that an integer is stored as 4 bytes (32 bits), then a variable with a value of 0x01234567 (Hexadecimal decimal representation) will be stored in the form of 0x01, 0x23, 0x45, 0x67. In systems with big endian, this data is stored in this order while in small endian systems it is stored in reverse order.
Difference Between Little Endian and Big Endian
The following figure shows the big and little endian difference.
In Oracle databases, endian format is determined by the endian information in the environment in which it works. The endian format in the databases tells us which environments the related database can be moved to. It is not possible to move the database with normal methods between different endian environments. For example, you cannot transfer a database with Data Guard to a system with Big Endian from a Little Endian system.
You can see the current endian format in your database with the following query.
1 2 3 4 5 |
SQL> select name,platform_id,platform_name from v$database; NAME PLATFORM_ID PLATFORM_NAME --------- ----------- ---------------------------------------------------------- ORCL 13 Linux x86 64-bit |
The following queries show other environments where your existing database can be moved.
Big Endian Format (IBM AIX)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
SQL> set lines 200 SQL> set pages 200 SQL> COL "Source" FORM a32 SQL> COL "Compatible Targets" FORM a40 SQL> select d.platform_name "Source", t.platform_name "Compatible Targets", endian_format from v$transportable_platform t, v$database d where t.endian_format = (select endian_format from v$transportable_platform t, v$database d where d.platform_name = t.platform_name) order by "Compatible Targets"; Source Compatible Targets ENDIAN_FORMAT -------------------------------- ---------------------------------------- ------------------------------------------ AIX-Based Systems (64-bit) AIX-Based Systems (64-bit) Big AIX-Based Systems (64-bit) Apple Mac OS Big AIX-Based Systems (64-bit) HP-UX (64-bit) Big AIX-Based Systems (64-bit) HP-UX IA (64-bit) Big AIX-Based Systems (64-bit) IBM Power Based Linux Big AIX-Based Systems (64-bit) IBM zSeries Based Linux Big AIX-Based Systems (64-bit) Solaris[tm] OE (32-bit) Big AIX-Based Systems (64-bit) Solaris[tm] OE (64-bit) Big 8 rows selected. |
Little Endian Format (Linux x86)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
SQL> set lines 200 SQL> set pages 200 SQL> COL "Source" FORM a32 SQL> COL "Compatible Targets" FORM a40 SQL> select d.platform_name "Source", t.platform_name "Compatible Targets", endian_format from v$transportable_platform t, v$database d where t.endian_format = (select endian_format from v$transportable_platform t, v$database d where d.platform_name = t.platform_name) order by "Compatible Targets"; Source Compatible Targets ENDIAN_FORMAT -------------------------------- ---------------------------------------- -------------- Linux x86 64-bit Apple Mac OS (x86-64) Little Linux x86 64-bit HP IA Open VMS Little Linux x86 64-bit HP Open VMS Little Linux x86 64-bit HP Tru64 UNIX Little Linux x86 64-bit Linux IA (32-bit) Little Linux x86 64-bit Linux IA (64-bit) Little Linux x86 64-bit Linux x86 64-bit Little Linux x86 64-bit Microsoft Windows IA (32-bit) Little Linux x86 64-bit Microsoft Windows IA (64-bit) Little Linux x86 64-bit Microsoft Windows x86 64-bit Little Linux x86 64-bit Solaris Operating System (x86) Little Linux x86 64-bit Solaris Operating System (x86-64) Little 12 rows selected. |