Total Pageviews

Wednesday 27 May 2015

ORA-38760: This database instance failed to turn on flashback database

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-38760: This database instance failed to turn on flashback database

The flashback recovery area has run out of space. You see a message in the alert log similar to
the following:

Can not open flashback thread because there is no more space in flash recovery area

If the database has aborted earlier because of any flashback errors and you attempt to
start it, you get the following error:

You want to correct the problem, or at least shut the flashback down so that the normal
database operations can continue.

There are three solutions. Which to choose depends upon the nature of the emergency
and the resources you have at your disposal.

Solution 1 :
--------------
You can increase the size of the flashback area dynamically. To increase it to, say, 10GB, you
would issue the following:

SQL> alter system set db_recovery_file_dest_size = 10G;

Solution 2: Remove Restore Points

The alternative to increasing the size of the flashback area is to remove some of the older restore points that you no longer need. The following is a query to list the restore points you currently have:

SQL> col name format a25
SQL> select name, storage_size from v$restore_point;

NAME STORAGE_SIZE
------------------------- ------------
RP0 207028224
RP1 0
RP2 915701760
PRE_TEST1 0

These results show that restore points RP0 and RP2 have storage associated with them.
This is because they are guaranteed restore points You should remove them to make some room in the flash recovery area. To remove a restore point, issue a drop restore point command:

SQL> drop restore point rp2;
Restore point dropped.

SQL> drop restore point rp0;
Restore point dropped.

Restore points are created by executing SQL statements such as the following:

SQL> create restore point rp1;

This statement creates a named point in time to which you can flash back the database,
through the SQL statement (provided, of course, that you have turned on the flashback for the
database). Once you have a restore point, you can rewind or flash back to that point in time
using a statement such as this:
SQL> flashback database to rp1;

There are two types of restore points—normal and guaranteed. The preceding example of
creating a restore point creates a normal one. You may be able to flash back to that point, provided
enough flashback logs are available. If the flashback logs are not available (perhaps
because the space in the flashback recovery area ran out and Oracle had to delete some flashback
logs to make room for the newer occupants), then your flashback operation will fail. The
solution—a guaranteed restore point. To create a guaranteed restore point, you will have to
specifically ask for the guarantee:

A guaranteed restore point stores information needed to flash back in a special way. When
space pressures in the flash recovery area force the database to remove the unneeded files,
flashback logs are the first to go, unless these are for a guaranteed restore point. The flashback
logs of the guaranteed restore points are stored even when the flash recovery area runs out of
space. The only way to reclaim the space is to drop the guaranteed restore point. Dropping the
guaranteed restore points frees up that space.

Dropping restore point should clear up space, and you may be able to start the database.

Solution 3: Disable Flashback

If solutions 1 and 2 fail or are not applicable, you may want to disable flashback in the database
temporarily. First shut down the database (if not down already):

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 67111156 bytes
Database Buffers 96468992 bytes
Redo Buffers 2973696 bytes
Database mounted.

Then disable flashback in the database:

SQL> alter database flashback off;
Database altered.

This will stop the flashback operations and will stop generating flashback logs. This
should reduce the space requirement on the flash recovery area. To free up some space, you
may want to delete some more files such as archived redo logs, unneeded backups, and so on.


RMAN-06495: must explicitly specify DBID with SET DBID command

Your backup strategy doesn’t take advantage of either a flash recovery area or a recovery catalog.
You are trying to restore a control file as follows, and you receive an error message stating
that you must explicitly set the database identifier (DBID):

RMAN> connect target /
RMAN> startup nomount;
RMAN> restore controlfile from autobackup;


Error : RMAN-06495: must explicitly specify DBID with SET DBID command


You don’t know the DBID for your database, and you aren’t sure how to find the DBID.
Without a control file for your database, you can’t mount the database and query the DBID
value from the V$DATABASE view.

Solution

RMAN> connect target /
RMAN> startup nomount;
RMAN> set dbid 2601506593;

RMAN> restore controlfile from autobackup;

You can determine the DBID of your database in one of the following ways:

• You can derive the DBID from an autobackup file.
• You can retrieve the DBID from RMAN output.
• You can write the DBID to the alert.log file.
• You can derive DBID from a file dump.

Description of %F Format Variable
------------------------------------------------

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';

c-IIIIIIIIII-YYYYMMDD-QQ



Retrieving the DBID from RMAN Output

RMAN> connect target /
connected to target database: BRDSTN(DBID=2601506593)

Writing the DBID to the Alert.log File

Another way of recording the DBID is to make sure that it is written to the alert.log file on a
regular basis using the DBMS_SYSTEM package. For example, you could have this SQL code
execute as part of your backup job:

COL dbid NEW_VALUE hold_dbid
SELECT dbid FROM v$database;
exec dbms_system.ksdwrt(2,'DBID: '||TO_CHAR(&hold_dbid));

After running the previous code, you should see a text message in your target database
alert.log file that looks like this:
DBID: 2601506593

The KSDWRT procedure writes a text message to your database alert.log file. In this case,
the hold_dbid SQL variable is populated with the DBID. If you write your target database DBID
to the alert.log file on a regular basis, you should be able to identify it easily should the need
arise.

Dumping Files

If any of the datafiles, online redo log files, or archived redo log files are physically available,
you can use the SQL alter system dump statement to write the DBID to a trace file. Your database
does not have to be mounted for this to work. For example, here is the syntax for taking a
datafile dump:

SQL> connect / as sysdba
SQL> startup nomount;
SQL> alter system dump datafile '/<PATH>/system01.dbf' block min 1 block max 10;

Use this syntax to take a dump of an archived redo log file or online redo log file:

SQL> alter system dump logfile '<log file name>';
The trace file with the DBID will be in your user dump destination. If you search for the
string “Db ID,” you should find something similar to this output:
Db ID=2601506593=0x9b0fd721, Db Name='BRDSTN'

Every Oracle database has an internal unique DBID that can be queried from V$DATABASE
as follows:

SQL> select dbid from v$database;
DBID
------------------------------
2601506593


Sunday 24 May 2015

ASMCMD - New commands in 11gR1

The ASMCMD cp option allows you to copy files between ASM disk groups and OS file systems and between two ASM servers. 

The following file copy can be performed 

- ASM Diskgroup to OS file system 
- OS file system to ASM Diskgroup 
- ASM Diskgroup to another diskgroup
ASM Diskgroup to OS File system 

ASMCMD> cp +DGEXT/orcl/datafile/tbsext.256.628847401 /home/oracle/tbsext.dbf 
source +DGEXT/orcl/datafile/tbsext.256.628847401 
target /home/oracle/tbsext.dbf 
copying file(s)... 
file, /home/oracle/tbsext.dbf, copy committed. 

OS File system to ASM Diskgroup 

ASMCMD> cp /home/oracle/tbsext.dbf +DGEXTBK/prod/datafile/tbsext.dbf 
source /home/oracle/tbsext.dbf 
target +DGEXTBK/prod/datafile/tbsext.dbf 
copying file(s)... 
file, +DGEXTBK/prod/datafile/tbsext.dbf, copy committed.

SQL> create diskgroup dgext external redundancy disk '/dev/raw/raw1','/dev 
/raw/raw2'; 
Diskgroup created. 

SQL> create diskgroup DGEXTBK external redundancy disk '/dev/raw/raw3','/dev/raw /raw4'; 
Diskgroup created. 

ASMCMD> cd DGEXTBK 
ASMCMD> mkdir prod 
ASMCMD> cd prod 
ASMCMD> mkdir datafile 
ASMCMD> cd datafile 
ASMCMD> pwd 
+DGEXTBK/prod/datafile 

SQL> create tablespace TBSEXT datafile '+DGEXT' size 10m; 
Tablespace created. 

SQL> select name from v$datafile; 

NAME 
------------------------------------------------------------- 
+DGEXT/orcl/datafile/tbsext.256.628847401
cp +DGEXT/orcl/datafile/tbsext.256.628847401 +DGEXTBK/prod/datafile/tbsext  

ASMCMD> cp +DGEXT/orcl/datafile/tbsext.256.628847401 +DGEXTBK/prod/datafile/tbsext  
source +DGEXT/orcl/datafile/tbsext.256.628847401  
target +DGEXTBK/prod/datafile/tbsext  
copying file(s)...file, +DGEXTBK/prod/datafile/tbsext, copy committed.  


The tbsext is alias name created in the folder +DGEXTBK/prod/datafile.


SMCMD md_backup and md_restore 





Disk group to be backed up: DGEXT 

The full mode restores the diskgroup exactly as it was at the time of backup
ASMCMD> md_restore -b dgbk -t full -g dgext 
Current Diskgroup being restored: DGEXT 
ASMCMD-09352: CREATE DISKGROUP failed 
ORA-15018: diskgroup cannot be created 
ORA-15030: diskgroup name "DGEXT" is in use by another diskgroup (DBD ERROR: OCIStmtExecute) 

Diskgroup dropped. 

Current Diskgroup being restored: DGEXT 
Diskgroup DGEXT created! 
System template XTRANSPORT modified! 
System template ONLINELOG modified! 
System template DATAGUARDCONFIG modified! 
System template AUTOBACKUP modified! 
System template TEMPFILE modified! 
System template ARCHIVELOG modified! 
System template ASM_STALE modified! 
System template BACKUPSET modified! 
System template DUMPSET modified! 
System template FLASHBACK modified! 
System template PARAMETERFILE modified! 
System template CONTROLFILE modified! 
System template DATAFILE modified! 
System template CHANGETRACKING modified! 


------------ -------------------- ------ 
           1 DGEXT                EXTERN
The 'nodg' mode restore the attributes,templates, and alias directory structure specified in the backup file to an existing disk group.
ASMCMD> md_restore -b dgbk -t nodg -g dgext 
Current Diskgroup being restored: DGEXT 
System template XTRANSPORT modified! 
System template ONLINELOG modified! 
System template DATAGUARDCONFIG modified! 
System template AUTOBACKUP modified! 
System template TEMPFILE modified! 
System template ARCHIVELOG modified! 
System template ASM_STALE modified! 
System template BACKUPSET modified! 
System template DUMPSET modified! 
System template FLASHBACK modified! 
System template PARAMETERFILE modified! 
System template CONTROLFILE modified! 
System template DATAFILE modified! 
System template CHANGETRACKING modified!
The 'newdg' mode allows the user to override the disk group name,disk, and failgroup specifications as part of a diskgroup creation,but retains 
the attribute,template and, alias directory structure from the backup
ASMCMD>  md_restore -b dgbk -t newdg -o 'DGEXT:DG' 
Current Diskgroup being restored: DGEXT 
Current Diskgroup name replace by: DG 
Diskgroup DG created! 
System template XTRANSPORT modified! 
System template ONLINELOG modified! 
System template DATAGUARDCONFIG modified! 
System template AUTOBACKUP modified! 
System template TEMPFILE modified! 
System template ARCHIVELOG modified! 
System template ASM_STALE modified! 
System template BACKUPSET modified! 
System template DUMPSET modified! 
System template FLASHBACK modified! 
System template PARAMETERFILE modified! 
System template CONTROLFILE modified! 
System template DATAFILE modified! 
System template CHANGETRACKING modified!
SQL> select group_number,name,type from v$asm_diskgroup 

------------ -------------------- ------ 
           1 DG                   EXTERN

How to Move a Datafile from Filesystem to ASM Using ASMCMD CP Command



SQL> select file_id , file_name from dba_data_files ;

   FILE_ID FILE_NAME
---------- ----------------------------------------------------------------------------------------------------
4 +DATA/orcl/datafile/users.279.875242649
3 +DATA/orcl/datafile/undotbs1.278.875242649
2 +DATA/orcl/datafile/sysaux.277.875242649
1 +DATA/orcl/datafile/system.276.875242649
5 +DATA2/orcl/datafile/users.294.875976397
6 /data01/app/oracle/product/11.2.0.3/db_1/dbs/user02.dbf

6 rows selected.


SQL> alter system switch logfile;

System altered.

SQL> alter database datafile 6 offline;

Database altered.

SQL> select file_name, file_id, online_status from dba_data_files where file_id=6;

FILE_NAME                           FILE_ID   ONLINE_STATUS
---------------------------------------------------------------------------------------------------- ------
/data01/app/oracle/product/11.2.0.3/db_1/dbs/user02.dbf      6      RECOVER


ASMCMD> cp /data01/app/oracle/product/11.2.0.3/db_1/dbs/user02.dbf +DATA/ORCL/DATAFILE/user02.dbf
copying /data01/app/oracle/product/11.2.0.3/db_1/dbs/user02.dbf -> +DATA/ORCL/DATAFILE/user02.dbf

MOUNTED  EXTERN  N      DATA2/
ASMCMD> cd DATA/ORCL/DATAFILE
ASMCMD> pwd
+DATA/ORCL/DATAFILE
ASMCMD> ls -lt
Type      Redund  Striped  Time             Sys  Name
                                            N    user02.dbf => +DATA/ASM/DATAFILE/user02.dbf.258.880490555
DATAFILE  UNPROT  COARSE   MAY 23 20:00:00  Y    USERS.279.875242649
DATAFILE  UNPROT  COARSE   MAY 23 20:00:00  Y    UNDOTBS1.278.875242649
DATAFILE  UNPROT  COARSE   MAY 23 20:00:00  Y    SYSTEM.276.875242649
DATAFILE  UNPROT  COARSE   MAY 23 20:00:00  Y    SYSAUX.277.875242649

SQL> select file_name, file_id, online_status from dba_data_files where file_id=6 ;

FILE_NAME                    FILE_ID ONLINE_STATUS
--------------------------------------------------------------------------
+DATA/orcl/datafile/user02.dbf 6     ONLINE    

SQL> select file_name, file_id, online_status from dba_data_files
  FILE_ID FILE_NAME
---------- -------------------------------------------------------------
4 +DATA/orcl/datafile/users.279.875242649
3 +DATA/orcl/datafile/undotbs1.278.875242649
2 +DATA/orcl/datafile/sysaux.277.875242649
1 +DATA/orcl/datafile/system.276.875242649
5 +DATA2/orcl/datafile/users.294.875976397
6 +DATA/orcl/datafile/user02.dbf

Wednesday 20 May 2015

How to Check Clusterware Version and Name

To check name of cluster and version :

/app/grid/product/11.2.0.4/grid/bin/cemutlo -n

node-cluster01

/app/grid_base>crsctl query crs softwareversion

Oracle Clusterware version on node [node1] is [12.1.0.2.0]

/app/grid_base>crsctl query crs activeversion

Oracle Clusterware active version on the cluster is [12.1.0.2.0]

RMAN Recovery catalog

SQL> create tablespace cattbs datafile '/data01/app/oracle/datafiles/racdb/catalog.dbf' size 500M ;

Tablespace created.

SQL> create user rman identified by rman default tablespace cattbs quota unlimited on cattbs;

User created.

SQL> grant recovery_catalog_owner to rman;

Grant succeeded.

RMAN> connect catalog rman/rman

connected to recovery catalog database

[oracle@DB11G dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed May 20 09:38:17 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: RACDB (DBID=876245389)

RMAN> connect catalog rman/rman

connected to recovery catalog database

RMAN> list incarnation ;


RMAN> list incarnation ;


RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN> list incarnation;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       14      RACDB    876245389        PARENT  1          17-SEP-11
1       2       RACDB    876245389        CURRENT 995548     02-MAY-15


Cataloging Older Files

RMAN> catalog datafilecopy '/u01/app/oracle/users01.dbf';
cataloged datafile copy
datafile copy filename=/u01/app/oracle/users01.dbf recid=2 stamp=604202000
RMAN>

RMAN> catalog backuppiece '/disk1/backups/backup_820.bkp';
RMAN> catalog archivelog '/disk1/arch_logs/archive1_731.dbf',
'/disk1/arch_logs/archive1_732.dbf';

The files you want to catalog can exist only on disk and not on tape, and they must belong
to one of the following types:
• Datafile copy
• Control file copy
• Archived redo log
• Backup piece

Cataloging a Datafile Copy As an Incremental Backup
====================================================

RMAN> catalog datafilecopy '?/oradata/users01.bak' level 0;

Once you catalog a datafile copy as a level 0 backup, you can then perform an incremental backup by using that copy as your base.

RMAN> catalog start with '/disk1/arch_logs/';
RMAN> catalog start with '/disk1/arch_logs/' noprompt;

Updating the Recovery Catalog

RMAN> resync catalog;
starting full resync of recovery catalog
full resync complete
RMAN>

Monday 18 May 2015

Undo tablespace datafile dropped or corrupted

SQL> select file_name from dba_data_files ; 

FILE_NAME
--------------------------------------------------------------------------------
/data01/app/oracle/datafiles/racdb/users01.dbf
/data01/app/oracle/datafiles/racdb/undotbs01.dbf
/data01/app/oracle/datafiles/racdb/sysaux01.dbf
/data01/app/oracle/datafiles/racdb/system01.dbf

SQL>
SQL>
SQL>rm /data01/app/oracle/datafiles/racdb/undotbs01.dbf

Database will crash here with below alert log error . 

Alert Log:
===========
Errors in file /data01/app/oracle/diag/rdbms/racdb/racdb/trace/racdb_dbw0_3249.trc:
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/data01/app/oracle/datafiles/racdb/undotbs01.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /data01/app/oracle/diag/rdbms/racdb/racdb/trace/racdb_ora_3364.trc:
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/data01/app/oracle/datafiles/racdb/undotbs01.dbf'
ORA-1157 signalled during: alter database open ...




[oracle@DB11G ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon May 18 07:35:15 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup mount ;
ORACLE instance started.

Total System Global Area  563728384 bytes
Fixed Size    2230272 bytes
Variable Size  171968512 bytes
Database Buffers  385875968 bytes
Redo Buffers    3653632 bytes
Database mounted.

SQL> alter database open ;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 3 - see DBWR trace file
ORA-01110: data file 3: '/data01/app/oracle/datafiles/racdb/undotbs01.dbf'

SQL> alter database datafile  '/data01/app/oracle/datafiles/racdb/undotbs01.dbf' offline drop ;

SQL> alter system set undo_management=manual scope=spfile;

System altered.

SQL> shu immediate ;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

----> we will resolve this error later first create new undo and start database asap ,

SQL> drop tablespace undotbs1; 
drop tablespace undotbs1
*
ERROR at line 1:
ORA-01548: active rollback segment '_SYSSMU1_1240252155$' found, terminate
dropping tablespace

SQL> create UNDO tablespace undotbs2 datafile '/data01/app/oracle/datafiles/racdb/undotbs03.dbf' size 50M ;

Tablespace created.

SQL>  alter system set undo_management = auto scope=spfile;

System altered.

SQL> show parameter undo ;

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management     string MANUAL
undo_retention     integer 900
undo_tablespace     string UNDOTBS1


SQL> shu immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup ;
ORACLE instance started.

Total System Global Area  563728384 bytes
Fixed Size    2230272 bytes
Variable Size  171968512 bytes
Database Buffers  385875968 bytes
Redo Buffers    3653632 bytes
Database mounted.
Database opened.
SQL> Alter system set undo_tablespace=undotbs2 ;

System altered.

SQL> show parameter undo ;

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management     string AUTO
undo_retention     integer 900
undo_tablespace     string UNDOTBS2

SQL> drop tablespace undotbs1;
drop tablespace undotbs1
*
ERROR at line 1:
ORA-01548: active rollback segment '_SYSSMU1_1240252155$' found, terminate
dropping tablespace


SQL> drop rollback segment '_SYSSMU1_1240252155$' ;
drop rollback segment '_SYSSMU1_1240252155$'
                      *
ERROR at line 1:
ORA-02175: invalid rollback segment name

SQL> select segment_name,status,tablespace_name from dba_rollback_segs where status like '%RECOVERY%' ;

SEGMENT_NAME           STATUS   TABLESPACE_NAME
------------------------------ ---------------- ------------------------------
_SYSSMU1_1240252155$   NEEDS RECOVERY UNDOTBS1
_SYSSMU2_1240252155$   NEEDS RECOVERY UNDOTBS1
_SYSSMU3_4004931649$       NEEDS RECOVERY UNDOTBS1
_SYSSMU4_1126976075$       NEEDS RECOVERY UNDOTBS1
_SYSSMU5_4011504098$       NEEDS RECOVERY UNDOTBS1
_SYSSMU6_3654194381$       NEEDS RECOVERY UNDOTBS1
_SYSSMU7_4222772309$       NEEDS RECOVERY UNDOTBS1
_SYSSMU8_3612859353$       NEEDS RECOVERY UNDOTBS1
_SYSSMU9_3945653786$       NEEDS RECOVERY UNDOTBS1
_SYSSMU10_3271578125$       NEEDS RECOVERY UNDOTBS1



SQL> shu immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup ;
ORACLE instance started.

Total System Global Area  563728384 bytes
Fixed Size    2230272 bytes
Variable Size  171968512 bytes
Database Buffers  385875968 bytes
Redo Buffers    3653632 bytes
Database mounted.
Database opened.
SQL> create pfile from spfile ;

File created.

Edit pfile and start instance using pfile :

*._offline_rollback_segments=(_SYSSMU1_1240252155$,_SYSSMU2_111974964$,_SYSSMU3_4004931649$,_SYSSMU4_1126976075$,_SYSSMU5_4011504098$,_SYSSMU6_3654194381$,_SYSSMU7_4222772309$,_SYSSMU8_3612859353$,_SYSSMU9_3945653786$,_SYSSMU10_3271578125$)


SQL> drop tablespace undotbs1;

Tablespace dropped.

SQL> create spfile from pfile ;

File created.

SQL> select segment_name,status,tablespace_name from dba_rollback_segs ;

SEGMENT_NAME       STATUS TABLESPACE_NAME
------------------------------ ---------------- ------------------------------
SYSTEM       ONLINE SYSTEM
_SYSSMU30_2181141343$       ONLINE UNDOTBS2
_SYSSMU29_4137772411$       ONLINE UNDOTBS2
_SYSSMU28_1117717027$       ONLINE UNDOTBS2
_SYSSMU27_1646655687$       ONLINE UNDOTBS2
_SYSSMU26_73850059$       ONLINE UNDOTBS2
_SYSSMU25_1059101193$       ONLINE UNDOTBS2
_SYSSMU24_1011611768$       ONLINE UNDOTBS2
_SYSSMU23_1356515410$       ONLINE UNDOTBS2
_SYSSMU22_2758924745$       ONLINE UNDOTBS2
_SYSSMU21_480817652$       ONLINE UNDOTBS2

11 rows selected.

SQL> show parameter undo ; 

NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management     string AUTO
undo_retention     integer 900
undo_tablespace     string UNDOTBS2

Create spfile from pfile bounce db and start it using spfile now . 

Wednesday 6 May 2015

Script to Determine if a Materialized View is Being Refreshed

   SELECT s.sql , s.serial# , s.sql_id , s.status , s.event , s.last_call_et
     FROM v$lock l, dba_objects o, v$session s
    WHERE o.object_id = l.id1
      AND l.TYPE = 'JI'
      AND l.lmode = 6
      AND s.SID = l.SID
      AND o.object_type = 'TABLE'
      AND o.owner = &owner
      AND o.object_name = &mview_name