Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tools:oracle [2024/02/26 05:57] – [Oracle DB archive log] darron | tools:oracle [2024/07/28 19:32] (current) – [PHP] darron | ||
---|---|---|---|
Line 426: | Line 426: | ||
</ | </ | ||
- | 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 " | using the " | ||
Line 438: | Line 440: | ||
To enable backups with RMAN turn on archivelog mode. | To enable backups with RMAN turn on archivelog mode. | ||
+ | |||
+ | |||
+ | ==Enable== | ||
< | < | ||
- | [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 | ||
+ | Database Buffers | ||
+ | Redo Buffers | ||
+ | Database mounted. | ||
+ | SQL> alter database archivelog; | ||
- | Copyright (c) 1982, 2023, Oracle. | + | Database altered. |
- | Enter password: | + | SQL> alter database open; |
- | Connected to: | + | Database |
- | Oracle | + | </ |
- | Version 23.3.0.23.09 | + | |
+ | ==Status== | ||
+ | < | ||
+ | SQL> select name, | ||
+ | |||
+ | NAME LOG_MODE | ||
+ | --------- ------------ | ||
+ | FREE ARCHIVELOG | ||
+ | |||
+ | SQL> archive log list | ||
+ | Database log mode Archive Mode | ||
+ | Automatic archival | ||
+ | Archive destination | ||
+ | Oldest online log sequence | ||
+ | Next log sequence to archive | ||
+ | Current log sequence | ||
+ | </ | ||
+ | |||
+ | ==List== | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | Name: / | ||
+ | |||
+ | 2 | ||
+ | Name: / | ||
+ | |||
+ | 3 | ||
+ | Name: / | ||
+ | |||
+ | 4 | ||
+ | Name: / | ||
+ | |||
+ | 5 | ||
+ | Name: / | ||
+ | |||
+ | 6 | ||
+ | Name: / | ||
+ | |||
+ | 7 | ||
+ | Name: / | ||
+ | |||
+ | 8 | ||
+ | Name: / | ||
+ | |||
+ | |||
+ | |||
+ | RMAN> | ||
+ | </ | ||
+ | |||
+ | ==Disable== | ||
+ | |||
+ | < | ||
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 | Redo Buffers | ||
Database mounted. | Database mounted. | ||
- | SQL> alter database | + | SQL> alter database |
Database altered. | Database altered. | ||
Line 474: | Line 547: | ||
Database altered. | Database altered. | ||
- | SQL> | + | SQL> |
+ | Database log mode No Archive Mode | ||
+ | Automatic archival | ||
+ | Archive destination | ||
+ | Oldest online log sequence | ||
+ | Current log sequence | ||
</ | </ | ||
- | ===Hints and Tips=== | ||
- | ==PDB== | + | ==Delete== |
+ | |||
+ | < | ||
+ | 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 | ||
+ | Name: / | ||
+ | |||
+ | 2 | ||
+ | Name: / | ||
+ | |||
+ | 3 | ||
+ | Name: / | ||
+ | |||
+ | 4 | ||
+ | Name: / | ||
+ | |||
+ | 5 | ||
+ | Name: / | ||
+ | |||
+ | 6 | ||
+ | Name: / | ||
+ | |||
+ | 7 | ||
+ | Name: / | ||
+ | |||
+ | 8 | ||
+ | Name: / | ||
+ | |||
+ | |||
+ | Do you really want to delete the above objects (enter YES or NO)? yes | ||
+ | deleted archived log | ||
+ | archived log file name=/ | ||
+ | deleted archived log | ||
+ | archived log file name=/ | ||
+ | deleted archived log | ||
+ | archived log file name=/ | ||
+ | deleted archived log | ||
+ | archived log file name=/ | ||
+ | deleted archived log | ||
+ | archived log file name=/ | ||
+ | deleted archived log | ||
+ | archived log file name=/ | ||
+ | deleted archived log | ||
+ | archived log file name=/ | ||
+ | deleted archived log | ||
+ | archived log file name=/ | ||
+ | Deleted 8 objects | ||
+ | |||
+ | |||
+ | |||
+ | RMAN> | ||
+ | </ | ||
+ | ===Oracle | ||
- | __Access__ | + | ==Access== |
Access a specific PDB | Access a specific PDB | ||
Line 514: | Line 652: | ||
</ | </ | ||
- | __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: | ||
</ | </ | ||
- | + | ==Tablespace== | |
- | __Create__ | + | |
Create a tablespace inside the PDB | Create a tablespace inside the PDB | ||
Line 541: | Line 678: | ||
</ | </ | ||
- | __User__ | + | ==User== |
+ | |||
+ | Create a user which can connect to the server and operate on the PDB tablespace. | ||
< | < | ||
Line 550: | Line 689: | ||
</ | </ | ||
- | __Drop__ | + | ==Drop== |
+ | |||
+ | Drop a PDB if not required and reclaim disk space. | ||
< | < | ||
Line 558: | Line 699: | ||
</ | </ | ||
- | ==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. | ||
< | < | ||
Line 566: | Line 709: | ||
</ | </ | ||
- | To remove | + | ==Tablespace== |
+ | |||
+ | __Drop__ | ||
+ | |||
+ | To remove | ||
< | < | ||
Line 607: | Line 754: | ||
You should add " | You should add " | ||
</ | </ | ||
+ | ==Config== | ||
+ | Add extension=oci8.so to "/ | ||
+ | |||
+ | Add instant client to library path | ||
+ | |||
+ | < | ||
+ | echo "/ | ||
+ | ldconfig | ||
+ | </ | ||
==TEST== | ==TEST== | ||
Line 695: | Line 851: | ||
</ | </ | ||
- | ==Config== | ||
- | Add extension=oci8.so to "/ | ||
- | |||
- | Add instant client to library path | ||
- | |||
- | < | ||
- | echo "/ | ||
- | ldconfig | ||
- | </ | ||
===Resources=== | ===Resources=== | ||