Skip to main content

Posts

Showing posts from March, 2025

query rman catalog for backup info of archivelog, controlfile and datafile

three rman catalog script to find out rman backup of archivelog, controlfile and datafile. TAG input is optional @rman_tag_archivelog.sql @rman_tag_controlfile.sql @rman_tag_datafile.sql sqlplus rmanuser/password@rmancatalog get rman_tag_archivelog.sql set linesize 240 col handle format a120 col piece# format 99999 col bp_key format 999999999999999 col recid format 99999 col stamp format 999999999999999 col thread# format 9999999 col sequence# format 99999999 select distinct al.db_name,al.THREAD#,al.SEQUENCE#,al.NEXT_CHANGE#,al.NEXT_TIME,  bp.BP_KEY,bp.RECID,BS_KEY,handle from RC_BACKUP_ARCHIVELOG_DETAILS al, rc_backup_piece bp where  upper(al.db_name) like upper('%&cdb_name%') and upper(bp.tag)  like upper('%&tag_of_rman_backup%') --al.db_name='DBA1C' and upper(bp.tag)='DBA1C_FULL_DISK_BAC1' and bp.BS_KEY=al.BTYPE_KEY and bp.BACKUP_TYPE='L' and al.id1=bp.STAMP  --and al.BTYPE_KEY=13173376  order by bp.BS_KEY,bp.BP_KEY,al.THREAD#,al.SEQUE...

pdb in restricted mode

  OCI PDB ORA-01035: ORACLE only available to users with RESTRICTED SESSION due to Sync Failure ERROR "Sync PDB failed with ORA-65177 during 'alter user' in pdb_plug_in_violations (Doc ID 2503982.1) select CTIME,SQLSTMT,NAME,FLAGS,OPCODE,REPLAY# from PDB_SYNC$ where lower(SQLSTMT) like ('%alter user %'); delete from PDB_SYNC$  where lower(SQLSTMT) like ('%alter user %');

create pluggable pdb xml from datafiles

## problem: unplugged pdb xml file mismatch datafile info. # cause: I tested flashback database after re-plug pdb # fix: DBMS_PDB.RECOVER( PDB_DESCR_FILE => 'DBA1_new.xml', PDB_NAME => 'DBA1', FILENAMES => '+DATA/DBA1C/FAF5D035069EFA1BE053327578CE0266/DATAFILE/system.1656.1191011593, ... ## below are journals: rpres: rp_6 alter pluggable database dba1 open instances=all * ERROR at line 1: ORA-65107: Error encountered when processing the current task on instance:1 ORA-01147: SYSTEM tablespace file 30 is offline 09:36:02 2025-03-18 server2 SYS@DBA1C::CDB$ROOT $ SELECT file#, name, status FROM v$datafile WHERE file# = 30; FILE# NAME STATUS ---------- -------------------------------------------------------------------------------- ---------- 30 /u01/app/odaorahome/oracle/product/19.0.0.0/dbhome_14/dbs/UNNAMED00030 SYSOFF 09:36:07 2025-...

oracle import sql profile

  How to create SQL profile Pickup the best hash from the history SYS@TST3 $ @awr_plan_change_v2 0a99buvm9gszh SNAP_ID NODE BEGIN_INTERVAL_TIME SQL_ID PLAN_HASH_VALUE EXECS AVG_ETIME AVG_LIO ---------- ------ --------------------------------- ------------- --------------- ------------ ------------ -------------- 1 1 16-NOV-24 11.43.11.000 AM 0a99buvm9gszh 4020639609 4 11,964.283 137,065,366.8 1 2 16-NOV-24 11.44.41.000 AM 0a99buvm9gszh 2 11,985.675 145,016,795.0 60593 1 28-FEB-25 11.00.29.449 AM 0a99buvm9gszh 389675671 2 38.798 18,428,828.0 60593 2 28-FEB-25 11.00.29.454 AM 0a99buvm9gszh 2 34.657 18,428,869.5 60594 2 28-FEB-25 12.00.32.413 PM 0a99buvm9gszh 2 33.034 18,426,252.0 60698 1 04-MA...