Jump to content

O-R-A-C-L-E D-B-A Zara E Query Enduku Tappu E Chepandi Vayya


Recommended Posts

Posted

select DB NAME,dbid,NVL(TO_CHAR(max(backuptype_db),'DD/MM/YYYY HH24:MI'),'01/01/0001:00:00') DBBKP,
NVL(TO_CHAR(max(backuptype_arch),'DD/MM/YYYY HH24:MI'),'01/01/0001:00:00') ARCBKP
from (
select a.name DB,dbid,
decode(b.bck_type,'D',max(b.completion_time),'I', max(b.completion_time)) BACKUPTYPE_db,
decode(b.bck_type,'L',max(b.completion_time)) BACKUPTYPE_arch
from rman.rc_database a,bs b
where a.db_key=b.db_key
and b.bck_type is not null
and b.bs_key not in(Select bs_key from rman.rc_backup_controlfile where AUTOBACKUP_DATE
is not null or AUTOBACKUP_SEQUENCE is not null)
and b.bs_key not in(select bs_key from rman.rc_backup_spfile)
group by a.name,dbid,b.bck_type
) group by db,dbid
ORDER BY least(to_date(DBBKP,'DD/MM/YYYY HH24:MI'),to_date(ARCBKP,'DD/MM/YYYY HH24:MI'))
/

error at line 7
ORA-00942: table or view does not exist

Posted

[quote name='Bondu_Babu' timestamp='1360690756' post='1303266437']
Doesn't exist ante aa table ledhu ani ardham
[/quote]


a table undi bhayya query lo edo tappu undi edo missing, table aithe pakka adi

Posted

[quote name='juvenile' timestamp='1360691045' post='1303266471']
bs ane table ee schema lo undi ..

try with rman.bs
[/quote]


actual query idi bhayya


select DB NAME,dbid,NVL(TO_CHAR(max(backuptype_db),'DD/MM/YYYY HH24:MI'),'01/01/0001:00:00') DBBKP,
NVL(TO_CHAR(max(backuptype_arch),'DD/MM/YYYY HH24:MI'),'01/01/0001:00:00') ARCBKP
from (
select a.name DB,dbid,
decode(b.bck_type,'D',max(b.completion_time),'I', max(b.completion_time)) BACKUPTYPE_db,
decode(b.bck_type,'L',max(b.completion_time)) BACKUPTYPE_arch
from rc_database a,bs b
where a.db_key=b.db_key
and b.bck_type is not null
and b.bs_key not in(Select bs_key from rc_backup_controlfile where AUTOBACKUP_DATE
is not null or AUTOBACKUP_SEQUENCE is not null)
and b.bs_key not in(select bs_key from rc_backup_spfile)
group by a.name,dbid,b.bck_type
) group by db,dbid
ORDER BY least(to_date(DBBKP,'DD/MM/YYYY HH24:MI'),to_date(ARCBKP,'DD/MM/YYYY HH24:MI'))
/

kani rman schema lo e tables ani unnai rc_database inka rc_backup_controlfile
aduke nenu rman.rc_database a,bs b kani error kuda akkade vastundi

Posted

select * from rman.rc_database;

select * from bs;

ee queries execute avuthuinaaya? Check the permissinons whethere you have a select privs or not on those tables

Posted

[quote name='BlueBerry' timestamp='1360691323' post='1303266504']
select * from rman.rc_database;

select * from bs;

ee queries execute avuthuinaaya? Check the permissinons whethere you have a select privs or not on those tables
[/quote]
same feeling !

Posted

[quote name='BlueBerry' timestamp='1360691323' post='1303266504']
select * from rman.rc_database;

select * from bs;

ee queries execute avuthuinaaya? Check the permissinons whethere you have a select privs or not on those tables
[/quote]


select * from rman.rc_database; offcourse avutundi ayindi kuda

select * from bs; avadhu

select * from rman.bs ; ayindi

Posted

[quote name='KOTC' timestamp='1360691644' post='1303266539']


select * from rman.rc_database; offcourse avutundi ayindi kuda

select * from bs; avadhu

select * from rman.bs ; ayindi
[/quote]

ok... ithe prob solved kadhaa..! use rman.bs? is this the same table?

Posted

[quote name='BlueBerry' timestamp='1360691815' post='1303266562']

ok... ithe prob solved kadhaa..! use rman.bs? is this the same table?
[/quote]


ade ekkada add cheyali bhayya rman.bs ?

Posted

[quote name='KOTC' timestamp='1360691943' post='1303266572']


ade ekkada add cheyali bhayya rman.bs ?
[/quote]


yes bhayya!

"bs" badhulu schema prefix add cheyyi .... "rman.bs" ani w/o qoutes actual query lo.... From clause

Posted

[quote name='BlueBerry' timestamp='1360692078' post='1303266581']


yes bhayya!

"bs" badhulu schema prefix add cheyyi .... "rman.bs" ani w/o qoutes actual query lo.... From clause
[/quote]


deni thalli ippudu ayindi bhayya indaka nuv a question adiginapude try chesa error vachindi ippudu ok

thanks bhayya.

Posted

Kool... Always preferable prefix the schema name before any table/view. Make it a habit.... if you are a programmer ... it will help you a lot and saves you debug time.

Posted

[quote name='KOTC' timestamp='1360691943' post='1303266572']
ade ekkada add cheyali bhayya rman.bs ?
[/quote] do it in more laziest way .. anni tables mundhu rman ani add cheyyakkarledu..do the below thing and run your query from that session

alter session set current_schema=rman;

Posted

[quote name='Silence..Please' timestamp='1360692492' post='1303266630']
do it in more laziest way .. anni tables mundhu rman ani add cheyyakkarledu..do the below thing and run your query from that session

alter session set current_schema=rman;
[/quote]

Good to learn new command... but i tested it its not working;

Connected as HR

executed the command alter session set current_schema=scott;

show user; -- showing user as HR

select * from emp; -- Scott schema table


end up with

ORA-00942: table or view does not exist;


I am using SQL developer... oracle version 11.1.0.6

×
×
  • Create New...