Comparing Index And PK Of A Table Between Instances?

Dec 2, 2012

I am about to compare Indexes and PK's(Constraint) of 3 instances.

What DBA table/s should i use best? The comparison is done to a specific schema only.

PS:Which is better dba_ind_columns or dba_objects?

View 10 Replies


ADVERTISEMENT

SQL & PL/SQL :: Comparing One Row With Other Within Same Table

May 2, 2012

I have a requirement to get the count of those records whose department is not changed since they have joined the organization.
Script:

CREATE TABLE ddumps(orgid NUMBER, orgdate DATE, orgdept VARCHAR2(10))
/
INSERT INTO ddumps VALUES(1,'01-JAN-1999','ORG1')
/
INSERT INTO ddumps VALUES(1,'01-JAN-2000','ORG2')
/
INSERT INTO ddumps VALUES(1,'01-JAN-2001','ORG2')
/
INSERT INTO ddumps VALUES(2,'01-JAN-1999','ORG1')
/
INSERT INTO ddumps VALUES(2,'01-JAN-2000','ORG1')
/
INSERT INTO ddumps VALUES(2,'01-JAN-2001','ORG1')

ORGID ORGDATE ORGDEPT
1 1/1/1999 ORG1
1 1/1/2000 ORG2
1 1/1/2001 ORG2
2 1/1/1999 ORG1
2 1/1/2000 ORG1
2 1/1/2001 ORG1

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.

View 11 Replies View Related

SQL & PL/SQL :: Grouping To Be Done By Comparing 2 Rows In A Table?

Feb 15, 2011

I'm using oracle 10g.I have a table with 4 columns

main_group-----id--------start_date------------end_date
M1-------------1---------07FEB11---------------10FEB11
M1-------------2---------09FEB11---------------11FEB11
M1-------------3---------10FEB11---------------12FEB11
M1-------------4---------13FEB11---------------16FEB11
M2-------------5---------18FEB11---------------21FEB11
M2-------------6---------19FEB11---------------24FEB11
M2-------------7---------26FEB11---------------27FEB11

i need to group the id's which are having overlapping dates and the output should be

main_group-----id--------start_date------------end_date
M1-------------1---------07FEB11---------------10FEB11------G1
M1-------------2---------09FEB11---------------11FEB11------G1
M1-------------3---------10FEB11---------------12FEB11------G1
M1-------------4---------13FEB11---------------16FEB11------G2
M2-------------5---------18FEB11---------------21FEB11------G3
M2-------------6---------19FEB11---------------24FEB11------G3
M2-------------7---------26FEB11---------------27FEB11------G4

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.

View 7 Replies View Related

SQL & PL/SQL :: Comparing Multiple Columns According To Rows From Same Table

Aug 25, 2011

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...

View 12 Replies View Related

SQL & PL/SQL :: Comparing Date Ranges Against All Rows In Same Table

Oct 30, 2011

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?

View 4 Replies View Related

Oracle SP For Comparing Column Values In Table Pairs

Aug 16, 2013

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.

View 5 Replies View Related

PL/SQL :: Index Range Scan And Table Access By Index Rowid Versus Table Access Full

Oct 5, 2013

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

View 8 Replies View Related

Performance Tuning :: Local Index Versus Global Index On Partitioned Table

Jun 28, 2011

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.

View 6 Replies View Related

Performance Tuning :: Force Index If Table Not Using Index?

Aug 9, 2013

How to force an index if the table not using the index?

View 10 Replies View Related

SQL & PL/SQL :: How To Insert Values Into Another Column By Comparing Values Of Two Columns Of Same Table

Dec 23, 2010

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)

[Code]...

View 9 Replies View Related

Server Administration :: Reorganize A Table And Index After The Deletion Of Records From Table?

Feb 7, 2012

We deleted millions of records from a table.

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 ?

View 7 Replies View Related

Multiple DB Instances On Same Server

Sep 6, 2012

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?

View 7 Replies View Related

Using Services To Correlate Workloads To Instances In RAC

Jan 17, 2011

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!)

View 3 Replies View Related

How To List Disabled Database Instances

Nov 2, 2011

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.

View 1 Replies View Related

Running Two Instances On Single Machine

Apr 25, 2013

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?

View 5 Replies View Related

Clusterware :: 2 Oracle SE Instances In 1 Cluster?

Jun 21, 2013

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?

View 2 Replies View Related

PUSH Versus PULL Tables Between Two Instances?

Oct 19, 2010

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 ?

View 2 Replies View Related

Forms :: Running Multiple Instances Parallel In 11g R2

Feb 13, 2013

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.

View 1 Replies View Related

RAC & Failsafe :: Listing Hidden Parameters For All Instances

Nov 30, 2010

I used following statement (user SYS as SYSDBA)

select x.inst_id,x.indx+1,ksppinm,ksppity,ksppstvl, ksppstdvl, ksppstdf,
decode(bitand(ksppiflg/256,1),1,'TRUE','FALSE'),
decode(bitand(ksppiflg/65536,3),1,'IMMEDIATE',2,'DEFERRED', 3,'IMMEDIATE','FALSE'),
decode(bitand(ksppiflg,4),4,'FALSE', decode(bitand(ksppiflg/65536,3), 0, 'FALSE', 'TRUE')),
[code].......

to list hidden parameters. However, when using it on RAC I found that only a singe instance data is displayed.

View 8 Replies View Related

Data Guard :: Multiple (Database) Instances

Oct 17, 2012

I wanted to know whether we can configure single data guard for multiple database (instances), has this been done anytime in the past .

We are a small business and growing at rapid rate. we want to cut down the cost at the same time.

Any other method or approach that is practical and economical to synchronise database between multiple production system into centralised DR system.

View 4 Replies View Related

Installation :: Install Two Database Instances In The Same Server

Jun 4, 2013

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?

View 6 Replies View Related

Data Guard :: Stop Instances At Standby?

Aug 30, 2012

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.

View 9 Replies View Related

SQL & PL/SQL :: Full Table Scan On Index Table

Feb 3, 2012

when i am Executing the following statement

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 ..

View 11 Replies View Related

PL/SQL :: Load Data From Index By Table To Table

Jun 27, 2013

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;

[Code]....

Its throwing. How to implement this scenario .

View 2 Replies View Related

Enterprise Manager :: Grid Control Database Instances Always Down

Jun 11, 2010

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.

View 1 Replies View Related

Server Administration :: Listener Shutdown For Individual Instances

May 17, 2013

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?

View 9 Replies View Related

Real Application Clusters :: 2 Node Instances On AIX - Row Lock

Jan 24, 2013

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..

View 3 Replies View Related

Queueing :: Error When Create Sub-consult With DBLink Between 3 Instances

Nov 7, 2012

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

View 1 Replies View Related

Real Application Clusters :: Unable To Start All 3 Instances In RAC?

Aug 1, 2013

, 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.

srvctl start database -d abc123PRCR-1079 : Failed to start resource ora.abc123.dbCRS-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/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

View 4 Replies View Related

SQL & PL/SQL :: Use Of Table Index?

Feb 10, 2012

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;

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved