Companies need to deal with a number of reports, the need to use the percentage, to retain 2 decimal places, only with round and TRUNC functions can be implemented (round (_data,2), but the format is not very neat, the format is not strictly
I recently made a further analysis and study of RowNum when using Oracle's rownum to implement pagination display. are summarized as follows, hope to bring you harvest.For RowNum, it is an Oracle system sequence that is assigned the number of rows
Complete deletion of Oracle databases under Linux OS details:
1. Turn off Oracle server and background processes
Ps-ef | grep ora
Shut down the database.
Shutdown immediate
2. Turn off the monitor.
Lsnrctl status
If it's open, execute Lsnrctl
Dbms_random is a random function package provided by Oracle, here are some common examples of dbms_random:
Dbms_random.value usage:
Generates a 38 decimal number that is greater than or equal to 0, or less than or equal to 1
Copy Code code as
An error was encountered while installing Oracle
Preparing to launch Oracle Universal Installer from/tmp/orainstall2011-11-03_12-53-01pm. Please wait ... [Oracle@localhost database]$ Exception in thread ' main '
Applicable situation :
When Oracle sorts query results, the sorted field has a null value and you want to specify a null value to be at the front or the last side
keyword : Nulls first;nulls Last
Default: null defaults to Maximum value (that
The following error is always reported today when manually configuring ORACLE11G's EM:
Warning:ora-00001:uniqueconstraint (Sysman. Parameters_primary_key) violated
Ora-06512:at "Sysman. Emd_loader ", line4986
Ora-06512:atline1
There is no solution
The DISTINCT keyword can only filter all records in the query field (same Recordset), and if you want to specify a field without effect, another distinct keyword is sorted and inefficient.
The select distinct name from T1 can eliminate duplicate
Similar to other database systems, Oracle string concatenation uses the "| |" string concatenation, which is used in the same way as the plus sign "+" in MSSQLServer.
For example, execute the following SQL statement:
Copy Code code as
In Oracle, the Utl_file package provides functions and procedures for manipulating text files, and learns about his basic operations
1. Create directory and authorize users
Copy Code code as follows:
--Create Directory
Create or
The total number of fields queried for a table in Oracle, using SQL statements, or in Pl/sql
Copy Code code as follows:
Select COUNT (column_name) from user_tab_columns where table_name= ' T_b_auditor '
The number of fields
1, view the currently unlocked object
Example: A table AA lock is executed with a select * from AA for update;
Way one: Through SQL query
Select ' Alter system kill session ', ' ' | | Trim (t2.sid) | | | Trim (t2.serial#) | |
From V$locked_object t1
In Oracle, indexes are basically divided into the following categories:
B*tree Index, reverse index, descending index, bitmap index, function index, Intermedia Full-text index, etc., most commonly used are B*tree index and bitmap index.
(1),
There are several types of tables in Oracle:1, the heap organization table (heap organized tables):Commonly used table types, managed in heaps, use the first free space in the segment to fit the data size when data is added, and when data is deleted,
SQL statements for querying and deleting duplicate records1, look for redundant records in the table, duplicate records are based on a single field (ID) to judgeSELECT * FROM table where ID in (select Id from table GROUP by ID have count (Id) > 1)
The lag and lead functions can fetch the first n rows of data from the same field and the values of the latter n rows in a single query. This can be done using table joins to the same table, but with lag and leads is more efficient.
Copy Code
There are several modes of locking in Oracle:0:none1:null Empty2:row-s row Sharing (RS): Shared table Locks3:row-x line-specific (RX): For line modifications4:share shared Lock (S): block other DML operations5:s/row-x shared row Private (SRX):
Parsing Oracle's method for select locking and query for locksOracle to select Lock method
Copy Code code as follows:
CREATE TABLE Test (a number,b number);
INSERT into test values (1,2);
INSERT into test values (3,4);
INSERT into test
Using ORA to enter data into the datasheet ' Email_info '
When the user browses this script, displays a form that consists of a name, an email input field, and when the user adds a good data click Submit, the script will save the name and email to
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