Switchover between primary RAC and standby single instance

Hello All,
I am using Oracle 11gR2.
I am trying to do a switch over between primary database (RAC 2 nodes) and physical standby (single instance)
If my Primary is single instance i was following the below steps:
On the standby
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
On the primary database:
alter database commit to switchover to standby with session shutdown;
shutdown immediate;
startup nomount;
alter database mount standby database;
On the standby again:
alter database commit to switchover to primary WITH SESSION SHUTDOWN;
On the new standby:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;now, and since my primary is RAC when i am trying switch over I am getting the below error:
SQL> alter database commit to switchover to standby with session shutdown;
alter database commit to switchover to standby with session shutdown
ERROR at line 1:
ORA-01105: mount is incompatible with mounts by other instancesPlus that when I want to apply the remaining steps (below step), should I do it on each instance alone? or is there anyway to do it using the srvctl command:
alter database mount standby database;Regards,

Hi,
Since You are using 2 node RAc as primary, so for switchover operation you need to shutdown
one database instance( Suppose instance 2).
Suppose your node1:
hostname is dcpdb1
and node 2:
hostname is dcpdb2
and standby hostname is drpdb1
So follow this steps for switchover .
How to Switchover from Primary to Standby Database?
Process:
On the primary server, check the latest archived redo log and force a log switch.
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY next_time;
SQL> ALTER SYSTEM SWITCH LOGFILE;
Check the new archived redo log has arrived at the standby server and been applied.
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY next_time ;
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY next_time ;
SQL> ALTER SYSTEM SWITCH LOGFILE;
Check the new archived redo log has arrived at the standby server and been applied.
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY next_time ;
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
*########### Login dcpdb2 as Oracle user #########*
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
*########### Login dcpdb1 as Oracle user #########*
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;
Database altered.
SQL>
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL>
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7751076184 bytes
Database Buffers 7616856064 bytes
Redo Buffers 29409280 bytes
Database mounted.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO PRIMARY
SQL>
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
SESSIONS ACTIVE
SQL> alter database commit to switchover to primary with session shutdown;
Database altered.
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7717521752 bytes
Database Buffers 7650410496 bytes
Redo Buffers 29409280 bytes
Database mounted.
Database opened.
*########### Login dcpdb1 as Oracle user #########*
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
*########### Login dcpdb2 as Oracle user #########*
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.5400E+10 bytes
Fixed Size 2184872 bytes
Variable Size 7751076184 bytes
Database Buffers 7616856064 bytes
Redo Buffers 29409280 bytes
Database mounted.
SQL> alter database open read only;
Database altered.
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*########### Login drpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
TO STANDBY
*########### Login dcpdb1 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*########### Login dcpdb2 as Oracle user #########*
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
NOT ALLOWED
SQL>
*####################### Finish SwitchOver ########################*
Check
*########### Login drpdb1 as Oracle user #########*
SQL> alter system switch logfile;
SQL>
SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY sequence#;
SQL> archive log list
*########### Login dcpdb1 as Oracle user #########*
SQL>
SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY sequence#;
SQL> archive log list
*########### Login dcpdb2 as Oracle user #########*
SQL>
SELECT sequence#, first_time, next_time, applied
FROM v$archived_log
ORDER BY sequence#;
SQL> archive log list
Thanks
Solaiman
Edited by: 876149 on Apr 12, 2013 11:51 AM

Similar Messages

  • Cluster with one 2 Node RAC and a Single Instance using ASM

    Hi there,
    i am not sure with one planned installation and want to ask, weather i am on the right track.
    Some Facts:
    Clusterware 11g
    ASM 11g
    Database 10gR2
    AIX 5.3
    3 Machines
    2 Storages DS4700
    My Plan
    On Node 1 and Node 2 we install a RAC Database for an ERP Software
    On Node 3 we install a single Instance Database for a Logistic Software
    So i will install on all three Nodes Clusterware and an 3 Instances ASM - Cluster
    I create 2 Diskgroups, one for the FRA and one for the Data, both on Luns on the DS4700
    The RAC-Database and the Logistic-Database are using the same Diskgroups.
    Is this the way to go for this circumstances?
    The alternative is, as far as i see
    Clusterware on an 3 Servers
    One 2 Node ASM for the ERP Software
    one Single Node ASM for the Logistcs
    4 Diskgroups, because of the 2 ASM-Database 2 for the RAC and 2 for the Single Instance.
    Please give me some hints, which way i should prefer.
    My tendence is going to the first alternative. I like the idea to share the Diskgroups over more than on Database because of easy administration.
    The load of the 2 Databases are completly different, the logistc software will nearly do nothing compared to the ERP Software, so this should'nt be a problem.
    But maybe i oversee something, so please do not hesitate to tell me, i am completly wrong ;)
    Thanks a lot
    Jörg

    Chris Slattery wrote:
    why clusterware on 3rd machine ?
    I'd have separate DGs but that's just me.If you wish to install ASM you need OCS installed on the machine, even if it is just one node at all.
    It is a kind of a dependency, no OCS, no ASM
    cu
    Jörg

  • Difference between sqlplus - start and srvctl start instance

    Hello,
    why we need to start RAC instances with SRVCTL command, what is the difference between sqlplus -- startup and (srvctl start instance -d dbname -i inst_name)
    Thanks
    Karthick K

    The first ever thing that comes to mind is that sql*plus is not a clusterware utility which means, any updations done from it, may not update correctly the OCR . If you would play with RAC, you may see that doing the startup/shutdown using the sql*plus at times show a conflict the status of the instance when checked through crs_stat command. That's a reason that the srvctl is preferred against sql*plus in the cluster environments.
    HTH
    Aman....

  • Difference between primary key and primary index

    Dear All,
             Hi... .Could you pls tell me the difference between primary key and primary index.
    Thanks...

    Hi,
    Primary Key : It is one which makes an entry of the field unique.No two distinct rows in a table can have the same value (or combination of values) in those columns.
    Eg: first entry is 111, if you again enter value 111 , it doesnot allow 111 again. similarly for the strings or characters or numc etc. Remember that for char or numc or string 'NAME' is not equal to 'name'.
    Primary Index: this is related to the performance .A database index is a data structure that improves the speed of operations in a table. Indices can be created using one or more columns, providing the basis for both rapid random lookups and efficient ordering of access to records. The disk space required to store the index is typically less than the storage of the table (since indices usually contain only the key-fields according to which the table is to be arranged, and excludes all the other details in the table), yielding the possibility to store indices into memory from tables that would not fit into it. In a relational database an index is a copy of part of a table. Some databases extend the power of indexing by allowing indices to be created on functions or expressions. For example, an index could be created on upper(last_name), which would only store the uppercase versions of the last_name field in the index.
    In a database , we may have a large number of records. At the time of retrieving data from the database based on a condition , it is a burden to the db server. so whenever we create a primary key , a primary index is automatically created by the system.
    If you want to maintain indices on other fields which are frequently used in where condition then you can create secondary indices.
    Reward points if helpful.
    Thanks,
    Sirisha..

  • Difference between primary eindex and secondary index?

    hi experts
    pls answer me
    difference between primary eindex and secondary index?
    rewads apply.
    thanks.
    naresh.

    hi,
    check this link.
    http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/frameset.htm
    A difference is made between Primary & Secondary indexes to a table. the primary index consists of the key fields of the table and a pointer to the non-keys-fields of the table. The Primary index is generated automatically when a table is created and is created in the datebase as the same times as the table. It is also possible to define further indexes to a table in the ABAP/4 dictionary, which are then referred to as Secondary indexes.
    Always it is not mandatory that an index should have all the key fields of a table. To see the index of a table
    goto SE11->specify table name->click on the indexes... button on the application toolbar.
    Based on your requirement you can you any of those index fields in the where clause of your query. Always its a better practice to use the index fields in the order specified. While selecting the records from a table it is always better to select the fields in the same order as specified in the table.

  • Difference between PRIMARY KEY and UNIQUE KEY with NOT NULL

    What is the difference between PRIMARY KEY and UNIQUE KEY with NOT NULL constraint?
    Message was edited by:
    Nilesh Hole

    Answer for the master!!!
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8743855576462
    Thanks,
    Karthick

  • 11gR2 dataguard using a primary 2 node RAC and a single standby

    Hi,
    I need to implement dataguard between 11gR2 RAC db to a single standby. How do I proceed?
    Secondly, I need to timely apply the archive log i.e I need the dataguard to be in SYNC mode only in the night and the standby in read only
    mode rest of the times. Can I achieve this using dataguard broker? If yes, can you please provide me the steps?
    regards,
    Ram

    Doing that would require jobs again.
    In your example:
    9 am:
    alter database recover managed standby database cancel;
    -- here you can actually specify anything greater 780 because of the cancel at 10 pm; this is just to make sure the archive logs are being shipped.
    alter database recover managed standby database delay=780 disconnect from session;
    -- and, if your requriement is still to have the standby open read only
    alter database open read only;
    10 pm:
    shutdown immediate;
    startup nomount;
    alter database mount standby database;
    alter database recover managed standby database cancel;
    alter database recover managed standby database using current logfile disconnect from session;
    with that setup:
    - your standby stops recovering at 9am
    - the archive logs of the primary will still be shipped to your standby side for any emergency
    - you'll have an open read only standby from 9am to 10pm
    - the archive logs will be real time applied from 10pm to 9am
    Note that this is just theory at the moment, I don't have a test set up like this. But it should give you an idea of what's possible and in what way you can accomplish your needs.

  • Database replication between Oracle RAC and Oracle Standalone DB in 9i

    Hi,
    We have currently 4 node RAC environment and Oracle RAC implementation with 4 Oracle instances. We want to move the one instance and make it Standalone with Oracle database due to availability issue. Thus we will remain with 3 nodes on the RAC database and one Standalone database. We want to implement Oracle replication on this solution, where partial database of RAC environment needs to be replicated to Standalone node.
    We will have Oracle 9i database server for both RAC and Standalone machine.
    The partial data that we are looking for replication are of size 25GB. Some of questions we have:
    1. Is there any other replication mechanism apart from Materilzed view for this solution?
    2. Is it feasible to sychronize around 25GB data between servers?
    3. What can be estimated time for refresh or Synchronization?
    The methods that we are evaluating currently for this replication are:
    1. Multi Master replication
    2. Oracle 9i Datagaurd.
    Please let me know if we need to look for some other methods of replication also.
    Thanks in advance for help.

    ManojMac wrote:
    The partial data that we are looking for replication are of size 25GB. Some of questions we have:
    1. Is there any other replication mechanism apart from Materilzed view for this solution?Streams is another option
    2. Is it feasible to sychronize around 25GB data between servers?Sure. Depending on the rate of change, your latency requirements, whether the standalone database has the horsepower to apply all the changes generated by to other three nodes, etc.
    3. What can be estimated time for refresh or Synchronization?Depends on the architecture, the network connection, whether you are doing incremental refreshes, etc. And it depends on what time you're measuring-- you might be measuring the latency between the RAC cluster and the standalone database, you might be measuring the time it takes to incrementally refresh a single materailized view when there have been no changes, you might be measuring the time it takes to do a complete refresh of an entire refresh group, pulling 25 GB of data over the network.
    The methods that we are evaluating currently for this replication are:
    1. Multi Master replication
    2. Oracle 9i Datagaurd.DataGuard is not an option if you only want to replicate a subset of the data. The two realistic options are materialized views and Streams. Are you anticipating that you will be making changes on both nodes? If not, you can use simple materialized views rather than multi-master replication.
    Since 9.2 is not longer covered by Premier Support, are you planning to upgrade to a supported version in the near future? In particular, Streams works a lot better in later versions of the database.
    Justin

  • Database replication between Oracle RAC and Oracle Standalone DB

    Hi,
    We have currently 4 node RAC environment and Oracle RAC implementation with 4 Oracle instances. We want to move the one instance and make it Standalone with Oracle database due to availability issue. Thus we will remain with 3 nodes on the RAC database and one Standalone database. We want to implement Oracle replication on this solution, where partial database of RAC environment needs to be replicated to Standalone node.
    We will have Oracle 9i database server for both RAC and Standalone machine.
    The partial data that we are looking for replication are of size 25GB. Some of questions we have:
    1. Is there any other replication mechanism apart from Materilzed view for this solution?
    2. Is it feasible to sychronize around 25GB data between servers?
    3. What can be estimated time for refresh or Synchronization?
    Thanks in advance for help.

    The methods that we are evaluating currently for this replication are:
    1. Multi Master replication
    2. Oracle 9i Datagaurd.
    Please let me know if we need to look for some other methods of replication also.

  • Can I have a primary database and standby database with a different windows version?

    Hi
    I need your help.
    We need to increase the memory in the server where is the standby database , but first, we need to upgrade the windows version.
    The actual version is windows 2003 standard edition 64 bits
    The new version will be windows 2003 enterprise  edition 64 bits
    This difference in windows version  between primary and standby servers can cause a problem in the synchronization between primary and standby databases ??
    What do you recommend? Have both servers in the same windows version?
    The databases are in SQL SERVER 2005.
    Thanks.
    Loreinn

    This difference in windows version  between primary and standby servers can cause a problem in the synchronization between primary
    and standby databases ??<o:p></o:p>
    There is no issue with database synchronization as long as SQL Server is of same version.<o:p></o:p>
    What do you recommend? Have both servers in the same windows version?<o:p></o:p>
    OS(Windows version) has no restriction for using SQL server 2005 database mirroring/log shipping. You can go with upgrade without any worries on SQL
    database side.<o:p></o:p>

  • RAC and standby database

    Hi,
    We have configured a RAC production system and an standalone standby database.
    Last week, we had trouble with our ESS subsystem and we have to failover.
    Rigth now we solve the problem with the ESS subsysytem and the RAC enviroment is up and running but the database is no updated because is at the moment that we had the problem.
    So, we want to back to the initial configuration (RAC primary database and standalone standby).
    I want to know is this can be possible with only a backup/restore? (standby database cold backup and then restore the database over the RAC environment) and then reconfigure our standby database?
    Or which steps should we follow to do this?
    Thanks in advance,
    Gerald

    My question is:
    Is it possible to setup a standby database on a RAC environment with 2 nodes? I've searched through MOS but didn't find any information about that...Yes, it is possible. Refer this
    *Data Guard Physical Standby 11.2 RAC Primary to RAC Standby using a second network [ID 1349977.1]*
    MAA / Data Guard 10g Setup Guide – Creating a RAC Physical Standby for a RAC Primary
    http://www.oracle.com/technetwork/database/features/availability/maa-wp-10g-racprimaryracphysicalsta-131940.pdf
    http://wiki.tapriuneclak.com/index.php?title=Oracle_-StepBy_Step_of_Configuring_Oracle_11gR2_(11.2.0.1)_RAC_to_RAC_Dataguard
    http://davidalejomarcos.wordpress.com/2010/02/17/creating-a-3-node-rac-database-as-standby/

  • Restoring RAC database to single instance

    We run a 2-node RAC instance on 11g (Standard Edition) under SuSE 10 but our remote disaster recovery machine just runs a single instance.
    Is it possible to restore from RMAN in this case and how should we go about it?
    Thanks!

    It is always possible to restore a RAC database backup to single instance. Infact restores are generally made to a single instance. After the restore we convert the database to RAC with required number of instances. Depending on the procedure you use the steps vary.
    -Ravi

  • Which is the difference between Oracle RAC and Oracle Clusterware?

    Hi all, maybe this is a stupid question, but I've read the documentation, and still don't understand which is the difference between RAC and Clusterware.
    Can anybody explain it to me?
    Thanks in advance!

    RAC is database option part of Oracle Database software needed to have database running in cluster mode; see http://download.oracle.com/docs/cd/E11882_01/server.112/e16508/glossary.htm#CNCPT2076.
    Clusterware is separate software needed to run Oracle Database in cluster mode: you can use Oracle Clusterware without Oracle Database but you cannot use Oracle Database with RAC option without Oracle Clusterware.
    See http://download.oracle.com/docs/cd/E11882_01/rac.112/e16794/intro.htm#BABCHEEE.
    Edited by: P. Forstmann on 19 nov. 2010 19:11
    Edited by: P. Forstmann on 19 nov. 2010 19:11

  • Access path difference between Primary Key and Unique Index

    Hi All,
    Is there any specific way the oracle optimizer treats Primary key and Unique index differently?
    Oracle Version
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    SQL> Sample test data for Normal Index
    SQL> create table t_test_tab(col1 number, col2 number, col3 varchar2(12));
    Table created.
    SQL> create sequence seq_t_test_tab start with 1 increment by 1 ;
    Sequence created.
    SQL>  insert into t_test_tab select seq_t_test_tab.nextval, round(dbms_random.value(1,999)) , 'B'||round(dbms_random.value(1,50))||'A' from dual connect by level < 100000;
    99999 rows created.
    SQL> commit;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats(USER_OWNER','T_TEST_TAB',cascade => true);
    PL/SQL procedure successfully completed.
    SQL> select col1 from t_test_tab;
    99999 rows selected.
    Execution Plan
    Plan hash value: 1565504962
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            | 99999 |   488K|    74   (3)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| T_TEST_TAB | 99999 |   488K|    74   (3)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6915  consistent gets
            259  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL> create index idx_t_test_tab on t_test_tab(col1);
    Index created.
    SQL> exec dbms_stats.gather_table_stats('USER_OWNER','T_TEST_TAB',cascade => true);
    PL/SQL procedure successfully completed.
    SQL> select col1 from t_test_tab;
    99999 rows selected.
    Execution Plan
    Plan hash value: 1565504962
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            | 99999 |   488K|    74   (3)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| T_TEST_TAB | 99999 |   488K|    74   (3)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6915  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL> Sample test data when using Primary Key
    SQL> create table t_test_tab1(col1 number, col2 number, col3 varchar2(12));
    Table created.
    SQL> create sequence seq_t_test_tab1 start with 1 increment by 1 ;
    Sequence created.
    SQL> insert into t_test_tab1 select seq_t_test_tab1.nextval, round(dbms_random.value(1,999)) , 'B'||round(dbms_random.value(1,50))||'A' from dual connect by level < 100000;
    99999 rows created.
    SQL> commit;
    Commit complete.
    SQL> exec dbms_stats.gather_table_stats('USER_OWNER','T_TEST_TAB1',cascade => true);
    PL/SQL procedure successfully completed.
    SQL> select col1 from t_test_tab1;
    99999 rows selected.
    Execution Plan
    Plan hash value: 1727568366
    | Id  | Operation         | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |             | 99999 |   488K|    74   (3)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| T_TEST_TAB1 | 99999 |   488K|    74   (3)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6915  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL> alter table t_test_tab1 add constraint pk_t_test_tab1 primary key (col1);
    Table altered.
    SQL> exec dbms_stats.gather_table_stats('USER_OWNER','T_TEST_TAB1',cascade => true);
    PL/SQL procedure successfully completed.
    SQL> select col1 from t_test_tab1;
    99999 rows selected.
    Execution Plan
    Plan hash value: 2995826579
    | Id  | Operation            | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |                | 99999 |   488K|    59   (2)| 00:00:01 |
    |   1 |  INDEX FAST FULL SCAN| PK_T_TEST_TAB1 | 99999 |   488K|    59   (2)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6867  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL> If you see here the even though statistics were gathered,
         * In the 1st table T_TEST_TAB, the table is still using FULL table access after creation of index.
         * And in the 2nd table T_TEST_TAB1, table is using PRIMARY KEY as expected.
    Any comments ??
    Regards,
    BPat

    Thanks.
    Yes, ignored the NOT NULL part.Did a test and now it is working as expected
    SQL>  create table t_test_tab(col1 number not null, col2 number, col3 varchar2(12));
    Table created.
    SQL>
    create sequence seq_t_test_tab start with 1 increment by 1 ;SQL>
    Sequence created.
    SQL> insert into t_test_tab select seq_t_test_tab.nextval, round(dbms_random.value(1,999)) , 'B'||round(dbms_random.value(1,50))||'A' from dual connect by level < 100000;
    99999 rows created.
    SQL> commit;
    Commit complete.
    SQL>  exec dbms_stats.gather_table_stats('GREP_OWNER','T_TEST_TAB',cascade => true);
    PL/SQL procedure successfully completed.
    SQL>  set autotrace traceonly
    SQL>  select col1 from t_test_tab;
    99999 rows selected.
    Execution Plan
    Plan hash value: 1565504962
    | Id  | Operation         | Name       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |            | 99999 |   488K|    74   (3)| 00:00:01 |
    |   1 |  TABLE ACCESS FULL| T_TEST_TAB | 99999 |   488K|    74   (3)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6912  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL>  create index idx_t_test_tab on t_test_tab(col1);
    Index created.
    SQL>  exec dbms_stats.gather_table_stats('GREP_OWNER','T_TEST_TAB',cascade => true);
    PL/SQL procedure successfully completed.
    SQL>  select col1 from t_test_tab;
    99999 rows selected.
    Execution Plan
    Plan hash value: 4115006285
    | Id  | Operation            | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |                | 99999 |   488K|    63   (2)| 00:00:01 |
    |   1 |  INDEX FAST FULL SCAN| IDX_T_TEST_TAB | 99999 |   488K|    63   (2)| 00:00:01 |
    Statistics
              1  recursive calls
              0  db block gets
           6881  consistent gets
              0  physical reads
              0  redo size
        1829388  bytes sent via SQL*Net to client
          73850  bytes received via SQL*Net from client
           6668  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          99999  rows processed
    SQL>

  • Is their a difference between primary key and unique key with not null valu

    What is the difference in having a column as primary key and having unique key with not null for the column.
    vinodh

    SBH wrote:
    For quick review, below is the link
    http://www.dba-oracle.com/data_warehouse/clustered_index.htm
    You appear to have stumbled on a site that is a mine of disinformation about Oracle.
    >
    It would be helpful, if you explain it too..thnx !!
    The site is wrong and makes up its own terminology as it goes along.
    If the value for clustering factor approaches the number of blocks in the base table, then the index is said to be clustered. http://www.oracle.com/pls/db112/search?remark=quick_search&word=clustered+index
    There is no create clustered index in Oracle.
    - Clustering factor affects the efficiency of an index.
    - There can be clustered tables that you can create indexes on.
    - An Index Organized table is a similar concept to the Microsoft SQL Server clustered index, but it isn't the same thing at all.

Maybe you are looking for

  • Has there been a change to manually manage music and videos?

    Does anyone know if there has been a change to iTunes with regard to how to manually manage media files? I am almost positive that in order to manually manage music, books, videos, etc. you selected the Summary tab for your iDevice when you plugged i

  • I´m trying to download Whatsaap for my iphone 3 and I can´t

    I need to download Whatssap for my Iphone 3

  • MRP Exception message for Excess production quantity

    Originally, there is a demand for a common item material A 1500 One work order is opened for this grouped demand Grouped Demand: 1500 Work Order QTy: 1500 Due to a drop in demand, the demand fall to 1200 At this time, will any MRP exception raise to

  • TS3297 6.1.3 to 6.1.4 problem.. please help

    Hi All, I have the Iphone 5 with IOS 6.1.3 and when I try to update it to 6.1.4 Itunes tells me "This device is not eligible for the requested build". Apple Help says that it happens when people Jailbreaked their Iphone... but I haven't. What can i d

  • BPC10 NW: Same dimension Multiple times

    Hi Experts!!! Is it imposible to have a dimension more than ones in the same model. The problem is that i have a dimension called Person and in person i have employees and bosses. A person can be a boss and be at the same time an employee. how can i