cmd_sqlplus:set head off and set head on

msdnchina發表於2010-12-02
Microsoft Windows [版本 5.2.3790]
(C) 版權所有 1985-2003 Microsoft Corp.

C:\Documents and Settings\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Dec 2 17:01:13 2010

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';

Session altered.

SQL> EXECUTE DBMS_LOGMNR.START_LOGMNR(STARTTIME => '02-dec-2010 15:22:00', ENDTI
ME => '02-dec-2010 15:24:00', PTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG +D
BMS_LOGMNR.CONTINUOUS_MINE);

PL/SQL procedure successfully completed.

SQL>
SQL> show heading
heading ON
SQL> SELECT SQL_UNDO FROM V$LOGMNR_CONTENTS WHERE  SEG_NAME = 'EMP';

SQL_UNDO
--------------------------------------------------------------------------------

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7369','SMITH','CLERK','7902',TO_DATE('17-DEC-1980 00:00:00', 'D

D-MON-YYYY HH24:MI:SS'),'800',NULL,'20');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7499','ALLEN','SALESMAN','7698',TO_DATE('20-FEB-1981 00:00:00',

 'DD-MON-YYYY HH24:MI:SS'),'1600','300','30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7521','WARD','SALESMAN','7698',TO_DATE('22-FEB-1981 00:00:00',
'DD-MON-YYYY HH24:MI:SS'),'1250','500','30');

SQL_UNDO
--------------------------------------------------------------------------------


insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7566','JONES','MANAGER','7839',TO_DATE('02-APR-1981 00:00:00',
'DD-MON-YYYY HH24:MI:SS'),'2975',NULL,'20');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7654','MARTIN','SALESMAN','7698',TO_DATE('28-SEP-1981 00:00:00'

, 'DD-MON-YYYY HH24:MI:SS'),'1250','1400','30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7698','BLAKE','MANAGER','7839',TO_DATE('01-MAY-1981 00:00:00',

SQL_UNDO
--------------------------------------------------------------------------------

'DD-MON-YYYY HH24:MI:SS'),'2850',NULL,'30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7782','CLARK','MANAGER','7839',TO_DATE('09-JUN-1981 00:00:00',
'DD-MON-YYYY HH24:MI:SS'),'2450',NULL,'10');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7788','SCOTT','ANALYST','7566',TO_DATE('19-APR-1987 00:00:00',
'DD-MON-YYYY HH24:MI:SS'),'3000',NULL,'20');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D


SQL_UNDO
--------------------------------------------------------------------------------

EPTNO") values ('7839','KING','PRESIDENT',NULL,TO_DATE('17-NOV-1981 00:00:00', '

DD-MON-YYYY HH24:MI:SS'),'5000',NULL,'10');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7844','TURNER','SALESMAN','7698',TO_DATE('08-SEP-1981 00:00:00'

, 'DD-MON-YYYY HH24:MI:SS'),'1500','0','30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7876','ADAMS','CLERK','7788',TO_DATE('23-MAY-1987 00:00:00', 'D

D-MON-YYYY HH24:MI:SS'),'1100',NULL,'20');


SQL_UNDO
--------------------------------------------------------------------------------

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7900','JAMES1','CLERK','7698',TO_DATE('03-DEC-1981 00:00:00', '

DD-MON-YYYY HH24:MI:SS'),'950',NULL,'30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7902','FORD','ANALYST','7566',TO_DATE('03-DEC-1981 00:00:00', '

DD-MON-YYYY HH24:MI:SS'),'3000',NULL,'20');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7934','MILLER','CLERK','7782',TO_DATE('23-JAN-1982 00:00:00', '

DD-MON-YYYY HH24:MI:SS'),'1300',NULL,'10');

SQL_UNDO
--------------------------------------------------------------------------------



14 rows selected.

SQL> set head off
SQL> SELECT SQL_UNDO FROM V$LOGMNR_CONTENTS WHERE  SEG_NAME = 'EMP';

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7369','SMITH','CLERK','7902',TO_DATE('17-DEC-1980 00:00:00', 'D

D-MON-YYYY HH24:MI:SS'),'800',NULL,'20');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7499','ALLEN','SALESMAN','7698',TO_DATE('20-FEB-1981 00:00:00',

 'DD-MON-YYYY HH24:MI:SS'),'1600','300','30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7521','WARD','SALESMAN','7698',TO_DATE('22-FEB-1981 00:00:00',
'DD-MON-YYYY HH24:MI:SS'),'1250','500','30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D


EPTNO") values ('7566','JONES','MANAGER','7839',TO_DATE('02-APR-1981 00:00:00',
'DD-MON-YYYY HH24:MI:SS'),'2975',NULL,'20');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7654','MARTIN','SALESMAN','7698',TO_DATE('28-SEP-1981 00:00:00'

, 'DD-MON-YYYY HH24:MI:SS'),'1250','1400','30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7698','BLAKE','MANAGER','7839',TO_DATE('01-MAY-1981 00:00:00',
'DD-MON-YYYY HH24:MI:SS'),'2850',NULL,'30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7782','CLARK','MANAGER','7839',TO_DATE('09-JUN-1981 00:00:00',

'DD-MON-YYYY HH24:MI:SS'),'2450',NULL,'10');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7788','SCOTT','ANALYST','7566',TO_DATE('19-APR-1987 00:00:00',
'DD-MON-YYYY HH24:MI:SS'),'3000',NULL,'20');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7839','KING','PRESIDENT',NULL,TO_DATE('17-NOV-1981 00:00:00', '

DD-MON-YYYY HH24:MI:SS'),'5000',NULL,'10');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7844','TURNER','SALESMAN','7698',TO_DATE('08-SEP-1981 00:00:00'

, 'DD-MON-YYYY HH24:MI:SS'),'1500','0','30');


insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7876','ADAMS','CLERK','7788',TO_DATE('23-MAY-1987 00:00:00', 'D

D-MON-YYYY HH24:MI:SS'),'1100',NULL,'20');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7900','JAMES1','CLERK','7698',TO_DATE('03-DEC-1981 00:00:00', '

DD-MON-YYYY HH24:MI:SS'),'950',NULL,'30');

insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7902','FORD','ANALYST','7566',TO_DATE('03-DEC-1981 00:00:00', '

DD-MON-YYYY HH24:MI:SS'),'3000',NULL,'20');


insert into "SCOTT"."EMP"("EMPNO","ENAME","JOB","MGR","HIREDATE","SAL","COMM","D

EPTNO") values ('7934','MILLER','CLERK','7782',TO_DATE('23-JAN-1982 00:00:00', '

DD-MON-YYYY HH24:MI:SS'),'1300',NULL,'10');


14 rows selected.

SQL>

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/161195/viewspace-680812/,如需轉載,請註明出處,否則將追究法律責任。

相關文章