Time elapsed Calculation
I need to calculated time elapsed for each user to perform his part in a transaction. The sequence is: 0 -1 – B2 or 0-B3 The table looks like the following:...
View ArticleDatabase design for a table with both bulk insert and single row insert
I have to design a table where records will be inserted in two ways. Bulk insert from a batch process from a delimited text file between 2 – 3 million rows in a short burst. Later the same records will...
View ArticleAre there any incompatibilities between Oracle 11 and 12?
I have an application which has been validated on an Oracle 11.2 database. A client has asked me whether they can use Oracle 12c instead as that is what their IT department would prefer. Is there an...
View ArticleEscape characters in Oracle dump
I’m new to oracle and I have this problem. When I take a dump of particular table which has CLOB data type, the resulting dump doesnt handle escaping special characters. So I get ' un escaped, so...
View ArticleList all privileges granted on tablespace
Frineds, DB: 11gR2 OS: Unix So I’m moving all objects of a tablespace-A to new tablespace-B. Is there a way to list all privileges/quota granted for tablespace-A? Since tablespace-A can have default...
View ArticleHow to reuse code in Oracle Script?
I have a script where I am creating some test data. At the beginning of the script I create some tables where I have to insert the data. Before creating them I check that they do not exist. declare...
View ArticleInvalid create index syntax
I cannot create index with the where clause. Refer the below query: CREATE INDEX c_bplocation_isdefault ON c_bpartner_location (ad_client_id,c_bpartner_id,isdefault) WHERE isdefault = 'Y';
View Articlesql query takes too long to execute
I am having trouble with this query. It takes 10 hours to execute. WITH CONSUM AS ( SELECT C.ID_MEASURER,C.ID_MEASURING_POINT,C.CONSUM_TYPE FROM GCGT_RE_CONSUM_H_E C WHERE C.DAY BETWEEN 20130201 AND...
View ArticleNot able to update MySQL table using Oracle: Unknown column in 'where clause'...
I have the following tables: MySQL table: jti_member_interact CREATE TABLE `jti_member_interact` ( `INT_MEMBER_ID` int(11) NOT NULL, `INT_ID` int(11) NOT NULL AUTO_INCREMENT, `INT_SOURCE` varchar(1)...
View ArticleExporting scheduled jobs in Oracle
This is probably very simple but i already exported all but the scheduled jobs i created to subsequent schemas. How can I create a sql script of the scheduled jobs I created in Oracle? I know in SQL...
View ArticleOracle Buffer Pool TARGET_SIZE is different from CURRENT_SIZE, but...
According to the documentation for V$BUFFER_POOL, TARGET_SIZE shows that target size when resizing, but should be the same as CURRENT_SIZE if RESIZE_STATE is STATIC. However, on one of our databases...
View ArticleFastest way to change column type from varchar2 to number on large table in...
I have a table which contains a VARCHAR2 column that must me changed into NUMBER. The table contains more than 30 millions rows. The table definition : CREATE TABLE EFF ( MOD VARCHAR2(6) NOT NULL, MP...
View ArticleHow the sys user gets the sysdba privilege?
I am using oracle 12c on Linux. Using the enterprise manager database express I am looking at the list of privileges and roles for the sys user but I haven’t found the sysdba privilege assigned there....
View Articleexecute .sql script inside an anonymous pl/sql block which is invoked by a...
I got a shell script which connects to SQLPLUS and executes the .sql file like below: read a x=`echo $a | cut -d , -f 1` y=`echo $a | sed 's/.*,//'` c=`echo $USER | cut -c -2`"OPR"`echo $USER | cut -c...
View ArticleOracle Export using EXPDP gives ORA-06512 SYS.UTL_FILE error on Windows 7
I am using Oracle 11g and want to export a table using below statement C:>expdp SYS/sys@MYDATABASE DIRECTORY = Mydir DUMPFILE = Customer.dmp LOGFILE = Customer.log TABLES = PERSON.CUSTOMER After...
View ArticleSpecifying Oracle Service Name in UNIX Profile
Is there any way we can specify Oracle Service Name in UNIX Profile? I know that there is an environment variable ORACLE_SID for specifying SID in the Profile, But how about service name? If there is,...
View ArticleHow to create a function(table_name) that return a collection in Oracle?
I need to create a function in Oracle that accepts a table name and return a collection the content of which is based the table that accepted. I’ve been doing some search, many examples are of the...
View ArticlePL/SQL group orders by date and sum the total
I need to group orders by date and sum the total, My table looks like this : TEST_DATE TEST_ID - NUMBER SUCC_ID - NUMBER I need to group by date and sum the total, this is my query: SELECT COUNT(*),...
View ArticleSelect the max from two max values
I need to find the airport(departure or arrival) that had the most passengers in the last year. The tables are: PASSENGER(id,name,surname) TAKES(id_passenger,id_flight)...
View ArticleOracle 11.2 Explain Plan takes too long
I’m using Oracle 11.2 SE on a 16GB Xeon E3 Linux machine as well as 11.2 XE on a 8GB i7 Win8 machine: SELECT banner FROM v$version: Oracle Database 11g Release 11.2.0.4.0 - 64bit Production PL/SQL...
View Article