sqlplus

Why do i get #### in the NUMBER column after format… Oracle?

六月ゝ 毕业季﹏ 提交于 2019-12-03 06:03:31
I have two problematic columns: Fee NUMBER type, AdjFee also NUMBER. After column Fee format a5; select Fee ID smth from Visit; i get Fee ID smth #### 123 klkl #### 654 rfjgr You can adjust the number of digits you want SQL*Plus to use to display the numeric data just as you adjust the number of characters used to display character data. Something like column fee format 999999999.99 will tell SQL*Plus to display up to 9 digits before the decimal point and two after the decimal point. You can adjust that, of course, if you know your fees are going to be smaller (or larger). Yes, column names

How do I get SQL*Plus to create views / tables with a blank line in the middle of the create statement?

China☆狼群 提交于 2019-12-03 05:41:06
I wish to create some views using SQL*Plus via script, but seem to hit a problem if a developer has placed a blank line mid statement. The following statement works fine in TOAD / PL/SQL developer etc, but fails in SQL*Plus. (This is usually scripted, but entering it manually gives exactly the same error) Can anyone tell me why / how to stop it? CREATE VIEW bob AS SELECT * FROM DUAL; With SQL*Plus output SQL> CREATE VIEW bob 2 AS 3 SELECT * 4 SQL> FROM DUAL; SP2-0042: unknown command "FROM DUAL" - rest of line ignored. Vincent Malgrat You would use the SET SQLBLANKLINES command: SQL> SET

sqlplus how to find details of the currently connected database session

泄露秘密 提交于 2019-12-03 05:01:05
问题 I have very recently started to work on oracle databases. Generally I have many sqlplus windows open to different oracle databases. When switching from one sqlplus session to another, how can i view the current session details for each sqlplus session ? Any help is greatly appreciated! 回答1: Take a look at this one (c) Tanel Poder. You may either run it from your glogin.sql (so these settings will update each time you connect, or just run it manually. Notice host title command - it changes

Is there a good alternative to SQL*PLUS for Oracle?

跟風遠走 提交于 2019-12-03 04:44:23
问题 I am not a fan of using SQL*PLUS as an interface to Oracle. I usually use yasql, but it hasn't been updated since 2005 and can do with some improvements. A quick Google search shows yasql and SQLPal. I am using linux, so SQLPal is not an option. Are there any alternatives out there, or am I stuck with an interface that I do not like or one that is no longer maintained? 回答1: I presume that you want a low-overhead method of knocking out queries, but want more functions than SQL*Plus provides?

使用sqlplus进行Oracle数据库批量自动发布

拈花ヽ惹草 提交于 2019-12-03 03:54:56
应用系统的更新发布在企业日常运维中是一件比较常见工作,有文件的备份替换,也会有数据库方面的更新操作。本文介绍如何通过一台装有sqlplus工具的中转机对不同应用的Oracle数据库进行自动化发布。 经常遇到使用PL/SQL图形化工具对Oracle数据库进行相关的更新操作,例如程序包、触发器、存储过程、视图以及表中的数据。如果是单用户对单台数据库更新少量的内容,这个操作还可以接受,如果数据库服务器比较多,并且要切换不同的用户去更新大量的内容,这种方式就会比较低效繁琐,面对这种场景,实现后台自动化更新就很有必要。 如何通过一台sqlplus中转机对不同的Oracle数据库在后台完成更新示意如下: 规范要求 按照上图示意在后台完成数据库的发布更新需要一定的规范支持,简单来讲就是要让sqlplus工具能很明确的获取到以下几点信息: 更新时用什么账号去连接哪台服务器的哪个实例? 账号对应的密码应该如何传递给sqlplus命令? 更新的是程序包、存储过程还是视图? 多个更新之间是否有前后依赖关系? 更新文件的命名规范 通过sqlplus命令去连接Oracle数据库完成一次更新需要账号、密码、Oracle服务器的IP地址、侦听的端口、实例名、更新文件所在的路径,用法如下: 其中账号、IP地址、端口、实例名属于可公开的信息,这一部分内容可以连同更新次序和更新类型一起组织到文件名称中 例如【次序

Docker操作实践(1):容器的本质是什么?容器从何而来?

拥有回忆 提交于 2019-12-03 03:54:42
● 最后启动容器中需要运行的进程Endtrypoint 作者:沈晓龙 其他话题 使用sqlplus进行Oracle数据库批量自动发布 业务复杂、数据庞大、应用广怎办?了解下分布式事务的解决思路! 赣州银行增强科技创新,实现一键灾备切换 SaaS设计:自动化服务启停设计示例 这里有份选择云服务商的攻略,请查收… 来源: oschina 链接: https://my.oschina.net/u/4026796/blog/3110183

How to get the employees with their managers

自古美人都是妖i 提交于 2019-12-03 02:53:31
This is what I want the output to look like: Employee Emp# Manager Mgr# BLAKE 7698 KING 7839 CLARK 7782 KING 7839 JONES 7566 KING 7839 MARTIN 7654 BLAKE 7698 ALLEN 7499 BLAKE 7698 TURNER 7844 BLAKE 7698 JAMES 7900 BLAKE 7698 WARD 7521 BLAKE 7698 FORD 7902 JONES 7566 SMITH 7369 FORD 7902 SCOTT 7788 JONES 7566 ADAMS 7876 SCOTT 7788 MILLER 7934 CLARK 7782 Here's what I got: SQL> SELECT ename, empno, (SELECT ename FROM EMP WHERE empno = mgr)AS MANAGER, mgr from emp order by empno; ENAME EMPNO MANAGER MGR ---------- ---------- ---------- ---------- SMITH 7369 7902 ALLEN 7499 7698 WARD 7521 7698

how to increase sqlplus column output length?

回眸只為那壹抹淺笑 提交于 2019-12-03 02:10:01
问题 I have some queries to find out the ddl of some objects from a schema. The result columns I am getting are truncated in the middle of the queries. How can I increase the width of the column? I tried with SET SERVEROUTPUT ON SIZE 1000000; SET LINESIZE 50000; set pagesize 50000; set long 50000; But I'm still getting the same result. 回答1: I've just used the following command: SET LIN[ESIZE] 200 (from http://ss64.com/ora/syntax-sqlplus-set.html). EDIT: For clarity, valid commands are SET LIN 200

executing a .sql file in sql plus terminal

送分小仙女□ 提交于 2019-12-03 01:17:40
I have written couple of sql scripts in a text file and saved them with a .sql extension. I want to execute these scripts in the sql plus terminal without having to manually type the standalone sql scripts, but i'm struggling with it. If someone could list out the steps involved I would be very grateful. I could copy and paste those scripts in the terminal but that is not what I am looking at, I want to see if there is a way to provide the path to the scripts in the sql plus editor. If your filename is myQueries.sql, just type SQL>@/path/to/my/query/myQueries.sql SQL>/ 来源: https:/

How to echo text during SQL script execution in SQLPLUS

感情迁移 提交于 2019-12-03 01:16:00
I have a batch file which runs a SQL script in sqlplus and sends the output to a log file: sqlplus user/pw < RowCount.sql > RowCount.log My log file contains this: Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production SQL> SQL> COUNT(*) ---------- 0 SQL> COUNT(*) ---------- 0 etc. but it's several thousand lines of output and therefore hard to determine which results belong to which statement. I would like to add some formatting to the output, so that I may discern what happened. Either an echo of the executed statement or manually inserting some "echo" statements