Oracle lpad and rpad

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

Oracle queries the most resource-consuming SQL statements

  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',

Oracle AWR quick query

SQL> sqlplus/As sysdba SQL> exec dbms_workload_repository.create_snapshot SQL> Exec: snap_id: = dbms_workload_repository.create_snapshot SQL> var snap_id number SQL> Print snap_id SQL> @? /Rdbms/admin/awrrpt. SQL Oracleawr quick query   1.View the

Oracle automatic backup

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 (Collection and continuous sorting)

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:

Introduction to Oracle autonomous transactions

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

Insert a row in Oracle to automatically generate a unique sequence number as the primary key value.

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

Oracle case syntax

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

Oracle lpad () function and rpad () function usage

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

Oracle creates tablespaces and database users

Win system: Run-cmd Sqlplus/nolog Conn/As sysdba; Linux: Su-Oracle Sqlplus/nolog Conn/As sysdba; Create a tablespace: Create tablespace sztj datafile 'f: \ oracle \ product \ 10.2.0 \ db_1 \ oradata \ sztj. dmp'Size 50 mAutoextend on next

Oracle time period Query

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

Sequence of Oracle

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

Oracle databases, tablespaces, and tables

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

Oracle function instr usage

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

Oracle case when usage

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

[Reprint] view User Permissions and indexes in Oracle

\" 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

Create tables for oracle dblink & SQL operations on different databases

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

An example of Oracle function index Optimization

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

Split function in Oracle

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

Oracle frequent Archiving

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

Total Pages: 2147 1 .... 2099 2100 2101 2102 2103 .... 2147 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.