oracle - 如何使用 powershell 中的 sqlplus 运行 .sql 文件
问题描述
我正在尝试将 .sql 文件从 powershell 运行为:-
sqlplus username/password@TnsAlias 'c:\path\to\DBscript.sql'
这里的 TnsAlias 指的是我的 ORACLE_SID
每当我运行这个命令时,我都会得到 sqlplus 的标准使用说明。
有人可以帮我解决这个问题。
如果有帮助,我正在 Windows Server 2012 和 Powershell 4.0 版上运行它。
解决方案
这对我有用:
PS M:\> sqlplus scott/tiger@kc11g "@m:\dbscript.sql"
SQL*Plus: Release 11.2.0.1.0 Production on ╚et Kol 16 07:59:25 2018
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL>
推荐阅读
- react-native-android - 反应本机当前位置不起作用
- php - 类型错误:传递给 Illuminate\Database\Grammar::parameterize() 的参数 1 必须是数组类型,给定整数
- c# - Unity 每旋转 1 度播放声音
- python - 如何从公司内网抓取数据?
- python - 一个旅游景点可以有多个主题。如何在 django 模型中实现这一点?
- typescript - 如何为 mapStateToProps 指定正确的返回类型?
- r - 在 R 数据框中按行查找最大绝对值
- azure - 如何在 azure 数据工厂中使用复制活动将常量值更新到 sql 表字段中
- linux - 我应该使用哪个 docker OS 基础镜像?
- amazon-web-services - AWS 简单无服务器架构推荐