Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to see lock on table and query?

Rafi (Oracle DBA)Feb 22 2010 — edited Feb 22 2010
Hi All,
How do we see lock on table and query?


Thanks,
Rafi
This post has been answered by Girish Sharma on Feb 22 2010
Jump to Answer

Comments

damorgan
SQL> startup nomount;

$ rman target sys/oracle1@proda auxiliary /

RMAN> duplicate target database for standby nofilenamecheck;

RMAN> exit;

This is part of the standard curriculum of the 10gR2 Data Guard class I teach: It works.
The Human Fly
RMAN-04006: Error not connected to auxiliaire :ORA-12528: TNS:listener: all appropriate instances are blocking new connections
The above error is because the instance state is block in the listener. Make sure the instance state is READY, not BLOCKED.

Jaffar
153119
IIRC you need to have the database in the SID_LIST_LISTENER section of LISTENER.ORA and your TNSNAMES needs to read
orcl.. = (connect_data=(***SID***= ))
instead of service_name =

Hth
--
Sybrand Bakker
Senior Oracle DBA
51034
I think you might find the second part of this article useful:
http://www.dizwell.com/prod/node/9
happy10319
instance state would be blocked until it is in nomount state, and it should be in nomount (thenblocked ) for duplicat.
585629
creating new entry in the listener.ora for the auxiliary database.... and this will solve the problem.
happy10319
thanks but it is already done :
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME=orcl2)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(SID_NAME =orcl2)
)

)
happy10319
Hi Damorgan,
you are true, RMAN connected :
C:\Documents and Settings\user>rman target sys/pwd@orcl auxiliary /

Recovery Manager: Release 10.2.0.1.0 - Production on Sam. Ao¹t 4 15:37:46 2007

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

connected to target : ORCL (DBID=1155329895)
connected to auxiliary : ORCL2 (non mounted)

But :
When :
RMAN> run{
2> duplicate target database for standby
3> nofilenamecheck
4> dorecover;
5> }

canal ORA_AUX_DISK_1 : restauration de fichier de contr¶le
canal ORA_AUX_DISK_1 : copie du fichier de contr¶le copiÚe
fichier en entrÚe=C:\ORACLE\ORADATA\BACKUP\ORCL\CONTROL01.DBF
fichier de sortie=C:\ORACLE\ORADATA\ORCL2\CONTROL01.CTL
fichier de sortie=C:\ORACLE\ORADATA\ORCL2\CONTROL02.CTL
fichier de sortie=C:\ORACLE\ORADATA\ORCL2\CONTROL03.CTL
Fin de restore dans 04/08/07

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: Failed in Duplicate DB 08/04/2007 15:43:10
RMAN-03015: une erreur s'est produite dans le script stockÚ Memory Script
RMAN-03009: Úchec de la commande sql sur le canal clone_default Ó 08/04/2007 15:43:10
RMAN-11003: erreur lors de l'analyse ou de l'exÚcution d'une instruction SQL : alter database mount standby database
ORA-01103: database name 'orcl' in control file is not 'orcle2'

Any idea ??
The Human Fly
ORA-01103: database name 'orcl' in control file is not 'orcle2'
Database name must be unique on primary and standby database.
Make sure the db_name parameter of standby databas is similar to the primary database initialization parameter value.

Jaffar
happy10319
Jaffar,
according to oracle documentations it seems to me that we can have standby database on the same server then how can it have the same name ? Am I wrong ?Can you confirme that we can not have standby DB on the same server with another name?
Thanks before.
153119
Databases are internally identified by their database id which unique.
Your standby database needs to have:
- the same name as the primary database (required)
- a new database id. The procedure how to obtain a new database id is outlined in the documenation.
You need to follow the scenario 'duplicating the database to a standby database on the same host' carefully.

--
Sybrand Bakker
Senior Oracle DBA
153119
Incorrrect.
The db_name parameter of primary and standby database need to be identical.
The error message means the database name in the control file is not identical to the db_name parameter in pfile or spfile.
This can happen to any database.

I happen to notice your answers are quite often incorrect, inadequate or vague.
Evidently English is a second language for you, but your answers are quite often misleading due to insufficient command of English. This one is a typical example.
'Unique on primary and standby databas': as each database has only one name, this is meaningless.
'the db_name parameter of standby databas is similar to the primary database initialization parameter value', 'Similar' is just plain wrong, and the phrase 'the primary database initialization value' is meaningless. Which primary database initialization value. I know the answer, but do others know the answer?
Could you please try to be more accurate?
I wouldn't have dwelt on this, if I wouldn't have made the same mistakes.

Regards,
--
Sybrand Bakker
Senior Oracle DBA
happy10319
thak you sybrandb,
is it possible to have any link or Document number to the scenario 'duplicating the database to a standby database on the same host'.
Personnaly I followed this :
http://arkzoyd.blogspot.com/2006/12/standby-physique-et-recovery-manager.html

But it is in french.

Best regards.
28686
Hi,

I made a post on my blog to answer your last remark ;). Not sure what you miss and if you comment the post you reference we can have a talk. Hope you've solved this issue now.

http://arkzoyd.blogspot.com/2007/09/une-ide-doit-tre-exprime-de-la-manire.html

Enjoy

Gregory
happy10319
thank you,I will come back to you soon. I'm again on the same problème; I resolved connection probleme to stand by. For the moment I have a PROD DB on Win 2003 ans creating a STANDBY on Win XP. Following your sénario but when launching standby I have ORA-02778: Name given for the log directory is invalid
Here is my standby init.ora:

standby.__db_cache_size=88080384
standby.__java_pool_size=4194304
standby.__large_pool_size=4194304
standby.__shared_pool_size=67108864
standby.__streams_pool_size=0
*.audit_file_dest='C:\oracle\product\10.2.0/admin/PROD/adump'
*.background_dump_dest='C:\oracle\product\10.2.0/admin/PROD/bdump'
*.compatible='10.2.0.1.0'
*.control_files='C:\oracle\product\10.2.0\oradata\PROD\control01.ctl','C:\oracle\product\10.2.0\oradata\PROD\control02.ctl','C:\oracle\product\10.2.0\oradata\PROD\control03.ctl'
*.core_dump_dest='C:\oracle\product\10.2.0/admin/PROD/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_file_name_convert='PROD','STANDBY'
*.db_name='PROD'
*.db_recovery_file_dest='C:\oracle\product\10.2.0\flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=STANDBYXDB)'
*.fal_client='STANDBY'
*.fal_server='PROD'
*.job_queue_processes=10
*.log_archive_config='DG_CONFIG=(STANDBY,PROD)'
*.log_archive_dest_1='LOCATION=C:\oracle\product\10.2.0\oradata\STANDBY\arch
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=STANDBY'
*.log_archive_dest_2='SERVICE=PROD LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=PROD'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=30
*.log_file_name_convert='C:\oracle\product\10.2.0\oradata\PROD','C:\oracle\product\10.2.0\oradata\STANDBY'
*.open_cursors=300
*.pga_aggregate_target=16777216
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=167772160
*.standby_file_management='AUTO'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.2.0/admin/PROD/udump'

regards.

Message was edited by:
user522961
28686
I guess you won't like my answer but you'd better double check.

1- On the standby server check if you have the following directories :
- C:\oracle\product\10.2.0\oradata\STANDBY
- C:\oracle\product\10.2.0\oradata\STANDBY\arch
- C:\oracle\product\10.2.0\flash_recovery_area
- C:\oracle\product\10.2.0\oradata\PROD
- C:\oracle\product\10.2.0\admin\PROD\adump
- C:\oracle\product\10.2.0\admin\PROD\bdump
- C:\oracle\product\10.2.0\admin\PROD\cdump
- C:\oracle\product\10.2.0\admin\PROD\udump

2- Change the xx_dest parameter to fit Windows \ requirements

3- If you want to use db_file_name_convert and log_file_name_convert which enable you to store the standby and prod on the same server... then prefer to change all the directories from PROD to STANDBY this will be much more readable (In this case the controlfiles are in PROD)

4- If you want to use DB_UNIQUE_NAME in the archive_log_dest_n parameter then make sure the standby has it too (You should have *.db_unique_name=STANDBY) in the spfile of the standby. If not remove those clauses from the log_archive_dest_2 parameter.

Hope you will make it run !

Gregory
happy10319
Thank you.

I used the working demo files in Morgan's Library at www.psoug.org under Data Guard. These are working files used for all PSOUG Data Guard classes. In them the DB_UNIQUE_NAME in standby init.ora file for log_archive_dest_1 is STANDBY and for log_archive_dest_2 is PROD.
1- On the standby server check if you have the following directories :
- C:\oracle\product\10.2.0\oradata\STANDBY >>EXISTS
- C:\oracle\product\10.2.0\oradata\STANDBY\arch >>EXISTS
- C:\oracle\product\10.2.0\flash_recovery_area >> EXISTS
- C:\oracle\product\10.2.0\oradata\PROD
- C:\oracle\product\10.2.0\admin\PROD\adump
- C:\oracle\product\10.2.0\admin\PROD\bdump
- C:\oracle\product\10.2.0\admin\PROD\cdump
- C:\oracle\product\10.2.0\admin\PROD\udump

Shoul they realy exist on STANDBY server too?

Many thanks again.
28686
Well... You have to possibilities :
a- Leave everything in place (Because you use 2 servers) and thus change none of the paths
b- Change the place of the files (This is the one you choose, right ?)

Now look at you init and the location of the control files ; They are in this directory you've pointed in the last post : So you need it ! unless you change the location of them. (Not clear which step you are now ?)

I also need the location of the db files and redo logs on production as they will be created from the db_file_name_convert and log_file_name_convert parameter I you hve not already started the duplicate comand.

Gregory
happy10319
I will take your senario in here
http://arkzoyd.blogspot.com/2006/12/standby-physique-et-recovery-manager.html
and execute it.

Thanks and regards.
28686
Actually if you run on separate servers, using the same paths is the easiest way. But changing is path is not much more complex . Debugging a configuration to make it work is a good way to understand what happens behind the scene !

Yes, proceed please ;)
Actitud
Hello.

I'm trying to clone a database in the same server with a different sid name over ASM and I'm wondering if this command will affect the old instance.

I just want to create a new and separated database, not a standby one. After creation, there shouldn't be any relation between both databases.

Its a sort of...

1 - ALTER DATBASE BACKUP CONTROLFILE TO TRACE AS...
2 - COPY DBF FILES
3 - CREATE CONTROLFILES WITH NEW DATABASE SID NAME

but with RMAN over ASM. I just want the same result :D

Isn't there any way to do this smoothly?

Thanks.
Alex.
701909
Isn't there any way to do this smoothly?
Yes there is.

Why do you reply to a 2 year old post responding to a fool who does not no oracle?
Actitud
uh???

I don't get it. Sorry.

The post was quite similar and the following solution might help but I'm not sure.

If you have a possible solution, please post it, otherwise just be happy :D.

Thanks.
Alex.
712670
If you know of a way to do this, could you post it, or point me to a place that show how?
1 - 24
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 22 2010
Added on Feb 22 2010
19 comments
369,560 views