Commit (Commit), rollback (rollback)
DECLARE
dept_no number (2): =;
Begin-Start transaction
INSERT into dept
VALUES (dept_no, ' marketing department ', ' Beijing '); --Inserting department records INSERT INTO
methods for Oracle to recover deleted tables or table records
article Category: Database
One: Recovery of tables
For accidentally deleted tables, as long as you do not use the Purge permanent deletion option, then recover from the flash back zone
--Start
First, we prepare the test data.
CREATE TABLE TEST
(
NAME VARCHAR2,
birthday DATE
);
INSERT into TEST VALUES (' John ', DATE ' 2014-12-14 ');
INSERT into TEST VALUES (' Dick ', DATE ' 2013-12-14 ');
INSERT into TEST VALUES (' Harry ',
ORACLE Time Usage SummaryOracle month, year, week dataMonth Data SQL codeSELECT * FROM table t where T.create_date >=trunc (sysdate, ' MM ') and T.create_dateCurrent year data SQL codeSELECT * FROM table t where T.create_date >=trunc (sysdate, '
As we all know, MySQL InnoDB storage engine is very similar to Oracle, support transactions, row-locking, after the actual test, InnoDB and Oracle a relatively large difference point, in this test case, the same data, The InnoDB single-line storage
Directory===============================================1. The arrangement with null value2.top/bottom N Query3.first/last ranking Query4. Query by LevelOne, with a null value of the arrangement:In the previous article on Oracle development topics:
[ERR] ora-00001:unique constraint (...) violated
Violates a unique constraint, a field with a unique constraint, no duplicates, can be a space, and a space can only appear once. such as the primary key of the data
[ERR] ORA-00904: "XXX": Invalid
Problem
When the development of the debug to an update of the SQL statement, the program will not move, and then I tried on the plsql, found that Plsql has been in the display is being implemented, and so long time no results. But it's strange that
How to view the Oracle version and what options are installed.
System environment:
1, operating system: Windows 2000
2. Database: Oracle 8i R2 (8.1.6) for NT Enterprise Edition
3, Installation path: c:/oracle
Description
1. View database
If you have previously installed Oracle, you can clear it by using the following command:
sudo rm-rf $ORACLE _home
sudo rm/etc/oratab
sudo rm/etc/orainst. Loc
The two files in/etc are automatically generated when the root.sh is run during the
The concept of Grang:A cursor is a memory workspace of SQL that is defined by the system or user as a variable. The role of a cursor is to temporarily store blocks of data that are extracted from the database. In some cases, the data needs to be
Oracle Two-time subtraction default is days
Oracle Two-time subtraction default is the number of days *24 to the difference in hours
Oracle Two-time subtraction the default is the number of days *24*60 to the difference in minutes
Oracle Two-time
1 Trigger
The SQL statement is as follows:
Create or Replace Trigger Trigger_name
Before insert on Your_sid.tablename
For each row
Begin
Declare
I number;
Cursor cur is select MAX (id) from Your_sid.tablename;
BEGIN
Open cur;
FETCH cur into i;
Ubuntu installation Oracle 10g
Directory
1. Installation Preparation
1.1. Set up user
1.2. Create a directory and set permissions
1.3. Change Configuration
1.4. Installation
1.5. Start/Stop Oracle
1. Installation Preparation
Before installation
ORACLE RAC principle in an application environment, all servers use and manage the same database in order to spread the workload of each server, requiring at least two more servers on the hardware, and a shared storage device. It also requires two
Using the EXP and IMP commands is one of the simplest and most common ways for Oracle to migrate data for backup. The method steps used under this record for later use.
First, use the command on the old library:
Exp userid=username/password@database
1, SET autotrace parameters
SET autotrace off----------------does not generate Autotrace reports, which is the default modeSET autotrace on EXPLAIN------Autotrace displays only the optimizer execution path reportSET autotrace on STATISTICS--only
Oracle Rank () over, Dense_rank (), row_number () difference
Suppose there is a student table student, the student's table has the name, the score, the course number, and now I need to sort the students ' grades according to the course.
SELECT *
a table function can accept a query statement or a cursor as an input parameter and can output multiple rows of data. The function can be executed in parallel, and the data stream can be continuously output, known as pipeline output. The table
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service