oracle11g

What is a better way to do synchronous and asynchronous MView refreshes in Oracle 11g?

旧时模样 提交于 2019-12-24 12:50:08
问题 I have 7 Materialized Views that need to be refreshed on a schedule. Five of them are data source independent and could be rebuilt asynchronously. Two of them are dependent on some of the first five MViews and need to wait until those have been refreshed. These last two are independent of each other and could run asynchronously. I originally asked this question here. My plan was to go the DBMS_JOB.SUBMIT route. It was explained to me that DBMS_JOB.SUBMIT is an Oracle 8-level approach to the

ORA-01002: fetch out of sequence

大兔子大兔子 提交于 2019-12-24 12:39:43
问题 I'm getting the following oracle error when my app is deployed on the server only , and not when running the exact same executable on my local machine: The stack trace points to a simple select statement with a join, that I can successfully execute via TOAD locally and via SQL Plus on the problem server. The top half of the stacktrace is: Oracle.DataAccess.Client.OracleException ORA-01002: fetch out of sequence at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode,

Understanding behavior of remainder() function in Oracle

自古美人都是妖i 提交于 2019-12-24 12:13:16
问题 According to Oracle documentation for the remainder(n2,n1) function (https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions133.htm), the remainder(n2,n1) function evaluates to = n2 - n1 * N where N = ROUND(n2/n1) and n1 != 0. So, I would expect remainder(10,4) to return -2 using the above documented method of calculating the remainder as shown below: REMAINDER(10,4) =10 - 4 * N where N = ROUND(10/4) =10 - 4 * 3 since ROUND(10/4) = 3 =10 - 12 =-2 However, running remainder(10,4) in

Oracle. Reuse cursor as parameter in two procedures

故事扮演 提交于 2019-12-24 12:09:21
问题 Let's create two test procedures: CREATE OR REPLACE PROCEDURE Aaaa_Test1( pDog SYS_REFCURSOR ) IS TYPE tDogRec is record (objid varchar2(7), lim number, debt number); TYPE tDog IS TABLE OF tDogRec; vDog tDog; BEGIN IF pDog%ISOPEN THEN FETCH pDog BULK COLLECT INTO vDog; IF vDog.count >= 1 THEN FOR i IN vDog.First..vDog.Last LOOP Dbms_Output.Put_Line('Aaaa_Test1 = '||vDog(i).Objid); END LOOP; END IF; END IF; END; -- Aaaa_Test1 Procedure / CREATE OR REPLACE PROCEDURE Aaaa_Test2( pDog SYS

Oracle. Reuse cursor as parameter in two procedures

跟風遠走 提交于 2019-12-24 12:07:16
问题 Let's create two test procedures: CREATE OR REPLACE PROCEDURE Aaaa_Test1( pDog SYS_REFCURSOR ) IS TYPE tDogRec is record (objid varchar2(7), lim number, debt number); TYPE tDog IS TABLE OF tDogRec; vDog tDog; BEGIN IF pDog%ISOPEN THEN FETCH pDog BULK COLLECT INTO vDog; IF vDog.count >= 1 THEN FOR i IN vDog.First..vDog.Last LOOP Dbms_Output.Put_Line('Aaaa_Test1 = '||vDog(i).Objid); END LOOP; END IF; END IF; END; -- Aaaa_Test1 Procedure / CREATE OR REPLACE PROCEDURE Aaaa_Test2( pDog SYS

Oracle Triggers Update at Another Table

给你一囗甜甜゛ 提交于 2019-12-24 11:09:21
问题 I am trying to create a trigger in Oracle. I know sql but i have never created trigger before. I have this code: create or replace trigger "PASSENGER_BOOKING_T1" AFTER insert on "PASSENGER_BOOKING" for each row begin IF (:NEW.CLASS_TYPE == 'ECO') SELECT F.AVL_SEATS_ECOCLASS,F.FLIGHT_ID INTO SEAT, FLIGHT_INFO FROM BOOKING B, JOURNEY_FLIGHT J, FLIGHT F WHERE B.JOURNEY_ID = J.JOURNEY_ID and F.FLIGHT_ID = J.FLIGHT_ID; UPDATE FLIGHT SET AVL_SEATS_ECOCLASS = (SEAT-1) WHERE FLIGHT_ID = FLIGHT_INFO;

Error Importing a .dmp file in AWS RDS Oracle DB

℡╲_俬逩灬. 提交于 2019-12-24 10:55:19
问题 I have followed the AWS Importing Data into RDS guide. I have copied the .dmp file from Source Oracle Instance on another machine to the DATA_DUMP_DIR on RDS Instance. Now I am trying to import it using the code below: DECLARE hdnl NUMBER; BEGIN hdnl := DBMS_DATAPUMP.OPEN( operation => 'IMPORT', job_mode => 'SCHEMA', job_name=>null); DBMS_DATAPUMP.ADD_FILE( handle => hdnl, filename => 'sample_copied.dmp', directory => 'DATA_PUMP_DIR', filetype => dbms_datapump.ku$_file_type_dump_file); DBMS

Startup program and libocci.so.11.1: cannot open shared object file: No such file or directory

孤街醉人 提交于 2019-12-24 09:52:48
问题 please any one save my time .my application is written in c++ I was try to startup on boot in ubuntu linux,but when the program try to start it log error like:- error while loading shared libraries: libocci.so.11.1: cannot open shared object file: No such file or directory my program use oracle api:- my start service script which is written in /etc/init.d/sistartup:- #!/bin/sh # chkconfig: 345 99 10 OWNER=aki case "$1" in 'start') su $OWNER -c "/home/aki/sis_script/startsis.sh >> /home/aki

Sqoop import using ojdbc6 connector

笑着哭i 提交于 2019-12-24 09:19:50
问题 I am using sqoop to import data from oracle 11g, as i do not have the permission to put the ojdbc jar in sqoop's lib on cluster i am explicitly providing the jar using -libjars but it is throwing exception.The code I have used is : sqoop eval -libjars /root/shared_folder/ojdbc6.jar --driver oracle.jdbc.OracleDriver --connect jdbc:oracle:thin:@127.0.0.1:1521:XE --username srivastavaaman --password manager --query 'SELECT * from TestTable1' The output that follows is : Warning: /usr/lib/sqoop/.

Return zero value when no row data exists

♀尐吖头ヾ 提交于 2019-12-24 08:48:17
问题 My question has been addressed previously but I can't seem to apply any solution to my query to make it work. Would very much appreciate some guidance. My current query below returns this data set: | Age | Count | 0-1 day 300 2-3 days 6000 3-4 days 100 SELECT(CASE WHEN time_dtm > SYSDATE -1 THEN '0-1 day' WHEN time_dtm > SYSDATE -2 AND time_dtm < SYSDATE -1 THEN '1-2 days' WHEN time_dtm > SYSDATE -3 AND time_dtm < SYSDATE -2 THEN '2-3 days' WHEN time_dtm > SYSDATE -4 AND time_dtm < SYSDATE -3