|
What is RowID/ROW_ID, and How is it Generated and Used? [ID 476256.1] |
转到底部 |
|
修改时间:2012-2-11类型:HOWTO状态:PUBLISHED优先级:1 |
|
Applies to:
Siebel System Software - Version: 6.2.1.22 [10258] to 8.1 [21039] - Release: V6 to V8
Information in this document applies to any platform.
Area(s):System Administration, Client Functionality, Configuration - General
Release(s):V4-V8 all versions
Database(s):All Supported Databases
App Server OS(s):All Supported Platforms
Latest release tested against:V8 (Enterprise)
Keywords:ROW_ID, RowId, Row ID, RowIdToRowIdNum, convert, Sequence, number, numbering
This document was previously published as Siebel FAQ 1446.
Solution
This FAQ contains answers to several questions relating to the RowID in Siebel applications. Select a jump link from the list below to go to a specific question:
What is RowID?
What is RowIdToRowIdNum?
Will RowID Always be Unique?
Are There Other Ways to Generate Sequence Numbers?
What Is RowID?
The unique identifier associated with every record in a Siebel Enterprise database is known as a RowID. The column in which this value is found is ROW_ID and it is present on every table. The RowID is unique for an entity. For example, the RowIDs for the same person in S_PARTY, S_CONTACT, and S_CONTACT_X are the same because they each refer to the same person.
The RowID is a base-36 sequence number generated using a confidential, proprietary algorithm that ensures no duplication, thus protecting the referential integrity of the database. The ROW_ID column is a VARCHAR(15) field (both logical and physcal schemas) which may contain one or two non-numeric symbols (plus signs or hyphens, or both).
The format of the RowID is one of the following:
CP-NS |
Records created through the user interface |
CP+NP+NS |
Records created by Interface Manager (EIM) |
CP-NEXT_SESSION-xxxx |
Records created by EIM (versions 6.2 and later) |
TS:RND or CP:NS |
Records created on Handhelds |
Where:
CP = |
Corporate Prefix, alphanumeric characters |
NP = |
Next Prefix, alphanumeric characters |
NS = |
Next Suffix, alphanumerics up to the maximum column width |
TS = |
Time Stamp -- YY:MM:DD:HH:MM:SS, converted |
RND = |
RaNDom characters auto-generated on demand |
The maximum length of the RowID is 15 alphanumeric characters including the plus and hyphen characters.
The corporate prefix will always be unique for any database (main or local). The server maintains its original value, and mobile databases created against that particular server database are always assigned a new, unique value.
All connected users share the same Next Prefix (NP), which is obtained from the table S_SSA_ID on the server database. Remote users are each assigned a unique prefix during extraction, which is also stored in the S_SSA_ID table on the local database.
The Next Suffix (NS) is the heart of the RowID which is generated by the enterprise. When a new record is created through the user interface the Siebel application reads the value of the current NS column from S_SSA_ID table and increments this value by a value greater than 1 for performance reasons. In Siebel applications version 7.5.3 and earlier, this value is generally incremented by 50. Starting with Siebel 7.7 the value is incremented by 1000 (default). The client caches these potential RowIDs for future inserts. A new record entered from the user interface may result in many inserts to the underlying tables depending on the business components used. When the client disconnects, cached RowIDs are lost.
In EIM-created RowIDs, the "xxxx" suffix is a sequence starting with "1" and increasing to the highest value necessary to accommodate all new records. The NEXT_PREFIX and NEXT_SUFFIX components are not involved. For example, 15 new records are created in EIM_ACCOUNT using the following values from S_SSA_ID:
-- CORP_PREFIX: 8SIA
-- NEXT_PREFIX: 9SIA
-- NEXT_SUFFIX: 7ZT6T
-- NEXT_SESSION: DDA
The resulting 15 rows will have ROW_IDs of:
8SIA-DDA-0
8SIA-DDA-1
8SIA-DDA-2
8SIA-DDA-3
8SIA-DDA-4
8SIA-DDA-5
8SIA-DDA-6
8SIA-DDA-7
8SIA-DDA-8
8SIA-DDA-9
8SIA-DDA-10
8SIA-DDA-11
8SIA-DDA-12
8SIA-DDA-13
8SIA-DDA-14
Note that the xxxx sequence is a decimal INTEGER sequence; the row after '9' will be '10', not 'A'.
In Siebel applications version 7.5.2 and earlier the caching of RowIDs occurred on individual Application Object Manager (AOM) tasks. Beginning with version 7.5.3 RowID caching occurs on the AOM process itself. This change reduces the potential for contention issues on the S_SSA_ID table.
As of Siebel version 7, RowIDs from Handhelds are built differently, using a 6-character time stamp, a colon and then a randomly generated tail of 1-6 characters. The time stamp number is calculated from the number of seconds since midnight, 01/01/2001 and is then converted to MOD36, supporting years from 2001 though to 2070.
NOTE: If the client is in a database transaction when it needs to create a new RowID, the object manager updates the S_SSA_ID table in a separate transaction and commits the transaction immediately.
What Is RowIdToRowIdNum?
The RowIdToRowIdNum function was first introduced with Siebel 2000 to provide a means of displaying and storing purely numeric -- as opposed to alphanumeric -- RowID numbers. The functionality can be programmed using Siebel Visual Basic for Siebel 99 and earlier releases.
RowIdToRowIdNum alleviates the problems noted in certain Enhancement Requests which pertain to the confusion of characters 0 (zero) and O (oh), 1 (one) and l (ell), and the concerns over the rare occurrence of offensive words appearing within RowId numbers. It further eases customer DTMF entry of a RowID-based identifier in the case of automated telephone technical support.
RowIdToRowIdNum is a method that converts the base-36 parts of a RowID to a decimal number and is also guaranteed to produce unique numbers in order to preserve referential integrity. RowIDs generated by RowIdToRowIdNum will be of variable length; the basic RowID function cannot be limited to a set number of places but is constrained to a maximum field width of 15 characters.
It is not possible to fix the lengths of the numeric IDs because the base-36 (also known as MOD 36) to base-10 conversion will require at least as many character places as the original number used, and usually more.
The base-36 RowID 12-6RX8L would translate to 38-8021253 while 12-Y09KG would become 38-57119344 through decimal conversion. Five places in the original RowID number could require seven (10000[36]=1679616) or eight places (ZZZZZ[36]=60466175) in decimal, while six places in the RowID could take eight (100000[36]=60466176) to ten places (ZIK0ZJ[36]=2147483647, ZZZZZZ[36]=2176782335).
For more information on RowIdToRowIdNum, refer to Document 477625.1. There are free calculators available on-line and a further expanation of the MOD 36 system at wikipedia". Will RowID Always Be Unique?
Siebel Row IDs are guaranteed to be unique within any given table whether in standard form or converted by RowIdToRowIdNum. However, duplication is possible if import preparations are not complete. It is recommended that assistance be sought from the Technical Account Manager (TAM) during for any merge or conversion done outside of EIM. Siebel Applications do not reuse RowIDs. It is possible for you to experience a duplication that only manifests itself after a successful EIM import. Here are two examples:
·
o
If old service requests are imported into the database, EIM will create new RowIDs for the imported records but keep the original Service Request Number value. With a fresh repository and seed data, new RowIDs will be generated based on the current values in S_SSA_ID, and new Service Request Number values will be generated based on the new RowIDs. Although the RowIDs of the old and new records will not match, because EIM assigned a new RowID as part of the import, the Service Request Number for old and new records could match, since the Service Request Number for the imported record was not updated during the import.
This can be resolved by performing a mass update to existing records to ensure uniqueness of the Service Request Number value. It is recommended to engage a TAM or Expert Services for assistance
o
The Activity UID field (based on the ACTIVITY_UID column) is set to the value specified in the interface table, which may be based on the RowID exported from a different Siebel database. New activity records created through the user interface will have a RowID generated by the system, and the Activity UID will default to the RowID.
If the records created via EIM are set to the RowID of another system, there is a possibility of duplication of the Activity UID, which would violate the unique index S_EVT_ACT_U1. A TAM or Expert Services can provide assistance if such a situation arises.
NOTE: Siebel applications do not support partial import of the Siebel schema. Database migration using export and import commands requires that CONSISTENT=Y is set for the database export. If this flag is not set correctly, the following error may occur during data input or the EIM run: "ORA-00001, unique constraint XXXX.XXXX_XXXX_P1 violated". Refer to Document 475669.1 for detailed instructions on how to copy a Siebel schema from one database to another.
Are There Other Ways To Generate Sequence Numbers?
Single Value Field. Using Oracle database SEQUENCE Generation
The Oracle SEQUENCE generation function can be employed but we strongly recommends against basing any identifier on a generated database sequence number. Because the Oracle sequence number does not exist until after a record is created, the generated number cannot be seen until a screen refresh has been performed. Furthermore, the Siebel application-generated Row IDs have full referential integrity which cannot be guaranteed with database-generated numbering.
Microsoft SQL Server 7 and IBM DB2 do not provide an equivalent SEQUENCE function.
For more information on configuring business component fields to hold Oracle sequence numbers, refer to Siebel Bookshelf version 7.8 > Object Types Reference > Siebel Object Types >
Basing Rows or Columns on ROW_ID
It is strongly recommended that anything based on ROW_ID numbers be changed only with assistance from the Siebel TAM or Siebel Expert Services. In assigning Service Request numbers manually, there is a risk that the referential integrity built into the application may be lost. Changes to the base tables are unsupported and could damage system integrity. To use a field originally based on the RowID (such as Service Request number), use an extension column rather than modifying the original ID column.
Sequence Field
Another option for numbering is the Sequence Field. The configurable business component user property Sequence Field allows the creation of a sequence business component with a special business component class called CSSSequence. The Sequence field is available only for child business components; Quote Line numbering, for example, can be sequenced but Service Request numbering cannot be. Adding the Sequence Business Component user property to a business component which could be used in a non-master-detail relationship can significantly affect performance. Creating a new Service Request record in a view based only on the Service Request business component would require the application to perform a full table scan.
For more information about the definition of sequence fields, refer to Bookshelf:
·
and
·
|
|
|
|
|
|
·
|
|
|
ORA-1
返回页首