1. To enable Python to operate the Oracle database, you first need to install the Cx_oracle package, which can be obtained from the address below[Plain]View PlainCopy
http://cx-oracle.sourceforge.net/
2. Additional Oracle class
Database index processing is a bit of a problem, simply recordOracle rules that objects under the same schema cannot be named with the same name, typically creating index names with "table name _ Field name", so that you can quickly know which table
Logical storage of the database, starting from the table spaceThe logical storage structure for a database object is as followsTable Space-Segment-zone-BlockSELECT * from Dba_tablespaces;SELECT * FROM Dba_segmentswhere tablespace_name= ' Kyc_veh
This morning to the company, opened the computer and found that the launch of the Oracle instance, reported the following error:Oops, all of a sudden worried, the original still good how suddenly so? I recalled that it was my previous modified
I. ORACLE internal structure1. Table SpaceA tablespace is a logical division of a database, a table space belongs to only one database, each table space consists of one or more data files, and other logical structures in the table space are stored
In the common use of a database often encountered the problem of locking table, the phenomenon of occurrence.1. Stored procedures cannot be executed2, the query table data appears slowly3, the front end of the phenomenon of card deathThe data that
A) UsersUsers in Oracle are divided into two major categories1) when the Oracle database server is created, users that are automatically created by the system are called system users, such as Sys.2) users created by the system users, called ordinary
/************** Date ********************/1.select trunc (sysdate) from dual--2013-01-06 today's date is 2013-01-062.select trunc (sysdate, ' mm ') from dual--2013-01-01 returns the first day of the month.3.select trunc (sysdate, ' yy ') from dual--2
This article transferred from: http://www.cnblogs.com/suding1188/archive/2013/01/06/2848067.htmlThe use of the--oracle trunc () function/************** Date ********************/1.select trunc (sysdate) from dual--2013-01-06 today's date is 2013-01-0
Select To_char (sysdate, ' Yyyy-mm-dd hh24:mi:ss ') from dual; --Show Current time2011-12-29 16:24:34Select Trunc (Sysdate, ' year ') from dual; -Interception to year (first day of this year)2011-1-1Select Trunc (sysdate, ' Q ') from dual;
--insert a record into the tableCreate or Replace procedurepro_insertdept isbegin Insert intoScott.deptValues(' the','Dog','Dog'); Commit; Endpro_insertdept;--Executionbeginpro_insertdept; End;--define three input parameters, insert a recordCreate
Updating a field is simple and easy to understand: Update TableA a set a.name= (select name from TableB B where a.id=b.id) is more verbose when updating multiple fields: Update TableA a set A.name= (select name from TableB b where a.id=b.id), a.age=
You can think of the result set of group by as a table, and then you can take the number from here.e.g.Select A.project_code,a.die_no,e.one_consuming from (select T.project_code, T.die_no, SUM (t.offline_qty) OffqtyFrom Data_plan TWHERE t.begin_date
Storage FunctionsCreate or replace function Name of function (name in type, name out type, ...) return Data Type is result variable data type ;begin return ( result variable );end[Name of function];The difference between stored procedures and
Many times we need to filter the table to update, INSERT, delete and other operations. So if we're going to be a lot of trouble with a single table, here's how the merge into usage will greatly optimize the time and amount of code for our operation
--1. Lists all department and department information for at least three employees.SELECT D.deptno, D.dname, D.loc, t.countsFrom DEPT D, (SELECT DEPTNO, COUNT (*) COUNTS from EMP GROUP by DEPTNO) TWHERE D.deptno = T.deptnoand T.counts >= 3;--2. List
--View data usage for all table spacesSELECT Upper(f.tablespace_name) "tablespace name", D.TOT_GROOTTE_MB "table space size (M)", D.TOT_GROOTTE_MB-f.total_bytes "used Space (M)", To_char (Round((D.TOT_GROOTTE_MB-F.total_bytes)/D.tot_grootte_mb* -,2)
Packages are used to logically combine procedures and functions, which consist of package specifications and package bodies.1), we can use the Create Package command for creating packages such as:I, create a package sp_packageII. Declare that the
To view the remaining table space:Select tablespace_name,sum(bytes)/1024x768/1024x768| | ' M ' from Group by Tablespace_nameView Total table space size, usage size, remaining size, usage, remaining
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