社区
基础和管理
帖子详情
oracle sql developer如何打开多个tab
temp220
2010-10-19 11:15:29
每次打开一张表就替换了上一个
...全文
538
9
打赏
收藏
oracle sql developer如何打开多个tab
每次打开一张表就替换了上一个
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
xiaoyaobihai
2010-10-20
打赏
举报
回复
使用toad更方便,呵呵
minitoy
2010-10-20
打赏
举报
回复
tools->windows list 是显示打开窗口的列表,便于切换.
楼主是说在sql windows里同时查询几个表?
选中所要执行的所有sql,然后执行就可以了.
inthirties
2010-10-20
打赏
举报
回复
plsql dev里没有tab的概念,打开的都是window。
你可以通过在window菜单里切换。
或者用上面的方法。让window list显示在你的窗口里。
inthirties
2010-10-20
打赏
举报
回复
[Quote=引用 2 楼 zhuomingwang 的回复:]
我也没明白,你是要意思是要查询多个表吗?
你可以现在Tools里把Window List勾上,然后再Window里save layout.
[/Quote]
这个正点。
da21
2010-10-20
打赏
举报
回复
用toad吧
hao1hao2hao3
2010-10-20
打赏
举报
回复
在窗口列表中会显示你打开的所有的表的Tab页。
真的不知道取什么名
2010-10-20
打赏
举报
回复
我也没明白,你是要意思是要查询多个表吗?
你可以现在Tools里把Window List勾上,然后再Window里save layout.
心中的彩虹
2010-10-20
打赏
举报
回复
[Quote=引用楼主 temp220 的回复:]
每次打开一张表就替换了上一个
[/Quote]
打开的是窗口 需“工具”--“窗口切换”
Oracle
sql
developer
without jdk (win+linux)
Oracle
SQL
Developer
, v1.5.0.54.40 Release Notes 完整版下载:http://www.
oracle
.com/technology/global/cn/software/products/
sql
/index.html 1. Known Issues 1.1 General - Print prints only one page that is a truncation of the current
tab
. - Can't invoke
SQL
*Plus on Windows 2003. - The menu item, and right-click off a Connection node, for invoking
SQL
*Plus does not work with connections whose passwords are not persisted. 1.2 Connections - Cannot connect to remote da
tab
ase as OPS$ account. 1.3 Browse - If connected as sys with sysdba role, Types node displays built in data-types (e.g. BLOB, DATE, DECIMAL, etc.) If clicked on, will only see "create or replace". 1.4 Creating and Modifying Objects - Editing Triggers - If you have comments before the 'BEGIN' they will be lost if you edit. You will see when you click edit that they will not be there. To preserve them, they need to be below the BEGIN or you will need to edit via the
SQL
Worksheet. 1.5
Tab
le > Data -
Tab
les > Your_
Tab
le > Data - PageUp and PageDown buttons not working correctly if cursor is in the rownum column. 1.6 Export - Cannot export if result set contains duplicate column names. 2. Workarounds 2.1 To disable Code Insight Run
SQL
Developer
from a command line using the following statement: Windows :
sql
developer
-J-Dsdev.insight=false Linux or Mac: Run sh
sql
developer
-J-Dsdev.insight=false or edit
sql
developer
.conf and add "AddVMOption -J-Dsdev.insight=false" 2.2 If DDL
tab
is null for all objects in a Connection Your dbms_metadata might be loaded incorrectly. If this statement fails when executed in a
SQL
Worksheet against the Connection select dbms_metadata.get_ddl('
TAB
LE',
tab
le_name , user ) from user_
tab
les; You need to reload $
ORACLE
_HOME/rdbms/admin/catmeta.
sql
2.3 If Snippets are not accessible You may have not done a clean install.
SQL
Developer
needs to be installed into a clean directory, not over a previous release. 3. Accessibility Issues The following is a li
PL
SQL
.
Developer
(X64) v12.0.1.1814 主程序+ v11中文包+keygen
64位版本的 PL
SQL
正式版,只能运行在64位系统中,需要你安装 64 位的
Oracle
11g 或
Oracle
12c 客户端。 安装中文包时请注意安装路径是否为PL
SQL
程序的路径。 备注:新版本Ribbon启用了 Ribbon 界面,改动较大,不习惯的建议不要更新。 部分插件会加载失败。 Ribbon User Interface PL/
SQL
Developer
now uses a new Ribbon User Interface instead of a Menu User Interface: The Quick Access Toolbar above the ribbon contains the most frequently used functions, so that they are always immediately available. You can customize the Quick Access Toolbar to your own liking. Users that prefer a menu-like system to preserve screen real estate can select to automatically hide the ribbon. In the preferences you can select an option to revert to the familiar toolbar layout from PL/
SQL
Developer
11.0 and earlier. Single Document Interface On the "View" ribbon you can now choose between a Single Document Interface (SDI) or Multiple Document Interface (MDI - the same as in PL/
SQL
Developer
11.0 and earlier). In SDI mode you always see just one maximized window. A
tab
control above the window allows you to quickly switch between the windows: General User Interface Enhancements PL/
SQL
Developer
is now fully compliant with High-DPI screens such as 4K monitors and notebooks. All controls and images will scale with resolution (some Plug-Ins may still need to be enhanced). Click on the image below to enlarge this example of a 15" 4K notebook (250% DPI): All window types now have a specific icon color, so that you can quickly identify the type in the Window List, in the SDI
tab
control, in the window titles, and so on. The transaction status is now visible in the status bar of a window, next to the "Saved" and "Executing" indicators. Added user interface preference "Preselect current user for object selection lists". PL/
SQL
Clipboard The new PL/
SQL
Clipboard is a dockable tool that stores the history of all
SQL
and PL/
SQL
code you copy to the Windows clipboard, so that you can paste the clipboard item again in the future. It has a filter function so that you can quickly find a clipboard item based on its contents: At the bottom you see the PL/
SQL
Clipboard history items. Clicking on an item will show the text with syntax highlighting in the preview pane, and will show the timestamp above the preview pane. Double-click on an item to paste the text in the cursor location of the current editor or drag & drop it to a specific location in an editor. You can use the editor preferences to configure when and how items are added to and deleted from the PL/
SQL
Clipboard. Debugger Enhancements You can now display compound variable values such as user-defined types, records and cursors: Support has been added for Error Breakpoints, which allow you to break execution when a specific exception (handled or unhandled) occurs: Breakpoints can now be saved and loaded. Debug object privileges can now be granted and revoked from the user interface. Code Assistant Enhancements The Code Assistant can now include column names from a DML statement context without using an alias: The Code Assistant can now describe sub-records. The Code Assistant now includes an
choice for default object type constructors. The Code Assistant can now include synonyms for user object lists. The Code Assistant no longer pre-selects
after typing part of a parameter/column name.
SQL
Window Enhancements A new preference has been added: "Null value cell color for mandatory columns". This allows you to quickly identify mandatory columns when adding new records: The result set selection can now be copied as an expression list: "column in (value, value, ...)" by right-clicking on a selection and selecting "Copy as expression list" from the popup menu. This allows you to quickly build a where clause based on the selection: When viewing or editing LOB's the contents for common data formats will automatically be recognized, so that an external viewer or editor can be invoked: Changes made and saved in an external editor will automatically be propagated to the column data. The
SQL
Window will now navigate to the offending cell in the result set after an insert or update with a column-specific error. The rowid column is now omitted when exporting a result set grid in
SQL
format. Test Window Enhancements You can now define Standard Tests for a specific function or procedure: A Standard Test can be invoked from the popup menu when right-clicking on the function or procedure in the Object Browser or in a PL/
SQL
source: The Test Window now supports
Oracle
12c implicit results, which are automatically detected and added to the variable list: A new
Oracle
/ Output preference has been added to save dbms_output to a file. The filename can include %dbname%, %dbuser% and %date% variables to separate output files based on the da
tab
ase, user and date. Program Window Enhancements You can now suppress a hint or warning for a specific line of code by adding a "-- Ignore" comment. The Code Contents pane now shows local subprograms within a procedure/function in a separate folder. Session Window Enhancements The Session Window now has a Single Record View for the session details: You can now kill a session with the "immediate" option. Connection Enhancements A "Set current schema" item has been added to the connection popup menu. It will set the current schema for all windows of this connection. The current schema will be displayed in square brackets in the Connection List: Connecting through a proxy user is now supported. Other Enhancements A Compare function has been added to the Object Browser. You can compare program units,
tab
les, views, sequences with sources in the da
tab
ase, in a file or in a window. A new
Oracle
/ Options preference "Always include owner prefix" has been added. When enabled, DLL extracted from the da
tab
ase will always include the owner prefix. When disabled, the owner will be omitted if you are connected as the owner. A new "Stop" item has been added to the DBMS Scheduler "Running job" popup menu. Support has been added for
Oracle
12c read privileges for
tab
les and views. Scripts generated by Export User Objects and Export
Tab
les now have user-defined initialization and finalization. These files are located in the %APPDATA%\PL
SQL
Developer
12\Scripts directory. The Text Importer and ODBC Importer can now also truncate a
tab
le before import, in addition to the "Delete" option. The truncate option is faster but cannot be rolled back. The Compile Invalid Objects tool now has a User Selector. PL/
SQL
Developer
12 now comes as a new MSI installer for interactive and silent installation.
SQL
编写规范(数据库操作规范)
8.用执行计划分析
SQL
性能 EXPLAIN PLAN是一个很好的分析
SQL
语句的工具,它可以在不执行
SQL
的情况下分析语句 通过分析,我们就可以知道
ORACLE
是怎样连接表,使用什么方式扫描表(索引扫描或全表扫描),以及使用到的索引名称 按照从里到外,从上到下的次序解读分析的结果 EXPLAIN PLAN的分析结果是用缩进的格式排列的,最内部的操作将最先被解读,如果两个操作处于同一层中,带有最小操作号的将首先被执行 目前许多第三方的工具如PL
SQL
Developer
和TOAD等都提供了极其方便的EXPLAIN PLAN工具 PG需要将自己添加的查询
SQL
文记入log,然后在EXPLAIN PLAN中进行分析,尽量减少全表扫描
ORACLE
SQL
性能优化系列 1.选择最有效率的表名顺序(只在基于规则的优化器中有效)
ORACLE
的解析器按照从右到左的顺序处理FROM子句中的表名,因此FROM子句中写在最后的表(基础表driving
tab
le)将被最先处理 在FROM子句中包含
多个
表的情况下,必须选择记录条数最少的表作为基础表 当
ORACLE
处理
多个
表时,会运用排序及合并的方式连接它们 首先,扫描第一个表(FROM子句中最后的那个表)并对记录进行排序; 然后扫描第二个表(FROM子句中最后第二个表); 最后将所有从第二个表中检索出的记录与第一个表中合适记录进行合并 例如: 表
TAB
1 16,384 条记录 表
TAB
2 5 条记录 选择
TAB
2作为基础表 (最好的方法) select count(*) from
tab
1,
tab
2 执行时间0.96秒 选择
TAB
2作为基础表 (不佳的方法) select count(*) from
tab
2,
tab
1 执行时间26.09秒 如果有3个以上的表连接查询,那就需要选择交叉表(intersection
tab
le)作为基础表,交叉表是指那个被其他表所引用的表 例如: EMP表描述了LOCATION表和CATEGORY表的交集 SELECT * FROM LOCATION L, CATEGORY C, EMP E WHERE E.EMP_NO BETWEEN 1000 AND 2000 AND E.CAT_NO = C.CAT_NO AND E.LOCN = L.LOCN 将比下列
SQL
更有效率 SELECT * FROM EMP E , LOCATION L , CATEGORY C WHERE E.CAT_NO = C.CAT_NO AND E.LOCN = L.LOCN AND E.EMP_NO BETWEEN 1000 AND 2000 2.WHERE子句中的连接顺序
ORACLE
采用自下而上的顺序解析WHERE子句 根据这个原理,表之间的连接必须写在其他WHERE条件之前,那些可以过滤掉最大数量记录的条件必须写在WHERE子句的末尾 例如: (低效,执行时间156.3秒) SELECT * FROM EMP E WHERE SAL > 50000 AND JOB = 'MANAGER' AND 25 < (SELECT COUNT(*) FROM EMP WHERE MGR=E.EMPNO); (高效,执行时间10.6秒) SELECT * FROM EMP E WHERE 25 50000 AND JOB = 'MANAGER'; 3.SELECT子句中避免使用'*' 当你想在SELECT子句中列出所有的COLUMN时,使用动态
SQL
列引用'*'是一个方便的方法,不幸的是,这是一个非常低效的方法 实际上,
ORACLE
在解析的过程中,会将'*'依次转换成所有的列名 这个工作是通过查询数据字典完成的,这意味着将耗费更多的时间 4.减少访问数据库的次数
pl
sql
dev12.0.4.1826x64主程序+ v12中文包+keygen
64位版本的 PL
SQL
正式版,只能运行在64位系统中,需要你安装 64 位的
Oracle
11g 或
Oracle
12c 客户端。 安装中文包时请注意安装路径是否为PL
SQL
程序的路径。 备注:新版本Ribbon启用了 Ribbon 界面,改动较大,不习惯的建议不要更新。 部分插件会加载失败。 New features Ribbon User Interface PL/
SQL
Developer
now uses a new Ribbon User Interface instead of a Menu User Interface: The Quick Access Toolba
oracle
实验报告
实验一
SQL
*PLUS练习 【实验目的】 (1) 了解
Oracle
的工作环境和基本使用方法。 (2) 练习标准
SQL
的数据操作,查询命令及其查询优化。 (3) 学会使用高级
SQL
命令,排序、分组、自连接查询等。 (4) 学会使用
SQL
*PLUS命令显示报表,存储到文件等。 【实验内容】 一、 准备使用
SQL
*PLUS 1. 进入
SQL
*PLUS 2. 退出
SQL
*PLUS 3. 显示表结构命令DESCRIBE
SQL
>DESCRIBE emp 使用DESCRIBE(缩写DESC)可以列出指定表的基本结构,包括各字段的字段名以及类型、长度、是否非空等信息。 4. 使用
SQL
*PLUS显示数据库中EMP表的内容 输入下面的查询语句:
SQL
>SELECT * FROM emp; 按下回车键执行查询 5. 执行命令文件 START或@命令将指定文件调入
SQL
缓冲区中,并执行文件内容。
SQL
>@ 文件名(文件后缀缺省为.
SQL
)或
SQL
>START 文件名 文件中每条
SQL
语句顺序装入缓冲区并执行。 二、 数据库命令——有关表、视图等的操作 1. 创建表employee 例1 定义一个人事信息管理系统中存放职工基本信息的一张表。可输入如下命令:
SQL
>CREATE
TAB
LE employee (empno number(6) PRIMARY KEY, /* 职工编号 name varchar2(10) NOT NULL, /* 姓名 deptno number(2) DEFAULT 10, /* 部门号 salary number(7,2) CHECK(salarycreate
tab
le emp2 as select * from emp where 1=2; 在命令的where子句中给出1=2,表示条件不可能成立,因而只能复制表结构,而不能复制任何数据到新表中去。另外,还可以复制一个表的部分列定义或部分列定义及其数据。 三、
Oracle
数据库数据查询 1、单表查询 2、多表查询 四、
SQL
*PLUS常用命令 表1 常用报表格式化名命令 命令 定义 Btitle 为报表的每一页设置底端标题 Column 设置列的标题和格式 Compute 让
SQL
*PLUS计算各种值 Remark 将某些字标记为注释 Set linesize 设置报表的行宽字符数 Set newpage 设置报表各页之间的行数 Spool 使
SQL
*PLUS将输出写入文件中 Start 使
SQL
*PLUS执行一个
sql
文件 Ttitle 设置报表每页的头标题 Break 让
SQL
*PLUS进行分组操作 例3 建立一个批命令文件对查询到的数据以报表的形式输出并将其保存到指定的文件中。 处理方法:利用
SQL
*PLUS语言工具(也可以使用其他文本编辑器)建立批命令的.
SQL
文件。在“
SQL
>”提示符下,使用EDIT命令在”E:\”中建立SCGB.
SQL
文件。 SCGB.
SQL
文件中的命令组如下:
SQL
>EDIT E:\ SCGB.
SQL
SET echo off SET pagesize 30 SET linesize 75 TTITLE’2008年4月10号’CE’公司职员基本情况登记表’R’Page:’ FORMAT 99- >
SQL
.PNO SKIP 1 CE’===========================’ BTITLE COL 60 ’制标单位’
TAB
3 ‘人事部’ COLUMN empno heading ‘职工|编号’ COLUMN ename format a10 heading ‘姓 名’ COLUMN job heading ‘工 种’ COLUMN sal format $99,990 heading 工 资’ COLUMN comm Like sal heading ‘奖 金’ COLUMN deptno format 9999 heading ‘部门|编号’ COLUMN hiredate heading ‘参加工作时间’ SPOOL e:\sjbb /*在E盘中建立格式报表输出文件,默认属性为LST BREAK on deptno skip 1 COMPUTE sum of sal comm on deptno SELECT empno,ename,job,hiredate,sal,comm,deptno from emp ORDER BY deptno,sal; SPOOL off /*终止SPOOL功能,关闭其文件。注意,此命令不可省,否则将建立空文件。 五、 实验内容 1、以cs+学号为用户名创建用户,并授予用户创建数据对象的权限。 2、复制emp表,复制表名为emp_学号,然后将emp表中工资低于$2000 的职工插入到复制的表中。 3、对复制的emp表插入一行只包含有职工号,职工名,工资与部门号四个数据 项值的记录。 4、在复制的emp表中将雇员ALLEN提升为经理,工资增至$2500, 奖(佣 )金增加40%。 5、删除复制的emp表中工资低于500的记录行。 6、列出10号部门中既不是经理,也不是秘书的职工的所有信息。 7、查找出部门所在地是CHICAGO的部门的职工姓名、工资和工种。 8、统计各部门中各工种的人数、工资总和及奖金总和。 9、查找出工资比其所在部门平均工资高的职工姓名、工种与工资情况。 实验3
Oracle
数据库开发环境下PL/
SQL
编程 【实验目的】 (1)掌握 PL/
SQL
的基本使用方法。 (2)在
SQL
*PLUS环境下运行PL/
SQL
的简单程序。 (3)应用 PL/
SQL
解决实际问题 【实验内容与步骤】 PL/
SQL
块中的可执行部分是由一系列语句组成的(包括对数据库进行操作的
SQL
语句,PL/
SQL
语言的各种流程控制语句等)。在块中对数据库查询,增、删、改等对数据的操作是由
SQL
命令完成的。在PL/
SQL
块中,可以使用
SQL
的数据查询命令,数据操纵命令和事务控制命令。可使用全部
SQL
函数。PL/
SQL
中的
SQL
语句,可使用
SQL
的比较操作等运算符。但不能使用数据定义语句。 在PL/
SQL
块中使用SELECT语句时注意几点: (1)SELECT语句必须含有INTO子句。 (2)INTO子句后的变量个数和位置及数据类型必须和SELECT命令后的字段名表相同。 (3)INTO子句后可以是简单类型变量或组合类型变量。 (4)SELECT语句中的WHERE条件可以包含PL/
SQL
块中定义的变量及表达式,但变量名不要同数据库表列名相同。 (5)在未使用显式游标的情况下,使用SELECT语句必须保证只有一条记录返回,否则会产生异常情况。 [例3-1] 问题:编写一个过程,求和运算。 SET SERVEROUTPUT ON; DECLARE a number:=1; BEGIN a:=a+5; DBMS_OUTPUT.PUT_LINE('和为:'||TO_CHAR(a)); END; / 【例3-2】:使用%TYPE声明变量,输出制定表中的相关信息。 DECLARE my_name student.sname%TYPE; BEGIN SELECT sname INTO my_name FROM student WHERE no=’01203001’; DBMS_OUTPUT.PUT_LINE(my_name); END; / 【例3-3】问题:编写一个过程,可以输入一个雇员名,如果该雇员的工资低于2000,就给该员工工资增加10%。 declare v_sal emp.sal%type; begin select sal into v_sal from emp where ename=spName; if v_sal :NEW.sal THEN DBMS_OUTPUT.PUT_LINE('工资减少'); ELSIF :OLD.sal < :NEW.sal THEN DBMS_OUTPUT.PUT_LINE('工资增加'); ELSE DBMS_OUTPUT.PUT_LINE('工资未作任何变动'); END IF; DBMS_OUTPUT.PUT_LINE('更新前工资 :' || :OLD.sal); DBMS_OUTPUT.PUT_LINE('更新后工资 :' || :NEW.sal); END; / --执行UPDATE查看效果 UPDATE emp SET sal = 3000 WHERE empno = '7788'; 6、需要对在表上进行DML操作的用户进行安全检查,看是否具有合适的特权。 Create
tab
le foo(a number); Create trigger biud_foo Before insert or update or delete On foo Begin If user not in (‘DONNY’) then Raise_application_error(-20001, ‘You don’t have access to modify this
tab
le.’); End if; End; / 即使SYS,SYSTEM用户也不能修改foo表。 2、 利用PL/
SQL
编写程序实现下列触发器 1)、编写一个数据库触发器,当任何时候某个部门从dept表中删除时,该触发器将从emp表中删除该部门的所有雇员。(要求:emp表、dept表均为复制后的表) 2)、创建一个触发器,当客户下完订单后,自动统计该订单的所有图书的价格总额。 3)、创建一个触发器,禁止客户在非工作时间(早上8:00前,晚上17:00后)下订单。 五、实验心得
基础和管理
17,377
社区成员
95,128
社区内容
发帖
与我相关
我的任务
基础和管理
Oracle 基础和管理
复制链接
扫一扫
分享
社区描述
Oracle 基础和管理
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章