代码改变世界

阅读排行榜

oracle查询表信息(索引,外键,列等)

2012-05-13 00:09 by 终究难逃, 68367 阅读, 收藏,
摘要: oracle中查询表的信息,包括表名,字段名,字段类型,主键,外键唯一性约束信息,索引信息查询SQL如下,希望对大家有所帮助:1、查询出所有的用户表select * from user_tables 可以查询出所有的用户表select owner,table_name from all_tables; 查询所有表,包括其他用户表通过表名过滤需要将字母作如下处理select * from user_tables where table_name = upper('表名')因为无论你建立表的时候表名名字是大写还是小写的,create语句执行通过之后,对应的user_tables表中 阅读全文

ora-00054:resource busy and acquire with nowait specified解决方法

2012-05-26 23:58 by 终究难逃, 68023 阅读, 收藏,
摘要: 当某个数据库用户在数据库中插入、更新、删除一个表的数据,或者增加一个表的主键时或者表的索引时,常常会出现ora-00054:resource busy and acquire with nowait specified这样的错误。主要是因为有事务正在执行(或者事务已经被锁),所有导致执行不成功。1、用dba权限的用户查看数据库都有哪些锁select t2.username,t2.sid,t2.serial#,t2.logon_timefrom v$locked_object t1,v$session t2where t1.session_id=t2.sid order by t2.logon_ 阅读全文

ORACLE 10G 创建和查看表空间(临时表空间)名称及空间信息

2012-05-12 17:20 by 终究难逃, 15301 阅读, 收藏,
摘要: /*第1步:创建临时表空间 */create temporary tablespace tv_temp tempfile 'D:\orcldata\tv\temp.dbf' size 20480M autoextend on next 500M maxsize 30720Mextent management local; /*第2步:创建数据表空间 */create tablespace tv_data nologgingdatafile 'D:\orcldata\tv\data.dbf' size4096M autoextend on next200M max 阅读全文

Java 对Oracle Clob(大字符串)格式的操作 增改查

2012-04-25 21:06 by 终究难逃, 14018 阅读, 收藏,
摘要: package com.study.db;import java.io.FileInputStream;import java.io.IOException;import java.io.Reader;import java.io.Writer;import java.sql.Connection;import java.sql.DriverManager;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.sql.Statement;impor 阅读全文

oracle 处理temp 表空间爆长的问题

2012-05-15 00:23 by 终究难逃, 13784 阅读, 收藏,
摘要: 首先看temp ts,以下操作会使用temp表空间:- build index.- ORDER BY or GROUP BY - DISTINCT.- UNION & INTERSECT & MINUS- Sort-Merge joins.- Analyze正常来说,在完成Select语句、create index等一些使用TEMP表空间的排序操作后,Oracle是会自动释放掉临时段a的。但有些有侯我们则会遇到临时段没有被释放,TEMP表空间几乎满的状况,甚至是我们重启了数据库仍没有解决问题在v$sort_segment字典中,我们可能看到temp的详细的使用情况,SQL> 阅读全文