মঙ্গলবার, ৭ নভেম্বর, ২০২৩

Drop database manually

startup mount;

OR

RMAN>sql 'alter system enable restricted session'; 
Drop database including backups noprompt;
Or sql command
startup mount restrict;
drop database;

Cold Backup in Oracle database

 

Create directory where to install.

mkdir -p /u01/app/oracle/oradata

Move pfile/spfile to $ORACLE/HOME/dbs

scp initorcl.ora spfileorcl.ora oracle@machine_name:$ORACLE/HOME/dbs

Rename controlfile location name in parameter file

Copy file controlfile, datafile, logfile

scp * oracle@machine_name:/u01/app/oracle/oradata

startup mount;


Rename datafile,logfile like below.

alter database rename file '/u01/app/oracle/system01.dbf' to '/u01/app/oracle/oradata/system01.dbf';

alter database rename file '/u01/app/oracle/sysaux01.dbf' to '/u01/app/oracle/oradata/sysaux01.dbf';

alter database rename file '/u01/app/oracle/log01.dbf' to '/u01/app/oracle/oradata/log01.dbf';

alter database open;

বুধবার, ৫ জুলাই, ২০২৩

Archivelog File

 archive log list

show parameter archive_dest

alter system set log_archive_dest_1= 'LOCATION=F:\labs\archivelog' scope=both



list archivelog all; 

list copy of archivelog until time 'SYSDATE-1'; 

list copy of archivelog from time 'SYSDATE-1'; 

list copy of archivelog from time 'SYSDATE-1' until time 'SYSDATE-2'; 

list copy of archivelog from sequence 1000; 

list copy of archivelog until sequence 1500; 

list copy of archivelog from sequence 1000 until sequence 1500;



delete archivelog all;

delete archivelog until time 'SYSDATE-1'; 

delete archivelog from time 'SYSDATE-1'; 

delete archivelog from time 'SYSDATE-1' until time 'SYSDATE-2'; 

delete archivelog from sequence 1000; 

delete archivelog until sequence 1500; 

delete archivelog from sequence 1000 until sequence 1500;


delete noprompt archivelog until time 'SYSDATE-1';


crosscheck archivelog all;
list expired archivelog all;
delete expired archivelog all;

restore database preview;
restore datafile 14 preview;
RESTORE ARCHIVELOG FROM TIME 'SYSDATE-7' PREVIEW;
RESTORE ARCHIVELOG FROM TIME 'SYSDATE-7' PREVIEW SUMMARY;

run{
recover table "LABS"."MM_ITEM_STOCK" until time "to_date('14-09-2023 08:16:00','dd-mm-yyyy hh24:mi:ss')"
auxiliary destination 'g:\oracle_backup';
}

RUN {
set until time "to_date('08-AUG-2023 09:00', 'DD-MON-YYYY HH24:MI')";
restore database;
recover database;
}