Chapter 10 - Understanding Globalization Support
Review Questions
1. Globalization support is implemented through the text- and character processing functions provided by which Oracle feature?
A. RSTLNE
B. NLSRTL
C. LISTENER
D. NLSSORT
E. Linguistic sorts
----
Ans: B.
The NLS Runtime Library (NLSRTL) provides the language-independent text and
character processing functionality for Oracle.
2. What three elements of globalization can be explicitly defined using the NLS_LANG environment variable?
A. NLS_LANGUAGE
B. NLS_SORT
C. NLS_CALENDAR
D. NLS_CHARACTERSET
E. NLS_TERRITORY
---
Ans: A, D, E.
The client-side NLS_LANG parameter can define language, territory, and
character set all at once. Though the value for NLS_SORT is derived from the
NLS_LANGUAGE parameter setting, it is not explicitly set by NLS_LANG. NLS_CALENDAR
is not affected by the setting of NLS_LANG.
3. Given two different character sets (A and B), which of the following must be
true for A to be considered a strict superset of B? (Choose all that apply.)
A. A must contain all of the characters defined in B.
B. A must be Unicode.
C. The encoded values in A must match the encoded values in B for all characters defined in B.
D. A must be a multi-byte character set.
E. The encoded values in A must match the encoded values in B for all numeric and alphabetic characters in B.
---
Ans: A, C.
A strict superset must contain all characters found in the other character set and
have matching encoded values for those characters.
4. The NLS_SORT parameter sets the default sort method for which of the following operations? (Choose all that apply.)
A. WHERE clause
B. ORDER BY clause
C. BETWEEN clause
D. NLSSORT function
E. NLS_SORT function
---
Ans: A, D.
The NLS_SORT parameter defines the default sort method (binary or linguistic)
for both SQL WHERE clause operations and NLSSORT function operations. The default
sort method for ORDER_BY and BETWEEN (and all other SQL operations that support
linguistic sorts) is defined by the NLS_COMP parameter. NLS_SORT is an invalid
function name.
5. Which view shows all valid values for the NLS_LANGUAGE, NLS_SORT, NLS_TERRITORY, and NLS_CHARACTERSET parameters?
A. V$VALID_NLS_VALUES
B. NLS_VALID_VALUES
C. NLS_VALUE_OPTIONS
D. V$NLS_VALUE_OPTIONS
E. V$NLS_VALID_VALUES
---
Ans: E.
The V$NLS_VALID_VALUES view shows the names of all language, territory, sort,
and character set definitions that are available in the database.
6. Which of the following datatypes store time zone information in the database?
A. TIMESTAMP
B. DATE
C. TIMESTAMP WITH TIME ZONE
D. TIMESTAMP WITH LOCAL TIME ZONE
E. DATETIME
---
Ans: C.
Only TIMESTAMP WITH TIME ZONE datatype actually stores time zone information
in the database. The TIMESTAMP WITH LOCAL TIME ZONE datatype converts the
timestamp to local time and drops the time zone information before storing it in the
database. DATE and TIMESTAMP datatypes do not deal with time zone information at
all. DATETIME is not a valid datatype.
7. Which of the following are valid settings for the NLS_COMP parameter?
(Choose all that apply.)
A. ASCII
B. ANSI
C. BINARY
D. MONOLINGUAL
E. MULTILINGUAL
---
Ans: B, C.
The NLS_COMP parameter can be set to BINARY or ANSI. This parameter
determines the default sort type for certain SQL functions. (A setting of ANSI
specifies that linguistic sorts should be used.)
8. NLS parameters can be set using the five methods listed below. Put the methods in order from highest to lowest according to Oracle's order of precedence:
1. Default setting
2. Client environment variable
3. Explicit ALTER SESSION statement
4. Inside SQL function
5. Server initialization parameter
A. 2, 4, 5, 1, 3
B. 5, 1, 2, 3, 4
C. 4, 3, 2, 5, 1
D. 1, 2, 4, 3, 5
E. 4, 3, 2, 1, 5
----
Ans: C.
NLS settings embedded in a SQL function have the highest precedence, followed
by explicit ALTER SESSION statements, client environment variables (which execute
an implicit ALTER SESSION statement), server initialization parameters, and finally
default settings.
9. What can you determine about the following linguistic sorts based only on their names?
1. GERMAN
2. FRENCH_M
Select all the true statements:
A. 1 is a monolingual sort.
B. 2 is a monolingual sort.
C. 1 is case-insensitive.
D. Both 1 and 2 are case-insensitive.
E. Case-sensitivity is unknown.
---
Ans: A.
A is the only true statement. The _M appended to the end of a sort name denotes a
multilingual sort. Its absence denotes a monolingual sort. Case-sensitive and accent-insensitive
sorts have _CI or _AI appended to the name. Its absence denotes case- and accent-sensitivity.
10. In a database with the database character set of US7ASCII and a national
character set of UTF-8, which datatypes would be capable of storing Unicode
data by default?
A. VARCHAR2
B. CHAR
C. NVARCHAR2
D. CLOB
E. LONG
---
Ans: C.
NLS datatypes (NCHAR, NVARCHAR, and NCLOB) store data using the character set
defined as the national character set by default. Because the national character set is
UTF-8 (a Unicode character set), data stored in these datatypes will be Unicode data
by default. All other datatypes use the character set defined as the database character
set. Because US7ASCII is not a Unicode character set, it does not store Unicode data
by default.
11. Automatic data conversion will occur if
A. The client and server have different NLS_LANGUAGE settings.
B. The client and server character sets are not the same, and the database character set is not a strict superset of the client character set.
C. The client and server are in different time zones.
D. The client requests automatic data conversion.
E. The AUTO_CONVERT initialization parameter is set to TRUE.
--
Ans: B.
Automatic data conversion occurs when data is moved between character sets.
However, if the server character set is a strict superset of the client character set, no
conversion is necessary.
12. Which of the following NLS_SORT parameter values would result in case-insensitive
and accent-insensitive binary sorts?
A. NLS_SORT = BINARY
B. NLS_SORT = BINARY_AI
C. NLS_SORT = BINARY_CI
D. NLS_SORT = BINARY_AI_CI
E. Binary sorts are case and accent-insensitive by default.
---
Ans: B.
The _AI suffix implies that an accent-insensitive sort will be performed. Accent-insensitive
sorts are also case-insensitive by default. The _CI suffix implies that a
case-insensitive sort will be performed, but it will not be accent-insensitive.
Specifying both suffixes (_AI_CI) is illegal.
13. Which NLS parameter can be used to change the default Oracle sort method
from binary to linguistic for the SQL SELECT statement?
A. NLS_LANG
B. NLS_SORT
C. NLS_COMP
D. NLS_SORT
E. None of the above
--
Ans: E.
The SQL SELECT statement does not invoke a sort.
14. Which of the following would be affected by setting NLS_LENGTH_SEMANTICS=CHAR?
A. All objects in the database
B. Tables owned by SYS and SYSTEM
C. Data dictionary tables
D. NCHAR columns
E. CHAR columns
----
Ans: E.
Only option E is correct. Tables owned by the SYS and SYSTEM users are not
affected by default-length semantics. Data dictionary tables always use byte
semantics, and NCHAR columns always use character semantics. Therefore, neither is
affected by the setting of the NLS_LENGTH_ SEMANTICS parameter.
15. Which is not a valid locale definition file type?
A. Language
B. Linguistic sort
C. Calendar
D. Territory
E. Character set
---
Ans: C.
Calendar definitions are not stored as locale definition files. Only languages,
linguistic sorts, territories, and character set definitions are stored as locale definition
files.
16. How many different calendars does Oracle 10g support?
A. 22
B. 7
C. 6
D. 15
E. 2
----
Ans: B.
Oracle supports 7 distinct calendars: Gregorian, Japanese Imperial, ROC Official,
Persian, Thai Buddha, Arabic Hijrah, and English Hijrah.
17. Which NLS parameter directly governs linguistic searches?
A. NLS_SEARCH_L
B. NLS_SORT
C. NLS_SEARCH
D. NLS_SORT_L
E. None of the above
---
Ans: B.
Linguistic searches are closely related to linguistic sorts and are governed by the
NLS_SORT parameter.
18. Case-insensitive sorts are always accent-insensitive by default.
A. True
B. False
---
Ans: B.
Accent-insensitive sorts are always case-insensitive, not the other way around.
19. What is the name of the file that identifies the set of available locale definitions?
A. locale.def
B. lxdef.ora
C. lx1boot.nlb
D. lx1boot.ora
E. lang.def
--
Ans: C.
The lx1boot.nlb file identifies the available locale definitions to the NLSRTL.
20. Which of the following is not a valid linguistic sort element?
A. Accent expansion
B. Canonical equivalence
C. Reverse secondary sorting
D. Ignorable characters
E. Character rearrangement
---
Ans: A.
Linguistic sort elements define the rules for linguistic sorting. There is no
linguistic sort element named "accent expansion." The other choices are all valid
rules.
Everything Changes
1 week ago
No comments:
Post a Comment