Oralce Archive Log Open and Close Sample
- 2021-12-05 07:46:18
- OfStack
Check whether the oracle database is in archive mode
SQL
>
select name,log_mode from V$database;
NAME LOG_MODE
------------------ ------------------------
TEST NOARCHIVELOG
SQL
>
archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 80157
Current log sequence 80163
Edit the archive mode of the configuration database in this section
1. Change non-archiving mode to archiving mode
1)SQL
>
conn/as sysdba (Connect to database as DBA)
2)SQL
>
shutdown immediate; (Shut down the database now)
3)SQL
>
startup mount (Start the instance and load the database, but do not open it)
4)SQL
>
alter database archivelog; (Change database to archive mode)
5)SQL
>
alter database open; (Open database)
6)SQL
>
alter system archive log start; (Enable automatic archiving)
7)SQL
>
exit (exit)
Make a full backup, because the backup log generated in non-archive log mode is no longer available for archive mode. This step is not very important!
2. Change archiving mode to non-archiving mode
1)SQL
>
SHUTDOWN NORMAL/IMMEDIATE;
2)SQL
>
STARTUP MOUNT;
3)SQL
>
ALTER DATABASE NOARCHIVELOG;
4)SQL
>
ALTER DATABASE OPEN;
3. File related commands
archive log stop;
archive log start;
archive log list;
show parameters;
show parameters log_archive_start;
show parameters log_archive_max_process; # Number of archiving processes
alter system set log_archive_max_process=5; # Change the number of archiving processes to 5
select * from v $bgprocess; # Prosecution daemon process