Oracle联机文档

[原文]

Starting SQL*Plus Command-line

The SQL*Plus executable is usually installed in $ORACLE_HOME/bin, which is usually included in your operating system PATH environment variable. You may need to change directory to the $ORACLE_HOME/bin directory to start SQL*Plus.

In the following examples, you are prompted to enter the database account password.

An example using an Easy Connection identifier to connect to the HR schema in the MYDB database running on mymachine is:

sqlplus hr@\"//mymachine.mydomain:port/MYDB\"

An example using a Net Service Name is:

sqlplus hr@MYDB

Net Service Names can be stored in a number of places, including Oracle Names. See the Net Services Reference Guide for more information.

[译文]

启动Sqlplus命令行模式:

通常情况下,Sqlplus可以执行,它的安装目录是$ORACLE_HOME/bin,而且在系统中设置环境变量PATH,需要将目录改变为$ORACLE_HOME/bin,就可以执行Sqlplus。

下面的例子,按照提示,可以输入数据库的帐号和口令。

这个例子在我们的机器上运行简单的连接标识符来连接MYDB数据库的HR模式:

sqlplus hr@\"//mymachine.mydomain:port/MYDB\" 可以使用网络服务名称: sqlplus hr@MYDB 网络服务名称能存储一个确认点,包括Oracle数据库名。可以查看关于网络服务参考指导的更多信息。 [原文]

If you want to use Net Service Names configured in a local Oracle Net tnsnames.ora file, then set the environment variable TNS_ADMIN to the directory containing the tnsnames.ora file. For example, on UNIX, if your tnsnames.ora file is in /home/user1 and it defines the Net Service Name MYDB2:

TNS_ADMIN=/home/user1 export TNS_ADMIN sqlplus hr@MYDB2

This example assumes the ORACLE_HOME environment variable is set, and the $ORACLE_HOME/network/admin/tnsnames.ora or ORACLE_HOME\network\admin\tnsnames.ora file defines the Net Service Name MYDB3:

sqlplus hr@MYDB3

The TWO_TASK (on UNIX) or LOCAL (on Windows) environment variable can be set to a connection identifier. This removes the need to explicitly enter the connection identifier whenever a connection is made in SQL*Plus or SQL*Plus Instant Client. This UNIX example connects to the database known as MYDB4:

TNS_ADMIN=/home/user1 export TNS_ADMIN TWO_TASK=MYDB4 export TWO_TASK sqlplus hr

[译文]

如果我们使用网络服务名称,那就需要配置Oracle的网络文件tnsnames.ora;设置tnsnames.ora文件中的TNS_ADMIN环境变量。例如下面例子,在UNIX下,如果你的tnsnamets.ora文件设置目录/home/user1,并且定义网络服务名称为MYDB2:

TNS_ADMIN=/home/user1

export TNS_ADMIN

sqlplus hr@MYDB2

这个例子指出ORACLE_HOME环境变量已经被设置,并且定义$ORACLE_HOME/network/admin/tnsnames.ora or ORACLE_HOME\network\admin\tnsnames.ora中的网络服务名称为MYDB3:

sqlplus hr@MYDB3

在Unix和Windows下设置环境变量为确认连接标识符。当我们通过Sqlplus连接Oracle数据库时,需要确认连接标识符,这个UNIX例子中,连接的数据库被命名为MYDB4:

TNS_ADMIN=/home/user1

export TNS_ADMIN

TWO_TASK=MYDB4

export TWO_TASK

sqlplus hr

[原文]

To start SQL*Plus and connect to the default database

Open a UNIX or a Windows terminal and enter the SQL*Plus command:

sqlplus

When prompted, enter your Oracle Database username and password. If you do not know your Oracle Database username and password, ask your Database Administrator.

Alternatively, enter the SQL*Plus command in the form:

sqlplus username

You are prompted to enter your password.

SQL*Plus starts and connects to the default database.

Now you can start entering and executing SQL, PL/SQL and SQL*Plus statements and commands at the SQL> prompt.

To start SQL*Plus and connect to a database other than the default

Open a UNIX or a Windows terminal and enter the SQL*Plus command:

sqlplus username@connect_identifier

You are prompted to enter your password.

[译文]

启动Sqlplus连接默认的数据库

1. 打开UNIX和Windows系统中的终端窗口,输入Sqlplus命令:

sqlplus

2. 当提示符出现,输入Oracle数据库的用户名和密码。如果不确定用户名和密码,请向数据库管理员询问。

3. 也可以在Sqlplus命令行提示符下输入命令:

sqlplus username

根据提示,输入密码。

4.Sqlplus启动后,连接到默认的数据库上。

现在就可以在Sqlplus提示符>下输入Sql,PL/SQL和Sqlplus命令了。

如何启动Sqlplus连接到其它默认的数据库:

sqlplus username@connect_identifier 然后根据提示输入密码即可。 [原文]

Starting SQL*Plus Instant Client

SQL*Plus Instant Client is the SQL*Plus command-line without the need to install Oracle Database. For information about using it, see Starting SQL*Plus Command-line.

Because SQL*Plus Instant Client does not include a database, it is always 'remote' from any database server. To connect to a database you must specify the database using an Oracle Net connection identifier.

If TNS_ADMIN is not set, then an operating system dependent set of directories is examined to find tnsnames.ora. This search path includes looking in the directory specified by the ORACLE_HOME environment variable for network/admin/tnsnames.ora. This is the only reason to set the ORACLE_HOME environment variable for SQL*Plus Instant Client. If ORACLE_HOME is set when running Instant Client applications, it must be set to a directory that exists.

[译文]

启动Sqlplus安装客户端

当Oracle数据库没有安装Sqlplus时,就需要安装Sqlplus安装客户端;

因为Sqlplus安装客户端不包含在数据库中,它通常是通过其它数据库“远程”连接。所以连接到一个数据库必须指定数据库的网络连接标识符。

当操作系统依靠设置、检查的tnsnames.ora没有设置TNS_ADMIN,这个搜索过程包括目录的ORACLE_HOMT环境变量中的network/admin/tnsnames.ora.这是对Sqlplus安装客户端唯一进行设置的ORACLE_HOME环境变量。所以,如果ORACLE_HOME在安装运行客户端应用程序的过程时是设置了,那么它必须被设置目录和存在。

[原文]

Connecting to a Different Database

From an existing command-line session, enter a CONNECT command in the form:

SQL> connect username@connect_identifier

You are prompted to enter your password.

[译文]

如何连接不同的数据库

从已经连接的会话中退出,然后键入“CONNECT命令:

SQL> connect username@connect_identifier 然后根据提示输入密码。

(待续……)

oracle联机文档使用,Sqlplus 联机文档学习相关推荐

  1. oracle12c配置文档,Oracle12C安装配置文档

    Oracle12C安装配置文档 Oracle12C安装配置文档 准备软件: 开始安装: 打开从官网下载下来的两个压缩包,进行解压 打开解压好的后缀为2of2的文件夹 找到路径为database下的&q ...

  2. python 帮助文档,撰写函数文档,并查看函数文档

    python 帮助文档,撰写函数文档,并查看函数文档 定义函数 def test(a,b):'''参数:a:整数b:整数返回值:a+b'''return a+b 运行函数 test(11,22) 33 ...

  3. pdf 加深 扫描件_为什么PDF文档不能像Word文档一样随便编辑?如何免费将PDF转换为Word?...

    PDF文档是一种非常难编辑的文档,有时候我们需要编辑或者复制PDF文档里面的内容,把PDF文档转换为Word就是我们最佳的选择.为什么PDF文档这么难编辑?我们怎么免费把PDF文档转换为Word文档? ...

  4. 办公文档加密,企业文档加密,强制性透明加密技术,fasoft

    随着企事业单位的快速发展,文档以电子文档方式为企事业单位承载着越来越多重要的信息.而由于电子文档的容易散播性,导致企事业单位在外发给客户或合作伙伴的重要资料,都可能会在这交互的过程中被篡改.无序传播等 ...

  5. Python 技术篇-利用Office VBA实现word文档转化为pdf文档实例演示

    # -*- coding: UTF8 -*- from win32com.client import *def switch_pdf(path, name):'''作用:将word文档转化为pdf文档 ...

  6. ElasticSearch什么是文档?索引一个文档

    什么是文档? 程序中大多的实体或对象能够被序列化为包含键值对的JSON对象,键(key)是字段(field)或属性(property)的名字,值(value)可以是字符串.数字.布尔类型.另一个对象. ...

  7. swagger导出excel文档_将Swagger2文档导出为HTML或markdown等格式离线阅读

    网上有很多<使用swagger2构建API文档>的文章,该文档是一个在线文档,需要使用HTTP访问.但是在我们日常使用swagger接口文档的时候,有的时候需要接口文档离线访问,如将文档导 ...

  8. 十三种技术文档模板_竞品分析|关于产品规划的思考:石墨文档 VS 腾讯文档 VS金山文档...

    作者以在线协作文档行业领先的石墨文档.腾讯文档和金山文档为例进行了了竞品分析,通过对几款产品全方位的分析,总结了自己关于石墨文档产品规划的思考. 一.竞品概述 1. 竞品目的 2. 竞品目的 通过对石 ...

  9. python文档生成工具_pydoc --- 文档生成器和在线帮助系统 — Python 3.9.1rc1 文档

    pydoc --- 文档生成器和在线帮助系统¶ The pydoc module automatically generates documentation from Python modules. ...

最新文章

  1. 全景分割:CVPR2019论文解析
  2. vm linux连接互联网,通过wifi将Hyper-V VM(基于Linux)连接到互联网 - Linux中似乎没有连接到wifi...
  3. devices-list
  4. 做好MSSQL保卫战之xp_cmdshell
  5. 银行产生的烂账是如何处理的?
  6. ubuntu+anaconda+tensorflow 及相关问题
  7. linux安装mysql 5.6.33
  8. tinyxml c语言,开源TinyXML 最简单的新手教程
  9. python tricks —— datetime 删除日期中的前导 0
  10. SSRF攻击实例解析
  11. Ubuntu8.10下迁移SVN版本库到新增的SAS硬盘
  12. POJ 1182 食物链
  13. 2021年MathorCup高校数学建模挑战赛——大数据竞赛赛道A -思路分享
  14. QT 5.9.0下载安装及配置教程(自动化运维环境)
  15. java:数据结构面试题
  16. 【总结】1147- 一文吃透 Webpack 核心原理
  17. Android Property
  18. 又是一年双11,神棍节终于来啦
  19. 信息系统项目管理师必背核心考点(六十二)项目组合治理主要过程
  20. bzoj1605 洛谷2905 [Usaco2008 Open]Crisis on the Farm 牧场危机(DP)

热门文章

  1. Maven 项目管理 —— 安装与配置
  2. Head First 设计模式 —— 策略设计模式
  3. linux/unix 基本概念的认识(sha-bang 、PPA)
  4. 【读书笔记】—— 《从 0 到 1》
  5. Analysis of variance(ANOVA)
  6. matlab 矢量化编程(三) —— 软阈值函数
  7. 音乐的聆听 古典音乐的入门
  8. C Tricks(三)—— 以一维数组的形式对二维数组赋值
  9. 机器学习基础(二十五)—— Feature Selection
  10. bootstrap 模态框无法使用_22 模态框Modal教程(plotly Dash Bootstrap版)