位置: 编程技术 - 正文

Linux下通过script 命令记录(数据库)操作步骤

编辑:rootadmin

推荐整理分享Linux下通过script 命令记录(数据库)操作步骤,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

1、script命令描述

Linux下通过script 命令记录(数据库)操作步骤

复制代码代码如下:script命令会记录所有的操作到文件同时在屏幕上输出,直到终止登陆的会话,或使用CRTL+D,或使用exit退出则停止记录。这个命令对于数据库的升级或是重要设置的情形下使用可以用于后续查询操作成功或失败。用法: $ script [upgrade.log]如果未指定日志文件名的情形,自动生成日志文件名为typescript。如果需要输出到已经存在的日志文件,则使用 -a 参数,再接已经存在日志文件名。如果需要在输出到日志文件的同时,也可以查看日志文件的内容,可以使用 -f 参数。</p><p># script 帮助描述robin@SZDB:~> man scriptNAME script - make typescript of terminal session</p><p>SYNOPSIS script [-a] [-c COMMAND] [-f] [-q] [-t] [file]</p><p>DESCRIPTION Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1).</p><p> If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript.</p><p> Options:</p><p> -a Append the output to file or typescript, retaining the prior contents.</p><p> -c COMMAND Run the COMMAND rather than an interactive shell. This makes it easy for a script to capture the output of a pro- gram that behaves differently when its stdout is not a tty.</p><p> -f Flush output after each write. This is nice for telecooperation: One person does `mkfifo foo; script -f foo' and another can supervise real-time what is being done using `cat foo'.</p><p> -q Be quiet.</p><p> -t Output timeing data to standard error. This data contains two fields, separated by a space. The first field indi- cates how much time elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used to replay typescripts with realistic typing and output delays.

2、script命令用法示例

复制代码代码如下:a、script命令后接日志文件名robin@SZDB:~> script test_logfile.log #启用scriptScript started, file is test_logfile.log</p><p> .................#中间操作省略 robin@SZDB:~> exit #停止scriptexitScript done, file is test_logfile.log</p><p>#查看刚刚生成的日志文件robin@SZDB:~> more test_logfile.log Script started on Fri Apr :: PM CSTrobin@SZDB:~> sid bash: sid: command not foundrobin@SZDB:~> . ~/.bash_profilerobin@SZDB:~> sidORA_CRS_HOME=/opt/oracle/product/gR2/crsORACLE_PATH=.:/users/robin/dba_scripts/custom/sqlORA_ASM_HOME=/opt/oracle/product/gR2/asmORACLE_SID=SYBO2SZORACLE_BASE=/users/oracleORACLE_HOME=/users/oracle/OraHomegrobin@SZDB:~> sql </p><p>SQL*Plus: Release .2.0.3.0 - Production on Fri Apr :: </p><p>Copyright (c) , , Oracle. All Rights Reserved.</p><p>Error accessing PRODUCT_USER_PROFILEWarning: Product user profile information not loaded!You may need to run PUPBLD.SQL as SYSTEM</p><p>Connected to:Oracle Database g Release .2.0.3.0 - bit Production</p><p>goex_admin@SYBO2SZ> alter session set current_schema=scott;</p><p>Session altered.</p><p>goex_admin@SYBO2SZ> select * from dept;</p><p> DEPTNO DNAME LOC---------- -------------- ------------- ACCOUNTING NEW YORK RESEARCH DALLAS SALES CHICAGO OPERATIONS BOSTON</p><p>goex_admin@SYBO2SZ> exitDisconnected from Oracle Database g Release .2.0.3.0 - bit Productionrobin@SZDB:~> exitexit</p><p>Script done on Fri Apr :: PM CST </p><p>b、script 命下直接跟脚本名的示例robin@SZDB:~> script -c retval.shScript started, file is typescript SCOTT ANALYST :: Script done, file is typescript</p><p>#被执行的shell脚本的内容# Author : Robinson# Blog : more ~/dba_scripts/custom/bin/retval.sh#!/bin/bashRETVAL=`sqlplus -silent scott/tiger <<EOFSET PAGESIZE 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFFSELECT * FROM emp WHERE ename='SCOTT';EXIT;EOF`if [ -z "$RETVAL" ]; then echo "No rows returned from database" exit 0else echo $RETVALfi

Linux系统鲜为人知的大内幕介绍 据国外媒体报道,Linux似乎没有得到人们充分的爱戴。苹果的OSX和微软的Windows等操作系统一直是人们关注的重点,但事实上,免费且是开放源的Linux操作

Linux系统中的gdb程序调试工具的命令知识介绍 在Linux系统中有许多的命令程序来辅助系统的正常和方便运行,那么其中在系统中有着一个叫做gdb命令的程序,那么我们今天就来了解下关于gdb命令的知

Linux下SSH Session复制功能实现方法 特别感谢阿干同学的邮件分享。详细方法复制代码代码如下:Linux/mac下,在$HOME/.ssh/config中加入Host*ControlMasterautoControlPatha/tmp/ssh-%r@%h/a至此只要第一次SSH登

标签: Linux下通过script 命令记录(数据库)操作步骤

本文链接地址:https://www.jiuchutong.com/biancheng/360578.html 转载请保留说明!

上一篇:linux ulimit命令用法解析(ulimit命令详解)

下一篇:Linux系统鲜为人知的12大内幕介绍(linux系统干嘛的)

  • 财政的税收
  • 我国增值税的纳税人是如何管理的
  • 合并报表存货增值如何做账
  • 电子税务局自然人如何注册
  • 盈利就是净利润吗
  • 收入与支出怎么算利润率
  • 月底计提分录
  • 当前企业不存在是怎么回事
  • 房地产项目结转条件
  • 虚开增值税普通罪量刑标准
  • 预收款项增值税
  • 购进库存商品溢余账务处理怎么做?
  • 印鉴变更手续费50元
  • 房地产行业增值税筹划
  • 出现销项负数
  • 营改增后还有企业所得税吗?
  • 营改增后房屋维修的发票可以抵扣吗?
  • 待认证进项税额借贷方向
  • 收到保险公司退款
  • 公司的房产税如何征收
  • 个人财产转让所得在哪里申报
  • 用商品抵账的会计分录
  • 购买工程资质文件怎么写
  • 销售货物结转成本会计分录
  • 预缴的税款科目怎么做
  • win10锁屏壁纸自动更新
  • 残疾人保障金汇算清缴填在哪里
  • 联想笔记本在bios中怎么把图标和字变大
  • go进程管理
  • 飞机电子普通发票6%税率可以抵扣吗
  • kcleaner.exe是什么
  • 杜鹃花怎么养家庭养法视频
  • win10远程桌面连接不成功
  • 工程审计的目的包括哪些
  • php初学
  • vue2.0解决跨域问题
  • 公司的财产保险包括哪些
  • php获取随机数
  • websocket()
  • flink从入门到实战
  • vue.js过滤器
  • 公司抽奖奖品怎么做账
  • 收取的水电费怎么入账
  • 销售的百分点怎么计算
  • 弥补亏损的会计分录是怎样的
  • 要多少费用?
  • 征地补偿需要去村委会吗
  • 餐饮业税务申报
  • 工会经费可以列支哪些项目
  • 企业所得税季度申报表怎么填
  • 累计带薪缺勤账务怎么处理
  • 收到商业汇票计什么科目
  • 建筑业负数发票不填工程名称和地址可以吗
  • 企业到外地
  • 微众银行贷款到私账吗
  • 营改增题目
  • 挂靠工程项目预交税金的会计分录如何做?
  • 购入固定资产入账会计处理
  • sql转换
  • windows图标显示不出来
  • bios更改
  • centos7怎么配置
  • win101607怎么升级1903
  • ubuntu下载安装QQ的命令
  • 微软撤回快捷键
  • lsass.exe是什么病毒
  • win7如何录制电脑屏幕
  • win8可以装pr2018吗
  • cocos 2d x
  • 深入浅出python
  • 如何检测ip地址是否被占用
  • unity安装进度条不动
  • javascript sort方法排序
  • context和getApplicationContext()介绍
  • jquery滚动事件
  • 卷烟批发环节的消费税一箱150元
  • 增值税税率为6%,怎么计算税额
  • 技术服务费减免企业所得税政策
  • 组织生活会有民族评议党员大会会后报告
  • 购买税控盘怎么抵扣
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设