#2187
[Oracle] How-To
Disable Archive logs
SQL> shutdown immediate SQL> startup mount SQL> alter database noarchivelog; SQL> alter database open; SQL> archive log list;
# Check the size archive log list; # Update size ALTER SYSTEM SET db_recovery_file_dest_size = 50G SCOPE=BOTH SID=’*’;
(re)enable archivelog :
SQL> shutdown immediate SQL> startup mount SQL> alter database archivelog; SQL> alter database open; SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;
How to Resolve ORA-19809 Limit Exceeded for Recovery Files – Ed Chen Logic [How-to] Oracle Tablespaces
ORA-00265: instance recovery required, cannot set ARCHIVELOG mode
*Cause: The database either crashed or was shutdown with the ABORT
option. Media recovery cannot be enabled because the online
logs may not be sufficient to recover the current datafiles.
*Action: Open the database and then enter the SHUTDOWN command with the
NORMAL or IMMEDIATE option.
Update DBCA response file to add the following init param :
Check/Change the port for EM (Enterprise manager)
By default the port is 5500 and EM is available on https://yourserver:5500/em
See also : http://www.ludovicocaldara.net/dba/tag/start-dbconsole-12c/
Trace files
Start adrci
Check current retention period :
SHORTP_POLICY: Number of hours after which to purge ADR contents that have a short life. Default is 720 (30 days).
LONGP_POLICY: Number of hours after which to purge ADR contents that have a long life. Default is 8760 (365 days).
Update policies :
which means we set the long life keep time as 28 days and the short life keep time as 7 days.
This command can delete all trace files older than 10080 minutes (7 days) in current home immediately. You don’t have to wait background processes to do the job.
Delete old archive logs
Start RMAN :
Check files :
Delete expired files :
Delete all files :
without prompt :
Check oracle version :
Retreive DB/Instance info :
enable audit trail (for failed login attempt)
Oracle Compatible version
Show :
Update :
See : https://mikedietrichde.com/2019/04/17/when-and-how-should-you-change-compatible/
Oracle Optimizer
Check versions:
Check param :
Update System
Update Session
Hint
See http://www.dba-oracle.com/t_optimizer_features_enable.htm
Check CDB state:
Check PDB state:
SQLPlus & CDB/PDB :
With only SID:
With SID and PDB_SID:
display current CDB or PDB name
Auto start pdb :
https://logic.edchen.org/how-to-auto-open-pdb-when-startup-cdb/
Find restart history
Set oracle parameters (sessions, cursors, transactions, etc.)
https://www.funoracleapps.com/2022/10/how-to-increase-processessessions-and.html
Enable OEM (Oracle Enterprise Manager) for PDB
https://oradbdev.mathiasmagnusson.com/2023/03/14/enable-enterprise-manager-express/
Connect to PDB: