I've got a disaster recovery situation for you - pretty unlikely and pretty pointless but it again shows how useful cloud control can be....
So take the case that in some strange turn of disastrous events that we have everything we need to activate the database (datafile/redo etc etc) - the only thing missing is the lowly pfile/spfile that we need to start the instance up and get things going.
Somehow the pfile and spfile both got deleted, and somehow it's not been backed up at all with rman, bizarrely the alert log has also got removed (which could have told us what all of the settings were).
So we have nothing to start the instance.
It would be easy enough to just try and constuct one from scratch - all you really need is db_name and contro_files specified and you could just try and make up a lot of the the other settings until the system seemed OK again.
Is there another way though to get the exact file contents back as they were and save time rediscovering all the settings you had before by trial and error?
Well there is at least one - as long as you have cloud control set up.
The contents of the init file are uploaded to the repository and we can just query it we know where to look (which after some trial and error i do).
So if we know the db_name we are interested in we can just say
select init_param_name||'='||init_param_value
from MGMT$CS_DB_INIT_PARAMS p ,mgmt$target t
where t.target_name like '%YOUR_DB_NAME_HERE%'
and t.target_guid=p.target_guid
and p.INIT_PARAM_IS_DEFAULT='FALSE'
(the number just comes from the fact i exported it in plsql developer which adds a row number column.
INIT_PARAM_NAME||'='||INIT_PAR | |
---|---|
1 | audit_file_dest=/oracle/admin/DBNAME/adump |
2 | audit_trail=DB |
3 | backup_tape_io_slaves=TRUE |
4 | compatible=11.1.0.0.0 |
5 | control_file_record_keep_time=14 |
6 | control_files=/oracle/DBNAME/oradata/DBNAME/controlfile/o1_mf_87c072qk_.ctl, /oracle/DBNAME/recovery_area/DBNAME/controlfile/o1_mf_87c072t8_.ctl |
7 | db_32k_cache_size=100663296 |
8 | db_block_checksum=full |
9 | db_block_size=8192 |
10 | db_create_file_dest=/oracle/DBNAME/oradata |
11 | db_domain=WORLD |
12 | db_keep_cache_size=100663296 |
13 | db_name=DBNAME |
14 | db_recovery_file_dest=/oracle/DBNAME/recovery_area |
15 | db_recovery_file_dest_size=19327352832 |
16 | db_unique_name=DBNAME |
17 | diagnostic_dest=/oracle/admin/DBNAME |
18 | dispatchers=(PROTOCOL=TCP) (SERVICE=DBNAMEXDB) |
19 | instance_name=DBNAME |
20 | java_pool_size=268435456 |
21 | job_queue_processes=100 |
22 | log_archive_dest_1=LOCATION=USE_db_recovery_file_dest |
23 | log_archive_format=DBNAME_%t_%s_%r.arc |
24 | memory_target=0 |
25 | open_cursors=300 |
26 | pga_aggregate_target=314572800 |
27 | processes=300 |
28 | remote_login_passwordfile=EXCLUSIVE |
29 | service_names=DBNAME, DBNAME.WORLD |
30 | sessions=480 |
31 | sga_max_size=1577058304 |
32 | sga_target=1577058304 |
33 | shared_pool_size=268435456 |
34 | undo_tablespace=UNDOTBS1 |
35 | utl_file_dir=/oracle/utlfile/DBNAME |
So you can see you can easily rebuild the exact file from that - just needs some quotes adding in the right places.......
Pretty pointless i know - but could be useful after a very unlikely series of events.......
Comments
Post a Comment