Time_manager_info
Hello,
Please advise me to understand the following behavior:
select time_manager_info from AQ_table_T order by enq_time desc
06-12-2013 14:59:44,406000000
select to_char(sysdate,'DD-MM-YYYY HH24:MI') from dual
06-11-2013 14:03
why there is so big difference between the two dates?
thank you
Hello,
did you check the following discussion: TIME_MANAGER_INFO 1 hour earlier than SYSDATE?
Kind regards,
WoG
Similar Messages
-
TIME_MANAGER_INFO 1 hour earlier than SYSDATE?
When one of our processes fails and places the message back on the queue to be retried in 5 minutes time the TIME_MANAGER_INFO is 1 hour + the delay time less than SYSDATE in the database.
For example, if our message fails at 11am and the delay period is 5 minutes the TIME_MANAGER_INFO is being set to 10:05am when I would have thought it would be set to 11:05am. I'm guessing that wherever the Advanced Queue is getting its time from hasn't been adjusted for daylight savings but where is this set/managed so I can get it in sync with SYSDATE.
Where is the Advanced Queue getting its time from?Just in case anyone else comes across this, we had a bug where the queue state was staying at 1 and was never being reset to 0 once it reached its delay time. In order to "fix" this until Oracle releases a patch that works we wrote our own procedure that would compare the TIME_MANAGER_INFO value with SYSDATE and if it was earlier than sysdate then we set the state to 0 so it would be picked up by the dequeue. Easy. Except that because of the timezone issue the TIME_MANAGER_INFO value was immediately set to 1 hour earlier than SYSDATE so we always set the state to 0 regardless of its delay period. So, we are looking at using the TIMEZONE value in the system.aq$_queue_tables to determine which timezone the queue is using and compare it to the databases timezone to see if we should change the TIME_MANAGER_INFO to something different. At least, that's what we'll probably do.
select time_manager_info,
cast( from_tz( time_manager_info, (select timezone from system.aq$_queue_tables where name = 'MY_QUEUE$TAB')) at time zone (select sessiontimezone from dual) as date) t
from MY_QUEUE$tab qt -
What are differences between the target tablespace and the source tablespac
The IMPDP command create so manay errors. But the EXAMPLE tablespace is transported to the target database successfully. It seems that the transported tablespace is no difference with the source tablespace.
Why create so many errors?
How to avoid these errors?
What are differences between the target tablespace and the source tablespace?
Is this datapump action really successfull?
Thw following is the log output:
[oracle@hostp ~]$ impdp system/oracle dumpfile=user_dir:demo02.dmp tablespaces=example remap_tablespace=example:example
Import: Release 10.2.0.1.0 - Production on Sunday, 28 September, 2008 18:08:31
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Master table "SYSTEM"."SYS_IMPORT_TABLESPACE_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_TABLESPACE_01": system/******** dumpfile=user_dir:demo02.dmp tablespaces=example remap_tablespace=example:example
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-39117: Type needed to create table is not included in this operation. Failing sql is:
CREATE TABLE "OE"."CUSTOMERS" ("CUSTOMER_ID" NUMBER(6,0), "CUST_FIRST_NAME" VARCHAR2(20) CONSTRAINT "CUST_FNAME_NN" NOT NULL ENABLE, "CUST_LAST_NAME" VARCHAR2(20) CONSTRAINT "CUST_LNAME_NN" NOT NULL ENABLE, "CUST_ADDRESS" "OE"."CUST_ADDRESS_TYP" , "PHONE_NUMBERS" "OE"."PHONE_LIST_TYP" , "NLS_LANGUAGE" VARCHAR2(3), "NLS_TERRITORY" VARCHAR2(30), "CREDIT_LIMIT" NUMBER(9,2), "CUST_EMAIL" VARCHAR2(30), "ACCOUNT_MGR_ID" NU
ORA-39117: Type needed to create table is not included in this operation. Failing sql is:
ORA-39117: Type needed to create table is not included in this operation. Failing sql is:
CREATE TABLE "IX"."ORDERS_QUEUETABLE" ("Q_NAME" VARCHAR2(30), "MSGID" RAW(16), "CORRID" VARCHAR2(128), "PRIORITY" NUMBER, "STATE" NUMBER, "DELAY" TIMESTAMP (6), "EXPIRATION" NUMBER, "TIME_MANAGER_INFO" TIMESTAMP (6), "LOCAL_ORDER_NO" NUMBER, "CHAIN_NO" NUMBER, "CSCN" NUMBER, "DSCN" NUMBER, "ENQ_TIME" TIMESTAMP (6), "ENQ_UID" VARCHAR2(30), "ENQ_TID" VARCHAR2(30), "DEQ_TIME" TIMESTAMP (6), "DEQ_UID" VARCHAR2(30), "DEQ_
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
. . imported "SH"."CUSTOMERS" 9.850 MB 55500 rows
. . imported "SH"."SUPPLEMENTARY_DEMOGRAPHICS" 695.9 KB 4500 rows
. . imported "OE"."PRODUCT_DESCRIPTIONS" 2.379 MB 8640 rows
. . imported "SH"."SALES":"SALES_Q4_2001" 2.257 MB 69749 rows
. . imported "SH"."SALES":"SALES_Q1_1999" 2.070 MB 64186 rows
. . imported "SH"."SALES":"SALES_Q3_2001" 2.129 MB 65769 rows
. . imported "SH"."SALES":"SALES_Q1_2000" 2.011 MB 62197 rows
. . imported "SH"."SALES":"SALES_Q1_2001" 1.964 MB 60608 rows
. . imported "SH"."SALES":"SALES_Q2_2001" 2.050 MB 63292 rows
. . imported "SH"."SALES":"SALES_Q3_1999" 2.166 MB 67138 rows
Processing object type TABLE_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'USER1' does not exist
Failing sql is:
GRANT SELECT ON "HR"."REGIONS" TO "USER1"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'EXAM_03' does not exist
Failing sql is:
GRANT SELECT ON "HR"."REGIONS" TO "EXAM_03"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'USER1' does not exist
Failing sql is:
GRANT SELECT ON "HR"."COUNTRIES" TO "USER1"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'EXAM_03' does not exist
Failing sql is:
GRANT SELECT ON "HR"."COUNTRIES" TO "EXAM_03"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'USER1' does not exist
Failing sql is:
GRANT SELECT ON "HR"."LOCATIONS" TO "USER1"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'EXAM_03' does not exist
Failing sql is:
GRANT SELECT ON "HR"."LOCATIONS" TO "EXAM_03"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'USER1' does not exist
Failing sql is:
GRANT SELECT ON "HR"."DEPARTMENTS" TO "USER1"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'EXAM_03' does not exist
Failing sql is:
GRANT SELECT ON "HR"."DEPARTMENTS" TO "EXAM_03"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'USER1' does not exist
Failing sql is:
GRANT SELECT ON "HR"."JOBS" TO "USER1"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'EXAM_03' does not exist
Failing sql is:
GRANT SELECT ON "HR"."JOBS" TO "EXAM_03"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'USER1' does not exist
Failing sql is:
GRANT SELECT ON "HR"."EMPLOYEES" TO "USER1"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'EXAM_03' does not exist
Failing sql is:
GRANT SELECT ON "HR"."EMPLOYEES" TO "EXAM_03"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'USER1' does not exist
Failing sql is:
GRANT SELECT ON "HR"."JOB_HISTORY" TO "USER1"
ORA-39083: Object type OBJECT_GRANT failed to create with error:
ORA-01917: user or role 'EXAM_03' does not exist
Failing sql is:
GRANT SELECT ON "HR"."JOB_HISTORY" TO "EXAM_03"
ORA-39112: Dependent object type OBJECT_GRANT:"OE" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type OBJECT_GRANT:"OE" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
ORA-39112: Dependent object type INDEX:"OE"."CUSTOMERS_PK" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type INDEX:"OE"."CUST_ACCOUNT_MANAGER_IX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type INDEX:"OE"."CUST_LNAME_IX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type INDEX:"OE"."CUST_EMAIL_IX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type INDEX:"PM"."PRINTMEDIA_PK" skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
ORA-39112: Dependent object type CONSTRAINT:"OE"."CUSTOMER_CREDIT_LIMIT_MAX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type CONSTRAINT:"OE"."CUSTOMER_ID_MIN" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type CONSTRAINT:"OE"."CUSTOMERS_PK" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type CONSTRAINT:"PM"."PRINTMEDIA__PK" skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
ORA-39112: Dependent object type CONSTRAINT:"IX"."SYS_C005192" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUSTOMERS_PK" creation failed
ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUST_ACCOUNT_MANAGER_IX" creation failed
ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUST_LNAME_IX" creation failed
ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUST_EMAIL_IX" creation failed
ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"PM"."PRINTMEDIA_PK" creation failed
Processing object type TABLE_EXPORT/TABLE/COMMENT
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type COMMENT skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
ORA-39112: Dependent object type REF_CONSTRAINT:"OE"."CUSTOMERS_ACCOUNT_MANAGER_FK" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39083: Object type REF_CONSTRAINT failed to create with error:
ORA-00942: table or view does not exist
Failing sql is:
ALTER TABLE "OE"."ORDERS" ADD CONSTRAINT "ORDERS_CUSTOMER_ID_FK" FOREIGN KEY ("CUSTOMER_ID") REFERENCES "OE"."CUSTOMERS" ("CUSTOMER_ID") ON DELETE SET NULL ENABLE
ORA-39112: Dependent object type REF_CONSTRAINT:"PM"."PRINTMEDIA_FK" skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
Processing object type TABLE_EXPORT/TABLE/TRIGGER
ORA-39082: Object type TRIGGER:"HR"."SECURE_EMPLOYEES" created with compilation warnings
ORA-39082: Object type TRIGGER:"HR"."SECURE_EMPLOYEES" created with compilation warnings
ORA-39082: Object type TRIGGER:"HR"."UPDATE_JOB_HISTORY" created with compilation warnings
ORA-39082: Object type TRIGGER:"HR"."UPDATE_JOB_HISTORY" created with compilation warnings
Processing object type TABLE_EXPORT/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
ORA-39112: Dependent object type INDEX:"OE"."CUST_UPPER_NAME_IX" skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
ORA-39112: Dependent object type INDEX_STATISTICS skipped, base object type INDEX:"OE"."CUST_UPPER_NAME_IX" creation failed
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"OE"."CUSTOMERS" creation failed
ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"PM"."PRINT_MEDIA" creation failed
ORA-39112: Dependent object type TABLE_STATISTICS skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
Processing object type TABLE_EXPORT/TABLE/INDEX/DOMAIN_INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/POST_INSTANCE/PROCACT_INSTANCE
ORA-39112: Dependent object type PROCACT_INSTANCE skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
ORA-39083: Object type PROCACT_INSTANCE failed to create with error:
ORA-01403: no data found
ORA-01403: no data found
Failing sql is:
BEGIN
SYS.DBMS_AQ_IMP_INTERNAL.IMPORT_SIGNATURE_TABLE('AQ$_ORDERS_QUEUETABLE_G');COMMIT; END;
Processing object type TABLE_EXPORT/TABLE/POST_INSTANCE/PROCDEPOBJ
ORA-39112: Dependent object type PROCDEPOBJ:"IX"."AQ$_ORDERS_QUEUETABLE_V" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
ORA-39112: Dependent object type PROCDEPOBJ:"IX"."ORDERS_QUEUE_N" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
ORA-39112: Dependent object type PROCDEPOBJ:"IX"."ORDERS_QUEUE_R" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
ORA-39112: Dependent object type PROCDEPOBJ:"IX"."AQ$_ORDERS_QUEUETABLE_E" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
ORA-39112: Dependent object type PROCDEPOBJ:"IX"."ORDERS_QUEUE" skipped, base object type TABLE:"IX"."ORDERS_QUEUETABLE" creation failed
Job "SYSTEM"."SYS_IMPORT_TABLESPACE_01" completed with 63 error(s) at 18:09:14Short of trying to then reverse-engineer the objects that are in the dump file (I believe Data Pump export files contain some XML representations of DDL in addition to various binary bits, making it potentially possible to try to scan the dump file for the object definitions), I would tend to assume that the export didn't include those type definitions.
Since it looks like you're trying to set up the sample schemas, is there a reason that you wouldn't just run the sample schema setup scripts on the destination database? Why are you using Data Pump in the first place?
Justin -
ORA-22913 while creating a QUEUE TABLE of a "Typed type"
Hi guys:
I'm trying to recreate an [AskTom's post|http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:8760267539329], but with a single difference. My Oracle Type contains a field that is another Oracle Type and when I try to create a QUEUE_TABLE, I got the ORA-22913.
Here are my steps:
create or replace TYPE PODTL_TYPE AS OBJECT
item varchar2(25),
ref_item varchar2(25),
physical_location_type varchar2(1),
physical_location number(10),
physical_qty_ordered number(12,4),
unit_cost number(20,4),
origin_country_id varchar2(3),
supp_pack_size number(12,4),
earliest_ship_date date,
latest_ship_date date,
pickup_loc varchar2(250),
pickup_no varchar2(25),
packing_method varchar2(6),
round_lvl varchar2(6),
door_ind varchar2(1),
priority_level number(1),
new_item varchar2(1),
quarantine varchar2(1),
rcvd_unit_qty number(12,4),
tsf_po_link_id number(10),
cost_source varchar2(4),
est_in_stock_date date
create or replace TYPE PODtl_coll as table of PODTL_TYPE;
create or replace TYPE PODesc AS OBJECT
doc_type varchar2(1),
order_no varchar2(10),
order_type varchar2(9),
order_type_desc varchar2(250),
dept number(4),
dept_name varchar2(120),
buyer number(4),
buyer_name varchar2(120),
supplier varchar2(10),
promotion number(10),
prom_desc varchar2(160),
qc_ind varchar2(1),
not_before_date date,
not_after_date date,
otb_eow_date date,
earliest_ship_date date,
latest_ship_date date,
close_date date,
terms varchar2(15),
terms_code varchar2(50),
freight_terms varchar2(30),
cust_order varchar2(1),
payment_method varchar2(6),
payment_method_desc varchar2(40),
backhaul_type varchar2(6),
backhaul_type_desc varchar2(40),
backhaul_allowance number(20,4),
ship_method varchar2(6),
ship_method_desc varchar2(40),
purchase_type varchar2(6),
purchase_type_desc varchar2(40),
status varchar2(1),
ship_pay_method varchar2(2),
ship_pay_method_desc varchar2(40),
fob_trans_res varchar2(2),
fob_trans_res_code_desc varchar2(40),
fob_trans_res_desc varchar2(250),
fob_title_pass varchar2(2),
fob_title_pass_code_desc varchar2(40),
fob_title_pass_desc varchar2(250),
vendor_order_no varchar2(15),
exchange_rate number(20,10),
factory varchar2(10),
factory_desc varchar2(240),
agent varchar2(10),
agent_desc varchar2(240),
discharge_port varchar2(5),
discharge_port_desc varchar2(150),
lading_port varchar2(5),
lading_port_desc varchar2(150),
bill_to_id varchar2(5),
freight_contract_no varchar2(10),
po_type varchar2(4),
po_type_desc varchar2(120),
pre_mark_ind varchar2(1),
currency_code varchar2(3),
contract_no number(6),
pickup_loc varchar2(250),
pickup_no varchar2(25),
pickup_date date,
app_datetime date,
comment_desc varchar2(2000),
PODtl PODtl_coll
These are my 3 Oracle types. When I try to create the QUEUE TABLE:
DBMS_AQADM.CREATE_QUEUE_TABLE(
Queue_table => 'PODESC_QUEUE_TABLE',
Queue_payload_type => 'PODesc',
Multiple_consumers => TRUE);
END;
I got the following error:
22913. 00000 - "must specify table name for nested table column or attribute"
*Cause: The storage clause is not specified for a nested table column
or attribute.
*Action: Specify the nested table storage clause for the nested table
column or attribute.
How can I solve this?Here is the syntax used by Oracle in one of their internal tables.
orabase> select dbms_metadata.get_ddl('TABLE', 'ORDERS_QUEUETABLE', 'IX') from dual;
DBMS_METADATA.GET_DDL('TABLE','ORDERS_QUEUETABLE','IX')
CREATE TABLE "IX"."ORDERS_QUEUETABLE"
( "Q_NAME" VARCHAR2(30),
"MSGID" RAW(16),
"CORRID" VARCHAR2(128),
"PRIORITY" NUMBER,
"STATE" NUMBER,
"DELAY" TIMESTAMP (6),
"EXPIRATION" NUMBER,
"TIME_MANAGER_INFO" TIMESTAMP (6),
"LOCAL_ORDER_NO" NUMBER,
"CHAIN_NO" NUMBER,
"CSCN" NUMBER,
"DSCN" NUMBER,
"ENQ_TIME" TIMESTAMP (6),
"ENQ_UID" VARCHAR2(30),
"ENQ_TID" VARCHAR2(30),
"DEQ_TIME" TIMESTAMP (6),
"DEQ_UID" VARCHAR2(30),
"DEQ_TID" VARCHAR2(30),
"RETRY_COUNT" NUMBER,
"EXCEPTION_QSCHEMA" VARCHAR2(30),
"EXCEPTION_QUEUE" VARCHAR2(30),
"STEP_NO" NUMBER,
"RECIPIENT_KEY" NUMBER,
"DEQUEUE_MSGID" RAW(16),
"SENDER_NAME" VARCHAR2(30),
"SENDER_ADDRESS" VARCHAR2(1024),
"SENDER_PROTOCOL" NUMBER,
"USER_DATA" "IX"."ORDER_EVENT_TYP" , <---------------------- seems analogous to what you are trying to do
"USER_PROP" "SYS"."ANYDATA" ,
PRIMARY KEY ("MSGID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EXAMPLE" ENABLE
) USAGE QUEUE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EXAMPLE"
OPAQUE TYPE "USER_PROP" STORE AS BASICFILE LOB (
ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
CACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))Spend some time looking in directories under $ORACLE_HOME and you may well find the DDL that built it. -
OS - win2003 server
DB - 9.2.0.5.0
Can you have a look on Statspack Report and offer your valuable suggestions?
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
340547761 CHRYSLER 1 chrysler
Instances in this Statspack schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
340547761 1 CHRYSLER chrysler NOID2K36BGTP
B1
Using 340547761 for database Id
Using 1 for instance number
Completed Snapshots
Snap Snap
Instance DB Name Id Snap Started Level Comment
chrysler CHRYSLER 1 17 Jan 2008 10:05 5
2 17 Jan 2008 10:09 5
3 17 Jan 2008 10:16 5
4 17 Jan 2008 10:48 5
5 17 Jan 2008 11:02 5
6 17 Jan 2008 11:12 5
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 4
Begin Snapshot Id specified: 4
Enter value for end_snap: 6
End Snapshot Id specified: 6
PAR VERSN
HOST_NAME DB Name
Instance BTIME
NO 9.2.0.5.0
NOID2K36BGTPB1 CHRYSLER
chrysler 20080117 10:48:11
ETIME
20080117 11:12:09
Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is sp_4_6. To use this name,
press <return> to continue, otherwise enter an alternative.
Enter value for report_name: Statspack Report
Using the report name Statspack Report
SP2-0333: Illegal spool file name: "Statspack Report" (bad character: ' ')
STATSPACK report for
DB Name DB Id Instance Inst Num Release Cluster Host
CHRYSLER 340547761 chrysler 1 9.2.0.5.0 NO NOID2K36BGTP
B1
Snap Id Snap Time Sessions Curs/Sess Comment
Begin Snap: 4 17-Jan-08 10:48:11 22 6.5
End Snap: 6 17-Jan-08 11:12:09 27 7.4
Elapsed: 23.97 (mins)
Cache Sizes (end)
~~~~~~~~~~~~~~~~~
Buffer Cache: 184M Std Block Size: 8K
Shared Pool Size: 904M Log Buffer: 512K
Load Profile
~~~~~~~~~~~~ Per Second Per Transaction
Redo size: 10,225.13 4,901,244.00
Logical reads: 700.13 335,593.67
Block changes: 68.68 32,918.67
Physical reads: 15.03 7,206.67
Physical writes: 14.41 6,906.00
User calls: 1.22 584.00
Parses: 0.73 349.33
Hard parses: 0.03 13.67
Sorts: 0.40 193.00
Logons: 0.01 4.67
Executes: 1.46 701.67
Transactions: 0.00
% Blocks changed per Read: 9.81 Recursive Call %: 91.60
Rollback per transaction %: 0.00 Rows per Sort: 1016.53
Instance Efficiency Percentages (Target 100%)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffer Nowait %: 100.00 Redo NoWait %: 100.00
Buffer Hit %: 99.57 In-memory Sort %: 99.65
Library Hit %: 100.00 Soft Parse %: 96.09
Execute to Parse %: 50.21 Latch Hit %: 99.98
Parse CPU to Parse Elapsd %: 56.76 % Non-Parse CPU: 99.34
Shared Pool Statistics Begin End
Memory Usage %: 53.83 53.90
% SQL with executions>1: 84.54 84.53
% Memory for SQL w/exec>1: 62.62 62.65
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Ela Time
CPU time 32 79.76
direct path read 390 3 7.21
db file scattered read 275 2 3.78
log file parallel write 515 1 2.44
db file sequential read 365 1 2.07
Wait Events for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> s - second
-> cs - centisecond - 100th of a second
-> ms - millisecond - 1000th of a second
-> us - microsecond - 1000000th of a second
-> ordered by wait time desc, waits desc (idle events last)
Avg
Total Wait wait Waits
Event Waits Timeouts Time (s) (ms) /txn
direct path read 390 0 3 7 130.0
db file scattered read 275 0 2 5 91.7
log file parallel write 515 449 1 2 171.7
db file sequential read 365 0 1 2 121.7
control file parallel write 467 0 0 1 155.7
control file sequential read 294 0 0 1 98.0
db file parallel write 35 0 0 10 11.7
db file parallel read 1 0 0 251 0.3
LGWR wait for redo copy 19 1 0 12 6.3
SQL*Net message from dblink 18 0 0 4 6.0
latch free 14 0 0 5 4.7
log file sync 14 0 0 1 4.7
SQL*Net break/reset to clien 36 0 0 0 12.0
log buffer space 19 0 0 1 6.3
SQL*Net more data to client 103 0 0 0 34.3
direct path write 8 0 0 1 2.7
SQL*Net message to dblink 18 0 0 0 6.0
SQL*Net message from client 1,606 0 11,104 6914 535.3
wakeup time manager 47 47 2,580 54895 15.7
SQL*Net more data from clien 11 0 0 14 3.7
SQL*Net message to client 1,611 0 0 0 537.0
Background Wait Events for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> ordered by wait time desc, waits desc (idle events last)
Avg
Total Wait wait Waits
Event Waits Timeouts Time (s) (ms) /txn
log file parallel write 515 449 1 2 171.7
control file parallel write 467 0 0 1 155.7
db file parallel write 35 0 0 10 11.7
control file sequential read 188 0 0 2 62.7
LGWR wait for redo copy 19 1 0 12 6.3
latch free 4 0 0 17 1.3
rdbms ipc message 2,392 1,859 9,366 3916 797.3
pmon timer 487 487 2,651 5443 162.3
smon timer 4 4 2,307 ###### 1.3
SQL ordered by Gets for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Buffer Gets Threshold: 10000
-> Note that resources reported for PL/SQL includes the resources used by
all SQL statements called within the PL/SQL code. As individual SQL
statements are also reported, it is possible and valid for the summed
total % to exceed 100
CPU Elapsd
Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
415,514 2 207,757.0 41.3 5.45 5.44 1116368370
Module: SQL*Plus
INSERT INTO STATS$SQLTEXT ( HASH_VALUE , TEXT_SUBSET , PIECE , S
QL_TEXT , ADDRESS , COMMAND_TYPE , LAST_SNAP_ID ) SELECT ST1.HAS
H_VALUE , SS.TEXT_SUBSET , ST1.PIECE , ST1.SQL_TEXT , ST1.ADDRES
S , ST1.COMMAND_TYPE , SS.SNAP_ID FROM V$SQLTEXT ST1 , STATS$SQL
SUMMARY SS WHERE SS.SNAPID = :B3 AND SS.DBID = :B2 AND SS.INST
223,045 2 111,522.5 22.2 1.09 1.38 3446574552
Module: SQL Developer
select column_name from all_updatable_columns where TABLE_NAME
= :OBJECT_NAME and owner = :OBJECT_OWNER and updatable = 'YES'
208,951 1 208,951.0 20.8 10.42 14.21 1240367379
Module: SQL*Plus
BEGIN statspack.snap ; END;
208,539 1 208,539.0 20.7 10.47 14.11 2522684317
Module: sqlplus.exe
BEGIN statspack.snap; END;
81,198 1 81,198.0 8.1 0.73 0.73 401938015
Module: Oracle SQL Developer
SELECT s.owner, s.synonym_name, 'SYNONYM' as object_type FROM sy
s.all_synonyms s, sys.all_objects o WHERE s.table_name = o.objec
t_name AND s.table_owner = o.owner AND object_type IN ('PACKAGE'
, 'PROCEDURE', 'SEQUENCE', 'TABLE', 'TYPE', 'VIEW', 'FUNCTION' )
ORDER BY s.owner, s.synonym_name
58,656 10 5,865.6 5.8 3.34 3.33 3247664323
insert into source$(obj#,line,source) values (:1,:2,:3)
57,404 2 28,702.0 5.7 0.28 0.30 3259503395
Module: SQL Developer
select * from (SELECT OBJECT_NAME, OBJECT_ID ,'' short_name,
decode(( SELECT count (1) FROM SYS.ALL_TAB_PARTITIONS WHERE TAB
LE_OWNER =owner AND TABLE_NAME = object_name ),0,'FALSE','TRUE'
) partition, OWNER OBJECT_OWNER
FROM SYS.ALL_OBJECTS O WHERE O.OWNE
51,583 1 51,583.0 5.1 0.77 0.75 2077069258
Module: Oracle SQL Developer
SELECT owner, object_name, object_type FROM sys.all_objects WHER
E object_type IN ('PACKAGE', 'PROCEDURE', 'SEQUENCE', 'TABLE', '
TYPE', 'VIEW', 'FUNCTION' ) ORDER BY owner, object_name
41,310 2 20,655.0 4.1 0.27 0.29 1607513402
Module: SQL Developer
SELECT OWNER,TABLE_NAME FROM all_external_tables
SQL ordered by Gets for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Buffer Gets Threshold: 10000
-> Note that resources reported for PL/SQL includes the resources used by
all SQL statements called within the PL/SQL code. As individual SQL
statements are also reported, it is possible and valid for the summed
total % to exceed 100
CPU Elapsd
Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
20,776 1 20,776.0 2.1 0.20 0.21 1305228895
Module: SQL*Plus
select owner , object_name , object_type from dba_objects where
object_type = 'TABLE'
15,709 10 1,570.9 1.6 0.97 1.07 3098922061
delete from source$ where obj#=:1
11,854 1 11,854.0 1.2 0.11 0.21 4208944292
Module: SQL Developer
with pri_cols as ( SELECT cols.column_name column_name, cols.pos
ition column_position FROM all_constraints cons, al
l_cons_columns cols WHERE cons.constraint_type = 'P'
AND cons.constraint_name = cols.constraint_name
AND cons.owner = cols.owner and cols.table_name
7,493 1 7,493.0 0.7 0.17 1.87 1279266739
Module: SQL Developer
select count(*) from IMP_TEMPSS_PARTSLANG
3,904 47 83.1 0.4 0.00 0.14 815501214
select t.schema, t.name, t.flags, q.name from system.aq$_queue_t
ables t, sys.aq$_queue_table_affinities aft, system.aq$_que
ues q where aft.table_objno = t.objno and aft.owner_instance = :
1 and q.table_objno = t.objno and q.usage = 0 and b
itand(t.flags, 4+16+32+64+128+256) = 0 for update of t.name, aft
3,467 14 247.6 0.3 0.50 0.53 1554250272
Module: SQL Developer
select count(1) from all_objects where owner <> 'PUBLIC' and ob
ject_name in (:S0)
1,694 4 423.5 0.2 0.08 0.08 1547382267
Module: SQL Developer
select object_type,owner,object_name,rank from ( select objec
t_type,owner,object_name,0 rank from all_objects where obj
ect_name = :NAME and UPPER(owner) = nvl(:OWNER,UPPER(sys_cont
ext('USERENV', 'CURRENT_SCHEMA'))) and object_type not in ( '
SYNONYM' ) union all select ao.object_type,ao.owner,ao.ob
1,317 188 7.0 0.1 0.00 0.03 3371479671
select t.name, (select owner_instance from sys.aq$_queue_table_
affinities where table_objno = t.objno) from system.aq$_queue
_tables t where t.name = :1 and t.schema = :2 for update skip lo
cked
892 1 892.0 0.1 0.02 0.01 3021556466
Module: SQL Developer
SELECT OBJECT_NAME, OBJECT_ID, DECODE(STATUS, 'INVAL
ID', 'TRUE', 'FALSE') INVALID, 'TRUE' runnable,
SQL ordered by Gets for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Buffer Gets Threshold: 10000
-> Note that resources reported for PL/SQL includes the resources used by
all SQL statements called within the PL/SQL code. As individual SQL
statements are also reported, it is possible and valid for the summed
total % to exceed 100
CPU Elapsd
Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
NVL( b.HAS_BODY, 'FALSE') HAS_BODY FROM SYS.ALL_OBJECTS
a, (SELECT 'TRUE' HAS_BODY, object_name tmp_name FROM SYS.
ALL_OBJECTS WHERE OWNER = :SCHEMA AND OBJECT_TYPE = 'PACKAGE BOD
890 2 445.0 0.1 0.09 0.10 1201167771
Module: SQL Developer
SELECT T.TABLE_NAME, 'TABLE' OBJECT_TYPE , (SELECT O.OBJ
ECT_ID FROM ALL_OBJECTS O WHERE O.OWNER = T.OWNER
AND O.OBJECT_TYPE = 'TABLE' AND O.OBJECT_NAME = T.
TABLE_NAME) OBJECT_ID FROM ALL_TABLES T WHERE T.OWNER = :1 AN
D T.TABLE_NAME LIKE :2 AND T.IOT_NAME IS NULL AND T.NES
779 10 77.9 0.1 0.02 0.05 3067006941
delete from dependency$ where d_obj#=:1
748 146 5.1 0.1 0.05 0.05 3951809012
insert into dependency$(d_obj#,d_timestamp,order#,p_obj#,p_times
tamp,d_owner#, property)values (:1,:2,:3,:4,:5,:6, :7)
632 2 316.0 0.1 10.53 17.92 4043595143
Module: SQL*Plus
INSERT INTO STATS$SQL_SUMMARY ( SNAP_ID , DBID , INSTANCE_NUMBER
, TEXT_SUBSET , SHARABLE_MEM , SORTS , MODULE , LOADED_VERSIONS
SQL ordered by Reads for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Disk Reads Threshold: 1000
CPU Elapsd
Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
17,317 2 8,658.5 80.1 10.53 17.92 4043595143
Module: SQL*Plus
INSERT INTO STATS$SQL_SUMMARY ( SNAP_ID , DBID , INSTANCE_NUMBER
, TEXT_SUBSET , SHARABLE_MEM , SORTS , MODULE , LOADED_VERSIONS
, FETCHES , EXECUTIONS , LOADS , INVALIDATIONS , PARSE_CALLS ,
DISK_READS , BUFFER_GETS , ROWS_PROCESSED , COMMAND_TYPE , ADDRE
SS , HASH_VALUE , VERSION_COUNT , CPU_TIME , ELAPSED_TIME , OUTL
8,659 1 8,659.0 40.1 10.42 14.21 1240367379
Module: SQL*Plus
BEGIN statspack.snap ; END;
8,658 1 8,658.0 40.0 10.47 14.11 2522684317
Module: sqlplus.exe
BEGIN statspack.snap; END;
3,880 1 3,880.0 17.9 0.17 1.87 1279266739
Module: SQL Developer
select count(*) from IMP_TEMPSS_PARTSLANG
299 2 149.5 1.4 1.09 1.38 3446574552
Module: SQL Developer
select column_name from all_updatable_columns where TABLE_NAME
= :OBJECT_NAME and owner = :OBJECT_OWNER and updatable = 'YES'
12 5 2.4 0.1 0.05 0.13 3444463493
Module: SQL Developer
SELECT TEXT FROM SYS.ALL_SOURCE WHERE TYPE = :TYPE AND OWNER =
:OWNER AND NAME = :NAME ORDER BY LINE
12 4 3.0 0.1 0.03 0.13 3833423502
Module: SQL Developer
SELECT TEXT FROM SYS.ALL_SOURCE WHERE TYPE = :1 AND OWNER = :2 A
ND NAME = :3 ORDER BY LINE
9 1 9.0 0.0 0.00 0.07 3687727603
insert into col$(obj#,name,intcol#,segcol#,type#,length,precisio
n#,scale,null$,offset,fixedstorage,segcollength,deflength,defaul
t$,col#,property,charsetid,charsetform,spare1,spare2,spare3)valu
es(:1,:2,:3,:4,:5,:6,decode(:7,0,null,:7),decode(:5,2,decode(:8,
-127/*MAXSB1MINAL*/,null,:8),178,:8,179,:8,180,:8,181,:8,182,:8,
8 2 4.0 0.0 0.28 0.30 3259503395
Module: SQL Developer
select * from (SELECT OBJECT_NAME, OBJECT_ID ,'' short_name,
decode(( SELECT count (1) FROM SYS.ALL_TAB_PARTITIONS WHERE TAB
LE_OWNER =owner AND TABLE_NAME = object_name ),0,'FALSE','TRUE'
) partition, OWNER OBJECT_OWNER
FROM SYS.ALL_OBJECTS O WHERE O.OWNE
7 5 1.4 0.0 0.02 0.06 3508476732
insert into idl_ub1$(obj#,part,version,piece#,length,piece) valu
es(:1,:2,:3,:4,:5,:6)
SQL ordered by Reads for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Disk Reads Threshold: 1000
CPU Elapsd
Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
5 8 0.6 0.0 0.00 0.03 1008661772
update idl_ub1$ set piece#=:1 ,length=:2 , piece=:3 where obj#=:
4 and part=:5 and piece#=:6 and version=:7
5 1 5.0 0.0 0.11 0.21 4208944292
Module: SQL Developer
with pri_cols as ( SELECT cols.column_name column_name, cols.pos
ition column_position FROM all_constraints cons, al
l_cons_columns cols WHERE cons.constraint_type = 'P'
AND cons.constraint_name = cols.constraint_name
AND cons.owner = cols.owner and cols.table_name
2 3 0.7 0.0 0.00 0.01 761440199
insert into idl_ub2$(obj#,part,version,piece#,length,piece) valu
es(:1,:2,:3,:4,:5,:6)
1 3 0.3 0.0 0.00 0.01 1249304535
update idl_ub2$ set piece#=:1 ,length=:2 , piece=:3 where obj#=:
4 and part=:5 and piece#=:6 and version=:7
1 2 0.5 0.0 0.27 0.29 1607513402
Module: SQL Developer
SELECT OWNER,TABLE_NAME FROM all_external_tables
1 10 0.1 0.0 0.03 0.02 1825174980
delete from access$ where d_obj#=:1
1 10 0.1 0.0 0.02 0.05 3067006941
delete from dependency$ where d_obj#=:1
1 10 0.1 0.0 3.34 3.33 3247664323
insert into source$(obj#,line,source) values (:1,:2,:3)
1 146 0.0 0.0 0.05 0.05 3951809012
insert into dependency$(d_obj#,d_timestamp,order#,p_obj#,p_times
tamp,d_owner#, property)values (:1,:2,:3,:4,:5,:6, :7)
0 2 0.0 0.0 0.00 0.00 10821553
Module: SQL Developer
ALTER SESSION SET TIME_ZONE = '05:30'
0 3 0.0 0.0 0.00 0.01 66972507
Module: SQL Developer
SELECT TO_DATE(TIMESTAMP, 'YYYY-MM-DD:HH24:MI:SS') FROM SYS.ALL_
OBJECTS WHERE OWNER = :1 AND OBJECT_NAME = :2 AND OBJECT_TYPE =
:3
0 2 0.0 0.0 0.02 0.00 80089551
Module: SQL Developer
SELECT LAST_DDL_TIME FROM SYS.ALL_OBJECTS WHERE OWNER = :1 AND O
BJECT_NAME = :2 AND OBJECT_TYPE = :3
0 1 0.0 0.0 0.00 0.00 120978412
select col#,intcol#,ntab# from ntab$ where obj#=:1 order by intc
SQL ordered by Reads for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Disk Reads Threshold: 1000
CPU Elapsd
Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value
ol# asc
0 5 0.0 0.0 0.00 0.00 130926350
select count(*) from sys.job$ where next_date < :1 and (field1 =
:2 or (field1 = 0 and 'Y' = :3))
0 5 0.0 0.0 0.00 0.00 155765854
select count(*),min(piece#),max(piece#) from idl_ub1$ where obj#
=:1 and part=:2 and version=:3
0 1 0.0 0.0 0.00 0.00 162044583
select col#,intcol#,charsetid,charsetform from col$ where obj#=:
1 order by intcol# asc
0 2 0.0 0.0 0.00 0.00 179957765
select count(*),min(piece#),max(piece#) from idl_char$ where obj
#=:1 and part=:2 and version=:3
0 3 0.0 0.0 0.00 0.00 204386021
select col#, grantee#, privilege#,max(mod(nvl(option$,0),2)) fro
m objauth$ where obj#=:1 and col# is not null group by privilege
#, col#, grantee# order by col#, grantee#
0 10 0.0 0.0 0.00 0.00 292617943
delete from vtable$ where obj#=:1
0 1 0.0 0.0 0.73 0.73 401938015
Module: Oracle SQL Developer
SELECT s.owner, s.synonym_name, 'SYNONYM' as object_type FROM sy
SQL ordered by Executions for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Executions Threshold: 100
CPU per Elap per
Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
280 0 0.0 0.00 0.00 1316169839
select job, nvl2(last_date, 1, 0) from sys.job$ where (((:1 <= n
ext_date) and (next_date < :2)) or ((last_date is null) and
(next_date < :3))) and (field1 = :4 or (field1 = 0 and 'Y' = :5)
) and (this_date is null) order by next_date, job
280 280 1.0 0.00 0.00 1693927332
select count(*) from sys.job$ where (next_date > sysdate) and (n
ext_date < (sysdate+5/86400))
188 188 1.0 0.00 0.00 3371479671
select t.name, (select owner_instance from sys.aq$_queue_table_
affinities where table_objno = t.objno) from system.aq$_queue
_tables t where t.name = :1 and t.schema = :2 for update skip lo
cked
146 146 1.0 0.00 0.00 3951809012
insert into dependency$(d_obj#,d_timestamp,order#,p_obj#,p_times
tamp,d_owner#, property)values (:1,:2,:3,:4,:5,:6, :7)
76 76 1.0 0.00 0.00 2997854589
insert into access$(d_obj#,order#,columns,types) values (:1,:2,:
3,:4)
47 0 0.0 0.00 0.00 633914867
select q_name, state, delay, expiration, rowid, msgid, dequeu
e_msgid, chain_no, local_order_no, enq_time, enq_tid, step_no,
priority, exception_qschema, exception_queue, retry_count, corr
id, time_manager_info from SYS.AQ_EVENT_TABLE where time
managerinfo <= :1 and state != :2 for update skip locked
47 188 4.0 0.00 0.00 815501214
select t.schema, t.name, t.flags, q.name from system.aq$_queue_t
ables t, sys.aq$_queue_table_affinities aft, system.aq$_que
ues q where aft.table_objno = t.objno and aft.owner_instance = :
1 and q.table_objno = t.objno and q.usage = 0 and b
itand(t.flags, 4+16+32+64+128+256) = 0 for update of t.name, aft
47 0 0.0 0.00 0.00 870116171
select q_name, state, delay, expiration, rowid, msgid, dequeu
e_msgid, chain_no, local_order_no, enq_time, enq_tid, step_no,
priority, exception_qschema, exception_queue, retry_count, corr
id, time_manager_info from SYSTEM.DEF$_AQERROR where tim
e_manager_info <= :1 and state != :2 for update skip locked
47 0 0.0 0.00 0.00 1153132087
select q_name, state, delay, expiration, rowid, msgid, dequeu
e_msgid, chain_no, local_order_no, enq_time, enq_tid, step_no,
priority, exception_qschema, exception_queue, retry_count, corr
id, time_manager_info from SYSTEM.DEF$_AQCALL where time
managerinfo <= :1 and state != :2 for update skip locked
47 0 0.0 0.00 0.00 3920324236
select q_name, state, delay, expiration, rowid, msgid, dequeue
SQL ordered by Executions for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Executions Threshold: 100
CPU per Elap per
Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
msgid, chainno, local_order_no, enq_time, enq_tid, step_no,
priority, exception_qschema, exception_queue, retry_count, corri
d, time_manager_info, sender_name, sender_address, sender_prot
ocol from SYS.AQ_SRVNTFN_TABLE where time_manager_info <= :1
30 30 1.0 0.00 0.00 2201541053
insert into error$(obj#,sequence#,line,position#,textlength,text
) values (:1,:2,:3,:4,:5,:6)
26 115 4.4 0.00 0.00 1749333492
select position#,sequence#,level#,argument,type#,charsetid,chars
etform,properties,nvl(length, 0), nvl(precision#, 0),nvl(scale,
0),nvl(radix, 0), type_owner,type_name,type_subname,type_linknam
e,pls_type from argument$ where obj#=:1 and procedure#=:2 order
by sequence# desc
21 0 0.0 0.00 0.00 1683508596
delete from idl_sb4$ where obj#=:1 and part=:2
21 0 0.0 0.00 0.00 1894783783
delete from idl_char$ where obj#=:1 and part=:2
21 0 0.0 0.00 0.00 2479503691
delete from idl_ub1$ where obj#=:1 and part=:2
21 0 0.0 0.00 0.00 3926364396
delete from idl_ub2$ where obj#=:1 and part=:2
20 20 1.0 0.00 0.00 3401267293
insert into settings$(obj#, param, value) values (:1, :2, :3)
14 62 4.4 0.00 0.00 1356713530
select privilege#,level from sysauth$ connect by grantee#=prior
privilege# and privilege#>0 start with (grantee#=:1 or grantee#=
1) and privilege#>0
14 14 1.0 0.04 0.04 1554250272
Module: SQL Developer
select count(1) from all_objects where owner <> 'PUBLIC' and ob
ject_name in (:S0)
13 13 1.0 0.00 0.00 3468666020
select text from view$ where rowid=:1
12 12 1.0 0.00 0.00 825987371
Module: SQL Developer
declare l_line varchar2(255); l_done number; l_buffe
r long; begin loop exit when length(l_buffer)+255 > :maxby
tes OR l_done = 1; dbms_output.get_line( l_line, l_done );
l_buffer := l_buffer || l_line || chr(10); end loop; :done
:= l_done; :buffer := l_buffer; end;
12 0 0.0 0.00 0.00 2222871512
Module: SQL Developer
SQL ordered by Executions for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Executions Threshold: 100
CPU per Elap per
Executions Rows Processed Rows per Exec Exec (s) Exec (s) Hash Value
SELECT LINE,POSITION,TEXT FROM USER_ERRORS WHERE TYPE=:1AND NAME
=:2
SQL ordered by Parse Calls for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Parse Calls Threshold: 1000
% Total
Parse Calls Executions Parses Hash Value
47 47 4.48 633914867
select q_name, state, delay, expiration, rowid, msgid, dequeu
e_msgid, chain_no, local_order_no, enq_time, enq_tid, step_no,
priority, exception_qschema, exception_queue, retry_count, corr
id, time_manager_info from SYS.AQ_EVENT_TABLE where time
managerinfo <= :1 and state != :2 for update skip locked
47 47 4.48 815501214
select t.schema, t.name, t.flags, q.name from system.aq$_queue_t
ables t, sys.aq$_queue_table_affinities aft, system.aq$_que
ues q where aft.table_objno = t.objno and aft.owner_instance = :
1 and q.table_objno = t.objno and q.usage = 0 and b
itand(t.flags, 4+16+32+64+128+256) = 0 for update of t.name, aft
47 47 4.48 870116171
select q_name, state, delay, expiration, rowid, msgid, dequeu
e_msgid, chain_no, local_order_no, enq_time, enq_tid, step_no,
priority, exception_qschema, exception_queue, retry_count, corr
id, time_manager_info from SYSTEM.DEF$_AQERROR where tim
e_manager_info <= :1 and state != :2 for update skip locked
47 47 4.48 1153132087
select q_name, state, delay, expiration, rowid, msgid, dequeu
e_msgid, chain_no, local_order_no, enq_time, enq_tid, step_no,
priority, exception_qschema, exception_queue, retry_count, corr
id, time_manager_info from SYSTEM.DEF$_AQCALL where time
managerinfo <= :1 and state != :2 for update skip locked
47 188 4.48 3371479671
select t.name, (select owner_instance from sys.aq$_queue_table_
affinities where table_objno = t.objno) from system.aq$_queue
_tables t where t.name = :1 and t.schema = :2 for update skip lo
cked
47 47 4.48 3920324236
select q_name, state, delay, expiration, rowid, msgid, dequeue
msgid, chainno, local_order_no, enq_time, enq_tid, step_no,
priority, exception_qschema, exception_queue, retry_count, corri
d, time_manager_info, sender_name, sender_address, sender_prot
ocol from SYS.AQ_SRVNTFN_TABLE where time_manager_info <= :1
21 21 2.00 1683508596
delete from idl_sb4$ where obj#=:1 and part=:2
21 21 2.00 1894783783
delete from idl_char$ where obj#=:1 and part=:2
21 21 2.00 2479503691
delete from idl_ub1$ where obj#=:1 and part=:2
21 21 2.00 3926364396
delete from idl_ub2$ where obj#=:1 and part=:2
14 14 1.34 1356713530
SQL ordered by Parse Calls for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Parse Calls Threshold: 1000
% Total
Parse Calls Executions Parses Hash Value
select privilege#,level from sysauth$ connect by grantee#=prior
privilege# and privilege#>0 start with (grantee#=:1 or grantee#=
1) and privilege#>0
14 14 1.34 1554250272
Module: SQL Developer
select count(1) from all_objects where owner <> 'PUBLIC' and ob
ject_name in (:S0)
13 13 1.24 3468666020
select text from view$ where rowid=:1
12 12 1.15 825987371
Module: SQL Developer
declare l_line varchar2(255); l_done number; l_buffe
r long; begin loop exit when length(l_buffer)+255 > :maxby
tes OR l_done = 1; dbms_output.get_line( l_line, l_done );
l_buffer := l_buffer || l_line || chr(10); end loop; :done
:= l_done; :buffer := l_buffer; end;
12 12 1.15 2222871512
Module: SQL Developer
SELECT LINE,POSITION,TEXT FROM USER_ERRORS WHERE TYPE=:1AND NAME
=:2
11 11 1.05 701589132
Module: SQL Developer
BEGIN /* NOP UNLESS A TABLE OBJECT */ IF dictionary_
obj_type = 'TABLE' AND sys.dbms_cdc_publish.active > 0 THE
N sys.dbms_cdc_publish.change_table_trigger(dictionary_o
bj_owner,dictionary_obj_name,sysevent); END IF; END;
11 11 1.05 4144490151
delete from error$ where obj#=:1
11 11 1.05 4151580176
update obj$ set obj#=:6,type#=:7,ctime=:8,mtime=:9,stime=:10,sta
tus=:11,dataobj#=:13,flags=:14,oid$=:15,spare1=:16, spare2=:17 w
here owner#=:1 and name=:2 and namespace=:3 and(remoteowner=:4 o
r remoteowner is null and :4 is null)and(linkname=:5 or linkname
is null and :5 is null)and(subname=:12 or subname is null and :
10 10 0.95 292617943
delete from vtable$ where obj#=:1
10 10 0.95 412513799
select o.owner#, u.name, o.name, o.namespace,
o.obj#, d.d_timestamp, nvl(d.property,0), o.type#, o.s
ubname from dependency$ d, obj$ o, user$ u where d.p_obj#=:1
and (d.p_timestamp=:2 or d.property=2) and d.d_obj#=o.obj#
and o.owner#=u.user# and decode(:3,0,0,o.type#)=:3
10 10 0.95 1077743770
SQL ordered by Parse Calls for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Parse Calls Threshold: 1000
% Total
Parse Calls Executions Parses Hash Value
delete from argument$ where obj#=:1
SQL ordered by Sharable Memory for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Sharable Memory Threshold: 1048576
Sharable Mem (b) Executions % Total Hash Value
3,898,908 2 0.4 3259503395
Module: SQL Developer
select * from (SELECT OBJECT_NAME, OBJECT_ID ,'' short_name,
decode(( SELECT count (1) FROM SYS.ALL_TAB_PARTITIONS WHERE TAB
LE_OWNER =owner AND TABLE_NAME = object_name ),0,'FALSE','TRUE'
) partition, OWNER OBJECT_OWNER
FROM SYS.ALL_OBJECTS O WHERE O.OWNE
2,519,473 1 0.3 680078008
Module: SQL Developer
SELECT O.OBJECT_NAME, O.OBJECT_TYPE, O.OBJECT_ID FROM ALL_OBJE
CTS O WHERE O.OWNER = :1 AND O.OBJECT_NAME LIKE :2 AND O.
OBJECT_TYPE IN (:3) AND O.SUBOBJECT_NAME IS NULL AND O.SEC
ONDARY = 'N' AND ( O.OBJECT_TYPE <> 'INDEX' OR (
EXISTS (SELECT 1 FROM ALL_INDEXES I
1,882,420 1 0.2 4208944292
Module: SQL Developer
with pri_cols as ( SELECT cols.column_name column_name, cols.pos
ition column_position FROM all_constraints cons, al
l_cons_columns cols WHERE cons.constraint_type = 'P'
AND cons.constraint_name = cols.constraint_name
AND cons.owner = cols.owner and cols.table_name
1,687,994 4 0.2 1547382267
Module: SQL Developer
select object_type,owner,object_name,rank from ( select objec
t_type,owner,object_name,0 rank from all_objects where obj
ect_name = :NAME and UPPER(owner) = nvl(:OWNER,UPPER(sys_cont
ext('USERENV', 'CURRENT_SCHEMA'))) and object_type not in ( '
SYNONYM' ) union all select ao.object_type,ao.owner,ao.ob
1,406,016 2 0.1 2033073833
Module: SQL Developer
select parameter,value from nls_session_parameters union all SE
LECT 'DB_TIMEZONE' name, DBTIMEZONE value FROM DUAL union all S
ELECT parameter, value FROM nls_database_parameters WHERE parame
ter='NLS_CHARACTERSET'
SQL ordered by Version Count for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
-> End Version Count Threshold: 20
Version
Count Executions Hash Value
53 2 2033073833
Module: SQL Developer
select parameter,value from nls_session_parameters union all SE
LECT 'DB_TIMEZONE' name, DBTIMEZONE value FROM DUAL union all S
ELECT parameter, value FROM nls_database_parameters WHERE parame
ter='NLS_CHARACTERSET'
Instance Activity Stats for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
Statistic Total per Second per Trans
CPU used by this session 3,185 2.2 1,061.7
CPU used when call started 3,185 2.2 1,061.7
CR blocks created 48 0.0 16.0
Cached Commit SCN referenced 0 0.0 0.0
Commit SCN cached 0 0.0 0.0
DBWR buffers scanned 0 0.0 0.0
DBWR checkpoint buffers written 22 0.0 7.3
DBWR checkpoints 0 0.0 0.0
DBWR free buffers found 0 0.0 0.0
DBWR lru scans 0 0.0 0.0
DBWR make free requests 0 0.0 0.0
DBWR revisited being-written buff 0 0.0 0.0
DBWR summed scan depth 0 0.0 0.0
DBWR transaction table writes 6 0.0 2.0
DBWR undo block writes 12 0.0 4.0
SQL*Net roundtrips to/from client 1,570 1.1 523.3
SQL*Net roundtrips to/from dblink 18 0.0 6.0
active txn count during cleanout 188 0.1 62.7
background checkpoints completed 0 0.0 0.0
background checkpoints started 0 0.0 0.0
background timeouts 1,682 1.2 560.7
branch node splits 0 0.0 0.0
buffer is not pinned count 436,985 303.9 145,661.7
buffer is pinned count 948,328 659.5 316,109.3
bytes received via SQL*Net from c 803,800 559.0 267,933.3
bytes received via SQL*Net from d 6,405 4.5 2,135.0
bytes sent via SQL*Net to client 831,677 578.4 277,225.7
bytes sent via SQL*Net to dblink 3,735 2.6 1,245.0
calls to get snapshot scn: kcmgss 7,027 4.9 2,342.3
calls to kcmgas 763 0.5 254.3
calls to kcmgcs 208 0.1 69.3
change write time 375 0.3 125.0
cleanout - number of ktugct calls 3,728 2.6 1,242.7
cleanouts and rollbacks - consist 0 0.0 0.0
cleanouts only - consistent read 3,527 2.5 1,175.7
cluster key scan block gets 27,451 19.1 9,150.3
cluster key scans 12,274 8.5 4,091.3
commit cleanout failures: block l 0 0.0 0.0
commit cleanout failures: buffer 0 0.0 0.0
commit cleanout failures: callbac 2 0.0 0.7
commit cleanout failures: cannot 0 0.0 0.0
commit cleanouts 1,219 0.9 406.3
commit cleanouts successfully com 1,217 0.9 405.7
commit txn count during cleanout 3,574 2.5 1,191.3
consistent changes 95 0.1 31.7
consistent gets 926,553 644.3 308,851.0
consistent gets - examination 304,799 212.0 101,599.7
current blocks converted for CR 0 0.0 0.0
cursor authentications 13 0.0 4.3
data blocks consistent reads - un 95 0.1 31.7
db block changes 98,756 68.7 32,918.7
db block gets 80,228 55.8 26,742.7
deferred (CURRENT) block cleanout 613 0.4 204.3
dirty buffers inspected 3,379 2.4 1,126.3
enqueue conversions 90 0.1 30.0
enqueue releases 2,288 1.6 762.7
Instance Activity Stats for DB: CHRYSLER Instance: chrysler Snaps: 4 -6
Statistic Total per Second per Trans
enqueue requests 2,290 1.6 763.3
enqueue timeouts 0 0.0 0.0
enqueue waits 0 0.0 0.0
execute count 2,105 1.5 701.7
free buffer inspected 3,379 2.4 1,126.3
free buffer requested 4,937 3.4 1,645.7
hot buffers moved to head of LRU 243 0.2 81.0
immediate (CR) block cleanout app 3,527 2.5 1,175.7
immediate (CURRENT) block cleanou 240 0.2 80.0
index fast full scans (full) 0 0.0 0.0
index fetch by key 248,987 173.2 82,995.7
index scans kdiixs1 457,728 318.3 152,576.0
leaf node 90-10 splits 1 0.0 0.3
leaf node splits 36 0.0 12.0
logons cumulative 14 0.0 4.7
messages received 553 0.4 184.3
messages sent 553 0.4 184.3
no buffer to keep pinned count 0 0.0 0.0
no work - consistent read gets 483,400 336.2 161,133.3
opened cursors cumulative 806 0.6 268.7
parse count (failures) 14 0.0 4.7
parse count (hard) 41 0.0 13.7
parse count (total) 1,048 0.7 349.3
parse time cpu 21 0.0 7.0
parse time elapsed 37 0.0 12.3
physical reads 21,620 15.0 7,206.7
physical reads direct 17,317 12.0 5,772.3
physical writes 20,718 14.4 6,906.0
physical writes direct 17,317 12.0 5,772.3
physical writes non checkpoint 20,698 14.4 6,899.3
pinned buffers inspected 0 0.0 0.0
prefetched blocks 3,662 2.6 1,220.7
prefetched blocks aged out before 0 0.0 0.0
process last non-idle time 16,807,669,922 11,688,226.7 ############
recovery blocks read 0 0.0 0.0
recursive calls 19,103 13.3 6,367.7
recursive cpu usage 2,568 1.8 856.0
redo blocks written 29,780 20.7 9,926.7
redo buffer allocation retries 19 0.0 6.3
redo entries 51,190 35.6 17,063.3
redo log space requests 0 0.0 0.0
redo log space wait time 0 0.0 0.0
redo ordering marks 17 0.0 5.7
redo sizeI know, I must apply the latest patch to make it 9.2.0.8.0. coming back to your question, I am actually new in this company, don't know much about their nature of database. their database appears to run prety slow. specially, when they perfrom bulk DML activity. I've already suggested them to disable the indexes
and drop the constraints, but that didn't seem to work eighter. I though, you guys would able to offer something , which would make sence in order to kill the ongoing problem. Anyways, thanks for the inputs
hare krishna
Alok -
Moving a table with long data type column
hi
1.how to move a table with a long data type column in 8.1.7.3.0 ver database.
alter table APPLSYS.FND_LOBS_DOCUMENT move lob(BLOB_CONTENT) store as (tablespace testing)
ERROR at line 1:
ORA-00997: illegal use of LONG datatype
2. and a table with varray type column
alter table APPLSYS.WF_ERROR move lob("USER_DATA"."PARAMETER_LIST") store as (tablespace testing)
ERROR at line 1:
ORA-22917: use VARRAY to define the storage clause for this column or attribute
table description is:
SQL> desc applsys.wf_error;
Name Null? Type
Q_NAME VARCHAR2(30)
MSGID NOT NULL RAW(16)
CORRID VARCHAR2(128)
PRIORITY NUMBER
STATE NUMBER
DELAY DATE
EXPIRATION NUMBER
TIME_MANAGER_INFO DATE
LOCAL_ORDER_NO NUMBER
CHAIN_NO NUMBER
CSCN NUMBER
DSCN NUMBER
ENQ_TIME DATE
ENQ_UID NUMBER
ENQ_TID VARCHAR2(30)
DEQ_TIME DATE
DEQ_UID NUMBER
DEQ_TID VARCHAR2(30)
RETRY_COUNT NUMBER
EXCEPTION_QSCHEMA VARCHAR2(30)
EXCEPTION_QUEUE VARCHAR2(30)
STEP_NO NUMBER
RECIPIENT_KEY NUMBER
DEQUEUE_MSGID RAW(16)
SENDER_NAME VARCHAR2(30)
SENDER_ADDRESS VARCHAR2(1024)
SENDER_PROTOCOL NUMBER
USER_DATA APPS.WF_EVENT_T
lob column:
SQL> select owner,table_name,column_name from dba_lobs where table_name='WF_ERROR';
OWNER TABLE_NAME COLUMN_NAME
APPLSYS WF_ERROR "USER_DATA"."PARAMETER_LIST"
APPLSYS WF_ERROR "USER_DATA"."EVENT_DATA"
pls help me
thanks and regards
srinivas1. Export and import
2. Sql*Plus 'copy' command
It is a good idea to move from 'LONG' to 'CLOB'. -
DBMS_METADATA.GET_DDL inside the pl/sql procedure
We have a requirement to drop certain materialized view and need to recreate based on certain condition inside the
pl/sql procedure.i am using the dbms_metadata to get the Mv ddls.
var1 := 'SELECT DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW,'MV_NAME','OWNER')'|| 'from dual' || ';' ;
dbms_output.put_line(var1);
But i am unable to get the create ddl syntax in var1.
Can anyone help me on thisHi Deepu,
you are not helping us too much. You information are coming drop by drop.
Anyway, I don't have a materialized view but I have tried with a table.
Here is my test and output (what I expect you too show us too):
First test using normal SELECT FROM DUAL:
SET LONG 2000000
SET HEAD OFF
SET ECHO ON
SELECT DBMS_METADATA.get_ddl ('TABLE', 'ALERT_QT', 'SYS') FROM DUAL;
Output:
SQL>
SQL> SELECT DBMS_METADATA.get_ddl ('TABLE', 'ALERT_QT', 'SYS') FROM DUAL;
CREATE TABLE "SYS"."ALERT_QT"
( "Q_NAME" VARCHAR2(30),
"MSGID" RAW(16),
"CORRID" VARCHAR2(128),
"PRIORITY" NUMBER,
"STATE" NUMBER,
"DELAY" TIMESTAMP (6),
"EXPIRATION" NUMBER,
"TIME_MANAGER_INFO" TIMESTAMP (6),
"LOCAL_ORDER_NO" NUMBER,
"CHAIN_NO" NUMBER,
"CSCN" NUMBER,
"DSCN" NUMBER,
"ENQ_TIME" TIMESTAMP (6),
"ENQ_UID" VARCHAR2(30),
"ENQ_TID" VARCHAR2(30),
"DEQ_TIME" TIMESTAMP (6),
"DEQ_UID" VARCHAR2(30),
"DEQ_TID" VARCHAR2(30),
"RETRY_COUNT" NUMBER,
"EXCEPTION_QSCHEMA" VARCHAR2(30),
"EXCEPTION_QUEUE" VARCHAR2(30),
"STEP_NO" NUMBER,
"RECIPIENT_KEY" NUMBER,
"DEQUEUE_MSGID" RAW(16),
"SENDER_NAME" VARCHAR2(30),
"SENDER_ADDRESS" VARCHAR2(1024),
"SENDER_PROTOCOL" NUMBER,
"USER_DATA" "SYS"."ALERT_TYPE" ,
"USER_PROP" "SYS"."ANYDATA" ,
PRIMARY KEY ("MSGID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "SYSAUX" ENABLE
) USAGE QUEUE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGIN
G
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "SYSAUX"
OPAQUE TYPE "USER_PROP" STORE AS LOB (
ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
CACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
{code}
Now with the procedure storing in CLOB variable
{code:sql}
SET SERVEROUTPUT ON SIZE UNLIMITED
SET LIN 5000
SET LONG 20000000
SET ECHO ON
DECLARE
l_clob CLOB;
BEGIN
l_clob := DBMS_METADATA.get_ddl ('TABLE', 'ALERT_QT', 'SYS');
DBMS_OUTPUT.put_line (l_clob);
END;
Output:
SQL>
SQL> DECLARE
2 l_clob CLOB;
3 BEGIN
4 l_clob := DBMS_METADATA.get_ddl ('TABLE', 'ALERT_QT', 'SYS');
5 DBMS_OUTPUT.put_line (l_clob);
6 END;
7 /
CREATE TABLE "SYS"."ALERT_QT"
( "Q_NAME" VARCHAR2(30),
"MSGID" RAW(16),
"CORRID" VARCHAR2(128),
"PRIORITY" NUMBER,
"STATE" NUMBER,
"DELAY" TIMESTAMP (6),
"EXPIRATION" NUMBER,
"TIME_MANAGER_INFO" TIMESTAMP (6),
"LOCAL_ORDER_NO" NUMBER,
"CHAIN_NO" NUMBER,
"CSCN" NUMBER,
"DSCN" NUMBER,
"ENQ_TIME" TIMESTAMP (6),
"ENQ_UID" VARCHAR2(30),
"ENQ_TID" VARCHAR2(30),
"DEQ_TIME" TIMESTAMP (6),
"DEQ_UID" VARCHAR2(30),
"DEQ_TID" VARCHAR2(30),
"RETRY_COUNT" NUMBER,
"EXCEPTION_QSCHEMA" VARCHAR2(30),
"EXCEPTION_QUEUE" VARCHAR2(30),
"STEP_NO" NUMBER,
"RECIPIENT_KEY" NUMBER,
"DEQUEUE_MSGID" RAW(16),
"SENDER_NAME" VARCHAR2(30),
"SENDER_ADDRESS" VARCHAR2(1024),
"SENDER_PROTOCOL" NUMBER,
"USER_DATA" "SYS"."ALERT_TYPE" ,
"USER_PROP" "SYS"."ANYDATA" ,
PRIMARY KEY ("MSGID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "SYSAUX" ENABLE
) USAGE QUEUE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "SYSAUX"
OPAQUE TYPE "USER_PROP" STORE AS LOB (
ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
CACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
{code}
It should be nice if you could post your tests too if they are not working.
Regards.
Al -
DB version: Oracle Database 10g Enterprise Edition Release 10.1.0.3.1
A small number of messages stuck in a queue table when our messaging system load is high.
The 'state' column has value '3' in all these rows. What does that mean ?
Why they are stuck over there ?
thanks
We got following rows when query the queue table:
SQL> select * from trans_t_2;
Q_NAME MSGID
CORRID
PRIORITY STATE
DELAY
EXPIRATION
TIME_MANAGER_INFO
LOCAL_ORDER_NO CHAIN_NO CSCN DSCN
ENQ_TIME
ENQ_UID ENQ_TID
DEQ_TIME
DEQ_UID DEQ_TID RETRY_COUNT
EXCEPTION_QSCHEMA EXCEPTION_QUEUE STEP_NO
RECIPIENT_KEY DEQUEUE_MSGID SENDER_NAME
SENDER_ADDRESS
SENDER_PROTOCOL
USER_DATA(STORE_ID)
USER_PROP()
AQ$_TRANS_T_2_E 495DCB163CD07743E040A8C039014231
:EMAILDRIVER:
0 3
0
0 0 0 0
26-MAR-08 03.22.56.895319 PM
WIRELESS 34.16.7968
0
TRANS_Q_2 0
0
TRANS_STORE_OBJECT(738922)
AQ$_TRANS_T_2_E 495E82B0D97B33BBE040A8C0390145BC
:EMAILDRIVER:
0 3
0
0 0 0 0
26-MAR-08 03.22.56.914877 PM
WIRELESS 2.34.522909
0
TRANS_Q_2 0
0
TRANS_STORE_OBJECT(738924)Hello,
The messages are not stuck they have expired and been placed in the default exception queue AQ$_TRANS_T_2_E. The messages will have been put in the queue for the EXPIRATION_REASON given in the AQ$TRANS_T_2 view. The messages will have been placed in the exception queue by the qmon processes for that reason and when designing your application you need to consider the possibility that messages may be placed in the exception queue and what you intend to do when they are placed there.
When examining the state of messages in the queues associated with a queue table you should be querying the view AQ$TRANS_T_2 and not the underlying objects. The view interprets the underlying values for you and gives consistent information generated from all the objects associated with a queue table.
Thanks
Peter -
Problem with approving standard workflows.
We are testing workflows in Content DB prior to initiating a larger project. We have defined a serial approval workflow for uploading a file to a folder. When a file is uploaded, the approver can see the request but is not given the possibility to approve or reject the request.
The approver has been granted "approval" role with standard permissions "Set Attributes, Set Metadata, Discover, Lock, Get Metadata, Get Content, Set Content, Copy".
What can be missing in our setup that blocks for approving in workflows?A few things to check:
1) That a message appears (briefly) on the outbound advanced queue (IFS_OUT) when the workflow is triggered. You can perform a "select * from ifs_out_table;" You need to be quick though.
However, if there is a build up of messages on the queue, but none are being removed, it would appear the Oracle Workflow process is not running.
2) If the message appears on the queue (briefly), then disappears, workflow is correctly dequeing the message.
In order for the approve/reject buttons to become visible in the Content DB Web UI, Oracle Workflow must repond on the inbound queue (IFS_IN) with seperate "notification" messages for each of the applicable responders.
If "orcladmin" was a responder for the worflow, a queue message may look like :-
IFS Queue Message Details:
Message Type: IFS_ECM_WORKFLOW_NID
IFS Queue Message Parameters:
IFS_ECM_WORKFLOW_PROCESSID=48799 (STRING)
IFS_ECM_WORKFLOW_RESPONDER=ORCLADMIN (STRING)
IFS_ECM_WORKFLOW_NID=3 (STRING)
You will thus need to monitor the inbound queue table (IFS_IN_TABLE) - and see if Worflow is responding to the request with these responder notifications.
If workflow is not returning notifications for each responder of the original request, then the Workflow process has failed / or is not running. You will need to check with the Oracle Workflow guys on how to debug workflow further.
If however, the notification messages are on the IFS_IN queue, but are not being removed, it means the Content DB agent responsible for processing inbound queue messages is not running.
The agent responsible for this is the InboundQueueListenerAgent. Check the Content DB node log file and search for entries relating to oracle.ifs.management.servers.InboundQueueListenerAgent
You will notice a table in the Content DB schema named odm_responder
SQL> desc odm_responder;
Name Null? Type
ID NOT NULL NUMBER(20)
REQUEST NUMBER(20)
RESPONDERUSER NUMBER(20)
RESPONSE NUMBER(1)
RESPONSEDATE NUMBER(20)
NOTIFICATIONID NUMBER(20)
For a particular responder to see approve/reject buttons for a particular request, I believe the notificationid value has to be non-null.
BTW - the message on the IFS_OUT queue will look something like :-
Q_NAME MSGID
CORRID
PRIORITY STATE
DELAY
EXPIRATION
TIME_MANAGER_INFO
LOCAL_ORDER_NO CHAIN_NO CSCN DSCN
ENQ_TIME
ENQ_UID ENQ_TID
DEQ_TIME
DEQ_UID DEQ_TID RETRY_COUNT
EXCEPTION_QSCHEMA EXCEPTION_QUEUE STEP_NO
RECIPIENT_KEY DEQUEUE_MSGID SENDER_NAME
SENDER_ADDRESS
SENDER_PROTOCOL
USER_DATA(MESSAGETYPE, PARAMETERLIST(NAME, VALUE, DATATYPE))
USER_PROP()
IFS_OUT 37A0E24085DB24DCE040BB0AC8417ABA
1 0
0 0 0 0
16/AUG/07 04:48:32.357811 PM
65 9.21.1157
0
0
0
IFSQUEUEMESSAGE('START_STANDARD_WORKFLOW', PARAMETERS(
IFSQUEUEMESSAGEPARAMETER('IFS_ECM_WORKFLOW_MINYESVOTES', '1', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_APPROVE_MSG', 'Choose Yes to Approve the request.', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_MESSAGE_SUBJECT', 'CreateWorkspace Request 43436 submitted in Content Services', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_REJECT_MSG', 'Choose No to Reject the request.', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_ECM_WORKFLOW_OWNER', 'ASLAM', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_MESSAGE_HEADER', 'A CreateWorkspace Request has been submitted in Content Services. You are...', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_REQUEST_TIMEOUT', '14', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_ECM_WORKFLOW_JUSTIFICATION', 'please approve', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_ECM_WORKFLOW_REQUESTID', '43436', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_AGENT_BASED_REQUEST', 'N', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_ECM_WORKFLOW_RESPONDERS', 'ASLAM CONTENTADMIN ORCLADMIN', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_ECM_WORKFLOW_MINNOVOTES', '1', 'STRING'),
IFSQUEUEMESSAGEPARAMETER('IFS_ECM_WORKFLOW_PROCESSID', '43446', 'STRING')))
Workflow must return a notification id message for each person listed in the IFS_ECM_WORKFLOW_RESPONDERS queue parameter.
in the case above, the requesters are "ASLAM, CONTENTADMIN, ORCLADMIN"
Using the request id from above ..
SQL> select responderuser from content.odmv_responder where request = 43436;
RESPONDERUSER
38503
...etc
select name from odmv_publicobject where id = 38503
NAME
orcladmin
select notificationid from content.odmv_responder where request = 43591;
NOTIFICATIONID
notice the notificationid is NULL - meaning approve/reject buttons would not be visible
cheers
Matt. -
Read Only Schema in Oracle APPS EBS R12 database
I want create a read only schema say apps_read in EBS database which have select access on all objects like apps. Kindly let us know how can I accomplish it or What is the best practice of doing it.
Hussein - I have gone through all the threads but No one solves my problem. Actually there is a table in applsys schema i.e table_name ecx_outqueue.
ECX_OUTQUEUE is having columns of type "User Defined Type Objects". I have highlighted these columns in Italics. Kindly help me How I can give select access on these user defined objects.on
SQL> desc applsys.ecx_outqueue
Name Null? Type
Q_NAME VARCHAR2(30)
MSGID NOT NULL RAW(16)
CORRID VARCHAR2(128)
PRIORITY NUMBER
STATE NUMBER
DELAY TIMESTAMP(6)
EXPIRATION NUMBER
TIME_MANAGER_INFO TIMESTAMP(6)
LOCAL_ORDER_NO NUMBER
CHAIN_NO NUMBER
CSCN NUMBER
DSCN NUMBER
ENQ_TIME TIMESTAMP(6)
ENQ_UID NUMBER
ENQ_TID VARCHAR2(30)
DEQ_TIME TIMESTAMP(6)
DEQ_UID NUMBER
DEQ_TID VARCHAR2(30)
RETRY_COUNT NUMBER
EXCEPTION_QSCHEMA VARCHAR2(30)
EXCEPTION_QUEUE VARCHAR2(30)
STEP_NO NUMBER
RECIPIENT_KEY NUMBER
DEQUEUE_MSGID RAW(16)
SENDER_NAME VARCHAR2(30)
SENDER_ADDRESS VARCHAR2(1024)
SENDER_PROTOCOL NUMBER
USER_DATA SYSTEM.ECXMSG
USER_PROP SYS.ANYDATA
SQL> -
Oracle 11g AQ : problem enqueue user-defined type with varchar2 attribute
Hello.
I have a problem enqueuing a user-defined type to the queue on Oracle 10g.
I'm using jdbc driver (ojdbc5.jar, version 11.1.0.6.0) as they provide oracle.jdbc.aq package.
The type is following:
CREATE OR REPLACE TYPE FIXED_T5 AS OBJECT
(id integer,
label varchar2(100),
code integer,
today date
)I have created a java class for this type with jpub utility supplied with oracle 11g client package:
jpub -user=scott/tger -url=jdbc:oracle:thin:@host:sid-sql=FIXED_T5:ru.invito.FixedType -compile=falseIt generated FixedType.java and FixedTypeRef.java files. Don't understand why i need the latter (FixedTypeRef).
Then in test app:
package ru.invito;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Properties;
import java.util.UUID;
import junit.framework.TestCase;
import oracle.jdbc.aq.AQAgent;
import oracle.jdbc.aq.AQEnqueueOptions;
import oracle.jdbc.aq.AQFactory;
import oracle.jdbc.aq.AQMessage;
import oracle.jdbc.aq.AQMessageProperties;
import oracle.jdbc.aq.AQEnqueueOptions.DeliveryMode;
import oracle.jdbc.aq.AQEnqueueOptions.VisibilityOption;
import oracle.jdbc.driver.OracleConnection;
import oracle.jdbc.driver.OracleDriver;
import oracle.sql.Datum;
import oracle.sql.STRUCT;
import oracle.sql.StructDescriptor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class AqTest extends TestCase {
protected Log logger = LogFactory.getLog(getClass());
public void testEnqueue() throws Exception {
OracleDriver dr = new OracleDriver();
Properties prop = new Properties();
prop.setProperty("user", Config.USERNAME);
prop.setProperty("password", Config.PASSWORD);
OracleConnection connection = (OracleConnection) dr.connect(Config.JDBC_URL, prop);
assertNotNull(connection);
connection.setAutoCommit(false);
enqueueMessage(connection, "INVITO.FIXED_T5Q", null);
connection.commit();
private void enqueueMessage(OracleConnection conn, String queueName, AQAgent[] recipients) throws SQLException,
IOException {
logger.debug("----------- Enqueue start ------------");
AQMessageProperties props = makeProps(queueName);
AQMessage mesg = AQFactory.createAQMessage(props);
String msqText = String.format("Hello, %s!", queueName);
FixedType data = createData(36, msqText);
Datum d = data.toDatum(conn);
STRUCT s = (STRUCT) d;
debugStruct("s", s);
String toIdStr = byteBufferToHexString(s.getDescriptor().getOracleTypeADT().getTOID(), 20);
logger.debug("s.toIdStr: " + toIdStr);
StructDescriptor sd = StructDescriptor.createDescriptor("INVITO.FIXED_T5", conn);
logger.debug("sd.toXMLString(): " + sd.toXMLString());
mesg.setPayload(s);
AQEnqueueOptions opt = makeEnqueueOptions();
logger.debug("sending............");
// execute the actual enqueue operation:
conn.enqueue(queueName, opt, mesg);
debugMessageId(mesg);
logger.debug("----------- Enqueue done ------------");
private void debugMessageId(AQMessage mesg) throws SQLException {
byte[] mesgId = mesg.getMessageId();
if (mesgId == null) {
throw new IllegalStateException("message id is NULL");
String mesgIdStr = byteBufferToHexString(mesgId, 20);
logger.debug("Message ID from enqueue call: " + mesgIdStr);
* @return
* @throws SQLException
private FixedType createData(int ID, String label) throws SQLException {
FixedType data = new FixedType();
data._struct.setNChar(1);// initializes the flag for 'label' field
data.setId(ID);
data.setLabel(label);
data.setCode(1);
Date today = new Date();
data.setToday(new Timestamp(today.getTime()));
return data;
* @param string
* @param s
* @throws SQLException
private void debugStruct(String string, STRUCT s) throws SQLException {
logger.debug(s + ".debugString(): " + s.debugString());
logger.debug(s + "s.dump(): " + s.dump());
* @return
* @throws SQLException
private AQAgent makeAgent() throws SQLException {
AQAgent ag = AQFactory.createAQAgent();
ag.setName("AQ_TEST");
String agentAddress = null;
try {
agentAddress = InetAddress.getLocalHost().getHostAddress();
catch (UnknownHostException e) {
logger.error("cannot resolve localhost ip address. will not set it as AQ Agent address");
agentAddress = "NA";
ag.setAddress(agentAddress);
return ag;
private AQMessageProperties makeProps(String queueName) throws SQLException {
final String EXCEPTION_Q_TEMPLATE = "AQ$_%sT_E";
final int DEFAULT_DELAY = 0;
final int DEFAULT_EXPIRATION = -1;
final int DEFAULT_PRIORITY = 0;
AQMessageProperties propeties = AQFactory.createAQMessageProperties();
propeties.setCorrelation(UUID.randomUUID().toString());
propeties.setDelay(DEFAULT_DELAY);
propeties.setExceptionQueue(String.format(EXCEPTION_Q_TEMPLATE, queueName));
propeties.setExpiration(DEFAULT_EXPIRATION);
propeties.setPriority(DEFAULT_PRIORITY);
// propeties.setRecipientList(null);//should not set
propeties.setSender(makeAgent());
return propeties;
* @return
* @throws SQLException
private AQEnqueueOptions makeEnqueueOptions() throws SQLException {
AQEnqueueOptions opt = new AQEnqueueOptions();
opt.setRetrieveMessageId(true);
// these are the default settings (if none specified)
opt.setDeliveryMode(DeliveryMode.PERSISTENT);
opt.setTransformation(null);
opt.setVisibility(VisibilityOption.ON_COMMIT);
return opt;
* Form the AQ reference
* @param buffer
* @param maxNbOfBytes
* @return
private static final String byteBufferToHexString(byte[] buffer, int maxNbOfBytes) {
if (buffer == null)
return null;
int offset = 0;
StringBuffer sb = new StringBuffer();
while (offset < buffer.length && offset < maxNbOfBytes) {
String hexrep = Integer.toHexString((int) buffer[offset] & 0xFF);
if (hexrep.length() == 1)
hexrep = "0" + hexrep;
sb.append(hexrep);
offset++;
String ret = sb.toString();
return ret;
}The output is following:
[main] 2008-07-03 19:09:49,863 DEBUG [ru.invito.AqTest] - ----------- Enqueue start ------------
[main] 2008-07-03 19:09:50,348 DEBUG [ru.invito.AqTest] - [email protected](): name = INVITO.FIXED_T5 length = 4 attribute[0] = 36 attribute[1] = Hell
o, INVITO.FIXED_T5Q! attribute[2] = 1 attribute[3] = 2008-07-03 19:09:49.0
[main] 2008-07-03 19:09:50,363 DEBUG [ru.invito.AqTest] - [email protected](): name = INVITO.FIXED_T5
length = 4
ID = 36
LABEL = Hello, INVITO.FIXED_T5Q!
CODE = 1
TODAY = 2008-07-03 19:09:49.0
[main] 2008-07-03 19:09:50,363 DEBUG [ru.invito.AqTest] - s.toIdStr: 507ccce5b6e9f572e040007f01007203
[main] 2008-07-03 19:09:50,363 DEBUG [ru.invito.AqTest] - sd.toXMLString(): <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<StructDescriptor sqlName="INVITO.FIXED_T5" >
<OracleTypeADT sqlName="INVITO.FIXED_T5" typecode="0" tds_version="1"
is_embedded="false" is_top_level="true" is_upt="false" finalType="true" subtype="false">
<attributes>
<attribute name="ID" type="INTEGER" >
<OracleType typecode="2" />
</attribute>
<attribute name="LABEL" type="VARCHAR2" >
<OracleType typecode="12" />
</attribute>
<attribute name="CODE" type="INTEGER" >
<OracleType typecode="2" />
</attribute>
<attribute name="TODAY" type="DATE" >
<OracleType typecode="0" />
</attribute>
</attributes>
</OracleTypeADT>
</StructDescriptor>
[main] 2008-07-03 19:09:50,379 DEBUG [ru.invito.AqTest] - sending............
[main] 2008-07-03 19:09:50,395 DEBUG [ru.invito.AqTest] - Message ID from enqueue call: 511ff143bd4fa536e040007f01003192
[main] 2008-07-03 19:09:50,395 DEBUG [ru.invito.AqTest] - ----------- Enqueue done ------------But when dequeueing the 'label' attribute is lost:
DECLARE
dequeue_options DBMS_AQ.dequeue_options_t;
message_properties DBMS_AQ.message_properties_t;
message_handle RAW(16);
message fixed_t5;
BEGIN
dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;
DBMS_AQ.DEQUEUE(
queue_name => 'fixed_t5q',
dequeue_options => dequeue_options,
message_properties => message_properties,
payload => message,
msgid => message_handle);
DBMS_OUTPUT.PUT_LINE('ID : '||message.id);
DBMS_OUTPUT.PUT_LINE('Label: '||message.label);
DBMS_OUTPUT.PUT_LINE('Code : '||message.code);
DBMS_OUTPUT.PUT_LINE('Today: '||message.today);
COMMIT;
END;
ID : 36
Label:
Code : 1
Today: 03.07.08
Could anyone tell me what is wrong with the setup/code?
Why 'label' not saved in queue, though i saw it is not empty in STRUCT?Thank you for the reply!
I have enqueued:
[main] 2008-07-04 15:30:30,639 DEBUG [ru.invito.UserDefinedTypeAqTest$1] - [email protected](): name = INVITO.FIXED_T5
length = 4
ID = 41
LABEL = Hello, INVITO.FIXED_T5Q!
CODE = 1
TODAY = 2008-07-04 15:30:30.0and in table (select * from FIXED_T5QT) the 'label' is blank:
Q_NAME FIXED_T5Q
MSGID 51310809B5EA3728E040007F01000C79
CORRID b8f38fd3-4fa6-4e0f-85d1-2440d02d655e
PRIORITY 0
STATE 0
DELAY
EXPIRATION
TIME_MANAGER_INFO
LOCAL_ORDER_NO 0
CHAIN_NO 0
CSCN 0
DSCN 0
ENQ_TIME 04.07.2008 15:28:44
ENQ_UID INVITO
ENQ_TID 4012
DEQ_TIME
DEQ_UID
DEQ_TID
RETRY_COUNT 0
EXCEPTION_QSCHEMA AQ$_INVITO
EXCEPTION_QUEUE FIXED_T5QT_E
STEP_NO 0
RECIPIENT_KEY 0
DEQUEUE_MSGID
SENDER_NAME AQ_TEST
SENDER_ADDRESS 10.1.1.137
SENDER_PROTOCOL
USER_DATA.ID 41
USER_DATA.LABEL
USER_DATA.CODE 1
USER_DATA.TODAY 04.07.2008 15:30:30I must point to a strange thing: when the FixedType instance is created (via new operator) and then the setLabel("....") called as:
FixedType data = new FixedType();
// hack: proper initialization for 'label' field
data._struct.setNChar(1);
data.setId(ID);
data.setLabel(label);
data.setCode(1);
Date today = new Date();
data.setToday(new Timestamp(today.getTime()));
Datum d = data.toDatum(connection);
STRUCT s = (STRUCT) d;
logger.debug(s + ".debugString(): " + s.debugString());
logger.debug(s + ".dump(): " + s.dump());and if i comment line (data._struct.setNChar(1);) the debug messages for created STRUCT also shows empty value for label.
But if i explicitly call data._struct.setNChar(1) then debug contains the label i defined in call to the setLabel method. -
Why are messages not dequeuing and stuck in the ready state?
Messages are successfully enqueueing but not dequeuing and are stuck in ready state (STATE = 0). The ENQ_TIME is 5 hours ahead of system time. In one environment, AQ is working (10g 10.2.0.4.0). In the other environment, it is not working (11g 11.2.0.3.0).
I just did the following:
1. Purged queue table
2. Stopped queues
3. Dropped queues
4. Dropped queue table
5. Created queue table
6. Created queues
7. Started queues
I tested once and a record was inserted in the queue table:
MSGID <msgid>
CORRID
PRIORITY 1
STATE 0
DELAY
EXPIRATION
TIME_MANAGER_INFO
LOCAL_ORDER_NO 0
CHAIN_NO 0
CSCN 0
DSCN 0
ENQ_TIME 12/23/2014 4:33:43.338902 PM
ENQ_UID <enq_uid>
ENQ_TID <enq_tid>
DEQ_TIME
DEQ_UID
DEQ_TID
RETRY_COUNT 0
EXCEPTION_QSCHEMA
EXCEPTION_QUEUE
STEP_NO 0
RECIPIENT_KEY 0
DEQUEUE_MSGID
SENDER_NAME
SENDER_ADDRESS
SENDER_PROTOCOL
USER_DATA <user_data>
USER_PROP
Notice the RETRY_COUNT is 0. The ENQ_TIME is 5 hours ahead. In the procedures to enqueue and dequeue, there are no errors.
Following is the plsql to enqueue:
CREATE OR REPLACE PACKAGE BODY
pkg_2
AS
FUNCTION queue_create_thing ( <parameters> )
RETURN NUMBER
IS
enqueue_options dbms_aq.enqueue_options_t;
message_properties dbms_aq.message_properties_t;
message_handle RAW(16);
v_message msg_type;
v_thing_id things.id%TYPE;
BEGIN
v_message := msg_type( <parameters> );
dbms_aq.enqueue(queue_name => '<queue name>',
enqueue_options => enqueue_options,
message_properties => message_properties,
payload => v_message,
msgid => message_handle);
RETURN v_thing_id;
EXCEPTION
WHEN OTHERS
THEN
errpkg.record_and_stop (SQLCODE);
END queue_create_thing;
PROCEDURE queue_delete_thing( <parameters> )
IS
enqueue_options dbms_aq.enqueue_options_t;
message_properties dbms_aq.message_properties_t;
message_handle RAW(16);
v_message msg_type;
BEGIN
v_message := msg_type( <parameters> );
dbms_aq.enqueue(queue_name => '<queue name>',
enqueue_options => enqueue_options,
message_properties => message_properties,
payload => v_message,
msgid => message_handle);
END;
END pkg_2;
Following is the code to dequeue:
CREATE OR REPLACE PACKAGE BODY
pkg_1
AS
PROCEDURE create_thing ( context IN RAW,
reginfo IN sys.aq$_reg_info,
descr IN sys.aq$_descriptor,
payload IN RAW,
payloadl IN NUMBER )
IS
dequeue_options dbms_aq.dequeue_options_t;
message_properties dbms_aq.message_properties_t;
message_handle RAW(16);
message msg_type;
BEGIN
dequeue_options.msgid := descr.msg_id;
dequeue_options.consumer_name := descr.consumer_name;
DBMS_AQ.DEQUEUE(queue_name => descr.queue_name,
dequeue_options => dequeue_options,
message_properties => message_properties,
payload => message,
msgid => message_handle);
pkg_2.create_thing( p_thing_id => message.thing_id );
UPDATE table t
SET creation_complete = 1
WHERE id = message.thing_id;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
plog.error(SQLERRM);
plog.full_call_stack;
END create_thing;
PROCEDURE delete_thing ( context IN RAW,
reginfo IN sys.aq$_reg_info,
descr IN sys.aq$_descriptor,
payload IN RAW,
payloadl IN NUMBER )
IS
dequeue_options dbms_aq.dequeue_options_t;
message_properties dbms_aq.message_properties_t;
message_handle RAW(16);
message msg_type;
BEGIN
dequeue_options.msgid := descr.msg_id;
dequeue_options.consumer_name := descr.consumer_name;
DBMS_AQ.DEQUEUE(queue_name => descr.queue_name,
dequeue_options => dequeue_options,
message_properties => message_properties,
payload => message,
msgid => message_handle);
pkg_2.delete_thing( p_thing_id => message.thing_id );
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
plog.error(SQLERRM);
plog.full_call_stack;
END delete_thing;
END pkg_1;Following is the code to create the queue:
BEGIN
SYS.DBMS_AQADM.STOP_QUEUE ( QUEUE_NAME => '<queue name>');
SYS.DBMS_AQADM.DROP_QUEUE ( QUEUE_NAME => '<queue name>');
END;
BEGIN
SYS.DBMS_AQADM.CREATE_QUEUE
QUEUE_NAME => '<queue name>'
,QUEUE_TABLE => '<queue table>'
,QUEUE_TYPE => SYS.DBMS_AQADM.NORMAL_QUEUE
,MAX_RETRIES => 5
,RETRY_DELAY => 0
,RETENTION_TIME => 0
,COMMENT => 'Queue for processing creation of things'
END;
BEGIN
SYS.DBMS_AQADM.START_QUEUE
QUEUE_NAME => '<queue name>'
,ENQUEUE => TRUE
,DEQUEUE => TRUE
END; -
Process flow hanging in owb 11.2.0.2
Hello All,
My process flow keeps on running and never completes but in the design center I see that my maps have all completed, I checked my tables and the data has been loaded.
There is this process running in the background. I don't know what this is trying to do.
How could i solve this problem.
select /*+ FIRST_ROWS(1) */ tab.rowid, tab.msgid, tab.corrid, tab.priority, tab.delay, tab.expiration ,tab.retry_count, tab.exception_qschema, tab.exception_queue, tab.chain_no, tab.local_order_no, tab.enq_time, tab.time_manager_info, tab.state, tab.enq_tid, tab.step_no, tab.sender_name, tab.sender_address, tab.sender_protocol, tab.dequeue_msgid, tab.user_prop, tab.user_data
from "OWBSYS"."WB_RT_NOTIFY_QUEUE_TAB" tab
where q_name = :1 and corrid = :2 and (state = :3 ) for update skip locked
SELECT MIN(MSGID)
FROM WB_RT_NOTIFY_QUEUE_TAB N1
WHERE PRIORITY = (
SELECT MIN(N2.MSG_PRIORITY)
FROM AQ$WB_RT_NOTIFY_QUEUE_TAB N2
WHERE N2.CORR_ID = :B1 AND MSG_STATE = 'READY') AND N1.CORRID = :B1
BEGIN wb_rt_notification.wait( :1 , :2 ,
:3 , :4 , :5 )
; END;Hi,
We are dealing with the same issue. Is this solved yet at your site?
I also note there are lots of records in WB_RT_NOTIFY_QUEUE_TAB. A lot of the AQ$_WB_RT_NOTIFY_QUEUE_TAB_E records are pretty old
Can I just delete them?
SQL> select count(*), Q_NAME from owbsys.WB_RT_NOTIFY_QUEUE_TAB group by Q_NAME;
COUNT(*) Q_NAME
80223 WB_RT_NOTIFY_QUEUE
751129 AQ$_WB_RT_NOTIFY_QUEUE_TAB_E
best regards, Hans -
Hi there,
I want to name all objects that are automatically created by Oracle 10g when creating a queue.
Those objects are:
SYS_... Index on MSGID column of Queue Table.
SYS_LOB... LOB corresponding to USER_PROP SYSANYDATA column in Queue Table
AQ$_... Indexes, views and queue automatically created with the queue.
Is there a way to use custom names for all these objects at creation, especially for SYS_ index and SYS_LOB?
I tried the storage clause with no luck as it say that "USER_PROP" is an invalid identifier (LOB(USER_PROP) STORE AS XXX)
Thank you very much in advance.Hi Neerb,
Consider this:
CREATE TABLE "EDC"."RAW_DATA_QUEUETAB"
( "Q_NAME" VARCHAR2(30 BYTE),
"MSGID" RAW(16),
"CORRID" VARCHAR2(128 BYTE),
"PRIORITY" NUMBER,
"STATE" NUMBER,
"DELAY" TIMESTAMP (6),
"EXPIRATION" NUMBER,
"TIME_MANAGER_INFO" TIMESTAMP (6),
"LOCAL_ORDER_NO" NUMBER,
"CHAIN_NO" NUMBER,
"CSCN" NUMBER,
"DSCN" NUMBER,
"ENQ_TIME" TIMESTAMP (6),
"ENQ_UID" VARCHAR2(30 BYTE),
"ENQ_TID" VARCHAR2(30 BYTE),
"DEQ_TIME" TIMESTAMP (6),
"DEQ_UID" VARCHAR2(30 BYTE),
"DEQ_TID" VARCHAR2(30 BYTE),
"RETRY_COUNT" NUMBER,
"EXCEPTION_QSCHEMA" VARCHAR2(30 BYTE),
"EXCEPTION_QUEUE" VARCHAR2(30 BYTE),
"STEP_NO" NUMBER,
"RECIPIENT_KEY" NUMBER,
"DEQUEUE_MSGID" RAW(16),
"SENDER_NAME" VARCHAR2(30 BYTE),
"SENDER_ADDRESS" VARCHAR2(1024 BYTE),
"SENDER_PROTOCOL" NUMBER,
"USER_DATA" "EDC"."MEASUREMENT_RAW_DATA_TYPE" ,
"USER_PROP" "SYS"."ANYDATA" ,
PRIMARY KEY ("MSGID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "EDC_MAIN" ENABLE
) USAGE QUEUE PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "EDC_MAIN"
LOB ("USER_DATA"."RAW_MESSAGE") STORE AS "RDQT_RAW_MESSAGE_LOBSEG"(
TABLESPACE "EDC_MAIN" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))
OPAQUE TYPE "USER_PROP" STORE AS LOB (
ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
CACHE
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) ;
Just an idea ...
Perhaps this helps you.
Please post here again, if this works. -
Cap at SRC1_DB Prop to TRG1_DB Apply then re-enqueue Prop to TRG2_DB Apply
Hi, I need some assistance.
I am new to Streams and have been doing some research and experimentation. I have successfully setup a Stream from SRC1 db to TRG1 db, using a Propagation and a DML handler procedure.
SRC1............=>...............TRG1
capt_1.......prop...............apply_1
SRC1_Q....str1_to_str2......TRG1_Q
....................................DML_Hndlr_1
Now, I want to do do something more advanced.
SRC1............=>..............TRG1
capt_1.......prop...............apply_1
SRC1_Q....str1_to_str2......TRG1_Q
...................................DML_Hndlr_1
.......................................||..............->..................TRG2
.......................................\/.............prop................apply_2
...................................SRC2_Q.......str2_to_str3........TRG2_Q
...........................................................................DML_Hndlr_2
I want the apply_1 at the TRG1 db to put the LCRs onto a new queue, SRC2_Q. Up to this point, everything works ok. I can see the LCRs on the SRC2_Q.
The problem comes in when I then setup a second propagation. I create a propagation at TRG1, called str2_to_str3. All my scripts to set up the environment run without any errors. I can't find any errors in any of the data dictionaries. I have tested database links. I am stuck.
I have included all the setup scripts that I am using, as well as the log file from my latest installation.
I have also included my scripts to:
1) stop and start all the processes (not sure if these are correct)
2) perform and insert, update and delete on the source table.
3) cleanup the environment.
The scripts are easily configurable via SQLPLUS define statements.
Is what I am trying to do possible?
Please note that I do not want to perform a second capture at the TRG1 database. All the LCRs must be able to be Applied at both TRG1 and TRG2, via seperate apply processes, each using their own DML_Handler.
I see that queue forwarding and apply forwarding do not cater for this scenario above. What are the alternatives? Also comment on performance of the alternatives if possible.
I have all my scripts available and all my log files as well, but I am not sure how to upload them? Do I have to paste them into a response to this question on the forum?
ThanksThanks for the response.
There are 3 instances SRC1, TRG1 and TRG2. I want to capture on SRC1, Apply on TRG1, then re-enque and then propagate same LCR (source is SRC1) to TRG2 and Apply on TRG2 (source is still SRC1).
The application of such an architecture would be SRC1= transactional database, TRG1=Audit Trail database, TRG2=Reporting database with denormalised tables.
So, yes, I want to apply LCR for TRG2 also locally on TRG1.
We need to see also the declaration of the apply process on TRG2 as the source DB name now becomes important. CONNECT &db_TRG2_STREAMS_user/&db_TRG2_STREAMS_pass.@&db_TRG2_db
BEGIN
DBMS_APPLY_ADM.SET_DML_HANDLER(
object_name => '&db_SRC1_user..&db_SRC1_table',
object_type => 'TABLE',
operation_name => 'DEFAULT',
error_handler => FALSE,
user_procedure => '&db_TRG2_STREAMS_user..TRG2_dml_handler',
apply_database_link => NULL,
apply_name => '&db_APPLY_2');
END;
All the code is about 1000 lines.
Q)If you like, I can include it all.
If you have 3 test instances, you could run it, it is easy to configure. But for now, I'll include the parts where I think things could be going wrong. Assume that the first transfer is in place and is working. The Apply at TRG1 is using this DML handler (the Apply at TRG2 is identical):
CONNECT &db_TRG1_STREAMS_user/&db_TRG1_STREAMS_pass.@&db_TRG1_db
create or replace PROCEDURE TRG1_dml_handler(in_any IN ANYDATA) IS
lcr SYS.LCR$_ROW_RECORD;
rc PLS_INTEGER;
command VARCHAR2(30);
v_old_trg_ts VARCHAR2(30);
v_new_trg_ts VARCHAR2(30);
v_old_SRC1_ts VARCHAR2(30);
v_new_SRC1_ts VARCHAR2(30);
v_old_name VARCHAR2(30);
v_new_name VARCHAR2(30);
old_values SYS.LCR$_ROW_LIST;
v_temp ANYDATA;
v_temp_int PLS_INTEGER;
BEGIN
rc := in_any.GETOBJECT(lcr);
command := lcr.GET_COMMAND_TYPE();
lcr.SET_OBJECT_NAME('&db_TRG1_table');
lcr.SET_OBJECT_OWNER('&db_TRG1_user');
logger.log_it( 'HANDLER_LOG', 'TRG1_dml_handler : '||command||' : '||TO_CHAR(sysdate, 'HH:MI:ss AM : '));
IF command = 'INSERT' THEN
lcr.SET_VALUE('new', 'TRG_TS', ANYDATA.ConvertVarchar2(TO_CHAR(sysdate, 'HH24:MI:SS AM')));
lcr.EXECUTE(FALSE);
END IF;
IF command = 'UPDATE' OR command = 'DELETE' THEN
v_temp := lcr.GET_VALUE('old', 'NAME', 'Y');
v_temp_int := ANYDATA.GetVarchar2(v_temp, v_old_name);
v_temp := lcr.GET_VALUE('old', 'SRC1_TS', 'Y');
v_temp_int := ANYDATA.GetVarchar2(v_temp, v_old_SRC1_ts);
SELECT TRG_TS INTO v_old_trg_ts FROM &db_TRG1_user..&db_TRG1_table WHERE NAME=v_old_name AND SRC1_TS=v_old_SRC1_ts;
lcr.SET_VALUE('old', 'TRG_TS', ANYDATA.ConvertVarchar2(v_old_trg_ts));
lcr.EXECUTE(FALSE);
END IF;
IF command = 'UPDATE' THEN
v_temp := lcr.GET_VALUE('new', 'NAME', 'Y');
v_temp_int := ANYDATA.GetVarchar2(v_temp, v_new_name);
v_temp := lcr.GET_VALUE('new', 'SRC1_TS', 'Y');
v_temp_int := ANYDATA.GetVarchar2(v_temp, v_new_SRC1_ts);
EXECUTE IMMEDIATE 'UPDATE &db_TRG1_user..&db_TRG1_table SET TRG_TS=TO_CHAR(sysdate, ''HH24:MI:SS AM'') WHERE NAME='''||v_new_name||''' AND SRC1_TS='''||v_new_SRC1_ts||''' ';
commit;
END IF;
IF command = 'DELETE' THEN
lcr.SET_COMMAND_TYPE('INSERT');
lcr.SET_OBJECT_NAME('&db_TRG1_table._DEL');
old_values := lcr.GET_VALUES('old');
lcr.SET_VALUES('new', old_values);
lcr.SET_VALUES('old', NULL);
lcr.SET_VALUE('new', 'TRG_TS', ANYDATA.ConvertVarchar2(TO_CHAR(sysdate, 'HH24:MI:SS AM')));
lcr.EXECUTE(FALSE);
END IF;
END;
This handler works 100% for Applying on TRG1.
Q) What I not sure about is, what exactly gets put on the SRC2_Q. Is it the original SRC1 LCR, or is it the modified one that was Executed by this DML Handler?
define db_SRC2_STREAMS_user=&&db_TRG1_STREAMS_user
CONNECT &db_SRC2_STREAMS_user/&db_SRC2_STREAMS_pass.@&db_SRC2_db
DECLARE
emp_rule_name_dml VARCHAR2(30);
BEGIN
SELECT RULE_NAME into emp_rule_name_dml FROM DBA_STREAMS_RULES where streams_type='APPLY' and streams_name='&db_APPLY_1' and RULE_OWNER='&db_TRG1_STREAMS_user';
DBMS_OUTPUT.PUT_LINE('emp_rule_name_dml = '||emp_rule_name_dml);
DBMS_APPLY_ADM.SET_ENQUEUE_DESTINATION(
rule_name => emp_rule_name_dml,
destination_queue_name => '&db_SRC2_STREAMS_user..&db_SRC2_Q');
END;
This part seems to be working, the LCRs get into the SRC2_Q, because I can see a record for each LCR, when I query TRG1.SRC2_Q_TABLE.
e.g.
"Q_NAME","MSGID","CORRID","PRIORITY","STATE","DELAY","EXPIRATION","TIME_MANAGER_INFO","LOCAL_ORDER_NO","CHAIN_NO","CSCN","DSCN","ENQ_TIME","ENQ_UID","ENQ_TID","DEQ_TIME","DEQ_UID","DEQ_TID","RETRY_COUNT","EXCEPTION_QSCHEMA","EXCEPTION_QUEUE","STEP_NO","RECIPIENT_KEY","DEQUEUE_MSGID","SENDER_NAME","SENDER_ADDRESS","SENDER_PROTOCOL","USER_DATA","USER_PROP"
"AQ$_SRC2_Q_TABLE_E","B6A77B139CAC426CAFF6DB6A8000745B","","0","3","","","","0","0","7502525","0","06/OCT/10 13:34:49.420000000","SYS"," 17001","","","","0","","SRC2_Q","0","0","","TRG1_STR","","","SYS.ANYDATA",""
What is it declared into the LCR when it arrives on TGR2 and how is your table initialised? Well, at this stage, the LCR is not getting to TRG2. The second propagation is failing.
Any LCR enqueued into TRG2 into SRC2_Q is now an TRG1 LCR and should bear the meta data of TGR1. Perhaps this answers my quesion above. I will give it a quick try now, making the neccessary changes assuming that the LCR is now the modified LCR with TRG1 as it's source.
Q)Is there a way to get the Apply process to re-enqueue the original unmodified LCR?
Watch out the error if you duplicated the LCR into DML_hndlr_1, you still need to replace the meta data and the SCN of SRC1 by new one of TRG1 . What your are doing is not a downstreams capture.Q)I dont think that I duplicated the LCR in my DML Hanlder?
Thanks
Maybe you are looking for
-
New Payment display Closed invoices and amount error ?
Hi experts, Help, I have a serious stupidity after data migration, I changed the invoices by SQL and at a new payment document it display the invoices already closed and their amounts not corresponding with the real invoices amounts or or retrieves t
-
Can I use the early 2009 iMac 24" with a non-thunderbolt 27" cinema display?
Is this possible, and if so, presumably the displays - bottom levels of the glass will be at different heights? Thanks
-
Java for PI 7.1 EHP1 in Windows and SQL Server 2008
Hi Gurus I try to install PI 7.1 EHP1 in Windows and SQL Server 2008. The questions is : What version of java is the correct for this installation??? And where i can download it?? Thanks and advance!!!
-
Hello - I am trying to create a query that will show me the most recent cost estimate in BW infocubes 0COPC_C08 or 0COPC_C09, without making any changes to the standard functionality or available characteristics in these cubes. One of the cubes has
-
Error while posting from runtime workbench
Hi all, My scenario is idoc-idoc(One SAP system is sending data to another SAP system through XI as an idoc). I am trying to test the scenario by posting the idoc data in RWB -> Integration Engine but its showing me an error:500 Error during Sender A