042-13 Oracle数据库的安全Audit;配置网络
--**AUDIT TRAIL 审计的跟踪SQL> show parameter Audit --查询审计相关的参数/*NAME TYPE VALUE--------------------------...
042-12 Schema-Index 模拟不能提高性能
--************模拟使用index不能提高效率的情况Insert Into t1 Select * From t1 --构建大表,百万数据以上 Select Count(*) From t1 --1265792Alter Table t1 Move &nbs...
042-11 schema-Index Rowid
Alter Table tt Move --讲表移动整理,让数据存放的更有序b-tree:balance --平衡树(相对于binary--二叉树,用于数据仓库)--Index 使表查询变快,但修改受到影响变慢Create Table t1 As Select * From dba_objects;--Rowid 伪列 与nextval,currval一样都是伪列Insert Into t1 Select * From t...
042-10 Schema对象
/*A schema is a collection of database objects that are owned by a particular user. Typically,for a production database, this user does not represent a person, but an application. Aschema has the same name as the user that owns the schema. Schema objects are thelogical structures that directly re...
042-8 02天7 Undo表空间
--************UNDO表空间Select * From dba_tablespaces Select * From dba_data_filesSelect * From dba_temp_filesSelect * From dba_segments Where tablespace_name='UNDOTBS2' --查看UNDO表空间段 回滚段Select * From dba_extents Where segment_name = 'TT'Select * From dba_tables Where Table_...
042-7 Undo表空间,SESSION,PROCESS,Connect
--SESSION的概念新窗口(不同SESSION)查询到1 a的原理,是由于存在undo表空间,oracle将修改前的数据放在undo表空间/*SESSIO会话 --通过session信息查找对应的操作系统进程select distinct sid from v$mystat; --查询当前SESSION的IDSelect * From v$session where sid in (143) --查看SESSION,PADDR=1FE4C60C...
042-6 DB逻辑结构
Database1.physical2.logicalSelect * From dba_tablespacesSelect * From dba_data_filesSelect * From dba_temp_filesSelect * From dba_segments Where tablespace_name='A'Select * From dba_extents Where segment_name = 'TA'Database -> Tablespace -> segments -> Extents -> blocks -> os blocksSelect...
042-5 Oracle的启动过程
/*cmd进入sqlplus中文显示???C:\>set nls_lang = American_America.ZHS16GBK*/1.physical structure物理结构parameter Fileclient parameter File(Pfile)server parameter File(Spfile)--==================================tom kyte --oracle专家asktom.orac...
042-4 Oracle的结构
1.physical structure物理结构parameter Fileclient parameter File(Pfile)server parameter File(Spfile)qlplus Sys@testdb As Sysdbashow parameter Spfile--spfile的路径C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SPFILETESTRID.ORACreate Pfile From Spfile --在spfile的路径下,新创建的pfile文件INITtest...
042-3 OracleEM
--常用工具pl/Sql developertoad: tool Of oracle application developer --www.quest.com--oracle EM--添加的EM过程1.图形2.命令 emca -config dbcontrol db -repos recreate db console db grid --ocm要考的内容------------------更改语言...
042-2 配置和常用工具
/*windows下卸载oracle步骤1.删除环境变量 path下的oracle变量2.删除注册表HKEY_LOCAL_MACHINE\SOFTWARE\ORACLEHKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Oracle*3.restart System 重启4.删除oracle安装的目录ORACLE_BASE和数据目录oradata5.删除c:\Program Files\Oracle目录 &n...
042-1 表空间
Database1.physical2.logicalSelect * From dba_tablespacesSelect * From dba_data_filesSelect * From dba_temp_filesSelect * From dba_segments Where tablespace_name='A'Select * From dba_extents Where segment_name = 'TT'Database -> Tablespace -> segments -> Extents -> blocks -> os blocksSele...
21.Oracle用户权限
user Privilege 用户权限--系统权限Select * From System_Privilege_Map --系统权限表Create User b Identified By b --创建空用户sqlplus b/b@testDB --连接报错,ORA-01045: 用户 B 没有 CREATE...
20.层次检索
hierarchical Retrieval 层次检索--创建雇员表CREATE TABLE EMPLOYEE_CHART( EMPLOYEE_ID NUMBER(7) PRIMARY KEY, --主键TITLE VARCHAR2(20),REPORTS_TO NUMBER(7));--增加外键ALTER TABLE EMPLOYEE_CHARTADD CONSTRAINT FK_EM_EMFOREIGN KEY (REPORTS_TO)REFERENCES EMPLOYEE_CHART (EMPLOYEE_ID);--数据...
19.大数据集
.large Data Sets 大数据集Create Table t2 atablespace users As Select * From dba_objects --用查询到的结果集创建表t2Select Count(*) From t2Insert Into t2 Select * From t2--使用相关子查询结果进行更新数据/*Update PORTS PT Set(TOT_SHIPS_ASSIGNED,TOT_SHIPS_ASGN_CAP) = (Sel...
18.数据字典
data Dictionary--dba_xxxSelect * From dba_tables --dba打头的表,包括所有owner下的对象--all_xxxSelect * From all_objects --all打头的表,登录用户有权访问的所以对象--user_xxxSelect * From User_Objects --user打头的表,登录用户下的所有对象,没有owner权限,没有owner列--===...
17.grouping组函数
grouping组函数Select owner,Count(*) From dba_objects Group By owner --用owner做分组的条件--ROLLUP的使用--分组并求合计 Select owner,Count(*) From dba_objects Group By owner Union Select Null,Count(*) From dba_objects --使用union查询合计Select owner,Count(*) From dba_objects Group By r...
16.set operation 集合
set operation 集合Select * From t;Select * From tt;--union allSelect Id,Name From tUnion AllSelect Id,Name2 From tt; --不过滤重复,不排序,效率高于union--unionSelect Id,Name From tUnionSelect Id,Name2 From tt; --过滤重复--Minus 差集Select Id,Name From tminusSelect Id,Name2 From tt; --...
15.闪回
Flashback 闪回 有6种闪回1.Flashback Query 闪回查询Create Table tt(Id Int,Name Varchar2(10))Insert Into tt Values(1,'a')Insert Into tt Values(2,'b')Select * From ttSelect Sysdate From dual --查询当前时间 2013-12-10 16:55:58,此时数据还存在...
14.管理schema对象
manager schema Object--增加修改列--sys用户下的列可以增加,不可以删除Select * From tDelete t Where Id = 4 And Rownum =1Alter Table t Add name2 Varchar2(10) Default 'a' Not Null --增加列Alter Table t Drop Column Name2 --删除单列Alter Table t Drop (name1,name2) &...