- 浏览: 24949 次
最新评论
文章列表
// Buffer 常见方法:
// flip(): 写模式转换成读模式
// rewind() :将 position 重置为 0 ,一般用于重复读。
// clear() :清空 buffer ,准备再次被写入 (position 变成 0 , limit 变成 capacity) 。
// compact(): 将未读取的数据拷贝到 buffer 的头部位。
// mark() 、 reset():mark 可以标记一个位置, reset 可以重置到该位置。
// Buffer 常见类型: B ...
package com.security.dpi.das.fileprocess;
import java.util.LinkedList;
import java.util.Queue;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
//简单阻塞队列实现2
public class SimpleBlockingQ
{
public SimpleBlockingQ() ...
http://zhang-xzhi-xjtu.iteye.com/category/133743
9 查锁
select l.session_id sid,l.locked_mode lockmode,l.oracle_username db_user,l.os_user_name os_user,s.machine,s.schemaname,o.object_name tablename,q.sql_text
from v$locked_object l, v$session s, v$sql q, all_objects o
where l.session_id = s.sid
and s.type = 'USER' and s.sql_address = ...
su - oracle
sqlplus / as sysdba
shutdown immediate;
// 启动数据库
startup nomount;
alter database mount;
alter database open;
// 查询表空间文件
select file_name,tablespace_name,bytes/(1024*1024) from dba_data_files
where tablespace_name = 'TBS_DATA_SIG_USER_RPT1';
// 查询每一个表空间的大小和使用
select a.tablespace_name as ...
/**
* ��������Ƿ�Ϊһ��Ϸ���IP��ַ �±����ֶ��������ַ����������IP�û� 0.* 127.* 255.255.255.255
* 224.*���ϵģ������鲥�����ַ��Ҳ��������IP�û���
...
/**
* excludeAType=true ���Թ���A���127��ͷ��IP��ַ�����ⵥ��A06D18683
* @param strIp
* @param excludeAType
* @return
*/
public static long ipToLong(String strIp, boolean excludeAType)
{
if (!ipValid(strIp, excludeAT ...
package com.security.dpi.util;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
imp ...
/**
* @return the sqlLoadDirectory
*/
public String getSqlLoadDirectory()
{
return sqlLoadDirectory;
}
/**
* @return the passwd
*/
public String getPasswd()
{
return passwd;
}
/**
* @return the uName
*/
public String ...
/**
* 把sqlLoad失败的日志写到DAS日志文件中
* @param logFileName
*/
private void readSqlLoadErrLog(String logFileName)
{
BufferedReader reader = null;
try
{
reader = new BufferedReader(new FileReader(new File(logFileName)));
StringBuffer logSt ...
/**
* 获取文件头
*
* @param path
* @param tabName
* @return 返回文件头信息
* @throws IOException
*/
public String getColumn(String path) throws IOException
{
BufferedReader brFile = null;
File file = null;
String line = null;
try
...
private boolean ociSqlldr(String path, AbstractSqlLoad sqlload)
{
// 定义处理状态
boolean result = false;
try
{
sqlload.setDirectoryFile(getSqlLoadDirectory(), fileName,
getColumn(path));
// 设置用户名、密码、主机IP等参数
sqlload ...
/**
* 初始化入库文件的数据库相关信息
* @param fileName
* @param dbInfo
*/
public SqlLoad(String fileName, DBInfo dbInfo, String loadDirectory)
{
this.fileName = fileName;
// 配置数据库相关信息
dbType = dbInfo.getDbType();
host = DasUtil.longToIP(dbInfo.getIp());
...
/**
*
* SQL LOAD 上报数据类
* <p>
* detailed comment
* @author Administrator 2008-10-16
* @see
* @since 1.0
*/
public class SqlLoad implements DebugBean
{
/** 定义日至对象 */
private static final Log logger = LogFactory.getLog(SqlLoad.class);
/** 数据库类型 */
private int dbType;
...
public boolean isTimeOut()
{
return isTimeOut;
}
public String toString()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < cmdarray.length; i++)
{
sb.append(cmdarray[i]).append(" ");
}
return sb.toS ...