Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2011
    Posts
    2

    Smile Unanswered: Find db and last refesh time.

    hi,
    I am trying to find which db when it is refeshed.
    Depending on the db i want to run my job.

    select name,created from v$database;

    when i am doing this on command line i am getting answer.Same thing if try to run in procedure it is giving me table not found.So i gave schema name as sys.

    select name,created from sys.v$database;
    I still get the error.

    Thanks in advance.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    do as below so we can know complete Oracle version & OS name.

    Post via COPY & PASTE complete results of
    SELECT * from v$version;

    >I still get the error.
    ERROR? What Error? I do not see any error.

    It is really, Really, REALLY difficult to fix a problem that can not be seen.
    use COPY & PASTE so we can see what you do & how Oracle responds.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Mar 2011
    Posts
    2
    create or replace procedure test_refresh as

    v_db_name varchar2(50);
    v_db_refresh_time date;
    begin
    --select name,created into v_Db_name,v_db_refresh_time from v$database;
    select name,created into v_db_name.v_db_refresh_time from sys.v$database;

    --if v_db_name="DEV1" then
    dbms_output.put_line('db name:' ||v_db_name);
    -- else
    dbms_output.put_line('db refresh time:'|| v_db_refresh_time);
    -- end if;
    end test_refresh;


    Ths what i am doing i get instance name.And i get ora-00942 error.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    privileges acquired via ROLE do NOT apply within named PL/SQL procedures.

    GRANT SELECT on V_$DATABASE TO <procedure_owner>;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •