--determine if the table exists and delete if it existsDeclareNum Number; begin Select Count(1) intoNum fromAll_tableswheretable_name= 'EMP' andOWNER='SCOTT'; ifNum=1 Then ExecuteImmediate'drop table EMP'; End if; End; /
Without Oraclehoume, execute the environment variable fileSqlldr userid= DM/DM control =/home/oracle/libc/load.ctlLoad dataInFile '/home/oracle/libc/data.txt 'INSERT INTO Table Tmp_dm_user_total_monthFields terminated by ' \ t
Identify the current state of the system
Model of the system server
CPU the speed and quantity of
Memory size
I/O Equipment Situation
Network status
Number of system users and number of concurrent users
Current system CPU
Permissions:Create sessionCREATE tableUnlimited tablespaceConnectResourceDbaCases:#sqlplus/nologSql> Conn/as sysdba;Sql>create user username identified by passwordSql> Grant DBA to username;Sql> Conn Username/passwordSql> select * from
Use SEQUENCE -Create SEQUENCE create sequence emp_sequence INCREMENT BY 1 -- Add a few each time; start with 1 -- counting starting from 1; NOMAXVALUE -- does not set the maximum NOCYCLE --
1. View all table space sizesSelect Tablespace_name,sum (bytes)/1024/1024 from dba_data_files Group by Tablespace_name; 2. Unused table space sizeSelect Tablespace_name,sum (bytes)/1024/1024 from dba_free_space Group by Tablespace_name; 3. So the
Questions :Employee table: A (e_id,name,) Department table: B (d_id,d_name) employee-to-Department relationship: C (id,e_id,d_id)SELECT A.e_id,a.name, b.d_name from A INNER joins C on a.e_id=c.e_id INNER joins B on b.d_id=c.d_id;The record of such
If:Make changes to the table field type.For example, the table name is a, the field is A_namefield compatibility can be modified directly! In this case of incompatibility, there will be an error message:ORA-01439: To change the data type, the column
Create or replace procedure Qianfeigl_jiaokuandy (Cebenh varchar2, Kehuh varchar2, Hetongh varchar2, v_cur out query_pkg. Query_cur)IsSqlstr VARCHAR2 (3000);Beginsqlstr:= ' Select A.S_CH,A.S_CID,C.S_HETONGH,A.D_CAOZUOSJ from Zw_yingyez a left joins
1, simple Query method of lock table statement Select from where t1.session_id = ORDER by T2.logon_time2, for the results of the above query to unlock, as shown belowAlter Kill ' 382,1125 '3, lock table detailed information querySelect dba_objects.
Declare v_out varchar2 (a); begin Execute ' Select P_guid from C_itcomp ' into v_out; Dbms_output.put_line (v_out); End;Database version must be > =oracle 8iThe direct SELECT statement is useless, guess because select returns
1. Why should I use the package? A: In a large project, there may be many modules, and each module has its own procedures, functions and so on. And these procedures, functions are put together by default (such as in PL/SQL, the process is put
Before running the following script, you need to use the SQL that generated the AWR report (the program scripts are generally stored in the rdbms/admin under $oracle_home. The name is awrrpt.sql and you need to enter the number of days to generate
The first time you use SqlServer2012, the interface and VS2012 style are the same, great!To get to the point, this blog post mainly write a case of your own, using SqlServer2012 's "Import and export data" function to import data tables to oracle11g,
Oracle multi-key partition Test
Partitions can be partitioned by two fields. The first column is compared first. If yes, the second column is ignored. If the first column is not met, the second column needs to be compared. This partitioning method
Oracle local management comparison data dictionary management tablespaceLocally vs. Dictionary Managed TablespacesOrganized from: http://www.orafaq.com/node/3.When Oracleallocates space to a segment (like a table or index), a group of contiguousfree
Create partitions on Oracle11g virtual Columns
On Oracle 11g, partitions can be performed on virtual columns. This feature is useful. Let's perform a test:
SQL> select * from v $ version;BANNER
--------------------------------------------------------
Oracle10g (32, 64-bit) is successfully installed in win7 (32, 64-bit) and whether the installation is successful
Win7-32-bit installation 32-bit oracle10g, win7-64 32-bit installation, 64-bit oracle10g can refer to this case.
Reference:
Shared SQL statement for Oracle performance optimization learning notesTo avoid repeated parsing of the same SQL statement, Oracle stores the SQL statement in memory after the first parsing. The memory in the shared buffer pool of the SGA
Oracle SQL statement Optimization
Although orm ing is used in the project, the optimization of the Oracle system is very valuable. Here we will summarize the commonly used statements from the perspective of SQL statements.
1. Optimization in the
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