Label:The process of 1.sql parsing
Oracle first converts the SQL text to ASCII characters and calculates its corresponding hash value (Hash_value) based on the hash function. The corresponding bucket is found in the library cache based on the calculated hash value, and the SQL statement in the bucket is compared.
)
From EMP X
Where X. emp_no = E. emp_no );
6. Ultimate tips-HintsThis is a toy of Oracle DBA and a fuse weapon. For example, if Oracle's choice in CBO and RBO is not satisfactory, you can use it to strongly tune oracle. The results are often overjoyed.If developers don't have much time to learn about it, they can rely on Toad SQL opmitzer to automatically gener
Label:General Programming Language Basics 2.1pl/sql Programming Basics 1. Character type: Supports four types of characters: letters, numbers, symbols and spaces, combining one or more characters creates a lexical unit 2. Vocabulary unit A. Identifiers must begin with a character B. Reserved words are PL/SQL special words C. Delimiters only characters with special meaning to PL/
Label:Recently found in Javaeye many comrades on the optimization of SQL seems to know very little, recently summed up a few for reference only, but a few may depend on the situation, most of it is quite effective.Note: The following (inefficient) and (efficient) are fairly speaking. 】1. The connection order in the WHERE clause:Oracle parses the WHERE clause in a bottom-up order.According to this principle, the connection between tables must be writte
Restore the tables drop by pl SQL in oracle by mistake
View tables in the recycle bin
Select object_name, original_name, partition_name, type, ts_name, createtime, droptime from recyclebin;
Restore table
SQL> flashback table test_drop to before drop; orSQL> flashback table "BIN $ B + XkkO1RS5K10uKo9BfmuA = $0" to before drop;
Note: The full-text index cannot be r
after the while is true, the loop weight statement sequence is executed 1 times, and then the expression after the while is re-determined to be true, only if the Boolean expression after the while is false. To end the entire loop loop. The syntax for the statement structure is as follows: [ C, while ... Loop structure Sql>--while...loop
sql> declare
2 v_rlt Number (8): =-3;
3 begin
4 3.F
1, table access mode optimization: a) Common table first "index Lookup index Scan" to avoid full table scanIn most scenarios, it is much more efficient to scan through index Lookup indexes than full table scan (FTS). When writing SQL, in order to ensure that the query can use the index, you need to avoid the following scenario:
Is null and is not NULL
Null is not indexed in Oracle, and if ther
replace package pkg_test
/* Define the ref cursor type
The return type is not added. The return type is weak. dynamic SQL queries are allowed,
Otherwise, it is strongly typed and cannot be queried using dynamic SQL;
*/
Type myrctype is ref cursor;
-- Function declaration
Function get (intID number) return myrctype;
End pkg_test;
/
Create or replace package body pkg_test
-- Funct
with less data as the driver table (placed on the last side of the From table list). Loops the data in the drive table and the data in another table as a connection query. When multiple tables are checked, select the table with the most associated.3. Table join conditions are placed in front of the clauses that filter records more than the conditions are placed behind (because the SQL execution order is ri
SAA-SQL access advisor (oracle 11.2 and later), saa-sqladvisor
I recently used SAA and found that many blogs on the Internet actually have problems using it in subsequent versions after oracle 11.2,
Either the version change syntax is changed or incomplete. Take some time to list the use of the new version.
**********
Tags: Oracle sqlAt the command prompt, enter Sqlplus.or open Sqlplus directlyScott/tiger (username/password) {or enter username (Scott)-Enter-password (Tiger)}1.sqlplus Orcale provides a customer-side tool that can be used to send some SQL Communicating with a databaseSqlplus commandSqlplus User name/passwordSqlplus User NameSqlplus/nolog--> starts the Sqlplus character interface and then conn the user
machine is: d:/instantclient_11_2/network/admin4, set the language of Oracle, add the environment variable Nls_lang, the value is simplified Chinese_china. Zhs16gbkAssuming that the Oracle language of the remote database is unclear, SSH or telnet to the remote machine, enter in the command interface, and connect to the database with the command line.SELECT * from Nls_instance_parameters;View the value of N
First, simple query
SQL (structured query Language) Structured Query language is a database query and programming language for accessing data and querying, updating, and managing relational database systems. ANSI (American National Standards Institute) claims that SQL is the standard language for relational database management systems.Oracle databases have developed well, mainly because
: 10.6 seconds)
SELECT...
FROM EMP E
WHERE 25
Where mgr = E. EMPNO)
And sal> 50000
And job = 'manager ';
6. Avoid '*' in the SELECT clause '*'
When you want to list all columns in the SELECT clause, using dynamic SQL COLUMN reference '*' is a convenient method. unfortunately, this is a very inefficient method. in fact, ORACLE converts '*' into all column names i
;show parameter service_name command to viewExample: sql> show parameter service_name; NAME type VALUE ----------------------------------------- ------------------------ service_names string ORCL 2) Configure environment variables: oracle_home:d:\oracle Install client\instantclient_12_1//is above Oracle install The directory where the client extracte
--set up login mappings.EXEC sp_addlinkedsrvlogin txtsrv, FALSE, NULL, Admin, NULLGO--list the tables in the linked server.EXEC sp_tables_ex TxtsrvGO--query one of the Tables:file1#txt--using a 4-part name.SELECT *From Txtsrv ... [File1#txt]Iv. Linking SQL Server servers:1. Microsoft OLE DB provider using ODBCEXEC sp_addlinkedserver ' aliases ', ' ', ' msdasql ', Null,null, ' Driver={
Enter the DOS interface.
Enter the SQL file directory.
Run Sqlplus,c:\sql>sqlplus user_name/[email protected]_service_name at the command prompt
Specify the SQL execution log file, log filename arbitrary, but must be a log suffix name: Sql>spool e:\temp\a.log
Create a batch execution file. If you want to ex
variable Nls_lang, and the value is simplified Chinese_china. Zhs16gbkIf you do not know the Oracle language of the remote database, you can ssh or telnet to the remote machine, enter it at the command interface, and connect to the database using the command line.SELECT * from Nls_instance_parameters;View the value of Nls_languageNls_languageNls_territory5. Download and install the PL.SQL.Developer configuration appConfigure Tools->preferences->conne
nomount to start the database in load-free mode.
10. Set the database to the load mode: alter database mount;
11. view the data file list: select name from v $ datafile;
View the temporary file list: select name from v $ tempfile;View the log file list: select * from v $ logfile;
The following result is displayed:
E: \ APP \ USER \ ORADATA \ ORADB \ SYSTEM01.DBF
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.