ITPub博客

首页 > Linux操作系统 > Linux操作系统 > sqlplus host doscmd执行外部命令

sqlplus host doscmd执行外部命令

原创 Linux操作系统 作者:gispf_itpub 时间:2010-12-03 15:15:20 0 删除 编辑

看过很多文章讲到:sqlplus>!cp oarlce\oradata\*.* orabak\*.*
可以用于冷备份,但是我试了N遍!也无法用“!”执行sqlplus
外部命令,难道执行sqlplus外部命令另有他法,还是unix与win语法不同?

我已用bat批处理方法,创建了冷备份过程(两机ora安装路径完全一致);
但是在sqlplus中shutdown还要手动执行,是用win的任务计划结合sqlplus完成全部自动化处理哪,还是利用sqlplus+外部win命令实现这一过程,哪种最合理,最有效!请版主指点1——2!

----------------------------------------------------

Remen 2005-10-13 09:12

You can use
sqlplus>host cp oarlce\oradata\*.* orabak\*.*

pearth 2005-10-13 22:06

host cp 是unix的下的还是win下的!

Remen 2005-10-14 11:04

both are ok!
you can try

Remen 2005-10-14 11:06

NT:
SQL> host dir sqlnet.log
驱动器 F 中的卷是 WIN2000_PRO
卷的序列号是 4B2F-6AB1

F:\oracle9i\bin 的目录

2005-10-14  10:43            61,701 sqlnet.log
               1 个文件         61,701 字节
               0 个目录  1,165,893,632 可用字节

SQL>

Unix:
$ sqlplus "/as sysdba"

SQL*Plus: Release 9.2.0.6.0 - Production on Fri Oct 14 10:48:09 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production

SQL> host pwd
/T3/VIS/ora/visdata

SQL>

pearth 2005-10-20 13:28

最近忙了点,马上回去试试!谢谢楼上的!

lihongjun 2005-10-20 18:15

[quote]Originally posted by [i]Remen[/i] at 2005-10-14 11:04:
both are ok!
you can try [/quote]

SQL> host cp
'cp' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

SQL>

ng1990 2005-10-20 18:16

good

Remen 2005-10-21 08:45

[quote]Originally posted by [i]lihongjun[/i] at 2005-10-20 06:15 PM:
SQL> host cp
'cp' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

SQL> [/quote]

Sorry, i made a mistake!
cp can not use in win,only can run in unix or linux!
On windows,you should use copy not cp!

and  you'd better give the full path!

[ Last edited by Remen on 2005-10-21 at 08:48 ]

pearth 2005-10-21 21:23

试过了,OK!

ycfyh 2005-10-24 16:34

let's try

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9460258/viewspace-680878/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-07-25

  • 博文量
    21
  • 访问量
    68536