Index:Query user_indexes can get more information about the indexes that the user has created.Query user_ind_partitions can get detailed information about the partition index that the user has created.Query User_ind_columns can get detailed
1. Data typeVARCHAR2 ()Number ()DATEClobBlob2. Copy table: CREATE TABLE TableName as SELECT * from emp3. New column: ALTER table name Add (field Name field type default defaults);4. Modify columns: ALTER table name MODIFY (field Name field type
DECLARE num number; Beginselect COUNT (1) into NUM from user_tables WHERE table_name = UPPER (' TableName '), IF num > 0 Then EXECUTE immed Iate ' DROP TABLE tableName '; END IF; END; Multi-table casedeclare num number; NUM1 number;num2
First, create a table:
CREATE TABLE Example (
ID Number (4) Not NULL PRIMARY KEY,
NAME VARCHAR (25));
Then, customize a sequence (sequence):
CREATE SEQUENCE example_sequence
INCREMENT by 1--add a few each time
To create a package:Create or Replace package P_view_param isfunction Set_param (num number) return number;function Get_param return number;End P_view_param;To implement the package body:Create or Replace package body P_view_param isParamvalue
1. Standard SQL specificationOne, single IF1, if A= ... Then.........end if;2, if a= ... then......else....end if; two, more IfIf a=. Then......elsif a=. Then....end if; The middle here is "elsif", not else IF. Special attention is needed
Data types in Oracle/*data types in ORACLE; char length fixed range: 1-2000 VARCHAR2 length variable range: 1-4000 long length variable maximum range 2gb longer character type numb ER numeric number (p,s) date type, accurate to seconds TIMESTAMP
--Creating a stored procedure for adding a local database Create or replaceprocedure Pro_electric_record as begin insert into Electric_meter_record (Id,basestati On_id,name,meter_number,createtime) Select Sys_guid (), substr (s.sname,0,36),
The Expdp:sql command executes only once and does not need to be executed again.Mkdir/home/oracle/backupchmod 777/home/oracle/backupSql> Create directory Expdir as '/home/oracle/backup ';Sql> Grant Read,write on the directory Expdir to Deepradar;Sql>
-----------------Produce Cartesian product------------------------------------SELECT * from Emp,dept; --with no conditions, the number of records is 14*4 = 56 recordsSELECT * from the EMP Cross join dept;--crossover connection, IBID.Select COUNT (*)
24. The name of the teacher who has more than 5 students who have enrolled in a courseSelect from where t.tno= and C.cno=and =( Selectfromgroupby hasCount(CNO)> 5 Group by T.tname25. Check the records of all students in class 95033 and
--Data paging scripts--Create a header structure that contains the data pagination code element declarationCreate or Replace package Data_controlIsType type_cursor_data is REF CURSOR;V_totalline int; --Total number of data rowsV_totalpage int;
1. Check the status of the main library:Sql> SELECT switchover_status from V$database;Switchover_status--------------------To STANDBY2. Set the main library to standby roleALTER DATABASE commit to switchover to physical standby;Shutdown
DMP Format:Export in 1.dmp format can be done through client-side tool (PL/SQL) operations, through the menu bar---->tools---->export Tables, then set to tick the appropriate parameters, rows represent whether to export with the data2. The export
SELECT A.areaname AS Level two place name from houses h,houses H2,Areas a WHERE H.areaid=a.areasid and H2.areaid=a.areasid and H.finalassessmentid=1 andH.houseslevel=2 and H2.houseslevel=1 and A.areasid!=a.parentareasid and a.companysid=2;SELECT *
12. Check the average score of the course with at least 5 students enrolled in the score table and begin with 3.Select cno,Count(CNO),avgfromgroup by has Count(CNO)>=5 and substr (CNO,0,1)=' 3'13, the query score is greater than 70, less than 90 of
Oracle database is the world's most powerful database management software, the functional system is particularly large. It is necessary for us to learn about every part of it, and then to effectively grasp it from a global perspective. We will focus
I. Related content1. Verify system Rights Management.2. Verify role management.3. Verify profile Management.Second, the specific operationA1. Grant and recycle the system permissions according to the following requirements:(1) Create a user User1
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