// Implement an automatic value-added column in Oracle
-- 1. create Table users (userid int primary key, -- User ID username varchar (20), -- User Name passwd varchar (20), email varchar (30), grade INT ); -- user level -- 2. create sequence userid_
During project creation, Oracle database migration may occur, and the sequence may be reset. As a result, when the current value of the sequence is smaller than the maximum value of the field in the table using the sequence, an error occurs,
If the Oracle database table contains a Date Field, assume that the field name is time, the date to be inserted is now, now is in string format, and the value is "1900-01-01 ", the following statement fails to insert data:
String. Format ("insert
We know that the Oracle client supports setting the nls_lang parameter. The setting of the nls_lang parameter varies with the system platform. This article first introduces the composition of the nls_lang parameter, and then introduces the settings
% Rowtype in Oracle:
% Rowtype: indicates that this type is the row data type. It is stored as a row of data. A row has many columns, which is equivalent to a row of data in the table or a row of data in the cursor.
% Rowtype is used to query
Alter user Scott account unlock; -- Unlock Scott userSelect * from Scott. EMP where to_char (hiredate, 'yyyy-mm-dd')> '2014-1-1 '; -- date comparisonSelect * from Scott. EMP where to_char (hiredate, 'yyyy') = '000000'; -- the start time year is 1980.
Basic PL/SQL
1. PL/SQL concepts
PL/SQL (Procedural Language/SQL) is an extension of Oracle in the standard SQL language. PL/SQL not only allows embedding SQL languages, but also defines variables and constants, allows the use of conditional
Data AdministratorEach Oracle database should have at least one Database Administrator (DBA). For a small database, one DBA is enough, but for a large database, multiple DBAs may be required to assume different management responsibilities.*
Oracle Complex Query
* Use subqueries in the from clause
. Display information of employees higher than the average salary of their own departments.
// 1. query the average salary and department number of each department, select deptno, AVG (SAL)
Oracle does not set an auto-incrementing primary key. If you want to implement the auto_increment function of databases such as MySQL, you need to create a sequence.
1. Define the primary key as the automatic growth identifier type
In MySQL, if
1. Set linesize 100; set the length
2. Set pagesize 30; set the number of entries displayed on each page
3. Open the notepad ed F: \ soft \ key.txt in Ed a. SQL, which indicates opening the file on drive F. If it does not exist, you will be prompted
First install the tool and then connect
VPN:IP: 113.108.186.130User: jfwh_qujyPassword: qujy0429
VPN,
Click the gray connection VPN in the second picture. the user name and password are also available here.
Linux Server:IP:
There are a lot of Oracle processes in the top process of the IBM p570 dB host. I don't know why, the memory is all eaten, and the CPU idle is 0,
The swap zone is almost used up.
Who, or which program is so powerful? The two computers can be killed.
About arrays in Oracle: record the same setThe set can be implemented in three ways:1. Use varray to customize a type to obtain an array. However, you can only define the basic type as follows:Create type name as varray of varchar2 (20 );
1. Use
When the machine on which Oracle is installed changes the machine name or IP address. Then the original dbconsole cannot start.
Or an error is reported when running emctl start dbconsole in DOS. Solution:
1. Modify the Dbsnmp password:
To
Generate primary key values using sequences.
Sequence is a database object that can be used by multiple users to generate a series of unique numbers. Sequence definition is stored in the data dictionary. You can use sequence to automatically
2.9. Run the script (orainstroot. SH and root. Sh)
Execute the orainstroot. Sh script in sequence on each node (execute the node where the CRS software is installed first ):
[Oracle @ Rac1 ~] $ Su-Root
Password:
[Root @ Rac1 ~]
When starting the database, we may encounter the following errors:
ORA-1122: database file % s failedverification check
A ORA-1110: datafile:
ORA-1207: ora 1207 file is more recent thancontrol File
The main reason for the ORA-1207 is that the
1. materialized view Overview
The Materialized View of Oracle is a database object that includes query results. It is a local copy of remote data or is used to generate a summary table based on the sum of data tables. Materialized View stores data
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