Query, disable, enable, and delete Foreign keys in Oracle
1. query the Foreign keys of all tables:
Select table_name, constraint_name from user_constraints where constraint_type = 'R ';
2. Disable all foreign key constraints and use the
-- Enter the following commands on the terminal in sequence: Sqlplus -- Enter the username to be deleted -- Enter the password Set head off; Set feedback off; Spool c: \ drop_tables. SQL; -- CHR (13) ASCII = newline CHR (10) ASCII = carriage
Assume that the database network connection string is db_wending, the password is DBA/123, @ lk.comSqlplus (the password is enclosed in a pair of double quotation marks ):SQL> alter user u_test identified by "DBAs/123, @ lk.com ";SQL> conn
Connect role: -- is the most basic and typical right granted to end users.Alter session -- modify a sessionCreate Cluster -- create a clusterCreate database link -- create a database linkCreate sequence -- create a sequenceCreate session -- create a
I heard that SQL Server and MySQL have top keywords and can return the first N records of sorting records. For example, select top 10 * From table_name order by col_name. I think Oracle must have similar functions, oracle uses the rownum keyword
The start with... connect by clause recursive query is generally used for a table to maintain a tree structure. Create example Table: Create Table tbl_test
(
ID number,
Name varchar2 (100 byte ),
PID Number default 0
); Insert test data: insert
A sequence is a database object that can be used to generate a unique integer. Generally, the sequence is used to automatically generate the primary code value.
The value of a sequence is composed of special Oracle
Program Automatic Generation, so
Oracle segment:First, create a package and package body in Oracle, and define the function and the returned result set of the stored procedure.1: Create a package:Create or replace package Scott. pk_wtIsType mytype is ref cursor;Procedure p_wt (MYCS
My colleague encountered a strange problem. A join query of three tables took about several seconds, and a restriction condition should be added to the query faster, but the results would not end up being executed.
Then I looked at the execution
In the past few days, a project using nhib.pdf has been transplanted from SQL Server to Oracle (using odp.net). After transplantation, it is found that the unit test is much slower, determine whether it is related to nhib.pdf and odp.net.
In the
Copyright (c) 2007 Dorian Deng. Signature Sharing is not commercially available.Reprinted please indicate the source: http://www.cnblogs.com/doriandeng/archive/2007/10/05/914834.html
Preface:
During project development using databases, query
When I am working on a project today, I need to insert multiple data records to the database (the database is Oracle 8.0.5) at a time,ProgramAn error occurred while running: ORA-00911: invalid characters. The SQL statement is as follows:
Delete
With the query syntax unique to Oracle, you can get twice the result with half the effort.
1. Tree Query
Create
Table
Tree (ID
Number
(
10
)
Not
Null
Primary
Key
,Name
Varchar2
(
100
)
Not
During SQL Execution, sometimes the automatic optimization method is not optimal. We need to manually add hint to improve query efficiency.1./* + all_rows */It indicates that the overhead-based optimization method is selected for the statement block,
1. Usage Overview
Why access WebService in Oracle? In system implementation, sometimes data transmission and distribution services are directly performed on the database using triggers, stored procedures, and other methods, which may involve some
This blog is a summary of the previous Linux Shell common skills and advanced skills series blogs. It will explain and explain the script of Oracle database server startup line by line, to help us better learn and understand the common skills and
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