Need a Query to find whether the database needs any media recovery...

Hi,
I am at the mount stage of a database and yet be opened.at this stage any Query is available or any other way is there to find whether the database needs any media recovery or Instance recovery..?
my objective is before opening the database i need to make sure it is consistent or inconsistent and any form of recovery is needed..
thanks &regards,
Ragunath
Edited by: ragu.dba.in on Mar 6, 2013 12:57 AM

Hi Ragunath,
Use these queries , SCN should be consistent .. no fuzzy files, check for recovery of files in v$recover_file .. pass sufficient archives & fulfill the checks before open reset-logs
set line 900
set pages 900
set echo on
alter session set nls_date_format='dd-mon-yyyy hh24:mi:ss';
set numwidth 13
col CHECKPOINT_CHANGE# for 9999999999999999
col CHANGE# for 9999999999999999
column error format a10
column member format a60
show parameter db_recover
select * from v$recover_file;
select file#, status from v$datafile;
select file#, checkpoint_change#, checkpoint_time, error from v$datafile_header;
select distinct status from v$backup;
select distinct  checkpoint_change#  from v$datafile_header;
select hxfil file_id, fhscn scn, fhthr thread, fhrba_seq sequence, fhsta status from x$kcvfh;
select distinct fhscn from x$kcvfh;
select hxfil file_id, fhtnm tablespace_name from x$kcvfh;
##### Fuzzy Check ####
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
set feedback on
set heading on
set pagesize 1000
set linesize 175
column checkpoint_change# format 999999999999999999999
select status, checkpoint_change#, fuzzy,
to_char(checkpoint_time, 'DD-MON-YYYY HH24:MI:SS') as checkpoint_time,
count(*)
from v$datafile_header
group by status, checkpoint_change#, fuzzy, checkpoint_time
order by status, checkpoint_change#, fuzzy, checkpoint_time;Thanks,
Ajay More
http://www.moreajays.com

Similar Messages

  • Query to find out the Activities done against a table

    Hi,
    One table has been truncated and data reloaded into the table by the user. But at latter stage user deny that activity. I believe all these activities stored in any oracle 10g database table.
    Need a query to find out the activities done on a specific date say 6th Sep.
    This is too urgent. Thanks in advance

    Hi,
    Welcome to the forum!
    If you don't have enable table auditing maybe you can see last_ddl_time column of user_objects view:
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> select * from test2;
          COL1       COL2       COL3
             1          1          3
             1          2          3
             1          3          3
    SQL> select to_char(uo.created, 'DD/MM/YYYY HH24:MI:SS'), to_char(uo.last_ddl_time, 'DD/MM/YYYY HH24:MI:SS') from user_objects uo where uo.object_name = 'TEST2';
    TO_CHAR(UO.CREATED,'DD/MM/YYYY TO_CHAR(UO.LAST_DDL_TIME,'DD/M
    12/09/2009 12:20:26            12/09/2009 12:20:27
    SQL> truncate table test2;
    Table truncated
    SQL> select to_char(uo.created, 'DD/MM/YYYY HH24:MI:SS'), to_char(uo.last_ddl_time, 'DD/MM/YYYY HH24:MI:SS') from user_objects uo where uo.object_name = 'TEST2';
    TO_CHAR(UO.CREATED,'DD/MM/YYYY TO_CHAR(UO.LAST_DDL_TIME,'DD/M
    12/09/2009 12:20:26            12/09/2009 14:01:21
    SQL> Regards,

  • How to find whether remote database is up or not (connected via dblink)

    Hi,
    I am using dblink to connect Biz database from Dev database.(Biz, Dev - database names)
    Running dbms job using the dblink from the Dev database to update data on Biz database...
    Problem is dbms job should run if and only if the Biz database is up for which i created the dblink...
    1) How to make sure or implement the check to find whether the Biz is database is up or not in Pl/sql or sql...
    2) How to reschedule the dbms jobs once the database is up
    pls suggest me how to find whether the database is up or not b4 running the dbms job?
    Using- Oracle 10g

    The only way to know whether the remote database is up (and whether the network between the two databases is up and whether the remote database's listener is up and whether the password configured in the database link is correct and whether the local TNS alias is correct, etc) would be to actually run a query against the remote database over the database link. In other words, the way to figure out whether the link is up is to let the job run and catch & handle exceptions when there are problems.
    By default, a job scheduled via DBMS_JOB will automatically reschedule itself if there is an unhandled exception by geometrically backing off (it waits 1 minute after the first failure, 2 minutes after the second, 4, 8, 16, 32 minutes, etc until it's marked as broken after 16 failures). You could, of course, catch appropriate exceptions and handle them in a reasonable fashion and manually reschedule jobs at intervals that make more sense for your particular job.
    Justin

  • Query to find out the list of user who have delete access

    Hi,
    I need a query to find out the list of users who have delete access on perticular folder/universe/ reports  in infoview.
    Please advice.
    Regards,
    Neo.

    orton607 wrote:
    thanks for replying guys. But the thing is i am using dynamic sql execute immediate in my package, so i want those tables also and the schema name.
    thanks,
    ortonThis is not possible. The best you could do is to have a good guess.
    Or how would you parse some dynamic statement as this:
       v_suffix := 'loyees';
       v_sql := 'Select count(*) from (select ''nonsense'' col1 from emp'||v_suffix||') where col1 = ''Y'''';
       execute_immediate(v_sql);
    ...What is the table name? How do you want to parse that?
    Better rewrite all dynamic SQL statements into non dynamic ones. Or do the source control logic for those dynamic parts in an extra module. For example implement your own dependency table and force every developer to add there all dynamic parts.

  • Need query to find out the sum till a period

    Hi,
    I need to write one query to find out the cumulative sum of raw_cost of table pa_budget_lines till the specified period, I tried to do this by analytical function, but that is not working in Report 10g. Can anybody help me in this.
    Thanks

    not familiar with report but could you do something like this
    with t as
      select 1 grp, 10 * level the_cost, add_months (sysdate,  level) effective_dt from dual connect by  level < 11 union all
      select 2 grp, 5 * level the_cost, add_months (sysdate,  level) effective_dt from dual connect by  level < 11
    input as
      ( select null grp, null the_cost, null running_total,  v_eff_dt effective_dt   from dual)
    select * from(
    select t.grp, t.the_cost, sum(t.the_cost) over (partition by t.grp order by t.effective_dt) running_total, t.effective_dt,
           lead(t.effective_dt) over (partition by t.grp order by t.effective_dt) next_effective_dt,
           input.effective_dt  inp_eff_dt
    from t, input
    where inp_eff_dt between effective_dt and next_effective_dtv_eff_dt would be the input date you are interested in

  • Query to find all the view name and their size in GB

    Hi,
    What is the query to find all the view name and their size in GB.I am aware of joining all_views and user_segments but this is not serving the purpose.is there any table i need to join to get the desired result
    Thanks

    You could of course be thinking of views as they are stored in other RDBMS' as some of them actually create the view as a table on the database with a copy of the data in it and maintain that data as the base tables are updated.
    As already mentioned, Oracle just stores the SQL of the View and executes that SQL when the view is queried.
    Alternatively, Oracle also has "materialized views" which are created as snapshots of the data and will have a size. This data is updated (refreshed) based on the parameters used when creating the materialized view which means that it will either be, commonly, when a commit is issued or when a refresh is explicitly requested (refresh on demand).

  • Query to find out the sales order

    Hi All,
    I need a query to find sales order number against which a serial number is transacted.
    Can ny one help onthis.
    Thanks ,

    hi,
    thanks you for your reply.
    its working but i am not able to see the required item serail number.
    Bit confused its their in mtl_serial_number but its not their in sales order.
    How is it possible.
    In mtl_serial_number its current_status is '4'
    Can you please hlep me.
    Thanks

  • Log SQL before query is sent to the database

    I have a query that hangs once it has been sent to the database. I'm looking for a way to log the SQL before it is sent to the DB. The SQL logging channel only logs the sql once the query has returned from the database. While the QUERY logging channel will log the QL before the query is executed, I still need the generated SQL to determine what is wrong.
    Is there a way to force SQL logging before the query is sent to the database. Alternatively is there a way to generate the sql from the current PersistenceManager or Query objects? I have tried using KodoQuery.getQueryString() but this returns the same output as the QUERY logging channel, i.e. the JDO QL.
    Kodo version 3.2.3 with SQL Server 2000
    Regards
    Nathan

    hi ,
    I am not sure of the answer , but i can explain what we will do to check the SQL that is being fired by the KODO to the database.
    We use log4j for logging purpose in our application. To generate SQL log file , we will keep an appender for the
    "com.solarmetric.kodo.impl.jdbc.SQL" with threshold value "ALL" . We get the skeleton prepaid statement as well as the query with values also.
    regards ,
    jill

  • Find out the database port

    Hi,
    i test my database with a connect from the programm SQL*PLUS. Here I need no port. Now I want to test ist with the SQL Developer. Here I need the database port. I don't know the database port. Can you tell me how I can find out the database port?

    At a command prompt type tnsping database. That will display the tns connection details which includes the port number.
    Or you could look in tnsnames.ora which is probably in <ORACLE_HOME>\network\admin.
    Or you could use the tns connection type in sqldeveloper which picks up the details from tnsnames directly.
    Message was edited by:
    smitjb

  • Need a query to find Grops mapped on Folders

    Hi ,
    I need a query builder query to find out the list  of folder and mapped groups to those folder.
    Would you please let me know if that is possible I triead but no luck .
    Regards,
    Neo

    Hi,
    This query sound goods but I get error 
    Select SI_NAME, SI_KIND From CI_APPOBJECTS, CI_INFOOBJECTS
    Where PARENTS("SI_NAME='Myfolder'",'CHILDREN(''SI_NAME=''UserGroup''')")
    Please let me know if I am giong in right direction becuse I never used Parents and child concept bit confused.
    All I need is when I put in my folder name it has to show me all the groups mapped to it.
    If this query gives  the result , it will be the great logic I would say
    Thanks a ot.
    Neo A

  • Query to find out the time used by an user for an application

    Hello All,
    I want to know the query to find out the whole time used by the user for an application. Please view the below data
    Employee:
    SNO EMP_ID EMP_NAME EMP_DATE LOGIN_TIME LOGOUT_TIME
    1 10 Visu 21-Nov-2010 06:30:00 07:30:00
    2 10 Visu 21-Nov-2010 06:40:00 07:20:00
    3 10 Visu 21-Nov-2010 06:50:00 07:50:00
    4 10 Visu 21-Nov-2010 07:30:00 08:30:00
    5 10 Visu 21-Nov-2010 09:30:00 10:30:00
    By checking the above data we can say that the total time Visu used the application is
    8.30 - 6.30 (From 1,2,3,4 records) = 2hrs
    10.30 - 9.30 (Based on 5th rec) = 1hr
    So the total time Visu used the application would be 3 hrs = 180 mins.
    Could you please help me in getting the result from that data using a query?

    odie_63 wrote:
    I think it may be solved with analytics too.
    with t1 as (
                select 1 sno,10 emp_id,'Visu' emp_name,'21-Nov-2010' emp_date,'06:30:00' login_time,'07:30:00' logout_time from dual union all
                select 2,10,'Visu','21-Nov-2010','06:40:00','07:20:00' from dual union all
                select 3,10,'Visu','21-Nov-2010','06:50:00','07:50:00' from dual union all
                select 4,10,'Visu','21-Nov-2010','07:30:00','08:30:00' from dual union all
                select 5,10,'Visu','21-Nov-2010','09:30:00','10:30:00' from dual
         t2 as (
                select  emp_id,
                        emp_name,
                        emp_date,
                        to_date(emp_date || login_time,'DD-MON-YYYYHH24:MI:SS') login_time,
                        to_date(emp_date || logout_time,'DD-MON-YYYYHH24:MI:SS') logout_time
                  from  t1
         t3 as (
                select  t2.*,
                        case
                          when login_time < max(logout_time) over(
                                                                  partition by emp_id,emp_date
                                                                  order by login_time
                                                                  rows between unbounded preceding
                                                                           and 1 preceding
                            then 0
                          else 1
                        end start_of_group
                  from  t2
         t4 as (
                select  t3.*,
                        sum(start_of_group) over(partition by emp_id,emp_date order by login_time) grp
                  from  t3
         t5 as (
                select  emp_id,
                        emp_date,
                        min(login_time) login_time,
                        max(logout_time) logout_time
                  from  t4
                  group by emp_id,
                           emp_date,
                           grp
    select  emp_id,
            numtodsinterval(sum(logout_time - login_time),'day') time_spent
      from  t5
      group by emp_id
      order by emp_id
        EMP_ID TIME_SPENT
            10 +000000000 03:00:00.000000000
    SQL> SY.

  • Hi guys,Explain how to find whether the user request is dialog or bc ...

    how to find whether the user request is dialog or bc or some other wp and where we can see that ?

    Hello Damodar,
    You can find out that in SM50.
    However one piece of advice. I have noticed that you are raising lots of questions about very basic questions. Either you new to SAP or dont know anything about SAP Basis and want to get in this area. Or else you are preparing for some interview. In either of these cases expecting solutions given at SDN are not going to be of much help. Better read yorself in SAP Help as most people do. SDN should not be overly used for such purposes. Basic questions are welcome but you want to learn SAP through SDN !!!
    Regards.
    Ruchit.

  • How to know whether the database is using SPFILE or PFILE

    How can i know whether the database is using SPFILE or PFILE.
    There are both initSID.ora and spfileSID.ora in default location.
    The registry entry for ORA_SID_PFILE is C:\oracle\ora90\database\initSID.ora
    Also, if it is using SPFILE than how can i modify the non dynamic parameters when the database is in the close state.
    Manu

    If you do not specify a path of a pfile , when you actually startup a database , then it will be use your pfile , if you specify a path explicitly fot a pfile , then it'll use your pfile.
    Also, if it is using SPFILE than how can i modify the non dynamic parameters when the database is in the close state.sql > create spfile from pfile ;
    the spfile will syncronise with pfile .
    Hare krishna
    Alok

  • Is there any way to find whether the private key is capable of 40 bits encr

    Is there any way to find whether the private key is capable of 40 bits encrypted or 128 bits encrypted.

    kanth_kanth wrote:
    Is there any way to find whether the private key is capable of 40 bits encrypted or 128 bits encrypted.Assuming an RSA private key, to get the number of bits extract the length of the 'modulus' in bytes and multiply by 8. How you extract the modulus depends on what format the private key has been stored in.

  • POST-QUERY trigger cannot retrieve the database field in TEMPLATE.fmb

    I have tried to create a form using TEMPLATE.fmb in Oracle Apps R11i. I found that the POST-QUERY trigger cannot retrieve the database field (which is display item property) properly. Can anyone tell me how to retrieve the displayed database fields? Thanks for any helps.

    POST-QUERY would fire after the query has been executed, it does not do the actual data retrieve.
    See if the items you have put have the data source properties set and are not control items.
    btw, this forum is for OA users, you would get better response to your query if you post it in forms forum
    Thanks,
    Tapash

Maybe you are looking for