sql/pl基本操作】【登陆】【格式化table显示】【两个数据库表复制数据】【格式化输出】
2013-11-04 00:55
597 查看
sqlplus /nolog sqlplus hugh1216/hugh@hughdb as sysdba exit quit select to_char(SYSDATE) FROM DUAL; select to_char(sysdate,'HH12:MI:SS') from dual; disc --断开连接 disconnect 表空间 select * from dba_tablespaces select * from dba_tables where TABLESPACE_NAME='UNDOTBS1' SELECT * FROM DBA_TABLES WHERE OWNER='HUGH' SELECT * FROM HUGH.ACADEMY select * from dba_users select * from user_ts_quotas sqlplus 命令 tttile left 'xxxxxxxx' col academy_id heading 'id' justify left format '9999' col academy_name heading 'academy' format 'A10' justify center select * from hugh.academy; clear col clear sql clear screen 两个数据库表复制数据 copy from scott/hugh@orcl to hugh/hugh@hughdb replace dept using select * from scott.dept; select * from dba_tables where TABLE_NAME='DEPT' copy from hugh/hugh@hughdb create academy(academy_id,academy_name) using select deptno,dname from hugh.dept ---------覆盖的方式COPY~ copy from hugh/hugh@hughdb insert academy(academy_id,academy_name) using select deptno,dname from hugh.dept ---------追加的方式COPY~ define define deptno="10" select * from hugh.dept where deptno=&deptno; desc academy --------查询表结构 variable n number; execute :n :=1; host host dir set autocommit on set autotrace on set pagesize 24 show all show sga show spool show errors select academy_id||','||academy_name||',' from academy select * from global_name; show parameter global_name; select * from v$option; col value justify left format 'a25' col parameter justify left format 'a50' set linesize 76 ------a25+a50+1=76,当linesize<76,不能在sqplus中一行显示 备注 linesize 规定sqlplus窗口中一行的长度一定是linesize大小,也就是说当
相关文章推荐
- Oracle基本操作八:PL/SQL特殊数据类型%type %rowtype VARRAY TABLE RECORD
- mysql数据库常用的基本SQL语句--数据库表操作
- PL/SQL格式化SQL语句, 选中行高亮,双击即显示表数据,特殊Copy 等技巧
- python基本数据类型(三)-字符串拼接-格式化输出-深浅复制-python3笔记
- 数据结构中线性表的基本操作-合并两个线性表-依照元素升序排列
- 基本查询语句及利用SQL语句完成数据的添加、删除、修改操作
- sql 当中的 count 用法 及两个库复制数据时该列不能为空
- pl/sql 查询数据量大时, 怎么提高输出缓存大小?
- SQL基本操作---数据查询
- SQL的经典操作——批量复制同行的其它列数据到其它列数据
- SQL语句:在两个数据库间复制表结构和更新数据
- SQL语句:在两个数据库间复制表结构和数据数据库
- MySQL从入门到精通-数据库表基本操作
- 【数据结构与算法C】利用两个栈S1S2模拟一个队列,用栈的基本操作实线EnQueue,DeQueue,QueueEmpty
- iOS学习笔记---数据库SQLite3的基本操作并讲内容显示在tableView中
- SQL的基本操作(1.数据类型)
- Oracle10g技术问题总结(四)SQL的基本操作、脚本文件操作、数据的自动化导出
- Oracle在pl/sql中操作基本表 记录
- pl/sql入门第六章--数据操作和控制语言
- 4. 数据库表基本操作