ALTER SESSION SET TRACEFILE_IDENTIFIER ='my_trace_id';
q样你的session产生的trace file׃(x)以设|的identifier为后~?/p>
SQL>alter session set tracefile_identifier='test_identifier'; Session altered. SQL>alter session set sql_trace=true; Session altered. SQL>select*from dual; D - X SQL>alter session set sql_trace=false; Session altered.
--用SampleQ?/span> select A.id,A.name from A sample block(20),B where A.id=B.id --用RownumQ?/span> select A.id,A.name from (select a.id,a.name from a where rownum<100) A,B where A.id=B.id
]]>ETL时先disable外键U束再load数据http://www.aygfsteel.com/xichengmylove/archive/2008/01/15/175486.html翼渐丰翼渐丰Tue, 15 Jan 2008 08:12:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2008/01/15/175486.htmlhttp://www.aygfsteel.com/xichengmylove/comments/175486.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2008/01/15/175486.html#Feedback4http://www.aygfsteel.com/xichengmylove/comments/commentRss/175486.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/175486.htmlFlexibility for Data Loads and Identification of Integrity Violations You can disable integrity constraints temporarily so that large amounts of data can be loaded without the overhead of constraint checking. When the data load is complete,you can easily enable the integrity constraints, and you can automatically report any new rows that violate integrity constraints to a separate exceptions table.
看来oracleq点上做的比较完善,q可以将q反完整性约束的数据自动记录C个exception表中?
]]>删除重复数据?U方?/title>http://www.aygfsteel.com/xichengmylove/archive/2008/01/08/173544.html翼渐丰翼渐丰Tue, 08 Jan 2008 02:04:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2008/01/08/173544.htmlhttp://www.aygfsteel.com/xichengmylove/comments/173544.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2008/01/08/173544.html#Feedback0http://www.aygfsteel.com/xichengmylove/comments/commentRss/173544.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/173544.html今天google分析函数row_number()的时候发现的Q觉得很好:(x)
表demo是重复拷贝自dba_objectsQ有88万左叻I不重复的?7323Q没有烦(ch)?br style="font-family: " />
Ҏ(gu)一Qdelete from demo a where a.rowid <> (select max(rowid) from demo b where
b.object_id=a.object_id);
耗时Q几个小时以?
Ҏ(gu)二:(x) delete from demo where rowid in
(select rid from
(select rowid rid,row_number() over(partition by object_id order by rowid) rn
from demo)
where rn <> 1 );
耗时Q?0U?br style="font-family: " />
Ҏ(gu)三:(x) create table demo2 as
select object_id,owner... from
(select demo.*,row_number() over(partition by object_id order by rowid) rn from demo)
where rn = 1;
truncate table demo; insert into demo select * from demo2; drop table demo2;
p时Q?10U,适合大数据量的情况,产生更少回滚量;
]]>datastage中Orchadmin命o(h)的用(转)(j) http://www.aygfsteel.com/xichengmylove/archive/2007/08/08/135256.html翼渐丰翼渐丰Wed, 08 Aug 2007 07:37:00 GMThttp://www.aygfsteel.com/xichengmylove/archive/2007/08/08/135256.htmlhttp://www.aygfsteel.com/xichengmylove/comments/135256.htmlhttp://www.aygfsteel.com/xichengmylove/archive/2007/08/08/135256.html#Feedback2http://www.aygfsteel.com/xichengmylove/comments/commentRss/135256.htmlhttp://www.aygfsteel.com/xichengmylove/services/trackbacks/135256.htmlOrchadmin is a command line utility provided by datastage to research on data sets. The general callable format is : $orchadmin [options] [descriptor file]
1. Before using orchadmin, you should make sure that either the working directory or the $APT_ORCHHOME/etc contains the file “config.apt” OR
The environment variable $APT_CONFIG_FILE should be defined for your session. Orchadmin commands
The various commands available with orchadmin are 1. CHECK: $orchadmin check
Validates the configuration file contents like , accesibility of all nodes defined in the configuration file, scratch disk definitions and accesibility of all the nodes etc. Throws an error when config file is not found or not defined properly
2. COPY : $orchadmin copy Makes a complete copy of the datasets of source with new destination descriptor file name. Please not that
a. You cannot use UNIX cp command as it justs copies the config file to a new name. The data is not copied.
b. The new datasets will be arranged in the form of the config file that is in use but not according to the old confing file that was in use with the source.
3. DELETE : $orchadmin <> [-f -x] descriptorfiles…. The unix rm utility cannot be used to delete the datasets. The orchadmin delete or rm command should be used to delete one or more persistent data sets. -f options makes a force delete. If some nodes are not accesible then -f forces to delete the dataset partitions from accessible nodes and leave the other partitions in inaccesible nodes as orphans. -x forces to use the current config file to be used while deleting than the one stored in data set.
4. DESCRIBE: $orchadmin describe [options] descriptorfile.ds This is the single most important command. 1. Without any option lists the no.of.partitions, no.of.segments, valid segments, and preserve partitioning flag details of the persistent dataset. -c : Print the configuration file that is written in the dataset if any -p: Lists down the partition level information. -f: Lists down the file level information in each partition -e: List down the segment level information . -s: List down the meta-data schema of the information. -v: Lists all segemnts , valid or otherwise -l : Long listing. Equivalent to -f -p -s -v -e
5. DUMP: $orchadmin dump [options] descriptorfile.ds The dump command is used to dump(extract) the records from the dataset. Without any options the dump command lists down all the records starting from first record from first partition till last record in last partition. -delim ‘’ : Uses the given string as delimtor for fields instead of space. -field : Lists only the given field instead of all fields. -name : List all the values preceded by field name and a colon -n numrecs : List only the given number of records per partition. -p period(N) : Lists every Nth record from each partition starting from first record. -skip N: Skip the first N records from each partition. -x : Use the current system configuration file rather than the one stored in dataset.
6. TRUNCATE: $orchadmin truncate [options] descriptorfile.ds Without options deletes all the data(ie Segments) from the dataset. -f: Uses force truncate. Truncate accessible segments and leave the inaccesible ones. -x: Uses current system config file rather than the default one stored in the dataset. -n N: Leaves the first N segments in each partition and truncates the remaining.
7. HELP: $orchadmin -help OR $orchadmin -help Help manual about the usage of orchadmin or orchadmin commands