Does oracle record table drops/purges ?
Hello,
I am using Oracle 11.2.0.3 Enterprise Edition and recently found certain users tables are missing. Does oracle record anything with respect to tables purged ? And in my case these are external tables. Pls revert back if I have to lookup in alert log or any v$ view. As far as I know if table is just dropped it can be found in dba_recyclebin ( not sure about retention) but I didn't find any information in that view. Any help would be great ! Thanks
Hi,
I am using Oracle 11.2.0.3
By default, some DDL commands are audited by default in Oracle 11g.
SQL> SELECT privilege from dba_priv_audit_opts where user_name is NULL;
PRIVILEGE
CREATE EXTERNAL JOB
CREATE ANY JOB
GRANT ANY OBJECT PRIVILEGE
EXEMPT ACCESS POLICY
CREATE ANY LIBRARY
GRANT ANY PRIVILEGE
DROP PROFILE
ALTER PROFILE
DROP ANY PROCEDURE
ALTER ANY PROCEDURE
CREATE ANY PROCEDURE
ALTER DATABASE
GRANT ANY ROLE
CREATE PUBLIC DATABASE LINK
DROP ANY TABLE
ALTER ANY TABLE
CREATE ANY TABLE
DROP USER
ALTER USER
CREATE USER
CREATE SESSION
AUDIT SYSTEM
ALTER SYSTEM
So, maybe you can try find out if another user dropped your tables making use of DROP ANY TABLE privilege. For this, you need to take a look at DBA_AUDIT_TRAIL view:
select * from dba_audit_trail where action_name = 'DROP TABLE' order by 5 desc;
Cheers
Legatti
Similar Messages
-
What is the version of grant alter table, drop table to user in Oracle 10g?
Hi,
Oracle support "grant alter table and drop table" before, but I get the "invalid privilege" error in Oracle 10g. Oracle 10g have the "DROP ANY TABLE" and "Alter any table". Is these two means can drop and alter tables belonging to other users? How do I grant the total control (CRUD) of tables in the owner's schema to the owner in Oracle10g?
Thanks,
JiangCREATE TABLE privilege grants complete control on owner's tables :
SYS@db102 SQL> create user test01 identified by test01;
User created.
SYS@db102 SQL> grant create session, create table to test01;
Grant succeeded.
SYS@db102 SQL> alter user test01 quota unlimited on users;
User altered.
SYS@db102 SQL> conn test01/test01
Connected.
TEST01@db102 SQL> create table test(a number);
Table created.
TEST01@db102 SQL> alter table test add(b varchar2(100));
Table altered.
TEST01@db102 SQL> drop table test purge;
Table dropped.
TEST01@db102 SQL> -
Hi Everyone,
My Jdev version is 11.1.2.3.0.
I have developed many ADF applications in this version itself by setting time zone as -Duser.timezone="+05:30" and all were running fine.
But Jdeveloper got crashed so i reinstalled the same version but now none of the applications are running.
Its showing error as below:
oracle.jbo.JboException: JBO-29112: The time zone 'GMT+05:30' defined in adf-config.xml or TimeZone.getDefault().getID() does not exist in your Oracle database table V$TIMEZONE_NAMES. Please set an available time zone in your TZ environment variable or user.timezone Java system property.
What to do now?
how will i know wat time zone should be set?
please help the needful...
Thanks.Check if www.jobinesh.com/2010/12/why-do-i-get-oraclejbojboexception-jbo.html helps.
Timo -
Does IXOS record the name of the file uploaded in a R3 table?
Does IXOS record the name of the file uploaded in a R3 table?
Hi Christiana,
When you perform a file upload to IXOS, the filename is not being record. The archivelink table (toa*) will keep track the document type of the file only.
Hope this help.
thanks,
Jess -
Like % in a query running on an Oracle Apps table with 8 million records
I am running the below query. As per the explain plan it is using the index on organization_id and inventory_item_id.
select segment1 from mtl_system_items where organization_id = 100 and inventory_item_id like '123456%'
It takes about 15 min to run this query which is a long time as this query returns values to the frontend created in asp. The webpage would time out by the time this query completes running. do you have any suggestions on how to run this query faster?It is an oracle apps table. below is the structure -
Name Null? Type
INVENTORY_ITEM_ID NOT NULL NUMBER
ORGANIZATION_ID NOT NULL NUMBER
LAST_UPDATE_DATE NOT NULL DATE
LAST_UPDATED_BY NOT NULL NUMBER
CREATION_DATE NOT NULL DATE
CREATED_BY NOT NULL NUMBER
LAST_UPDATE_LOGIN NUMBER
SUMMARY_FLAG NOT NULL VARCHAR2(1)
ENABLED_FLAG NOT NULL VARCHAR2(1)
START_DATE_ACTIVE DATE
END_DATE_ACTIVE DATE
DESCRIPTION VARCHAR2(240)
BUYER_ID NUMBER(9)
ACCOUNTING_RULE_ID NUMBER
INVOICING_RULE_ID NUMBER
SEGMENT1 VARCHAR2(40)
SEGMENT2 VARCHAR2(40)
SEGMENT3 VARCHAR2(40)
SEGMENT4 VARCHAR2(40)
SEGMENT5 VARCHAR2(40)
SEGMENT6 VARCHAR2(40)
SEGMENT7 VARCHAR2(40)
SEGMENT8 VARCHAR2(40)
SEGMENT9 VARCHAR2(40)
SEGMENT10 VARCHAR2(40)
SEGMENT11 VARCHAR2(40)
SEGMENT12 VARCHAR2(40)
SEGMENT13 VARCHAR2(40)
SEGMENT14 VARCHAR2(40)
SEGMENT15 VARCHAR2(40)
SEGMENT16 VARCHAR2(40)
SEGMENT17 VARCHAR2(40)
SEGMENT18 VARCHAR2(40)
SEGMENT19 VARCHAR2(40)
SEGMENT20 VARCHAR2(40)
ATTRIBUTE_CATEGORY VARCHAR2(30)
ATTRIBUTE1 VARCHAR2(150)
ATTRIBUTE2 VARCHAR2(150)
ATTRIBUTE3 VARCHAR2(150)
ATTRIBUTE4 VARCHAR2(150)
ATTRIBUTE5 VARCHAR2(150)
ATTRIBUTE6 VARCHAR2(150)
ATTRIBUTE7 VARCHAR2(150)
ATTRIBUTE8 VARCHAR2(150)
ATTRIBUTE9 VARCHAR2(150)
ATTRIBUTE10 VARCHAR2(150)
ATTRIBUTE11 VARCHAR2(150)
ATTRIBUTE12 VARCHAR2(150)
ATTRIBUTE13 VARCHAR2(150)
ATTRIBUTE14 VARCHAR2(150)
ATTRIBUTE15 VARCHAR2(150)
PURCHASING_ITEM_FLAG NOT NULL VARCHAR2(1)
SHIPPABLE_ITEM_FLAG NOT NULL VARCHAR2(1)
CUSTOMER_ORDER_FLAG NOT NULL VARCHAR2(1)
INTERNAL_ORDER_FLAG NOT NULL VARCHAR2(1)
SERVICE_ITEM_FLAG NOT NULL VARCHAR2(1)
INVENTORY_ITEM_FLAG NOT NULL VARCHAR2(1)
ENG_ITEM_FLAG NOT NULL VARCHAR2(1)
INVENTORY_ASSET_FLAG NOT NULL VARCHAR2(1)
PURCHASING_ENABLED_FLAG NOT NULL VARCHAR2(1)
CUSTOMER_ORDER_ENABLED_FLAG NOT NULL VARCHAR2(1)
INTERNAL_ORDER_ENABLED_FLAG NOT NULL VARCHAR2(1)
SO_TRANSACTIONS_FLAG NOT NULL VARCHAR2(1)
MTL_TRANSACTIONS_ENABLED_FLAG NOT NULL VARCHAR2(1)
STOCK_ENABLED_FLAG NOT NULL VARCHAR2(1)
BOM_ENABLED_FLAG NOT NULL VARCHAR2(1)
BUILD_IN_WIP_FLAG NOT NULL VARCHAR2(1)
REVISION_QTY_CONTROL_CODE NUMBER
ITEM_CATALOG_GROUP_ID NUMBER
CATALOG_STATUS_FLAG VARCHAR2(1)
RETURNABLE_FLAG VARCHAR2(1)
DEFAULT_SHIPPING_ORG NUMBER
COLLATERAL_FLAG VARCHAR2(1)
TAXABLE_FLAG VARCHAR2(1)
QTY_RCV_EXCEPTION_CODE VARCHAR2(25)
ALLOW_ITEM_DESC_UPDATE_FLAG VARCHAR2(1)
INSPECTION_REQUIRED_FLAG VARCHAR2(1)
RECEIPT_REQUIRED_FLAG VARCHAR2(1)
MARKET_PRICE NUMBER
HAZARD_CLASS_ID NUMBER
RFQ_REQUIRED_FLAG VARCHAR2(1)
QTY_RCV_TOLERANCE NUMBER
LIST_PRICE_PER_UNIT NUMBER
UN_NUMBER_ID NUMBER
PRICE_TOLERANCE_PERCENT NUMBER
ASSET_CATEGORY_ID NUMBER
ROUNDING_FACTOR NUMBER
UNIT_OF_ISSUE VARCHAR2(25)
ENFORCE_SHIP_TO_LOCATION_CODE VARCHAR2(25)
ALLOW_SUBSTITUTE_RECEIPTS_FLAG VARCHAR2(1)
ALLOW_UNORDERED_RECEIPTS_FLAG VARCHAR2(1)
ALLOW_EXPRESS_DELIVERY_FLAG VARCHAR2(1)
DAYS_EARLY_RECEIPT_ALLOWED NUMBER
DAYS_LATE_RECEIPT_ALLOWED NUMBER
RECEIPT_DAYS_EXCEPTION_CODE VARCHAR2(25)
RECEIVING_ROUTING_ID NUMBER
INVOICE_CLOSE_TOLERANCE NUMBER
RECEIVE_CLOSE_TOLERANCE NUMBER
AUTO_LOT_ALPHA_PREFIX VARCHAR2(30)
START_AUTO_LOT_NUMBER VARCHAR2(30)
LOT_CONTROL_CODE NUMBER
SHELF_LIFE_CODE NUMBER
SHELF_LIFE_DAYS NUMBER
SERIAL_NUMBER_CONTROL_CODE NUMBER
START_AUTO_SERIAL_NUMBER VARCHAR2(30)
AUTO_SERIAL_ALPHA_PREFIX VARCHAR2(30)
SOURCE_TYPE NUMBER
SOURCE_ORGANIZATION_ID NUMBER
SOURCE_SUBINVENTORY VARCHAR2(10)
EXPENSE_ACCOUNT NUMBER
ENCUMBRANCE_ACCOUNT NUMBER
RESTRICT_SUBINVENTORIES_CODE NUMBER
UNIT_WEIGHT NUMBER
WEIGHT_UOM_CODE VARCHAR2(3)
VOLUME_UOM_CODE VARCHAR2(3)
UNIT_VOLUME NUMBER
RESTRICT_LOCATORS_CODE NUMBER
LOCATION_CONTROL_CODE NUMBER
SHRINKAGE_RATE NUMBER
ACCEPTABLE_EARLY_DAYS NUMBER
PLANNING_TIME_FENCE_CODE NUMBER
DEMAND_TIME_FENCE_CODE NUMBER
LEAD_TIME_LOT_SIZE NUMBER
STD_LOT_SIZE NUMBER
CUM_MANUFACTURING_LEAD_TIME NUMBER
OVERRUN_PERCENTAGE NUMBER
MRP_CALCULATE_ATP_FLAG VARCHAR2(1)
ACCEPTABLE_RATE_INCREASE NUMBER
ACCEPTABLE_RATE_DECREASE NUMBER
CUMULATIVE_TOTAL_LEAD_TIME NUMBER
PLANNING_TIME_FENCE_DAYS NUMBER
DEMAND_TIME_FENCE_DAYS NUMBER
END_ASSEMBLY_PEGGING_FLAG VARCHAR2(1)
REPETITIVE_PLANNING_FLAG VARCHAR2(1)
PLANNING_EXCEPTION_SET VARCHAR2(10)
BOM_ITEM_TYPE NOT NULL NUMBER
PICK_COMPONENTS_FLAG NOT NULL VARCHAR2(1)
REPLENISH_TO_ORDER_FLAG NOT NULL VARCHAR2(1)
BASE_ITEM_ID NUMBER
ATP_COMPONENTS_FLAG NOT NULL VARCHAR2(1)
ATP_FLAG NOT NULL VARCHAR2(1)
FIXED_LEAD_TIME NUMBER
VARIABLE_LEAD_TIME NUMBER
WIP_SUPPLY_LOCATOR_ID NUMBER
WIP_SUPPLY_TYPE NUMBER
WIP_SUPPLY_SUBINVENTORY VARCHAR2(10)
PRIMARY_UOM_CODE VARCHAR2(3)
PRIMARY_UNIT_OF_MEASURE VARCHAR2(25)
ALLOWED_UNITS_LOOKUP_CODE NUMBER
COST_OF_SALES_ACCOUNT NUMBER
SALES_ACCOUNT NUMBER
DEFAULT_INCLUDE_IN_ROLLUP_FLAG VARCHAR2(1)
INVENTORY_ITEM_STATUS_CODE VARCHAR2(10)
INVENTORY_PLANNING_CODE NUMBER
PLANNER_CODE VARCHAR2(10)
PLANNING_MAKE_BUY_CODE NUMBER
FIXED_LOT_MULTIPLIER NUMBER
ROUNDING_CONTROL_TYPE NUMBER
CARRYING_COST NUMBER
POSTPROCESSING_LEAD_TIME NUMBER
PREPROCESSING_LEAD_TIME NUMBER
FULL_LEAD_TIME NUMBER
ORDER_COST NUMBER
MRP_SAFETY_STOCK_PERCENT NUMBER
MRP_SAFETY_STOCK_CODE NUMBER
MIN_MINMAX_QUANTITY NUMBER
MAX_MINMAX_QUANTITY NUMBER
MINIMUM_ORDER_QUANTITY NUMBER
FIXED_ORDER_QUANTITY NUMBER
FIXED_DAYS_SUPPLY NUMBER
MAXIMUM_ORDER_QUANTITY NUMBER
ATP_RULE_ID NUMBER
PICKING_RULE_ID NUMBER
RESERVABLE_TYPE NUMBER
POSITIVE_MEASUREMENT_ERROR NUMBER
NEGATIVE_MEASUREMENT_ERROR NUMBER
ENGINEERING_ECN_CODE VARCHAR2(50)
ENGINEERING_ITEM_ID NUMBER
ENGINEERING_DATE DATE
SERVICE_STARTING_DELAY NUMBER
VENDOR_WARRANTY_FLAG NOT NULL VARCHAR2(1)
SERVICEABLE_COMPONENT_FLAG VARCHAR2(1)
SERVICEABLE_PRODUCT_FLAG NOT NULL VARCHAR2(1)
BASE_WARRANTY_SERVICE_ID NUMBER
PAYMENT_TERMS_ID NUMBER
PREVENTIVE_MAINTENANCE_FLAG VARCHAR2(1)
PRIMARY_SPECIALIST_ID NUMBER
SECONDARY_SPECIALIST_ID NUMBER
SERVICEABLE_ITEM_CLASS_ID NUMBER
TIME_BILLABLE_FLAG VARCHAR2(1)
MATERIAL_BILLABLE_FLAG VARCHAR2(30)
EXPENSE_BILLABLE_FLAG VARCHAR2(1)
PRORATE_SERVICE_FLAG VARCHAR2(1)
COVERAGE_SCHEDULE_ID NUMBER
SERVICE_DURATION_PERIOD_CODE VARCHAR2(10)
SERVICE_DURATION NUMBER
WARRANTY_VENDOR_ID NUMBER
MAX_WARRANTY_AMOUNT NUMBER
RESPONSE_TIME_PERIOD_CODE VARCHAR2(30)
RESPONSE_TIME_VALUE NUMBER
NEW_REVISION_CODE VARCHAR2(30)
INVOICEABLE_ITEM_FLAG NOT NULL VARCHAR2(1)
TAX_CODE VARCHAR2(50)
INVOICE_ENABLED_FLAG NOT NULL VARCHAR2(1)
MUST_USE_APPROVED_VENDOR_FLAG NOT NULL VARCHAR2(1)
REQUEST_ID NUMBER
PROGRAM_APPLICATION_ID NUMBER
PROGRAM_ID NUMBER
PROGRAM_UPDATE_DATE DATE
OUTSIDE_OPERATION_FLAG NOT NULL VARCHAR2(1)
OUTSIDE_OPERATION_UOM_TYPE VARCHAR2(25)
SAFETY_STOCK_BUCKET_DAYS NUMBER
AUTO_REDUCE_MPS NUMBER(22)
COSTING_ENABLED_FLAG NOT NULL VARCHAR2(1)
AUTO_CREATED_CONFIG_FLAG NOT NULL VARCHAR2(1)
CYCLE_COUNT_ENABLED_FLAG NOT NULL VARCHAR2(1)
ITEM_TYPE VARCHAR2(30)
MODEL_CONFIG_CLAUSE_NAME VARCHAR2(10)
SHIP_MODEL_COMPLETE_FLAG VARCHAR2(1)
MRP_PLANNING_CODE NUMBER
RETURN_INSPECTION_REQUIREMENT NUMBER
ATO_FORECAST_CONTROL NUMBER
RELEASE_TIME_FENCE_CODE NUMBER
RELEASE_TIME_FENCE_DAYS NUMBER
CONTAINER_ITEM_FLAG VARCHAR2(1)
VEHICLE_ITEM_FLAG VARCHAR2(1)
MAXIMUM_LOAD_WEIGHT NUMBER
MINIMUM_FILL_PERCENT NUMBER
CONTAINER_TYPE_CODE VARCHAR2(30)
INTERNAL_VOLUME NUMBER
WH_UPDATE_DATE DATE
PRODUCT_FAMILY_ITEM_ID NUMBER
GLOBAL_ATTRIBUTE_CATEGORY VARCHAR2(150)
GLOBAL_ATTRIBUTE1 VARCHAR2(150)
GLOBAL_ATTRIBUTE2 VARCHAR2(150)
GLOBAL_ATTRIBUTE3 VARCHAR2(150)
GLOBAL_ATTRIBUTE4 VARCHAR2(150)
GLOBAL_ATTRIBUTE5 VARCHAR2(150)
GLOBAL_ATTRIBUTE6 VARCHAR2(150)
GLOBAL_ATTRIBUTE7 VARCHAR2(150)
GLOBAL_ATTRIBUTE8 VARCHAR2(150)
GLOBAL_ATTRIBUTE9 VARCHAR2(150)
GLOBAL_ATTRIBUTE10 VARCHAR2(150)
PURCHASING_TAX_CODE VARCHAR2(50)
The query is as below
select segment1 from mtl_system_items where organization_id = 100 and inventory_item_id like '123456%'
The explain plan is as below -
Plan
SELECT STATEMENT RULE
2 TABLE ACCESS BY INDEX ROWID INV.MTL_SYSTEM_ITEMS
1 INDEX RANGE SCAN NON-UNIQUE INV.MTL_SYSTEM_ITEMS_N1
The INV.MTL_SYSTEM_ITEMS_N1 index is created on
ORGANIZATION_ID and SEGMENT1 -
I have the bass connected to my imac with an interface.
I can hear the bass and I've clicked on the 'record' button, but the sound does not record.
Am I missing something ?
Please advise.
MikeDouble check all your audio settings.
System Preferences --> Sound --> Input should be set to your audio interface.
GB --> Preferences --> Audio/MIDI --> Input should be set to your audio interface.
With your track selected, open the Track Info pane, and select the Edit tab. Under input make sure that Mono 1 or 2 is selected (which number will depend on which input you plugged your bass cable into). -
Duplicate Rows In Oracle Pipelined Table Functions
Hi fellow oracle users,
I am trying to create an Oracle piplined table function that contains duplicate records. Whenever I try to pipe the same record twice, the duplicate record does not show up in the resulting pipelined table.
Here's a sample piece of SQL:
/* Type declarations */
TYPE MY_RECORD IS RECORD(
MY_NUM INTEGER
TYPE MY_TABLE IS TABLE OF MY_RECORD;
/* Pipelined function declaration */
FUNCTION MY_FUNCTION RETURN MY_TABLE PIPELINED IS
V_RECORD MY_RECORD;
BEGIN
-- insert first record
V_RECORD.MY_NUM = 1;
PIPE ROW (V_RECORD);
-- insert second duplicate record
V_RECORD.MY_NUM = 1;
PIPE ROW (V_RECORD);
-- return piplined table
RETURN;
END;
/* Statement to query pipelined function */
SELECT * FROM TABLE( MY_FUNCTION ); -- for some reason this only returns one record instead of two
I am trying to get the duplicate row to show up in the select statement. Any help would be greatly appreciated.Can you provide actual output from an SQL*Plus prompt trying this? I don't see the same behavior
SQL> SELECT * FROM V$VERSION;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> CREATE TYPE MY_RECORD IS OBJECT(MY_NUM INTEGER);
2 /
Type created.
SQL> CREATE TYPE MY_TABLE IS TABLE OF MY_RECORD;
2 /
Type created.
SQL> CREATE OR REPLACE FUNCTION MY_FUNCTION
2 RETURN MY_TABLE
3 PIPELINED
4 AS
5 V_RECORD MY_RECORD;
6 BEGIN
7 V_RECORD.MY_NUM := 1;
8 PIPE ROW(V_RECORD);
9
10 V_RECORD.MY_NUM := 1;
11 PIPE ROW(V_RECORD);
12
13 RETURN;
14 END;
15 /
Function created.
SQL> SELECT * FROM TABLE(MY_FUNCTION);
MY_NUM
1
1 -
Hi ,
we have a application for transfering data approx 1 million records from one schema to another. the data is first inserted into a table temporarily and after all the data is transfered the data is manually deleted from this table.
we are planning to replace this table with Oracle Temporary table. Can you please let us know if this would increase the performance and why???
Thanks & Regards
SarojIn theory it should, but you won't know whether the difference is going to be noticeable until you try.
Oracle has to do much less work with global temporary tables. It knows no other sessions will be using the data so it does not need to bother with rollback segments or locks. It also does not bother with redo because there will not be a need to recover. -
Teradat multiload script to oracle external table
Hi
Does anybody out there have a script handy that can semi-automate conversion of a teradata multiload script to oracle external table or sql loader.create table SYSTEM.C$_0STG_IN_FCST_PRS
C5_LOC VARCHAR2(12),
C4_PRODUCT VARCHAR2(10),
C3_TIME VARCHAR2(8),
C2_SLS_UNT_PSDF NUMBER(10),
C1_FCST_RLS_DT VARCHAR2(8)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY dat_dir
ACCESS PARAMETERS
RECORDS DELIMITED BY NEWLINE
CHARACTERSET 'WE8ISO8859P1'
STRING SIZES ARE IN CHARACTERS
BADFILE 'rdf_psfc.txt_%a.bad'
LOGFILE 'rdf_psfc.txt_%a.log'
DISCARDFILE 'rdf_psfc.txt_%a.dsc'
SKIP 0
FIELDS
MISSING FIELD VALUES ARE NULL
C5_LOC POSITION(1:12),
C4_PRODUCT POSITION(13:22),
C3_TIME POSITION(23:30),
C2_SLS_UNT_PSDF POSITION(31:40),
C1_FCST_RLS_DT POSITION(41:48)
LOCATION ('rdf_psfc.txt')
PARALLEL
REJECT LIMIT UNLIMITED
NOLOGGING -
Selecting Records from 125 million record table to insert into smaller table
Oracle 11g
I have a large table of 125 million records - t3_universe. This table never gets updated or altered once loaded, but holds data that we receive from a lead company.
I need to select records from this large table that fit certain demographic criteria and insert those into a smaller table - T3_Leads - that will be updated with regard to when the lead is mailed and for other relevant information.
My question is what is the best (fastest) approach to select records from this 125 million record table to insert into the smaller table. I have tried a variety of things - views, materialized views, direct insert into smaller table...I think I am probably missing other approaches.
My current attempt has been to create a View using the query that selects the records as shown below. Then use a second query that inserts into T3_Leads from this View V_Market. This is very slow. Can I just use an Insert Into T3_Leads with this query - it did not seem to work with the WITH clause? My Index on the large table is t3_universe_composite and includes zip_code, address_key, household_key.
CREATE VIEW V_Market as
WITH got_pairs AS
SELECT /*+ INDEX_FFS(t3_universe t3_universe_composite) */ l.zip_code, l.zip_plus_4, l.p1_givenname, l.surname, l.address, l.city, l.state, l.household_key, l.hh_type as l_hh_type, l.address_key, l.narrowband_income, l.p1_ms, l.p1_gender, l.p1_exact_age, l.p1_personkey, e.hh_type as filler_data, 1.p1_seq_no, l.p2_seq_no
, ROW_NUMBER () OVER ( PARTITION BY l.address_key
ORDER BY l.hh_verification_date DESC
) AS r_num
FROM t3_universe e
JOIN t3_universe l ON
l.address_key = e.address_key
AND l.zip_code = e.zip_code
AND l.p1_gender != e.p1_gender
AND l.household_key != e.household_key
AND l.hh_verification_date >= e.hh_verification_date
SELECT *
FROM got_pairs
where l_hh_type !=1 and l_hh_type !=2 and filler_data != 1 and filler_data != 2 and zip_code in (select * from M_mansfield_02048) and p1_exact_age BETWEEN 25 and 70 and narrowband_income >= '8' and r_num = 1
Then
INSERT INTO T3_leads(zip, zip4, firstname, lastname, address, city, state, household_key, hh_type, address_key, income, relationship_status, gender, age, person_key, filler_data, p1_seq_no, p2_seq_no)
select zip_code, zip_plus_4, p1_givenname, surname, address, city, state, household_key, l_hh_type, address_key, narrowband_income, p1_ms, p1_gender, p1_exact_age, p1_personkey, filler_data, p1_seq_no, p2_seq_no
from V_Market;I had no trouble creating the view exactly as you posted it. However, be careful here:
and zip_code in (select * from M_mansfield_02048)
You should name the column explicitly rather than select *. (do you really have separate tables for different zip codes?)
About the performance, it's hard to tell because you haven't posted anything we can use, like explain plans or traces but simply encapsulating your query into a view is not likely to make it any faster.
Depending on the size of the subset of rows you're selecting, the /*+ INDEX hint may be doing your more harm than good. -
Finding exact time for table drop
Hi,
yesterday i dropped one of the important table ...i have rman backup...i want to use until time incomplete recovery method.. but i dont know the exact time of table dropped ..i tried alert and trace files ..but no use...
is their any method to find out the exact time of table dropped..
Oracle 9.2
Redhat 5.3
Thank u
selva..So the database is not in ARCHIVELOG mode?
If you don't have the redo from the time in question, you haven't enabled auditing of DDL operations like DROP, and you don't have a DDL trigger that would have recorded the time of the drop, you're probably out of luck. Oracle won't have that information. You'll have to take your best guess.
If you were on a more recent version of Oracle, the dropped table would be in the recycle bin. But that wasn't available back in the 9.2 days.
Justin -
How does oracle text differentiate between various document formats?
how does oracle text differentiate between text documents of various formats. does it read binary headers or a file extension is necessary?
please comment..Oracle uses the inso_filter for document filtering as desribed in the documentation:
http://download-west.oracle.com/docs/cd/B10501_01/text.920/a96518/afilsupt.htm#625110
I did a little test (included below) where I copied a .pdf file to a file with a .test extension and it was still able to index it and search it, so apparently it does not need the file extensions and must read the header.
scott@10gXE> BEGIN
2 CTX_DDL.CREATE_PREFERENCE ('test_datastore', 'FILE_DATASTORE');
3 CTX_DDL.SET_ATTRIBUTE ('test_datastore', 'PATH', 'c:\oracle');
4 END;
5 /
PL/SQL procedure successfully completed.
scott@10gXE> CREATE TABLE test_tab
2 (id NUMBER,
3 docs VARCHAR2 (2000),
4 CONSTRAINT test_tab_id_pk PRIMARY KEY (id))
5 /
Table created.
scott@10gXE> INSERT INTO test_tab VALUES (1, 'master~1.pdf')
2 /
1 row created.
scott@10gXE> CREATE INDEX test_tab_idx ON test_tab (docs)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 PARAMETERS
4 ('DATASTORE test_datastore
5 FILTER CTXSYS.INSO_FILTER')
6 /
Index created.
scott@10gXE> SELECT id FROM test_tab
2 WHERE CONTAINS (docs, 'meat') > 0
3 /
ID
1
scott@10gXE>
scott@10gXE> DROP INDEX test_tab_idx
2 /
Index dropped.
scott@10gXE> HOST COPY c:\oracle\master~1.pdf c:\oracle\master.test
scott@10gXE> INSERT INTO test_tab VALUES (2, 'master.test')
2 /
1 row created.
scott@10gXE> CREATE INDEX test_tab_idx ON test_tab (docs)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 PARAMETERS
4 ('DATASTORE test_datastore
5 FILTER CTXSYS.INSO_FILTER')
6 /
Index created.
scott@10gXE> SELECT id FROM test_tab
2 WHERE CONTAINS (docs, 'meat') > 0
3 /
ID
1
2
scott@10gXE> -
Does Oracle allows zero length string
Hi,
I tried to insert zero length string ('') into an Oracle table, a null value and a non-empty string. But I found that zero length string and null are stored as NULL in the column.
Create table test (col1 number(2), col2 varchar(10));
Insert into test values (1, 'hi');
Insert into test values (2, NULL);
Insert into test values (3, '');
Select * from test where col2 is null;
Result: 2 rows
Select * from test where col2 = '';
Result: 0 rows
Is this to do with some environment setting in SQL* Plus or does oracle doesn't allow zero length string?Oracle treats '' as NULL.
There are frequent murmurs that some new version of Oracle is going to change this behaviour (I believe it's not ANSI-compliant) but I doubt that they will, as it will break too many old applications.
Cheers, APC -
Where can I change the buffer size for LKM File to Oracle (EXTRENAL TABLE)?
Hi all,
I'd a problem on the buffer size the "LKM File to Oracle (EXTRENAL TABLE)" as follow:
2801 : 72000 : java.sql.SQLException: ORA-12801: error signaled in parallel query server P000
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04020: found record longer than buffer size supported, 524288, in D:\OraHome_1\oracledi\demo\file\PARTIAL_SHPT_FIXED_NHF.dat
Do you know where can I change the buffer size?
Remarks: The size of the file is ~2Mb.
TaoHi,
The behavior is explained in Bug 4304609 .
You will encounter ORA-29400 & KUP-04020 errors if the RECORDSIZE clause in the access parameters for the ORACLE_LOADER access driver is larger than 10MB and you are loading records larger than 10MB. Which means their is a another limitation on read size of a record which is termed as granule size. If the default granule size is less then RECORDSIZE it limits the size of the read buffer to granule size.
Use the pxxtgranule_size parameter to change the size of the granule to a number larger than the size specified for the read buffer.You can use below query to determine the current size of the granule.
SELECT KSPFTCTXPN PARAMETER_NUMBER,
KSPPINM PARAMETER_NAME,
KSPPITY PARAMETER_TYPE,
KSPFTCTXVL PARAMETER_VALUE,
KSPFTCTXDF IS_DEFAULT,
KSPPIFLG MODIFICATION_FLAG,
KSPFTCTXVF VALUE_FLAG
FROM X$KSPPI X, X$KSPPCV2 Y
WHERE (X.INDX+1) = KSPFTCTXPN AND
KSPPINM LIKE '%_px_xtgranule_size%';
There is no 'ideal' or recommended value for pxxtgranule_size parameter, it is safe to increase it to work around this particular problem. You can set this parameter using ALTER SESSION/SYSTEM command.
SQL> alter system set "_px_xtgranule_size"=10000;
Thanks,
Sutirtha -
Fastest way to load csv into oracle BE table
I have csv file which is having 10 million records in it . what is the fastest approach to load this data to oracle BE table .
I am using Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Mining options .
csv format
first_name,last_name,occupation,address
above all the fields are of varchar data type.
I have tried to use external table while inserting its taking too much time .
Thankshi,
You can use sql loader.
options (skip=1)
LOAD DATA
INFILE 'csv file path'
truncate /append
INTO table table_name
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
trailing nullcols
column name ,
column name,
column name
{code}
Create this file as ctl(control file.) on the lcoation where your csv file is.
Execute it by goint to the path where your csv file resides.
{code}
cmd
cd path where your csv file resides
sqllder userid=username/password@database name control=your_control_file_name
{code}
Maybe you are looking for
-
Transferência de Mercadoria com unidade de medida em Caixa
Boa tarde prezados, estou com uma dificuldade em um determinado cliente no que se refere a transferência de mercadorias para as filiais. O que ocorre é o seguinte, um determinado item é configurado para comprar em Caixas e cada caixa contém 6 Un
-
Remote Mgr Console java not working 64bit
Is anyone else having issues using the java based console screen in Remote Manager (I assume this what people call "NoRM"?) on a 64 bit Windows 7 machine? We just upgraded our workstations, these are brand new Dell Precisions, and now I can't manage
-
Preferences will not open in 'Mail'
I am running Mail v3.5 (930.3) and have just upgraded to OS 10.5.6 but for some reason when I click on "Preferences" nothing happens. Can anyone offer a solution to this problem?
-
I think when my contract expires on 01/26/2013 that I will not renew my contract with VZW. I'll still remain with VZW, I'll pay the full-retail price for whatever glitzy device is all the rage. I figure, $800 FRP, without the threat of an ETF is well
-
Spaces and Spotlight issues after wakeup
Hi, when ever I wakeup my macbook pro 13" running 10.6.8 I have 2 issues: 1) the spaces grid freezes on the screen. I can still navigate via apple key + arrow keys, but the grid wont dissappear until... 2) I fidgit with spotlight. It wont respond vi