Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tools:oracle [2024/02/26 05:57]
darron [Oracle DB archive log]
tools:oracle [2024/02/28 04:29] (current)
darron [Miscellaneous]
Line 426: Line 426:
 </code> </code>
  
-With dbca create a database named FREE with Eg. 16 PDBs with the PREFIX DB+With dbca create a database named FREE. 
 + 
 +In this example a database with 16 PDBs with the PREFIX DB is created
 using the "Advanced configuration". using the "Advanced configuration".
  
Line 438: Line 440:
  
 To enable backups with RMAN turn on archivelog mode. To enable backups with RMAN turn on archivelog mode.
 +
 +
 +==Enable==
  
 <code> <code>
-[oracle@vm3 ~]$ sqlplus sys as sysdba+SQL> shutdown immediate; 
 +Database closed. 
 +Database dismounted. 
 +ORACLE instance shut down. 
 +SQL> startup mount; 
 +ORACLE instance started.
  
-SQL*Plus: Release 23.0.0.0.0 - Production on Fri Feb 23 14:57:06 2024 +Total System Global Area 1603679416 bytes 
-Version 23.3.0.23.09+Fixed Size                  5313720 bytes 
 +Variable Size             973078528 bytes 
 +Database Buffers          620756992 bytes 
 +Redo Buffers                4530176 bytes 
 +Database mounted
 +SQL> alter database archivelog;
  
-Copyright (c) 1982, 2023, Oracle.  All rights reserved.+Database altered.
  
-Enter password:+SQL> alter database open;
  
-Connected to: +Database altered
-Oracle Database 23c Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free +</code>
-Version 23.3.0.23.09+
  
 +==Status==
 +<code>
 +SQL> select name,log_mode from v$database;
 +
 +NAME      LOG_MODE
 +--------- ------------
 +FREE      ARCHIVELOG
 +
 +SQL> archive log list
 +Database log mode              Archive Mode
 +Automatic archival             Enabled
 +Archive destination            /opt/oracle/product/23c/dbhomeFree/dbs/arch
 +Oldest online log sequence     69
 +Next log sequence to archive   68
 +Current log sequence           67
 +</code>
 +
 +==List==
 +
 +<code>
 +RMAN> list archivelog all;
 +list archivelog all;
 +List of Archived Log Copies for database with db_unique_name FREE
 +=====================================================================
 +
 +Key     Thrd Seq     S Low Time
 +------- ---- ------- - ---------
 +1          61      A 23-FEB-24
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_61_1160003622.dbf
 +
 +2          62      A 23-FEB-24
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_62_1160003622.dbf
 +
 +3          63      A 23-FEB-24
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_63_1160003622.dbf
 +
 +4          64      A 25-FEB-24
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_64_1160003622.dbf
 +
 +5          65      A 25-FEB-24
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_65_1160003622.dbf
 +
 +6          66      A 25-FEB-24
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_66_1160003622.dbf
 +
 +7          67      A 25-FEB-24
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_67_1160003622.dbf
 +
 +8          68      A 25-FEB-24
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_68_1160003622.dbf
 +
 +
 +
 +RMAN>
 +</code>
 +
 +==Disable==
 +
 +<code>
 SQL> shutdown immediate; SQL> shutdown immediate;
 Database closed. Database closed.
 Database dismounted. Database dismounted.
 ORACLE instance shut down. ORACLE instance shut down.
-SQL> startup mount;+SQL> startup mount
 ORACLE instance started. ORACLE instance started.
  
Line 466: Line 539:
 Redo Buffers                4530176 bytes Redo Buffers                4530176 bytes
 Database mounted. Database mounted.
-SQL> alter database archivelog;+SQL> alter database noarchivelog;
  
 Database altered. Database altered.
Line 474: Line 547:
 Database altered. Database altered.
  
-SQL>+SQL> archive log list; 
 +Database log mode              No Archive Mode 
 +Automatic archival             Disabled 
 +Archive destination            /opt/oracle/product/23c/dbhomeFree/dbs/arch 
 +Oldest online log sequence     69 
 +Current log sequence           68
 </code> </code>
-===Hints and Tips=== 
  
-==PDB==+==Delete==
  
-__Access__+<code> 
 +RMAN> delete archivelog all; 
 +delete archivelog all; 
 +released channel: ORA_DISK_1 
 +allocated channel: ORA_DISK_1 
 +channel ORA_DISK_1: SID=50 device type=DISK 
 +List of Archived Log Copies for database with db_unique_name FREE 
 +===================================================================== 
 + 
 +Key     Thrd Seq     S Low Time 
 +------- ---- ------- - --------- 
 +1          61      A 23-FEB-24 
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_61_1160003622.dbf 
 + 
 +2          62      A 23-FEB-24 
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_62_1160003622.dbf 
 + 
 +3          63      A 23-FEB-24 
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_63_1160003622.dbf 
 + 
 +4          64      A 25-FEB-24 
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_64_1160003622.dbf 
 + 
 +5          65      A 25-FEB-24 
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_65_1160003622.dbf 
 + 
 +6          66      A 25-FEB-24 
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_66_1160003622.dbf 
 + 
 +7          67      A 25-FEB-24 
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_67_1160003622.dbf 
 + 
 +8          68      A 25-FEB-24 
 +        Name: /opt/oracle/product/23c/dbhomeFree/dbs/arch1_68_1160003622.dbf 
 + 
 + 
 +Do you really want to delete the above objects (enter YES or NO)? yes 
 +deleted archived log 
 +archived log file name=/opt/oracle/product/23c/dbhomeFree/dbs/arch1_61_1160003622.dbf RECID=1 STAMP=1161701923 
 +deleted archived log 
 +archived log file name=/opt/oracle/product/23c/dbhomeFree/dbs/arch1_62_1160003622.dbf RECID=2 STAMP=1161727348 
 +deleted archived log 
 +archived log file name=/opt/oracle/product/23c/dbhomeFree/dbs/arch1_63_1160003622.dbf RECID=3 STAMP=1161841884 
 +deleted archived log 
 +archived log file name=/opt/oracle/product/23c/dbhomeFree/dbs/arch1_64_1160003622.dbf RECID=4 STAMP=1161846158 
 +deleted archived log 
 +archived log file name=/opt/oracle/product/23c/dbhomeFree/dbs/arch1_65_1160003622.dbf RECID=5 STAMP=1161871223 
 +deleted archived log 
 +archived log file name=/opt/oracle/product/23c/dbhomeFree/dbs/arch1_66_1160003622.dbf RECID=6 STAMP=1161885796 
 +deleted archived log 
 +archived log file name=/opt/oracle/product/23c/dbhomeFree/dbs/arch1_67_1160003622.dbf RECID=7 STAMP=1161900306 
 +deleted archived log 
 +archived log file name=/opt/oracle/product/23c/dbhomeFree/dbs/arch1_68_1160003622.dbf RECID=8 STAMP=1161929059 
 +Deleted 8 objects 
 + 
 + 
 + 
 +RMAN> 
 +</code> 
 +===Oracle PDB=== 
 + 
 +==Access==
  
 Access a specific PDB Access a specific PDB
Line 514: Line 652:
 </code> </code>
  
-__Autostart__+==Autostart==
  
 Change state of PDB to OPEN and keep that state on restart. Change state of PDB to OPEN and keep that state on restart.
Line 530: Line 668:
 </code> </code>
  
- +==Tablespace==
-__Create__+
  
 Create a tablespace inside the PDB Create a tablespace inside the PDB
Line 541: Line 678:
 </code> </code>
  
-__User__+==User== 
 + 
 +Create a user which can connect to the server and operate on the PDB tablespace.
  
 <code> <code>
Line 550: Line 689:
 </code> </code>
  
-__Drop__+==Drop== 
 + 
 +Drop a PDB if not required and reclaim disk space.
  
 <code> <code>
Line 558: Line 699:
 </code> </code>
  
-==Tablespaces==+===Miscellaneous===
  
-Not specifying a file path will create a tablespace file in this directory for 23c.+==Path== 
 + 
 +Not specifying a file path will create a tablespace file and archive logs in this directory for 23c.
  
 <code> <code>
Line 566: Line 709:
 </code> </code>
  
-To remove the tablespace file various options are required when dropping a tablespace.+==Tablespace== 
 + 
 +__Drop__ 
 + 
 +To remove tablespace file various options are required when dropping it.
  
 <code> <code>