In the PL/SQL test window
-- Created on 2005-7-3 by tangtianDeclare-- Local variables hereI integer; leftpad varchar (11 );Rightpad varchar (14 );Begin-- Test statements hereSelect lpad ('Hello! ', 8, 'tangtian'), rpad ('Hello! ', 8, 'tang') into
I. First, run the TOP command to view the spid numbers with more resources.
II. Query SQL statements by PID
1. The first method is to query multiple PIDs.
(1) query the current time-consuming session ID, user name, sqlid, etc.In ('123',
The procedure is as follows:
1. 1. Create a C:/backup folder on the server (Folder path selected by the customer). 2. 2. Open dbbkup. bat --> modify the red part --> Save exp system/manager @ test file = D:/orabackup/% Date :~ 0, 4% % Date :~ 5, 2
Comparison of common functions of SQL Server and Oracle
1. absolute value S: Select ABS (-1) value o: Select ABS (-1) value from dual2. INTEGER (large) S: Select ceiling (-1.001) value O: select Ceil (-1.001) value from dual3. INTEGER (small) S:
One or several autonomous transactions can be defined in one of your transactions (outer transactions. An autonomous transaction can be committed independently without affecting the outer transaction. Similarly, the rollback of the outer transaction
The unique identifier generated by Oracle is different from that generated by SQL and Sybase. It uses a serial number generator. The serial number generator is a database object. The following statement creates a serial number generator SQL
From: http://blog.csdn.net/xuanxingmin/article/details/4266327
Oracle case statement
Currently, Oracle supports two case representation methods. One oracle is called simpleCase (simple form), and searched case (Query Form ). SimpleCase is
Lpad () function usage:
The lpad function fills the string on the left with some specific characters. The syntax format is as follows:
Lpad (string, N, [pad_string])
String: but a character or Parameter
N: the length of the character, which
Obtain data of a day
Select D. device_name as device, D. alert_time from Device D where D. alert_timeBetween to_date ('2017-9-27 00:00:00 ', 'yyyy-mm-dd hh24: MI: ss') andTo_date ('2017-9-27 23:59:59 ', 'yyyy-mm-dd hh24: MI: ss ')
// Return the
In an Oracle database, sequence is equivalent to the serial number. The sequence is automatically increased each time it is obtained. It usually acts on the location where the sequence number needs to be sorted.1. Create Sequence
(Note: you need the
I. Databases
A database is a collection of data, while Oracle is a software system that manages these data sets. It is an object-relational database management system.
Ii. tablespace
The tablespace is the logical ing of Oracle to the data in the
Instr
(Source string, target string, start position, matching serial number)
In Oracle/PLSQL, The instr function returns the position of the string to be truncated in the source string. Only retrieval once, that is, starting from the character
It
When using adoquery of Delphi to connect to the Oracle database, NOTE: When SQL contains multiple case when, you must add an arc. Otherwise, an exception or CPU debugging will be reported directly.The problem is very strange. If the same SQL
\"
1. View All Users
Select * From all_users; ------- view all users
Select * From user_users; -------- view current user
2. View user or role system permissions:
Select * From user_sys_privs; -------- view permissions of the current user
3. view
Two different database servers read data from one user on one database server from another database server. In this case, you can use dblink.
In fact, dblink is similar to the view in the database. When creating dblink, you need to know the IP
The table contains 5 million records, which are not indexed:
Set timing onSet autotrace traceonly
SQL> select count (*), to_char (time, 'hh24') from userloginlog2 Where trunc (time) = trunc (sysdate)-13 group by to_char (time, 'hh24 ')4 order by
Source code:
Create or replace type ty_str_split is table of VARCHAR2 (4000 );
Create or replace function fn_split (p_str IN VARCHAR2, p_delimiter IN VARCHAR2)
RETURN ty_str_split
IS
J INT: = 0;
I INT: = 1;
Len INT: = 0;
Len1 INT: = 0;
Str VARCHAR2
Check:
Top output CPU usage is very low;Iostat reads 1 M/s, writes 500 K/s, and iowait 3%;V $ there are not many sessions in the session, and there are no large transaction operations;Db_writer_processes = 4;Log_archive_max_processes = 2;There are
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