Oracle的重做日志
为什么需要redo log
- 内存中数据修改后,不必立即更新到磁盘 —效率
- 由日志完成数据的保护目的 —效率
- 其它副产品
- 数据恢复(备份集+归档日志)
- 数据同步(DG ,streams,gg)
- 日志挖掘
欲事之无繁,则必劳于始而逸于终
No results found
SQL> show sga Total System Global Area 4375998464 bytes Fixed Size- - - 2260328 bytes Variable Size- - 838861464 bytes # shared pool Database Buffers- 3523215360 bytes Redo Buffers- - 11661312 bytes |
conn lyj/lyj drop table t purge; create table t as select * from all_objects; create index ind_t_oid on t(object_id); col segment_name for a20 select segment_name,extents,blocks,bytes/1024/1024 size_m from user_segments where segment_name='T'; SEGMENT_NAME EXTENTS BLOCKS SIZE_M -------------------- ---------- ---------- ---------- T 23 1024 8 select segment_name,extents,blocks,bytes/1024/1024 size_m from user_segments where segment_name='IND_T_OID'; SEGMENT_NAME EXTENTS BLOCKS SIZE_M -------------------- ---------- ---------- ---------- IND_T_OID 17 256 2 |
SQL> conn scott/scott Connected. SQL> select * from cat; TABLE_NAME TABLE_TYPE ------------------------------ ----------- BONUS TABLE DEPT TABLE EMP TABLE SALGRADE TABLE select ENAME,JOB,to_char(HIREDATE,'YYYY-mm-dd') as HIREDATE from emp where DEPTNO = (select DEPTNO from emp where ENAME='BLAKE') and ENAME<>'BLAKE'; ENAME JOB HIREDATE ---------- --------- ---------- ALLEN SALESMAN 1981-02-20 WARD SALESMAN 1981-02-22 MARTIN SALESMAN 1981-09-28 TURNER SALESMAN 1981-09-08 JAMES CLERK 1981-12-03 |
$ sqlplus / as sysdba SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 4375998464 bytes Fixed Size 2260328 bytes Variable Size 905970328 bytes Database Buffers 3456106496 bytes Redo Buffers 11661312 bytes Database mounted. Database opened. |
create user test identified by test default tablespace users;
|