知识大全 oracle 中的常用命令重点展播
Posted 知
篇首语:宁叫钱吃亏,不叫人吃亏。本文由小常识网(cha138.com)小编为大家整理,主要介绍了知识大全 oracle 中的常用命令重点展播相关的知识,希望对你有一定的参考价值。
第一章 日志管理 forcing log switches sql> alter system switch logfile; forcing checkpoints sql> alter system checkpoint; adding online redo log groups sql> alter database add logfile [group ] sql> ( /disk /log a rdo /disk /log b rdo ) size m; adding online redo log members sql> alter database add logfile member sql> /disk /log b rdo to group sql> /disk /log b rdo to group ; changes the name of the online redo logfile sql> alter database rename file c:/oracle/oradata/oradb/redo log sql> to c:/oracle/oradata/redo log ; drop online redo log groups sql> alter database drop logfile group ; drop online redo log members sql> alter database drop logfile member c:/oracle/oradata/redo log ; clearing online redo log files sql> alter database clear [unarchived] logfile c:/oracle/log a rdo ; using logminer analyzing redo logfiles a in the init ora specify utl_file_dir = b sql> execute dbms_logmnr_d build( oradb ora c:\\oracle\\oradb\\log ); c sql> execute dbms_logmnr_add_logfile( c:\\oracle\\oradata\\oradb\\redo log sql> dbms_logmnr new); d sql> execute dbms_logmnr add_logfile( c:\\oracle\\oradata\\oradb\\redo log sql> dbms_logmnr addfile); e sql> execute dbms_logmnr start_logmnr(dictfilename=> c:\\oracle\\oradb\\log\\oradb ora ); f sql> select * from v$logmnr_contents(v$logmnr_dictionary v$logmnr_parameters sql> v$logmnr_logs); g sql> execute dbms_logmnr end_logmnr; 第二章 表空间管理 create tablespaces sql> create tablespace tablespace_name datafile c:\\oracle\\oradata\\file dbf size m sql> c:\\oracle\\oradata\\file dbf size m minimum extent k [logging/nologging] sql> default storage (initial k next k maxextents pctinccease ) sql> [online/offline] [permanent/temporary] [extent_management_clause] locally managed tablespace sql> create tablespace user_data datafile c:\\oracle\\oradata\\user_data dbf sql> size m extent management local uniform size m; temporary tablespace sql> create temporary tablespace temp tempfile c:\\oracle\\oradata\\temp dbf sql> size m extent management local uniform size m; change the storage setting sql> alter tablespace app_data minimum extent m; sql> alter tablespace app_data default storage (initial m next m maxextents ); taking tablespace offline or online sql> alter tablespace app_data offline; sql> alter tablespace app_data online; read_only tablespace sql> alter tablespace app_data read only|write; droping tablespace sql> drop tablespace app_data including contents; enableing automatic extension of data files sql> alter tablespace app_data add datafile c:\\oracle\\oradata\\app_data dbf size m sql> autoextend on next m maxsize m; change the size fo data files manually sql> alter database datafile c:\\oracle\\oradata\\app_data dbf resize m; Moving data files: alter tablespace sql> alter tablespace app_data rename datafile c:\\oracle\\oradata\\app_data dbf sql> to c:\\oracle\\app_data dbf ; moving data files:alter database sql> alter database rename file c:\\oracle\\oradata\\app_data dbf sql> to c:\\oracle\\app_data dbf ; 第三章 表 create a table sql> create table table_name (column datatype column datatype] ) sql> tablespace tablespace_name [pctfree integer] [pctused integer] sql> [initrans integer] [maxtrans integer] sql> storage(initial k next k pctincrease maxextents ) sql> [logging|nologging] [cache|nocache] py an existing table sql> create table table_name [logging|nologging] as subquery create temporary table sql> create global temporary table xay_temp as select * from xay; on mit preserve rows/on mit delete rows pctfree = (average row size initial row size) * /average row size pctused = pctfree (average row size* /available data space) change storage and block utilization parameter sql> alter table table_name pctfree= pctused= storage(next k sql> minextents maxextents ); manually allocating extents sql> alter table table_name allocate extent(size k datafile c:/oracle/data dbf ); move tablespace sql> alter table employee move tablespace users; deallocate of unused space sql> alter table table_name deallocate unused [keep integer] truncate a table sql> truncate table table_name; drop a table sql> drop table table_name [cascade constraints]; drop a column sql> alter table table_name drop column ments cascade constraints checkpoint ; alter table table_name drop columns continue; mark a column as unused sql> alter table table_name set unused column ments cascade constraints; alter table table_name drop unused columns checkpoint ; alter table orders drop columns continue checkpoint data_dictionary : dba_unused_col_tabs 第四章 索引 creating function based indexes sql> create index em_quantity on em (quantity quantity_shipped); create a B tree index sql> create [unique] index index_name on table_name(column asc/desc) tablespace sql> tablespace_name [pctfree integer] [initrans integer] [maxtrans integer] sql> [logging | nologging] [nosort] storage(initial k next k pctincrease sql> maxextents ); pctfree(index)=(maximum number of rows initial number of rows)* /maximum number of rows creating reverse key indexes sql> create unique index xay_id on xay(a) reverse pctfree storage (initial k sql> next k pctincrease maxextents ) tablespace indx; create bitmap index sql> create bitmap index xay_id on xay(a) pctfree storage( initial k next k sql> pctincrease maxextents ) tablespace indx; change storage parameter of index sql> alter index xay_id storage (next k maxextents ); allocating index space sql> alter index xay_id allocate extent (size k datafile c:/oracle/index dbf ); alter index xay_id deallocate unused; 第五章 约束 define constraints as immediate or deferred sql> alter session set constraint[s] = immediate/deferred/default; set constraint[s] constraint_name/all immediate/deferred; sql> drop table table_name cascade constraints sql> drop tablespace tablespace_name including contents cascade constraints define constraints while create a table sql> create table xay(id number( ) constraint xay_id primary key deferrable sql> using index storage(initial k next k) tablespace indx); primary key/unique/references table(column)/check enable constraints sql> alter table xay enable novalidate constraint xay_id; enable constraints sql> alter table xay ena cha138/Article/program/Oracle/201311/17903相关参考
Oracle10gRAC常用维护命令 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! 所有实例和服
Oracle服务器常用命令行工具一览 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! ()数据库管
详细讲解Oracle服务器的常用命令行 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!数据库管理相关
SQL>showall查看所有个系统变量值 SQL>showuser显示当前连接用户 SQL>showerror 显示错误 SQL>setheadingoff禁止输
oracleg中加入了recyclebin的功能即droptable之后还能用命令直接restore SQL>createtablex(idnumber); 表已创建 SQL>d
Oracle中tnsping命令解析 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! Oracle
哎一学期又结束了我想把这些简单命令记录下虽然可能我不会深入研究oracle搞不好以后也会要用到的时候现在花点时间把它给存起来 怎么安装oracle软件我就不介绍了只要下个安装包接下来的安装就不在
Oracle设置归档模式的命令 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧! Oracle数据库
createtablespacejfxtdatafileE:\\oracle\\oradata\\oradb\\jfxtorasizemreusedefaultstorage(initialkne
Oracle归档模式的命令及参数 以下文字资料是由(全榜网网www.cha138.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!Oracle数据库可