
- •About the Authors
- •Contents at a Glance
- •Contents
- •Table of Exercises
- •Introduction
- •Assessment Test
- •Answers to Assessment Test
- •What Is ASM?
- •Working with the ASM Instance
- •Overview of ASM Data Dictionary Views
- •Using ASM Storage
- •Using RMAN with ASM
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Understanding the Oracle Database as It Relates to Backup and Recovery
- •Performing Oracle Offline Backups
- •Performing Oracle Online Backups
- •Backing Up the Control File
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Performing Incomplete Recoveries
- •Performing Other Types of Recoveries
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Why Use RMAN?
- •Exploring the RMAN Architecture
- •Connecting to RMAN
- •Configuring RMAN for Use
- •Backing Up Your Database with RMAN
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Introducing the Recovery Catalog
- •Creating the Recovery Catalog User and Schema Objects
- •Using a Recovery Catalog
- •Maintaining the Recovery Catalog
- •Using the RMAN Virtual Private Catalog
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •RMAN Database-Recovery Basics
- •Using Image Copies to Recover Your Database
- •Other Basic Recovery Topics
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Switching Between RMAN Incarnations
- •Overview of RMAN Database Duplication
- •Performing an RMAN Tablespace Point-in-Time Recovery
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Overview of Flashback Technology
- •Using Automatic Undo Management
- •Using Flashback Technologies
- •Using Additional Flashback Operations
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Diagnosing the Database
- •Managing Database Performance
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Managing Memory
- •Managing Space
- •Managing Resources
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Automating Tasks with the Scheduler
- •Exploring the Scheduler Architecture
- •Exploring Common Administration Tools
- •Using Scheduler Jobs
- •Using Scheduler Programs
- •Using Schedules
- •Creating Lightweight Jobs
- •Using Job Chains
- •Using Scheduler Windows
- •Creating and Using Job Classes
- •Using Advanced Scheduler Concepts to Prioritize Jobs
- •Using Scheduler Views
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •An Overview of Globalization Support
- •Using NLS Parameters
- •Using Datetime Datatypes
- •Using Linguistic Sorts and Searches
- •Summary
- •Exam Essentials
- •Review Questions
- •Answers to Review Questions
- •Lab 1.1: Creating an ASM Instance
- •Lab 1.2: Creating ASM Disk Groups
- •Lab 1.3: Using ASM Disk Groups from a Database
- •Lab 2.2: Putting the Database in ARCHIVELOG Mode
- •Lab 2.3: Executing a Manual Online (Hot) Backup
- •Lab 3.1: Executing a Time-Based Point-in-Time Recovery
- •Lab 3.2: Recovering from Control-File Loss with a Backup Control File
- •Lab 3.3: Recovering from Loss of the Current Online Redo Log
- •Lab 4.1: Creating an RMAN Offline Backup
- •Lab 4.2: Creating an RMAN Incremental Backup
- •Lab 4.3: Creating an Image-Copy Backup
- •Lab 5.1: Implementing RVPC
- •Lab 6.1: Restoring a Datafile Online
- •Lab 6.2: Performing a Change-Based Recovery with RMAN
- •Lab 6.3: Restoring a Control File from an Autobackup
- •Lab 7.1: Monitoring RMAN Backups
- •Lab 7.2: One of My Backups Is Missing!
- •Lab 8.1: Duplicating a Database Using Active Database Duplication
- •Lab 8.2: Duplicating a Database Using Backup-Based Duplication to a Different Point in Time
- •Lab 9.1: Using the Recycle Bin
- •Lab 9.3: Using Flashback Data Archive
- •Lab 10.1: Using Support Workbench to Report a Problem to Oracle Support
- •Lab 11.1: Exporting a Transportable Tablespace
- •Lab 11.2: Testing Resumable Space Allocation
- •Lab 11.3: Manually Configuring the SGA
- •Lab 12.1: Creating a Local External Job
- •Lab 12.2: Creating a Job Window
- •Lab 13.1: Using the Locale Builder to Create a New Linguistic Sort
- •Lab 13.2: Setting NLS Parameters
- •Lab 13.3: Performing Linguistic Sorts
- •What You’ll Find on the CD
- •System Requirements
- •Using the CD
- •Troubleshooting
- •Glossary
- •Index

Lab 13.2: Setting NLS Parameters |
769 |
Lab 13.2: Setting NLS Parameters
In this lab, you will practice setting NLS parameters for the instance and for the session and observe how parameters are prioritized. Here are the general steps:
1.Show and modify instance NLS parameters.
2.Modify and observe the effects of setting session NLS variables.
3.Demonstrate NLS-parameter priorities.
Here’s an example:
1.Show and modify instance NLS parameters.
SQL> show parameter nls
NAME |
TYPE |
VALUE |
------------------------------------ |
----------- |
-------- |
nls_calendar |
string |
|
nls_comp |
string |
BINARY |
nls_currency |
string |
|
nls_date_format |
string |
|
nls_date_language |
string |
|
nls_dual_currency |
string |
|
nls_iso_currency |
string |
|
nls_language |
string |
AMERICAN |
nls_length_semantics |
string |
BYTE |
nls_nchar_conv_excp |
string |
FALSE |
nls_numeric_characters |
string |
|
nls_sort |
string |
|
nls_territory |
string |
AMERICA |
nls_time_format |
string |
|
nls_time_tz_format |
string |
|
nls_timestamp_format |
string |
|
nls_timestamp_tz_format |
string |
|
SQL> |
|
|
Only nls_nchar_conv_excp and nls_lenght_semantics are dynamically system modifiable or instance modifiable. You can, however, modify the parameter with scope=spfile and restart the instance to take effect.
SQL> alter system set nls_date_format=’dd-mon-yyyy hh24:mi:ss’ scope=spfile;
/

770 |
Appendix A n Lab Exercises |
|
|
System altered. |
|
|
|
SQL> shutdown immediate; |
|
|
|
Database closed. |
|
|
|
Database dismounted. |
|
|
|
ORACLE instance shut down. |
|
|
|
SQL> startup |
|
|
|
ORACLE instance started. |
|
|
|
Total System Global Area |
732352512 bytes |
|
|
Fixed Size |
1335696 bytes |
|
|
Variable Size |
444599920 bytes |
|
|
Database Buffers |
281018368 bytes |
|
|
Redo Buffers |
5398528 bytes |
|
|
Database mounted. |
|
|
|
Database opened. |
|
|
|
SQL> show parameter nls |
|
|
|
NAME |
|
TYPE |
VALUE |
------------------------------------ ----------- ---- |
|||
-------------------------- |
|
|
|
nls_calendar |
string |
|
|
nls_comp |
string |
BINARY |
|
nls_currency |
string |
|
|
nls_date_format |
string |
dd-mon-yyyy hh24:mi:ss |
|
nls_date_language |
string |
|
|
nls_dual_currency |
string |
|
|
nls_iso_currency |
string |
|
|
nls_language |
string |
AMERICAN |
|
nls_length_semantics |
string |
BYTE |
|
nls_nchar_conv_excp |
string |
FALSE |
|
nls_numeric_characters |
string |
|
|
nls_sort |
string |
|
|
nls_territory |
string |
AMERICA |
|
nls_time_format |
string |
|
|
nls_time_tz_format |
string |
|
|
nls_timestamp_format |
string |
|
|
nls_timestamp_tz_format |
string |
|
|
SQL> |
|
|
|
You can also observe the system NLS parameters by querying the NLS_INSTANCE_ PARAMETERS view.

Lab 13.2: Setting NLS Parameters |
771 |
2.Modify and observe the effects of setting session NLS variables. Query the NLS_SESSION_ PARAMETERS view to see your session parameter settings.
SQL> select * from nls_session_parameters SQL> /
PARAMETER |
VALUE |
------------------------------ |
---------------------------- |
NLS_LANGUAGE |
AMERICAN |
NLS_TERRITORY |
AMERICA |
NLS_CURRENCY |
$ |
NLS_ISO_CURRENCY |
AMERICA |
NLS_NUMERIC_CHARACTERS |
., |
NLS_CALENDAR |
GREGORIAN |
NLS_DATE_FORMAT |
DD-MON-RR |
NLS_DATE_LANGUAGE |
AMERICAN |
NLS_SORT |
BINARY |
NLS_TIME_FORMAT |
HH.MI.SSXFF AM |
NLS_TIMESTAMP_FORMAT |
DD-MON-RR HH.MI.SSXFF AM |
NLS_TIME_TZ_FORMAT |
HH.MI.SSXFF AM TZR |
NLS_TIMESTAMP_TZ_FORMAT |
DD-MON-RR HH.MI.SSXFF AM TZR |
NLS_DUAL_CURRENCY |
$ |
NLS_COMP |
BINARY |
NLS_LENGTH_SEMANTICS |
BYTE |
NLS_NCHAR_CONV_EXCP |
FALSE |
17 rows selected. |
|
SQL> select sysdate from dual; |
|
SYSDATE |
|
--------- |
|
23-NOV-08 |
|
SQL>
Modify the session NLS_DATE_FORMAT, and query.
SQL> alter session set nls_date_format=’dd-mon-yyyy hh24:mi:ss’; Session altered.

772 |
Appendix A n Lab Exercises |
|
SQL> select * from nls_session_parameters; |
||
PARAMETER |
VALUE |
|
------------------------------ |
---------------------------- |
|
NLS_LANGUAGE |
AMERICAN |
|
NLS_TERRITORY |
AMERICA |
|
NLS_CURRENCY |
$ |
|
NLS_ISO_CURRENCY |
AMERICA |
|
NLS_NUMERIC_CHARACTERS |
., |
|
NLS_CALENDAR |
GREGORIAN |
|
NLS_DATE_FORMAT |
dd-mon-yyyy hh24:mi:ss |
|
NLS_DATE_LANGUAGE |
AMERICAN |
|
NLS_SORT |
BINARY |
|
NLS_TIME_FORMAT |
HH.MI.SSXFF AM |
|
NLS_TIMESTAMP_FORMAT |
DD-MON-RR HH.MI.SSXFF AM |
|
NLS_TIME_TZ_FORMAT |
HH.MI.SSXFF AM TZR |
|
NLS_TIMESTAMP_TZ_FORMAT |
DD-MON-RR HH.MI.SSXFF AM TZR |
|
NLS_DUAL_CURRENCY |
$ |
|
NLS_COMP |
BINARY |
|
NLS_LENGTH_SEMANTICS |
BYTE |
|
NLS_NCHAR_CONV_EXCP |
FALSE |
17 rows selected.
SQL> select sysdate from dual;
SYSDATE
--------------------
23-nov-2008 00:11:38
SQL>
3.Demonstrate NLS-parameter priorities. Modify the session NLS_LANGUAGE, and query.
SQL> alter session set nls_language=’GERMAN’; Session altered.
SQL> select * from nls_session_parameters;

|
Lab 13.2: Setting NLS Parameters |
773 |
PARAMETER |
VALUE |
|
------------------------------ |
---------------------------- |
|
NLS_LANGUAGE |
GERMAN |
|
NLS_TERRITORY |
AMERICA |
|
NLS_CURRENCY |
$ |
|
NLS_ISO_CURRENCY |
AMERICA |
|
NLS_NUMERIC_CHARACTERS |
., |
|
NLS_CALENDAR |
GREGORIAN |
|
NLS_DATE_FORMAT |
dd-mon-yyyy hh24:mi:ss |
|
NLS_DATE_LANGUAGE |
GERMAN |
|
NLS_SORT |
GERMAN |
|
NLS_TIME_FORMAT |
HH.MI.SSXFF AM |
|
NLS_TIMESTAMP_FORMAT |
DD-MON-RR HH.MI.SSXFF AM |
|
NLS_TIME_TZ_FORMAT |
HH.MI.SSXFF AM TZR |
|
NLS_TIMESTAMP_TZ_FORMAT |
DD-MON-RR HH.MI.SSXFF AM TZR |
|
NLS_DUAL_CURRENCY |
$ |
|
NLS_COMP |
BINARY |
|
NLS_LENGTH_SEMANTICS |
BYTE |
|
NLS_NCHAR_CONV_EXCP |
FALSE |
|
17 rows selected.
SQL>
Notice that when you set the NLS_LANGUAGE, the NLS_DATE_LANGUAGE and NLS_SORT also changed but the NLS_TERRITORY and NLS_ISO_CURRENCY did not. Now change the NLS_LANGUAGE back and observe.
SQL> alter session set nls_language=’AMERICAN’;
Session altered.
SQL> select * from nls_session_parameters;
PARAMETER |
VALUE |
------------------------------ |
---------------------------- |
NLS_LANGUAGE |
AMERICAN |
NLS_TERRITORY |
AMERICA |
NLS_CURRENCY |
$ |
NLS_ISO_CURRENCY |
AMERICA |

774 |
Appendix A n Lab Exercises |
|
NLS_NUMERIC_CHARACTERS |
., |
|
NLS_CALENDAR |
GREGORIAN |
|
NLS_DATE_FORMAT |
dd-mon-yyyy hh24:mi:ss |
|
NLS_DATE_LANGUAGE |
AMERICAN |
|
NLS_SORT |
BINARY |
|
NLS_TIME_FORMAT |
HH.MI.SSXFF AM |
|
NLS_TIMESTAMP_FORMAT |
DD-MON-RR HH.MI.SSXFF AM |
|
NLS_TIME_TZ_FORMAT |
HH.MI.SSXFF AM TZR |
|
NLS_TIMESTAMP_TZ_FORMAT |
DD-MON-RR HH.MI.SSXFF AM TZR |
|
NLS_DUAL_CURRENCY |
$ |
|
NLS_COMP |
BINARY |
|
NLS_LENGTH_SEMANTICS |
BYTE |
|
NLS_NCHAR_CONV_EXCP |
FALSE |
17 rows selected.
SQL>
Note the NLS_LANGUAGE sets a default for NLS_DATE_LANGUAGE and NLS_SORT; however, you can modify NLS_DATE_LANGUAGE and NLS_SORT independently.
SQL> alter session set nls_sort=’GERMAN’;
Session altered.
SQL> select * from nls_session_parameters;
PARAMETER |
VALUE |
------------------------------ |
---------------------------- |
NLS_LANGUAGE |
AMERICAN |
NLS_TERRITORY |
AMERICA |
NLS_CURRENCY |
$ |
NLS_ISO_CURRENCY |
AMERICA |
NLS_NUMERIC_CHARACTERS |
., |
NLS_CALENDAR |
GREGORIAN |
NLS_DATE_FORMAT |
dd-mon-yyyy hh24:mi:ss |
NLS_DATE_LANGUAGE |
AMERICAN |
NLS_SORT |
GERMAN |
NLS_TIME_FORMAT |
HH.MI.SSXFF AM |
NLS_TIMESTAMP_FORMAT |
DD-MON-RR HH.MI.SSXFF AM |
NLS_TIME_TZ_FORMAT |
HH.MI.SSXFF AM TZR |

|
Lab 13.2: Setting NLS Parameters |
775 |
NLS_TIMESTAMP_TZ_FORMAT |
DD-MON-RR HH.MI.SSXFF AM TZR |
|
NLS_DUAL_CURRENCY |
$ |
|
NLS_COMP |
BINARY |
|
NLS_LENGTH_SEMANTICS |
BYTE |
|
NLS_NCHAR_CONV_EXCP |
FALSE |
|
17 rows selected.
SQL>
If I now set the NLS_LANGUAGE to American, it will overlay the NLS_SORT value with
BINARY:
SQL> alter session set nls_language=’AMERICAN’;
Session altered.
SQL> select * from nls_session_parameters;
PARAMETER |
VALUE |
------------------------------ |
---------------------------- |
NLS_LANGUAGE |
AMERICAN |
NLS_TERRITORY |
AMERICA |
NLS_CURRENCY |
$ |
NLS_ISO_CURRENCY |
AMERICA |
NLS_NUMERIC_CHARACTERS |
., |
NLS_CALENDAR |
GREGORIAN |
NLS_DATE_FORMAT |
dd-mon-yyyy hh24:mi:ss |
NLS_DATE_LANGUAGE |
AMERICAN |
NLS_SORT |
BINARY |
NLS_TIME_FORMAT |
HH.MI.SSXFF AM |
NLS_TIMESTAMP_FORMAT |
DD-MON-RR HH.MI.SSXFF AM |
NLS_TIME_TZ_FORMAT |
HH.MI.SSXFF AM TZR |
NLS_TIMESTAMP_TZ_FORMAT |
DD-MON-RR HH.MI.SSXFF AM TZR |
NLS_DUAL_CURRENCY |
$ |
NLS_COMP |
BINARY |
NLS_LENGTH_SEMANTICS |
BYTE |
NLS_NCHAR_CONV_EXCP |
FALSE |
17 rows selected. |
|
SQL> |
|