since the orgid 1 has changed the dept from org1 to org2 I do not want this to be appeared in the final count. Results should only include the orgid 2 since it didn't changed any dept.
I can give you the logic first i'll sort the start_date(already sorted in given example), then i'll compare the 2'nd id start date with 1'st id end date if it is less than the 1'st id end date, which means overlapping is there, then i'll group those 2 id's in to same group if not group them into 2 different groups.
I am new to oracle, I have request to build a query,
we have table that generates data from 7am to 20pm for eavery hour it generates 4 rows and has 43 session values as 43 columns.
Now i want to find for every hour which is the hights session value at what time. in one hour it runs four times like 7, 7:15, 7:30 and 7:45 and each row has date, time and 43 session columns in table...
I'm looking to see if there's a solution to my problem that I can use within the context of my business application interface into an Oracle RDMS. I have access to write custom SQL statements and functions, but I am NOT able to create stored procedures using the interface I have.
The challenge I am having is comparing date ranges. I have a table containing two columns labelled START TS TIME and END TS TIME, both of type 'Date'. I have figured out how to query each row against a given Next Session Start and Next Session End and determine if each row overlaps that row.
I need a procedure that will be recursive: that is, set Next Session Start and Next Session End to START TS TIME and END TS TIME of the first row, compare all rows against it, then set Next Session Start and Next Session End to the next row, compare all rows, ... for all rows in the table. I want to know what the maximum number of matches is (i.e. the most time periods that overlap).
If I could use a stored procedure I could complete this query easily. Is there other techniques (i.e. functions) available to leverage in order compare each row of date ranges against ALL rows in the same table?
I have a SP for comparing 80 diff column values in 8 table pairs and it is taking a huge lot of time to process as I have to process around 10k records.
Let's consider such table that all rows fit into single block:
SQL> create table test as select rownum id, '$'||rownum name from dual connect by level <= 530; Table created. SQL> create index i_test on test(id); Index created. SQL> SQL> begin
[code].....
why does approach with full scan take longer even if table occupies only one data block? PS. 11gR2
I have a huge table (about 60 gb) partition over range. The index on this table is global index created on 4 columns together. I have a query which is running very slowly. The explain plan is showing the use of this global index.Explain plan is not showing pstart and pend because the index is global.
My scenario is to insert values into 'out' column by comparing 's' and 'IP' columns of temp table.The exact situation is at first need to go to ip column,take a value and then go to source column and check for the same value of ip which is taken previously.Then after corresponding ip of that source column should be inserted back in previous source column.
The situation is marked clearly in file which i am attaching with '--' comments at respective places.I am also pasting the code which i tried out,unfortunately it is giving error as exact fetch returns more than requested number of rows since there are duplicates in the table.I tried it using nested for loops.Also implemented using rowid,but it didnt work.
fixing the errors or if there is any new logic that can be implemented.
DECLARE i_e NUMBER(10); BEGIN FOR cur_1 IN(SELECT IP from temp where IP IS NOT NULL) LOOP FOR cur_2 IN(SELECT IP from temp where s=cur_1.IP)
1.Is it necessary to reorganize a table and index after the deletion of records from table ? Because i see some change in table size after table and index reorganization.
2.Will re org table and index improve the database performance ?
We have installed "Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production" on server. we created one SID(agile9d) and configured listener(LISTENER) on 1521.This is working fine.
Now,we want to create one more SID(XXXX) on the same server.So,Need some clarification on below points.
(1). Do I need to configure one more listener for new SID?(Ex: LISTENER1)? (2). Can I use the 1521 port again while configuring new listener?
We have a new requirement for a RAC environment. Its workload will comprise both OLTP and batch loads. Am I right in thinking that I can map the appropriate applications to the required node using services, e.g.
Application 1 (OLTP) has node 1 as its preferred service node - so all OLTP trxs run through node 1 Application 2 (Batch) has node 2 as its preferred service node - so all batch trxs run through node 2
Both applications will have the other node for its available service to facilitate HA in an emergency.
Does that sound right? (or have I got it completely wrong!)
Currently, the only way I can find of doing so is to try to disable an instance, and if it is already disabled, it warns you that its disabled. This is not exatly an ideal solution! How do I simply run a query or issue a crs command to list all disabled database instances.
i am using oel 5.5 with oracle 10g release 2 installed in it . I am unable to run two different instances on same machine how can do that? I changed the ORACLE_SID then i startup one instance is starting but when i change the sid again and tried to startup it shows me that oracle is already started shut it down first.
Is there any way to startup two different instances?
I would like to build a 2-node cluster without RAC. I desire to operate 2 Oracle database instances for use by 2 separate applications. I plan to run Linux. I would like node1 to act as the primary server for the databases in application1 and node2 to act as the failover server for the databases in application1. Conversely, I want node2 to act as the primary server for databases in application2 and node1 to act as the failover server for databases in application2. Can Oracle SE and Oracle Clusterware be configured in this this way?
I want to move data between two instances and recommended we create a local database link to PULL data from remote database located here (supplier on site) but they want to PUSH data to us. I thought you could only PULL data over a database link but then read the link [URL] where PUSH is considered ? I was going to use standard creatas like create table A as select * from table A@<remote_db_link> which works well and fast ( tried and tested) but some are saying they think PUSH quicker/better ?
we do have data "PUSH" already but this does not use a db link - effectively it calls a local proceedure here and passes a row of data and is slow ie for a 1000 row table to be pushed to us we have our local proceedure called 1000 times.
I have always suggested a PULL with db_link as the fastest method - any proof OR info on a fast PUSH method ( that is quicker than PULL ) ? can you REALLY push ?
My requirement is to Run 2 instances of forms 11g R2 parallel at a time(means running 2 urls of 2 instances same time). I have tried with installing 2 instances but when i install and configure my 2nd instance then my 1st instance services are shutting down.At a time it is running only one instance services.
And also i have tried with installing 2 Cluster instances of 11g R2 Forms but same thing happening as above.
how to run 2 instances of Forms 11g R2 parallel and also suggest me to install instances in same domain or different domain because with same domain 2 instances it is creating only one config file..so i tried with different domains. Different Config files created but only one instance service is running.
We are planning to install second instance of Oracle 11gR2 in Linux server 2.6.39-400.21.1.el6uek.x86_64 x86_64. This is something we never haven done before. The existing instance has all the standard ports:
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Enterprise Manager Console HTTP Port (pterpdb02) = 1158 Enterprise Manager Agent Port (pterpdb02) = 3938
What ports should we select for second listener and enterprise manager? Is there anything else that we need to know before we install the second instance?
My oracle version is 11.2.0.2 RAC RDBMS on RHEL 5.6.
At my standby site my physical standby database is on 4 node cluster with all 4 instances up. I need to disable 3,4 instances so that we want it to run on only 1,2 instances.To disable the instances do i need to stop apply(mrp) process. And the apply node is node 1.
SELECT DISTINCT EXPOSURE_REF FROM KBNAS.VW_EXPOSUREDETS_FOR_CCYREVAL WHERE EXPOSURE_CURRENCY='THB' AND BASE_TXN_CCY='USD' AND BRANCH_CODE='7000' AND (REVAL_STATUS='O') AND CONV_RATE<>'62' AND (EXPOSURE_AMOUNT<>0) UNION SELECT DISTINCT ED.EXPOSURE_REF FROM KBNAS.EXPOSURE_DETAILS ED, [code].....
I have attached DDL for table EXPOSURE_DETAIL(PARTITION),LEDGERCARD,LEDGERCARDDETAILS, DDL for INDEX on those tables and DDL for Views..
Issue: we have created the Indexes but when we check the explain plain .. full table scan is going on..I have attached the explain plan ..
We need to load data from index by table to table.Below code is working fine.
declare query varchar2(200); Type l_emp is TABLE OF emp%rowtype INDEX BY Binary_Integer; rec_1 l_emp; begin
[Code]....
But data from source table and target table is dynamic.Ex:In above code, emp(source) and target table is emp_b are static. But for our scenario is depends on the source table , target would change as below.If source is emp then target is emp_bIf source is emp1 then target is emp_b1 ............
create or replace procedure p(source in varchar2, target in varchar2) as query varchar2(200); source varchar2(200); Type l_emp is TABLE OF emp%rowtype INDEX BY Binary_Integer; rec_1 l_emp;
Installed Grid Control 10.2.0.2.0 on Windows Server 2003R2 32-bit. Immediately upgraded to 10.2.0.5.0. Both install and upgrade went fine, Grid Control can see its own database in the list of targets, looks good.
I then installed Oracle 11gR2 11.2.0.1.0 64-bit on Windows Server 2008R2 64-bit and created a new database. I then installed the 10.2.0.5.0 agent manually on the server via OUI. Agent install went fine, secured and started properly.
The problems I'm having is Grid Control can't seem to see the database instance. If I go to "Targets", GC can see the host just fine, shows that its up and can see targets for the listener (Up), the agent at port 3872 (Up), and the database instance (Down). Drilling down to the database instance, it shows that the instance is not up (though it is as I can connect to it from a different machine and run queries against not) and the Agent Connection to Instance is down with the error: Failed to connect to database instance: (UNKNOWN OCI STATUS 1804) OCIInitialize. Check ORACLE_HOME and NLS settings etc...
Also, pulling up the "Alerts" tab for errors showed the following for Metrics "Access to Important Tables and Views", "DB Data Files Permissions", and "DB Control Files Permission":
Target: SR3 Type: Database Instance Metric: Access To Important Tables And Views Collection Timestamp: Jun 11, 2010 11:11:26 AM Error Type: Collection Failure Message: 1804 at c:oracleagent10g/sysman/admin/scripts/db/esaDbUtils.pl line 290. There are also several "Missing Properties : [AdrHome,ConvertFromCharset,needCharsetConvert]" errors listed too.
I've looked into the 1804 error and from what I could find, its a perl-related issue with not being able to get the ORACLE_HOME information.
- I verified that ORACLE_HOME was set in the environment variables and even rebooted to make sure it was being picked up properly. That didn't work. - I added "$ENV{ORACLE_HOME}='c:\oracle\product\11.2.0\dbhome';" to the esaDbUtils.pl file. That didn't work either. - I added the GC security certificate to the trusted certificates on the target box in case it was some kind of SSL issue. I don't get the annoying "invalid certificate" warning, but it didn't fix it.
I am upgrading a DB using catupgrd.sql, and one of the prerequisites is to shut down the listener. Now, I have multiple database instances registered with this listener, and I don't want the other ones to become unavailable while I do the upgrade. Is there any way to do this for a particular instance only?
I am wokring on oracle 10.2.0.4 rac 2 node instances on AIX. We have one table having multiple rows defilning jobs will be done by users ...the functionality is that ..when even one user will pick on row (job) , one update statement will issue and it will update status column to 1 which menas job is allocated , this means now this should not allocate to any other user ..
but we are facing issue that once any user will pick that job , in application log files we can see that row gets lock and updates the status to 1 . but then also users connecting to other or some time same instance will get that job...means multiple users can pick same job .. even after already picked by another user ..
Is this can be issue with rac configuration ... like whenever one user updates a row ..it will be in cache of one instance and when another user trys to again update 2nd instance does not have that information and allows user connected to that instance to pick that job..like delay in block transfer or cache fusion..
is this can be issue with rac or it is purely application issue..
I have 3 instances and i want to work between then. The error occurs when i use subquery, This is the code:
update erie.rie_cbtrega@l$e_tfcries rgr set rgr.c_descri = ( select rg.c_descri from dadm.cbtrega@l$e_tfccie rg where rg.c_idrega = rgr.c_idrega ) ;
When i execute update without subquery "( select rg.c_descri from dadm.cbtrega@l$e_tfccie rg where rg.c_idrega = rgr.c_idrega)" the result is successfully, but when i add subquery the result is
ORA-02019: no se ha encontrado la descripción de la conexión para la base de datos remota ORA-02063: line precediendo a TFCCIE ORA-02063: 2 lines precediendo a L$E_TFCRIES
, I got the following error while trying to restart a 3 node RAC database. OEM reported two out of three nodes to be down. We also noticed that the cluster_database parameter was set to "False" and the cluster_database_instances integer was set to 1.We changed the parameters to 'True' and '3' respectively and while trying to restart the database we get the error message as shown below.
The resource action "ora.abc123.db start" encountered the following error:
ORA-01102: cannot mount database in EXCLUSIVE mode. For details refer to "(:CLSN00107:)" in
"/oradba/app/grid/11.2.0.3_a/log/abcde104/agent/crsd/oraagent_oradba/oraagent_oradba.log". CRS-2674: Start of 'ora.abc123.db' on 'abcde104' failedCRS-2632:
There are no more servers to try to place resource 'ora.abc123.db' on that would satisfy its placement policy
CRS-5017: The resource action "ora.abc123.db start" encountered the following error:
ORA-01102: cannot mount database in EXCLUSIVE mode.
For details refer to "(:CLSN00107:)" in "/oradba/app/grid/11.2.0.3_a/log/abcde103/agent/crsd/oraagent_oradba/oraagent_oradba.log". CRS-2674: Start of 'ora.abc123.db' on 'abcde103' failed
Am pasting the sample code here, which i got from some site..
DECLARE TYPE population_type IS TABLE OF NUMBER INDEX BY VARCHAR2(64); country_population population_type; continent_population population_type; howmany NUMBER;
[code]...
Here we are fetching indexes (like Antartica/Australia) from these two statements continent_population.FIRST or continent_population.LAST. If there are three or more indexes in the same table, how to fetch all of them?
I have tried using this, but doesnt work because loop variables are by default integers:
for i in continent_population.FIRST .. continent_population.LAST loop dbms_output.put_line('i:'||i); end loop;