使用Linux下script工具記錄Oracle輸出

rongshiyuan發表於2012-08-14
oracle@linux-u72z:~> which script
/usr/bin/script
oracle@linux-u72z:~> script
Script. started, file is typescript
oracle@linux-u72z:~> sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 17 12:40:18 2012
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
SQL> conn / as sysdba
sConnected.
SQL>select sysdate from dual;    
SYSDATE
---------
17-AUG-12
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
oracle@linux-u72z:~> exit
Script. done, file is typescript
oracle@linux-u72z:~> ls -ltrh
total 1.9G
drwxrwxr-x  3 oracle dba    72 Jul 12 01:22 product
drwxrwxr-x  4 oracle dba    96 Jul 12 01:23 jre
drwxrwxr-x  6 oracle dba   176 Jul 12 01:24 oui
drwxrwxr-x  6 oracle dba   272 Jul 12 01:24 doc
drwxrwxr-x 12 oracle dba   464 Jul 12 18:08 oraInventory
drwxr-xr-x  4 oracle dba    96 Jul 12 23:42 admin
-rw-r--r--  1 root   root 246K Jul 29 08:11 rlwrap-0.37.tar.gz
drwxrwxr-x  8    500  500  752 Jul 29 08:12 rlwrap-0.37
-rw-r--r--  1 oracle dba    58 Aug  1 17:00 scp1.log
-rw-r--r--  1 oracle dba  1.9G Aug  1 17:00 radius1120120723_03_1.dmp
-rw-r--r--  1 oracle dba     0 Aug  1 17:03 radius1120120723_03_1.log
-rw-------  1 oracle dba  8.5M Aug  1 18:00 core
-rw-r--r--  1 oracle dba    58 Aug  2 17:56 exp.log
drwxr-xr-x  3 oracle dba   152 Aug  3 12:27 oradata
-rw-r--r--  1 oracle dba  1.2K Aug  6 10:00 tsradius1120120723_03.log
-rw-r--r--  1 oracle dba    58 Aug  6 10:00 imp.log
-rw-r--r--  1 oracle dba     0 Aug 16 10:16 kill
drwxr-xr-x  2 oracle dba   288 Aug 16 12:58 test
-rw-r--r--  1 oracle dba   652 Aug 17 12:40 typescript
oracle@linux-u72z:~> more typescript.
Script. started on Fri Aug 17 12:40:11 2012
oracle@linux-u72z:~> sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Fri Aug 17 12:40:18 2012
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
SQL> conn / as sysdba
sConnected.
SQL>select sysdate from dual;    
SYSDATE
---------
17-AUG-12
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
oracle@linux-u72z:~> exit
Script. done on Fri Aug 17 12:40:38 2012
 
當然還有更強悍的 scriptreplay 工具可以replay script,不過預設一般不帶。。。

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

相關文章