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!

Percentage completion calculations

TinaNov 23 2021

Hi Gurus,
I am trying to calculate percentage completion for a process.
I have expected_end_time and start_time for that process.Is there any formula we can use to get percentage remaining based on these dates?

SELECT TO_DATE('11/23/2021 10:31:12 PM','MM/DD/YYYY HH:MI:SS AM') AS EXPECTED_END_TIME,
TO_DATE('11/23/2021 10:00:00 PM','MM/DD/YYYY HH:MI:SS AM') AS START_TIME,
(TO_DATE('11/23/2021 10:31:12 PM','MM/DD/YYYY HH:MI:SS AM')- TO_DATE('11/23/2021 10:00:00 PM','MM/DD/YYYY HH:MI:SS AM'))*24*60 diff_in_min
FROM DUAL;

Thanks

Comments

Ivica Arsov

Hi,

I didn't understand your process, but anyway why don't you just open the standby database in read only mode (active data guard) ?

Anar Godjaev

hi,

You use active DataGuard? Secondary Database (Standby database) in read only mode?

Can you please paste here: (Standby Database)

SQL>select open_mode from v$database;

And

SQL> set linesize 1000

SQL> set pagesize 100

SQL>

SQL> select name, value from v$dataguard_Stats;

Thank you

saurabh

you database version information is important.

yes you can do this. some important points to remeber.

1. before shutdown of the dr defer the log_archive_dest for standby to stop archive shipping to the standby.

2. after shuttting down the DR copy the datafile and controlfile as well.

3. After your testing is completed.

4. REMANE  PROD_bak to PROD and then start the standby dataabse. The database which you have open if not required then delete all the file before renaming.


mrmessin

You can open a standby database read only, no issues there keep in mind that archive log apply will stop while the database is read only unless you use the active dataguard option, but depending on version of the database it may not be available.

See Oracle documentation I got all this from there:

http://docs.oracle.com/cd/B10501_01/server.920/a96653/manage_ps.htm


To open a standby database for read-only access when it is currently shut down:

  1. Start the Oracle instance for the standby database without mounting it:

          SQL> STARTUP NOMOUNT;

  1. Mount the standby database:

          SQL> ALTER DATABASE MOUNT STANDBY DATABASE;

  1. Open the database for read-only access:

          SQL> ALTER DATABASE OPEN READ ONLY;

To open a standby database for read-only access when it is currently performing managed recovery:

     Cancel log apply services:

          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

     Open the database for read-only access:

          SQL> ALTER DATABASE OPEN READ ONLY;

Now to put the database back to physical standby and apply the logs

To change the standby database from being open for read-only access to performing managed recovery:

     Terminate all active user sessions on the standby database, a shutdown works very well here

          SQL> shutdown immediate;

     Restart log apply services:

          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

Anar Godjaev

HI again,

Please check step by step in Secondary (Standby Database)

SQL> set linesize 1000

SQL> set pagesize 100

SQL>

SQL> select name, value from v$dataguard_Stats;  -- is ok then check below step:

For example: in Standby database:

NAME                      VALUE

------------------------- --------------------------------------------------

transport lag             +00 00:00:00

apply lag                 +00 00:00:00

apply finish time         +00 00:00:00.000

estimated startup time    21

------------------------------------------------------------------------------

Next Step in Secondary database:

          SQL> STARTUP NOMOUNT;

          SQL> ALTER DATABASE MOUNT STANDBY DATABASE;

          SQL> ALTER DATABASE OPEN READ ONLY;

And starying again MRP process in Secondary database:

STARTUP NOMOUNT

ALTER DATABASE MOUNT STANDBY DATABASE;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

Thank you

unknown-1052419

Thanks ALL,

DB 11.2.0.1

Supposing I will not hold-off or disrupt the standby db process since I am afraid that disaster strikes while it is paused off.

But instead I will create another reporting db  out of the standby because the standby server has not so much load on it.

Is this possible with RMAN? Creating a duplicate db out of the standby?

saratpvv

Why not - You can create duplicate db - Till now you haven't posted your db version..?

unknown-1052419

My db is 11.2.0.1

saurabh

As your database is of 11g version. You can take advantage of snapshot standby.

unknown-1052419

I searched google about snapshot db but it so complicated.

It says I need to configure DGBROKER which also complicated by its name.

Can I create snapshot db without using dgbroker?

Thanks,

saurabh
Answer
Marked as Answer by unknown-1052419 · Sep 27 2020
unknown-1052419

Thanks Saur

1 - 12

Post Details

Added on Nov 23 2021
1 comment
140 views