.Net 中读写Oracle数据库的两种方式
昨天晚上往Oracle数据库里面保存一幅图片,算是很稀松平常的大字段操作,搞了半天就是没存进去,提示是 “System.Data.OleDb.OleDbException: ORA-01008: 并非所有变量都已关联”。本以为是OleDbParameter的写法不对,到CSDN上一查,问题出在驱动程序上:把“provider= MSDAORA.1;”改为“provider='OraOleDb.Oracle';”,问题解决。 总结一下在 .Net 中读写Oracle数据库常用两种方式:OracleClient和OleDb,其中OleDb的方式根据驱动程序的不同又有两种。 1. OracleClient方式,是微软专门针对Oracle数据
Oracle Temporary Tablespace
SQL> alter tablespace temp add tempfile '/data/oradata/devdb3/temp01.dbf' size 50m autoextend on;SQL> alter database tempfile '/data/oradata/devdb3/temp02.dbf' drop ;SQL> alter tablespace temp add tempfile '/data/oradata/devdb3/temp02.dbf' reuse;SQL> alter database tempfile '/data/oradata/devdb3/temp02.dbf' drop including datafiles;[@more@]
Relocated Data file
SELECT * FROM DBA_DATA_FILESselect * from dba_temp_filesSQL> alter tablespace my_TABLESPACE read only;SQL> !cp -p /data/oradata/ndrs/my_TABLESPACE01.dbf /opt/oracle/ndrs/.SQL> alter tablespace my_TABLESPACE offline;SQL> alter database rename file '/data/oradata/ndrs/my_TABLESPACE01.dbf' to '/opt/oracle/ndrs/my_TABLESPACE01.dbf';SQL> alter tablespace my_TABLESPACE online;SQL> alter tablespace my_TABLESPACE read write;SQL> alter database backup controlfile to trace;SQL> !
Shared_Pool
v$sgastat 中shared pool miscellaneous 值每天都在增长相应shared pool free 的值一直在减少,造成最后没有free 空间,没发连接数据库的情况。 The most common cause is SQLs not using bind variables. alter system flush shared_pool periodically gives you relief temporarily, or set cursor_sharing to force (for 8i) if their bugs don't bother you. But the ultimate solution is to ask your developers to use bind variables. If the code is from third-party (meaning you can't control), that's out of the
WEB SITE
http://security.zz.ha.cn/http://www.linuxeden.comhttp://www.xfocus.net[@more@]
Network:Tools: netsh
在DOS命令行状态下,输入字符串命令“netsh -c interface dump>c:net1.txt”,单击回车键后,当前工作站的网络配置信息,就全部被保存到C盘net1.txt文件中了(该文件保存着网络1环境中的上网参数);下面,打开net1.txt文件,你可以看到如图5所示的配置信息,包括工作站的IP地址、掩码IP地址、网关IP地址等。现在,你可以用笔记本电脑可能使用到的其他网络环境中的配置参数,替换这里的对应参数,其余内容保持不变,然后再将该文本文件另存为“net2.txt”(该文件保存着网络2环境中的上网参数);同样地,你可以生成net3.txt、net4.txt
Solaris:Freeware:Download
http://www.download-ftp-center.com/http_repository_access/mirrors/sunfreeware.com/pub/freeware/http://www.download-ftp-center.com/http_repository_access/mirrors/sunfreeware.com/pub/freeware/sparc/5.8/x86: http://solaris.tophk.net/index.php[@more@]
Solaris cmd: find
find /path/dir1 -name "xxxx.yyy" -exec mv {} ./path/dir2 ; find ./ -mtime +1 -print find /path/dir1 -mtime +46 -exec mv {} /path/dir2 ;如何查所有非*.c的文件呢? find / -name "*.c" -prune -o -printfind . ! -name *.c 目录树小,可以用: grep xxx `find .` 目录树大: find . -type f -print | xargs grep xxx find . -type f -size +10000 -exec ls -al {} ;find . -atime +1 -type f - exec mv {} TMP ; # mv files older then 1 day to dir TMPfind . -name "-F" -exec rm {} ; &nbs
Solaris平台下的硬盘增设方法
Solaris平台下的硬盘增设方法大致如下: 1. 关闭系统,进入PROM状态 % init 0 ok (PROM状态提示) 2. 在PROM状态提示符下确认当前系统所连接的SCSI设备状况 ok probe-scsi 或 ok probe-scsi-all 这时,系统将显示所能识别的SCSI设备极其设备号(Target ID).如果新连接的硬 盘之信息没有出现时,请按下述方法进行确认. 1) 检查设备号是否重复? Target-ID SunOS 4.xSolaris 2.x 3 内藏硬盘 1 硬盘 通常与SunOS 4.x一致. 2 硬盘 当ID不重复时, 4,5也 0 硬盘 可以用于硬
Solaris CPU offline/ online
psrinfo -vpsradmpsrsetprsradm -f procid 将处理器procid设为离线.-n 让指定处理器在线.-a 作用于所有处理器.-v 对每次操作尝试的结果显示一条信息.只有超级用户和系统管理员才能执行这条命令,如果有LWP被绑定在某处理器上,那么该处理器不能设为离线.From the OK prompt runOK .asr // not the preceding '.'To generate a listing of system devices. You will see the cpu in question labelled as 'CPU1'.EnterOK asr-disable cpu1 Verify the that CPU1 has been disabled by again running '.asr'. To enable the CPU1 again simple
SQL Tuning
select sql_text from v$sqltext a where a.hash_value = (select sql_hash_value from v$session b where b.sid='&sid') order by piece ascSQL> set autotrace trace explainSQL> select index_name,column_name from user_ind_columns where table_name ='my_tables';SQL> alter session set sql_trace=true;SQL> exec dbms_system.set_sql_trace_in_session(7,284,true)[@more@]
Analysing locking issues with LOGMINER
Deadlock example ---------------- One process does the following: SQL> update dept set dname = 'dqkl' where deptno = 10; 1 row updated. SQL> delete emp where empno = 7934; 1 row deleted. Another process does the following and falls on a deadlock situation SQL> update emp set sal = sal * 1.1 where empno = 7934; 1 row updated. SQL> delete dept where deptno = 10; delete dept where deptno = 10 * ERROR at line 1: ORA-00060: deadlock detected while waiting for resour
Temporary Tablespace
Creation of a TEMPORARY Tablespace----------------------------------SQL> create TEMPORARY tablespace temp_tempfile_local2 TEMPFILE '/ora/V817/temp_temp.dbf' size 100M3 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;----------------------------------SQL> create tablespace TEMP_DATAFILE_DICT2 datafile '/tcase/oradata/V901/temp_data.dbf' size 100M3 TEMPORARY;Tablespace created.Tempfiles Removal---------------------------a. You cannot remove datafiles from a tablespace until you drop the tablespa
UltraEdit: config as PL/SQL code editor
Advanced -> Configration -> Syntax HighlightingAppend below to file C:Program FilesUltraEditwordfile.txt/L8"PL/SQL" Nocase Line Comment = -- Block Comment On = /* Block Comment Off = */ File Extensions = SQL/Delimiters = ~!%@^&*()-+=|/{}[]:;"'<> , .?/Function String = "%[A-Z _]*[~s]+(*)"/C1 "Keywords"ABORT ACCEPT ACCESS ADD ALL ALTER AND ANY ARRAY ARRAYLEN AS ASC ASSERT ASSIGN AT AUDIT AUTHORIZATION AVGBASE_TABLE BEGIN BETWEEN BINARY_INTEGER
Oracle10g: New Features for Administrators
Chapter 1 - Installation1. Installation New Feature Support:1.1. Database storage operations - file system - automatic Storage Management - raw devices1.2. Database management options - enterprise manager Grid Control - enterprise manager Database Control1.3. Database Backup and recovery options1.4. E-mail notification options1.5. Cluster ready services1.6. Cloning[@more@]
Solaris System Commands
1. Check for CPU type and speed root@mumu# psrinfo -vStatus of processor 0 as of: 10/18/04 14:08:38 Processor has been on-line since 09/20/04 08:25:08. The sparcv9 processor operates at 480 MHz, and has a sparcv9 floating point processor.Status of processor 1 as of: 10/18/04 14:08:38 Processor has been on-line since 09/20/04 08:25:09. The sparcv9 processor operates at 480 MHz, &
resize Online Redo Logfile
sql> startup open restrict;sql> select group#, bytes, status from v$log;sql> select group#, member from v$logfile;sql> alter database add logfile group 4 '/usr/oracle/dbs/log4jinn.dbf' size 100m;...sql> alter system switch logfile;sql> alter database drop logfile group 1;...sql> !rm /usr/oracle/dbs/log1jinn.dbf';sql> alter ssytem disable restricted session; [@more@]
turn Archiving ON or OFF
turn on:1. Enabling Automatic Archiving1a. alter system archive log start;1b. alter system set log_archive_start = true scope=spfile; => restart db2. Changing the Database Archiving ModeLOG_ARCHIVE_START => manual or autoLOG_ARCHIVE_DESTLOG_ARCHIVE_FORMAT => arch%S.%T.arcsql> startup mountsql> alter database archivelog;sql> alter database open;3. Archive commandssql> archive log listsql> archive log all,sql> alter system switch log;trun off:1a. alter system archiv
Function Based Index
Function Based Index Step by Step alter session set query_rewrite_enabled=true; alter session set query_integrity=trusted; create index on orders(trunc(time)); analyze table orders compute statistics; select /* +index(orders) */ * from orders where trunc(time)=trunc(sysdate);[@more@] need to research more ...
Connecting to Oracle through JDBC - Oracle 9i Java Programming
DBConnection.javaimport java.sql.DriverManager;import java.sql.Connection;import java.sql.SQLException;import java.sql.Statement;import java.sql.ResultSet;public class DBConnection{ public static void main(String args[]){ if (args.length < 3){ System.out.println("Syntax: DBConnection [url] [username] [password]"); System.exit(-1); } String urlurl = args[0]; String username = args[1]; String password =