Monday, February 6, 2012 8:02

‘Oracle’ News

Subscribe to RSS feed

Register table issue caused by using wrong column type in SQL

Tuesday, December 7, 2010 11:54

Wow, how long the title is! :) I came across one strange issue today (actually I found this last Friday, but you know weekend coming, hehehe). When using the update DQL to fill up one new column in the registered table, there are always lots of blanks appended. The root cause after doing ...

Tagged with: ,

Get definition for view in Oracle

Friday, April 23, 2010 9:19

set LONG 10000 select TEXT from ALL_VIEWS where view_name = 'MY_VIEW'; Line one must be at least the size of the statement used to create the view. Either pick a really ...

Tagged with: ,

Oracle Tuning Documentum Server

Monday, December 7, 2009 14:44

Modifying the dmcl.ini File on the Oracle WebCenter Content Service for Documentum Host On all computers that host the Oracle WebCenter Content Service for Documentum, you can increase the max_session_count variable in the dmcl.ini file to allow for additional concurrent sessions. By default, the ...

Tagged with: ,

Oracle Session Statistics

Monday, December 7, 2009 13:55

Here are some scripts related to Session Statistics . Session I/O By User SESSION I/O BY USER NOTES: Username - Name of the Oracle process user OS User - Name of the operating system user PID - Process ID of the session SID - Session ID of the session Serial# - Serial# of the session Physical Reads - ...

Tagged with:

spool命令和使用select语句批量动态生成sql语句

Friday, November 27, 2009 15:16

今天一个任务是从两张表中用sql语句导出些数据,并且提交这些数据的插入语句。上网查询后找到个方法,例子如下: spool c:\data.sql; select 'insert into table_name values('''||field_1||''','''||field_2||''');'from table_name where field_n=some_conditon; spool off; 从这个方案中引申学到两条:spool命令和使用select语句批量拼装sql语句 spool命令 1 Oracle的spool命令可以用来将数据export出来到文本文件。Oracle的Import/Export命令用于备份和恢复比较有效,但对于一些临时数据量的导出,Export不好用,甚至不可用。在这里,就是spool的发挥之地了。 2Spool一般使用格式为spool [filepath]filename;       其他sql语句;spool off; 要输出的内容都在spool语句中包含; 3 spool还有些其他控制命令: set pagesize 0               --设置页面大小, 0表示无限制,如果设置为10,则10行数据后出现一空行 set num 18                  --设置数字的长度,如果不够大,则用科学记数法显示 set heading off             --设置不要题头,则不出现select的field list set feedback off           --设置不需要返回信息, 比如" 100 rows selected“ set term off                 -- set trimspool on           --trim 4 如果在sqlplus中直接使用sql语句,则导出的数据文件中会包含spool语句中使用的sql语句,如果不想让生成这些可把要使用的sql语句存在一个文件中再在sqlplus中执行此文件即可。 使用select语句批量拼装sql语句 仿照select 'insert into table_name values('''||field_1||''','''||field_2||''');'from table_name where field_n=some_conditon;可联想批量生成其他sql语句,例如drop、update、delete语句。其中||为连接符号,三个单引号最后生成一个单引号。

Tagged with:

SSH 处理Oracle Clob

Wednesday, November 18, 2009 13:03

Uninstall Oracle

Tuesday, November 17, 2009 23:24

It sure is easier to remove oracle products than to add them.... The method suggested, using Oracle Universal installer to remove the product, is the safest method, and the only reliable means if you have several different ORACLE-HOMEs on you server. However, if you want to remove all oracle software from your ...

Oracle Flashback Deleted Table

Tuesday, November 17, 2009 23:21

SQL> create table tst (col varchar2(10), row_chng_dt date); Table created. SQL> insert into tst values ('Version1', sysdate); 1 row created. SQL> select * from tst ; COL ROW_CHNG ---------- -------- Version1 16:10:03 SQL> drop table tst; Table dropped. SQL> select object_name, original_name, type, can_undrop as "UND", can_purge as "PUR", droptime ...

Oracle EXP/IMP FAQs

Tuesday, November 17, 2009 23:17

Can one import tables to a different tablespace?ITPUB个人空间g!] g4`6k;W)a Oracle offers no parameter to specify a different tablespace to import data into. Objects will be re-created in the tablespace they were originally exported from. One ...

Oracle Recompile Invalid Objects

Tuesday, November 17, 2009 23:15

Recompile the invalid objects: SET NEWPAGE 0 SET SPACE 0 SET LINESIZE 80 SET PAGESIZE 0 SET ECHO OFF SET FEEDBACK OFF SET HEADING OFF SET MARKUP HTML OFF SET ESCAPE \ SPOOL RECOMPILE.SQL select 'ALTER VIEW ', object_name, 'compile \;' from user_objects where status = 'INVALID' and object_type='VIEW'; SPOOL OFF Reference: http://www.oracle-base.com/articles/misc/RecompilingInvalidSchemaObjects.php