Oracle8i SQL Reference Release 2 (8.1.6) A76989-01 |
|
SQL Statements (continued), 2 of 5
To specify or modify any of the conditions or parameters that affect your connection to the database. The statement stays in effect until you disconnect from the database.
To enable and disable the SQL trace facility, you must have ALTER
SESSION
system privilege.
You do not need any privileges to perform the other operations of this statement unless otherwise indicated.
|
sends advice to a remote database to force a distributed transaction. The advice appears in the
You can send different advice to different remote databases by issuing multiple |
|
|
closes the database link dblink. When you issue a statement that uses a database link, Oracle creates a session for you on the remote database using that link. The connection remains open until you end your local session or until the number of database links for your session exceeds the value of the initialization parameter |
|
|
Procedures and stored functions written in PL/SQL can issue
You can subsequently allow procedures and stored functions to issue
Some applications (such as SQL*Forms) automatically prohibit |
|
|
Note: This statement does not apply to database triggers. Triggers can never issue |
|
|
specifies whether all subsequent DML, DDL, or query statements in the session will be considered for parallel execution. This clause enables you to override the degree of parallelism of tables during the current session without changing the tables themselves. You can execute this clause for DML only between committed transactions. Uncommitted transactions must either be committed or rolled back prior to executing this clause for DML. |
|
|
|
executes subsequent statements in the session in parallel. This is the default for DDL and query statements. |
|
|
Restriction: You cannot specify the optional |
|
|
specifies that subsequent statements will be executed serially. This is the default for DML statements. |
|
|
Restriction: You cannot specify the optional |
|
|
forces parallel execution of subsequent statements in the session. If no parallel clause or hint is specified, then a default degree of parallelism is used. This clause overrides any parallel_clause specified in subsequent statements in the session, but is overridden by a parallel hint. |
|
|
|
|
|
|
|
The following types of DML operations are not parallelized regardless of this clause: |
|
|
For a detailed description of parallel DML features and hints, see Oracle8i Designing and Tuning for Performance. |
|
set_clause |
sets the session parameters that follow. You can set values for multiple parameters in the same set_clause. |
|
|
CAUTION: Unless otherwise indicated, the parameters described here are initialization parameters, and the descriptions indicate only the general nature of the parameters. Before changing the values of initialization parameters, please refer to their full description in Oracle8i Reference or Oracle8i National Language Support Guide. |
|
|
||
|
determines when conditions specified by a deferrable constraint are enforced. |
|
|
|
|
|
|
|
|
||
|
determines whether Oracle should automatically create and store an outline for each query submitted during the session. |
|
|
|
|
|
||
|
changes the current schema of the session to the specified schema. Subsequent unqualified references to schema objects during the session will resolve to objects in the specified schema. The setting persists for the duration of the session or until you issue another |
|
|
This setting offers a convenient way to perform operations on objects in a schema other than that of the current user without having to qualify the objects with the schema name. This setting changes the current schema, but it does not change the session user or the current user, nor does it give you any additional system or object privileges for the session. For more information on this parameter, see Oracle8i Application Developer's Guide - Fundamentals. |
|
|
||
|
determines what kind of SQL statements can share the same cursors.
See Also: Oracle8i Designing and Tuning for Performance for information on setting this parameter in these and other environments. |
|
|
||
|
controls whether data block checking is done. The default is |
|
|
||
|
specifies with integer the maximum number of blocks read in one I/O operation during a sequential scan. The default is 8. |
|
|
||
|
specifies the target number of I/Os (reads and writes) to and from buffer cache that Oracle should perform upon crash or instance recovery. Oracle continuously calculates the actual number of I/Os that would be needed for recovery and compares that number against the target. If the actual number is greater than the target, Oracle attempts to write additional dirty buffers to advance the checkpoint, while minimizing the affect on performance. For information on how to tune this parameter, see Oracle8i Designing and Tuning for Performance. |
|
|
||
|
specifies FIPS flagging, which causes an error message to be generated when a SQL statement issued is an extension of ANSI SQL92.
In Oracle, there is currently no difference between Entry, Intermediate, or Full level flagging. Once flagging is set in a session, a subsequent |
|
|
||
|
When you start an instance, Oracle determines whether to enforce global name resolution for remote objects accessed in SQL statements based on the value of the initialization parameter Oracle recommends that you enable global name resolution if you use or plan to use distributed processing. For more information on global name resolution and how Oracle enforces it, see "Referring to Objects in Remote Databases" and Oracle8i Distributed Database Systems. |
|
|
||
|
specifies in bytes the amount of memory to use for hash join operations. The default is twice the value of the |
|
|
||
|
enables or disables the use of the hash join operation in queries. The default is |
|
|
||
|
specifies the number of data blocks to read and write during a hash join operation. The value multiplied by the |
|
|
||
|
in a parallel server, accesses database files as if the session were connected to the instance specified by integer. |
|
|
||
|
specifies how transactions containing database modifications are handled. |
|
|
|
|
|
||
|
specifies up to five session-specific valid operating system pathnames or Oracle service names (plus other related options) as destinations for archive redo log file groups (n = integers 1 through 5). For a description of the options, refer to Oracle8i Reference. |
|
|
Restrictions: If you set a value for this parameter,
|
|
|
||
|
specifies the session-specific state associated with the corresponding |
|
|
||
|
specifies the session-specific minimum number of destinations that must succeed in order for the online log file to be available for reuse. |
|
|
||
|
specifies the upper limit of trace dump file size. Specify the maximum size as either a nonnegative integer that represents the number of blocks, or as |
|
NLS parameters: When you start an instance, Oracle establishes support based on the values of initialization parameters that begin with "NLS". You can query the dynamic performance table |
||
|
||
|
explicitly specifies a new calendar type. |
|
|
||
|
specifies that linguistic comparison is to be used according to the |
|
|
||
|
explicitly specifies a new value for the L number format element (the local currency symbol). The symbol cannot exceed 10 characters. |
|
|
||
|
explicitly specifies a new default date format. The 'fmt' value must be a date format model as specified in the section "Date Format Elements". |
|
|
||
|
explicitly changes the language for names and abbreviations of days and months, and for spelled-out values of other date format elements. |
|
|
||
|
explicitly specifies a new "Euro" (or other) dual currency symbol. The value of text is returned by the number format element U (see "Number Format Elements"); text cannot exceed 10 characters. |
|
|
||
|
explicitly specifies the territory whose ISO currency symbol should be used. That territory's currency symbol then becomes the value of the C number format element. |
|
|
||
|
changes the language in which Oracle returns errors and other messages. This parameter also implicitly specifies new values for these items: |
|
|
||
|
||
|
explicitly specifies a new decimal character and group separator. The 'text' value must have this form: 'dg' where: d is the new decimal character, and g is the new group separator. |
|
|
The decimal character and the group separator must be two different single-byte characters, and cannot be a numeric value or any of the following characters: plus sign ("+"), minus sign or hyphen ("-" ), less-than sign ("<"), or greater-than sign (">"). |
|
|
If the decimal character is not a period (.), you must use single quotation marks to enclose all number values that appear in expressions in your SQL statements. When not using a period for the decimal point, use the |
|
|
||
|
changes the sequence into which Oracle sorts character values. sort specifies the name of a linguistic sort sequence. |
|
|
||
|
implicitly specifies new values for these items: |
|
|
||
|
||
|
specifies the percentage of the optimal cache size that the session object cache can grow beyond the optimal size. The default is 10. |
|
|
||
|
specifies (in kilobytes) the size to which the session object cache is reduced when it exceeds maximum size. The default is 100. |
|
|
||
|
lets you tune the optimizer to favor nested loops joins and IN-list iterators. The value of integer indicates the percentage of the index blocks assumed to be in the cache. |
|
|
||
|
let you tune optimizer behavior for access path selection to make the optimizer more likely to select an index access path than a full table scan. The value of integer is a percentage indicating the importance the optimizer attaches to the index path compared with "normal". The default is 100 (indicating 100%), which makes the optimizer cost index access paths at the regular cost. |
|
|
||
|
lets you limit the amount of work the optimizer expends on optimizing queries with large joins. The value of integer is the number of permutations of the tables the optimizer will consider with large joins. |
|
|
||
|
specifies the approach and mode of the optimizer for your session. For information on how to choose a goal for the cost-based approach based on the characteristics of your application, see Oracle8i Concepts and Oracle8i Designing and Tuning for Performance. |
|
|
|
|
|
||
|
specifies the amount of parallelism the optimizer uses in its cost functions. The default is 0 (no parallelism). |
|
|
||
|
lets you enhance performance during hash and merge joins. |
|
|
||
|
identifies the parallel instance group to be used for spawning parallel query slaves. The default is all active instances. Set this parameter only if you are running Oracle Parallel Server in parallel mode. |
|
|
||
|
specifies the minimum percent of threads required for parallel query. The default is 0 (no parallelism). |
|
|
||
|
When set to |
|
|
Note: For important information on partition views, see "Partition Views". |
|
|
||
|
if See the PL/SQL User's Guide and Reference and Oracle8i Reference for more information about this session parameter. |
|
|
||
|
enables or disables query rewrite on all materialized views that have not been explicitly disabled. Query rewrite is disabled by default. It is also disabled by rule-based optimization (that is, if the |
|
|
This parameter has the following additional effect on the use of function-based indexes:
|
|
|
||
|
Enabling or disabling query rewrite does not affect descending indexes.
A setting of |
|
|
||
|
sets the minimum consistency level for query rewrite. The following values are permitted: |
|
|
This parameter does not affect descending indexes. For more information on query rewrite integrity level, see Oracle8i Data Warehousing Guide. For information on dimensions, see "CREATE DIMENSION". For information on constraints enabled with the RELY keyword, see "constraint_clause". |
|
|
||
|
specifies how dependencies of remote stored procedures are handled by the session. For more information, refer to Oracle8i Application Developer's Guide - Fundamentals. |
|
|
||
|
specifies the number of frequently used cursors that can be retained in the cache. The cursors can be open or closed, which is particularly useful for Oracle tools that close all session cursors associated with a form when switching to another form. In such cases, frequently used cursors do not have to be reparsed. A least recently used algorithm ages out entries in the cache to make room for new entries when needed. For more information on session cursor caching, see Oracle8i Designing and Tuning for Performance. |
|
|
||
|
controls the use and reporting of tables with unusable indexes or index partitions. |
|
|
||
|
||
|
||
|
||
|
specifies (in bytes) the maximum amount of memory that each sort operation will retain after the first fetch is done, until the cursor ends. If you do not explicitly set this parameter in the initialization parameter file or dynamically, Oracle uses the value of the |
|
|
||
|
specifies (in bytes) the maximum amount of memory to use for each sort operation. The default is OS-dependent. |
|
|
||
|
specifies the number of database blocks to read each time a sort performs a read from temporary segments. The default is 2. |
|
|
||
|
The SQL trace facility generates performance statistics for the processing of SQL statements. When you begin a session, Oracle enables or disables the SQL trace facility based on the value of this parameter. You can subsequently enable or disable the SQL trace facility for your own session with the |
|
|
See Also: Oracle8i Designing and Tuning for Performance for more information on the SQL trace facility, including how to format and interpret its output. |
|
|
||
|
determines whether a cost-based query transformation will be applied to star queries. The default is |
|
|
||
|
specifies whether the server requests the time from the operating system when generating time-related statistics. The default is |
|
|
||
|
determines whether the optimizer will use stored outlines to generate execution plans. |
|
|
Issue the following statement to enable parallel DML mode for the current session:
ALTER SESSION ENABLE PARALLEL DML;
The following transaction inserts an employee record into the EMP
table on the database identified by the database link SITE1
and deletes an employee record from the EMP
table on the database identified by SITE2
:
ALTER SESSION ADVISE COMMIT; INSERT INTO emp@site1 VALUES (8002, 'FERNANDEZ', 'ANALYST', 7566, TO_DATE('04-OCT-1992', 'DD-MON-YYYY'), 3000, NULL, 20); ALTER SESSION ADVISE ROLLBACK; DELETE FROM emp@site2 WHERE empno = 8002; COMMIT;
This transaction has two ALTER SESSION
statements with the ADVISE
clause. If the transaction becomes in doubt, SITE1
is sent the advice 'COMMIT
' by virtue of the first ALTER SESSION
statement and SITE2
is sent the advice 'ROLLBACK
' by virtue of the second.
This statement updates the employee table on the SALES
database using a database link, commits the transaction, and explicitly closes the database link:
UPDATE emp@sales SET sal = sal + 200 WHERE empno = 9001; COMMIT; ALTER SESSION CLOSE DATABASE LINK sales;
The following statement dynamically changes the default date format for your session to 'YYYY MM DD-HH24:MI:SS':
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY MM DD HH24:MI:SS';
Oracle uses the new default date format:
SELECT TO_CHAR(SYSDATE) Today FROM DUAL; TODAY ------------------- 1997 08 12 14:25:56
The following statement changes the language for date format elements to French:
ALTER SESSION
SET NLS_DATE_LANGUAGE = French;
SELECT TO_CHAR(SYSDATE, 'Day DD Month YYYY') Today
FROM DUAL;
TODAY
---------------------------
Mardi 28 Février 1997
The following statement dynamically changes the ISO currency symbol to the ISO currency symbol for the territory America:
ALTER SESSION SET NLS_ISO_CURRENCY = America; SELECT TO_CHAR( SUM(sal), 'C999G999D99') Total FROM emp; TOTAL ------------- USD29,025.00
The following statement dynamically changes the decimal character to comma (,) and the group separator to period (.):
ALTER SESSION SET NLS_NUMERIC_CHARACTERS = ',.' ;
Oracle returns these new characters when you use their number format elements:
SELECT TO_CHAR( SUM(sal), 'L999G999D99') Total FROM emp ; TOTAL ------------- FF29.025,00
The following statement dynamically changes the local currency symbol to 'DM':
ALTER SESSION SET NLS_CURRENCY = 'DM'; SELECT TO_CHAR( SUM(sal), 'L999G999D99') Total FROM emp; TOTAL ------------- DM29.025,00
The following statement dynamically changes to French the language in which error messages are displayed:
ALTER SESSION SET NLS_LANGUAGE = FRENCH; SELECT * FROM DMP; ORA-00942: Table ou vue inexistante
The following statement dynamically changes the linguistic sort sequence to Spanish:
ALTER SESSION SET NLS_SORT = XSpanish;
Oracle sorts character values based on their position in the Spanish linguistic sort sequence.
To enable the SQL trace facility for your session, issue the following statement:
ALTER SESSION SET SQL_TRACE = TRUE;
This statement enables query rewrite in the current session for all materialized views that have not been explicitly disabled:
ALTER SESSION SET QUERY_REWRITE_ENABLED = TRUE;
|
Copyright © 1999 Oracle Corporation. All Rights Reserved. |
|