Oracle's self-JOIN operationFor Oracle databases, there are two sets of grammars currently supported, one for Oracle's own SQL syntax and one for the standard SQL99 syntax, and two sets of syntax for Oracle's connection operations can be implemented separately. Of course, in terms of efficiency, there is no difference between the two. But from my point of view, Oracle's syntax is more concise.For example, we have a list of EMP, the table data is as follows[Email protected]> Conn Scott/tigerConne
L_database DROP Public Database link NO owbsys CREATE DATABASE Link YES imp_full_database CREATE DATABASE LINK NO SYS CREATE public DATABASE LINK NO DBA CREATE public DATABASE LINK YES GRANTEE PRIVILEGE ADM-------------------------------------------------------------------------DBA
CREATE DATABASE LINK YES to rows selected.
Sql> Grant CREATE DATABASE link to Scott;
Grant succeeded.Sql> CREATE
Tags: style blog color io for art ar DivThis is often used in OracleSelect Col1,col2, Row_number () over (partition by Colx order by Coly) from TABLE_NAME;;This means that the values in the table are grouped according to Colx, and each group is sorted internally by Coly, and Row_number () returns the ordinal number of the record within the reorganization after sorting.For example, we know there is an EMP table as follows:Sql> SELECT * fromSCOTT. EMP; EMPNO ename JOB MGR hiredate SAL COMM D
Yesimp_full_database CREATE DATABASE LINK nosys creat E Public DATABASE LINK NODBA CREATE public DATABASE LINK yesgrantee PRIVILEGE ADM-------------------------------------------------------------------------DBA CREATE databa SE LINK YES12 rows selected. Sql> Grant CREATE DATABASE link to Scott; Grant succeeded.Sql> CREATE DATABASE link Comparison_link Connect to Scott identified by Root using ' orac1 ';D atabase link created. Sql> show Useruser is ' SCOTT ' sql> s
);CREATE INDEX Sal_comm on EMP ((Sal+comm) *12, Sal,comm)*ERROR at line 1:Ora-01031:insufficient Privileges3) Connect to the DBA account and authorize:Sql> Connect Sys/[email protected]Connected.Sql> Grant GLOBAL QUERY REWRITE to Scott;Grant succeeded.Sql> Grant CREATE any INDEX to Scott;Grant succeeded.4) When connecting to the Scott account, create a function-based index:Sql> Connect Scott/[email protected]Connected.Sql> CREATE INDEX Sal_comm on EMP ((Sal+comm) *12, Sal,comm)2 Tablespace users
(7,2) default 0,Deptno number (2)); --ADD comments to the columnsComment on column emp.empno is ' encoded ';Comment on column emp.ename is ' name ';Comment on column emp.job is ' work ';Comment on column emp.mgr is ' supervisor ';Comment on column emp.hiredate is ' hire date ';Comment on column emp.sal is ' wages ';Comment on column Emp.comm is ' Commission ';Comment on column emp.deptno is ' department code ';--------------------------------------------Inserting dataInsert into EMP (empno, ena
# service Oracle Start//Launch Oracle# Service Oracle Stop//Turn off Oracle# Service Oracle Restart//Restart Oracle7. TestingA. Boot from bootLast Login:mon 19:57:06-10.0.0.145[Email protected] ~]# su-oracle[Email protected] ~]$ sqlplus "/as sysdba"Sql*plus:release 10.2.0.1.0-production on Mon Nov 26 20:07:33 2012Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-productionWith the partitioning, OLAP and Data Mining option
summarized the previous small examples, hoping to help you further understand the index.[Example 1] indexing is not required if the data volume is small.
// If the table has a small amount of data and the full table scan cost is very small, it is unnecessary to use the index. Tutorial operation: SQL> SELECT ENAME, JOB, SAL FROM SCOTT. EMP; // first, find a small table for the experiment and view the table information, only 14 rows of ename job sal ---------- --------- ------ smith clerk 800 all
research dallas 30 sales chicago 40 operations boston has selected 8 rows. Use the INTERSECT operator to query the Department numbers in the dept and emp tables under scott. SQL code> select deptno from emp 2 intersect 3 select deptno from dept; DEPTNO ---------- 10 20 30 use the MINUS operator to query the Department number that exists in the dept table under the scott user and does not exist in the emp table SQL code> select deptno from dept 2 minus 3 select deptno from emp; DEPTNO ----------
Javascript always fails to convert the string type to the int type. The following describes some precautions for converting jsstring to the int type, if you are interested, refer to var str = '000000 ';
Alert (Number (str); // get 1250
Alert (parseInt (str); // get 1250
Var str1 = '20140901 ';
Alert (Number (str1); // get 100
Alert (parseInt (str1); // get 64
It is found that the parseInt method
The following table lists the questions about updating field values with cursors in Oracle: [csharp] SQL> set pagesize 60; SQL> run; 1 * select * from employee www.2cto.com name salary ---------- SMITH 800 ALLEN 1600 WARD 1250 JONES 2975 MARTIN 1250 BLAKE 2850 CLARK 2450 SCOTT 3000 KING 5000 TURNER 1500 ADAMS 1100 JAMES 950 FORD 3000 MILLER 1300 already select 14 rows. In this table, if the SALARY column is
Oracle uses the backup control file for recovery, and then creates a tablespace for recovery.
1. Create a tablespace after the backup control file, and all the control files are lost. How can I restore the table using the backup control file?
The procedure is as follows:1. Back up the database
Rman target/catalog RC_ADMIN/RC_ADMIN @ prod3
Backup database plus archivelog delete all input;
2. Create a tablespaceSYS @ PROD2> create tablespace indx2 datafile '/u01/app/oracle/oradata/PROD2/indx01.db
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.