0% found this document useful (0 votes)
8 views3 pages

Knowledge Base Restore From Ddboost Finprd

Uploaded by

kapil Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views3 pages

Knowledge Base Restore From Ddboost Finprd

Uploaded by

kapil Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

ofclone 10.90.33.

8 password is New@2016

select 'set newname for datafile '||'file#'||' to


'||'''||'/mnt/datafiles/finprd/'||'name'||';' from v$datafile;

SELECT 'set newname for datafile '||FILE_ID||' TO '''||


REPLACE(FILE_NAME, '+FIN_DATA/','/mnt/')||''';'
FROM DBA_DATA_FILES
order by 1;

rman restore from ddboost for finprd on 10.90.33.8 ofclone/New@2016

1.take backup of pfile from finprd prod.. drop database at ofuat...


2. alter database backup controlfile to trace as 'file location'; scp
###restore controlfile from latest rman backup by cross checking tag > or (RESTORE
controlfile from autobackup;)
3.run restore_finddboost.sh
4.rman target / catalog rman/rman@rmanprd cmdfile=restore_finprd_ddboost.cmd
trace=restore_finprd_ddboost.log
5.before execute the script crosscheck datafiles locations in set new name
clause...

Jagan >
col "Database Size" format a20
col "Free space" format a20
col "Used space" format a20
select round(sum(used.bytes) / 1024 / 1024 / 1024 ) || ' GB' "Database Size"
, round(sum(used.bytes) / 1024 / 1024 / 1024 ) -
round(free.p / 1024 / 1024 / 1024) || ' GB' "Used space"
, round(free.p / 1024 / 1024 / 1024) || ' GB' "Free space"
from (select bytes
from v$datafile
union all
select bytes
from v$tempfile
union all
select bytes
from v$log) used
, (select sum(bytes) as p
from dba_free_space) free
group by free.p
/

SELECT 'REPLACE(FILE_NAME, '+FIN_DATA/','/mnt/')||'';'


FROM DBA_DATA_FILES
order by 1;

ofclone 10.90.33.8 password is New@2016

rman restore from ddboost for finprd on 10.90.33.8 ofclone/New@2016

1.take backup of pfile from finprd prod.. drop database at ofuat...


2. alter database backup controlfile to trace as 'file location'; scp
###restore controlfile from latest rman backup by cross checking tag > or (RESTORE
controlfile from autobackup;)
3.run restore_finddboost.sh
4.rman target / catalog rman/rman@rmanprd cmdfile=restore_finprd_ddboost.cmd
trace=restore_finprd_ddboost.log
5.before execute the script crosscheck datafiles locations in set new name
clause...

>>
NAME
---------
FINPRD--- 1711Gb 1.6T
Reserved_Space(MB) Used_Space(MB) Free_Space(MB)
------------------ -------------- --------------
1752229.65 1592007.59 160222.063

1 - The size of the Oracle database files can be computed several ways:

-- get database size from v$datafile:

select round((sum(bytes)/1048576/1024),2) from v$datafile;

-- get Oracle database size from dba_data_files:


select
"Reserved_Space(MB)", "Reserved_Space(MB)" - "Free_Space(MB)"
"Used_Space(MB)","Free_Space(MB)"
from(
select
(select sum(bytes/(1014*1024)) from dba_data_files) "Reserved_Space(MB)",
(select sum(bytes/(1024*1024)) from dba_free_space) "Free_Space(MB)"
from dual
);

2 - The size of the sum of table extents

select
segment_name table_name,
sum(bytes)/(1024*1024) table_size_meg
from
user_extents
where
segment_type='TABLE'
and
segment_name = 'MYTAB'
group
See code depot for full scripts.

3 - The sum of the size of the data within the tables

You can also compute the size of an Oracle database over time. In Oracle 10g and
beyond we have the dba_hist_seg_stat table with a wealth of information about all
active segments within the database, including the space usage in the
space_allocated_total and space_used_total columns.

This script will show "spaced used total" (total size) for a specific Oracle table,
essentially computing the Oracle table size over time:
col c1 format a15 heading 'snapshot|date'
col c2 format a25 heading 'table|name'
col c3 format 999,999,999 heading 'space|used|total'
select
to_char(begin_interval_time,'yy/mm/dd hh24:mm') c1,
object_name c2,
space_used_total c3
from
dba_hist_seg_stat s,
dba_hist_seg_stat_obj o,
dba_hist_snapshot sn
where
o.owner = 'SCHEMA_07'
and
s.obj# = o.obj#
and
sn.snap_id = s.snap_id
and
object_name like 'XIF2%'
order by
begin_interval_time;

There are 5 steps to recover the database:

1) Restore backup files from tape


2) Mount the instance
3) Restore the datafiles
4) Recover the database
5) Reset the logs

select
OWNER,INDEX_NAME,INDEX_TYPE,UNIQUENESS,COMPRESSION,TABLESPACE_NAME,STATUS,DEGREE,PA
RTITIONED from dba_indexes
where table_name='CRM_INDIVIDUAL';
select
OWNER,INDEX_NAME,INDEX_TYPE,UNIQUENESS,COMPRESSION,TABLESPACE_NAME,STATUS,DEGREE,PA
RTITIONED from dba_indexes
where table_name='CRM_INDV_EMP_INTER';
select
OWNER,INDEX_NAME,INDEX_TYPE,UNIQUENESS,COMPRESSION,TABLESPACE_NAME,STATUS,DEGREE,PA
RTITIONED from dba_indexes
where table_name='CRM_ADDRESS';

CRM_INDIVIDUAL, CRM_INDV_EMP_INTER and CRM_ADDRESS

You might also like