- •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
776 Appendix A n Lab Exercises
Lab 13.3: Performing Linguistic Sorts
In this exercise, you will create a table and populate it with values that are easily sorted. You will then modify the NLS parameters that affect linguistic sorts and query the table, observing how the NLS-parameter settings modify the sort results. Here are the steps:
1.Create a table for linguistic sorts, and populate it.
2.Verify your session NLS parameters.
3.Query the sort table.
4.Modify the sort parameter.
5.Query the table and observe the differences in the sort results. Here’s an example:
1.Create a table for linguistic sorts, and populate it.
SQL> create table linguistic_sort_test (x number, y varchar2(1)); Table created.
SQL>
insert into linguistic_sort_test values (1,’A’); insert into linguistic_sort_test values (2,’B’); insert into linguistic_sort_test values (3,’C’); insert into linguistic_sort_test values (4,’D’); insert into linguistic_sort_test values (5,’E’); insert into linguistic_sort_test values (6,’F’); insert into linguistic_sort_test values (7,’G’); insert into linguistic_sort_test values (8,’H’); insert into linguistic_sort_test values (9,’I’); insert into linguistic_sort_test values (10,’J’); insert into linguistic_sort_test values (11,’a’); insert into linguistic_sort_test values (12,’b’); insert into linguistic_sort_test values (13,’c’); insert into linguistic_sort_test values (14,’d’); insert into linguistic_sort_test values (15,’e’); insert into linguistic_sort_test values (16,’f’); insert into linguistic_sort_test values (17,’g’); insert into linguistic_sort_test values (18,’h’); insert into linguistic_sort_test values (19,’i’); insert into linguistic_sort_test values (20,’j’); commit;
Lab 13.3: Performing Linguistic Sorts |
777 |
2.Verify your session NLS parameters.
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>
3.Query the sort table. Order by the numeric value as a baseline or control query, and then order by the character column using the default BINARY sort.
SQL> select * from linguistic_sort_test order by x;
X Y
---------- -
1 |
A |
2 |
B |
3 |
C |
4 |
D |
5 |
E |
6 |
F |
7 |
G |
778 Appendix A n Lab Exercises
8 H
9 I
10J
11a
12b
13c
14d
15e
16f
17g
18h
19i
20j
20 rows selected.
SQL>
SQL> select * from linguistic_sort_test order by y;
X Y
---------- -
1 |
A |
2 |
B |
3 |
C |
4 |
D |
5 |
E |
6 |
F |
7 |
G |
8 |
H |
9 |
I |
10 |
J |
11 |
a |
12 |
b |
13 |
c |
14 |
d |
15 |
e |
16 |
f |
17 |
g |
Lab 13.3: Performing Linguistic Sorts |
779 |
18h
19i
20j
20 rows selected.
4.Modify the sort parameter. The default was BINARY; we’ll modify it to EBCDIC to demonstrate the simple difference.
SQL>
SQL> alter session set nls_sort=’EBCDIC’; Session altered.
5.Query the table and observe the differences in the sort results from the previous query.
SQL> select * from linguistic_sort_test order by y;
X Y
---------- -
11a
12b
13c
14d
15e
16f
17g
18h
19i
20j 1 A 2 B 3 C 4 D 5 E 6 F 7 G 8 H 9 I
10 J
20 rows selected.
780 Appendix A n Lab Exercises
Notice that the EBCDIC sort placed the lowercase letters at the beginning of the sort because they have a lower EBCDIC value than their uppercase counterparts.
If we now set the NLS_SORT value to ASCII7, you’ll see the same results as BINARY for this simple sort.
SQL> alter session set nls_sort=’ASCII7’;
Session altered.
SQL> select * from linguistic_sort_test order by y;
X Y
---------- -
1 |
A |
2 |
B |
3 |
C |
4 |
D |
5 |
E |
6 |
F |
7 |
G |
8 |
H |
9 |
I |
10 |
J |
11 |
a |
12 |
b |
13 |
c |
14 |
d |
15 |
e |
16 |
f |
17 |
g |
18 |
h |
19 |
i |
20 |
j |
20 rows selected.
Now if you set the NLS_SORT to CROATIAN, you’ll see something really interesting.
SQL> alter session set nls_sort=’CROATIAN’;
Lab 13.3: Performing Linguistic Sorts |
781 |
Session altered.
SQL> select * from linguistic_sort_test order by y;
X Y
---------- -
1 A
11a 2 B
12b 3 C
13c 4 D
14d 5 E
15e 6 F
16f 7 G
17g 8 H
18h 9 I
19i
10J
20j
20 rows selected.
SQL>
And when you set NLS_SORT to THAI_M, you’ll see the opposite pattern from the one for CROATIAN.
SQL> alter session set nls_sort=’THAI_M’;
Session altered.
SQL> select * from linguistic_sort_test order by y;
782 Appendix A n Lab Exercises
X Y
---------- -
11a 1 A
12b 2 B
13c 3 C
14d 4 D
15e 5 E
16f 6 F
17g 7 G
18h 8 H
19i 9 I
20j
10J
20 rows selected.
SQL>
Remember that setting NLS_LANGUAGE will override the NLS_SORT setting, but NLS_SORT can be set to whatever valid setting you choose following a change to NLS_LANGUAGE.
Appendix |
About the |
B |
Companion CD |
|
|
In this appendix: |
|
|
ÛÛWhat you’ll find on the CD |
|
ÛÛSystem requirements |
|
ÛÛUsing the CD |
|
ÛÛTroubleshooting |