Sunday, January 4, 2009

enabling & disabling archiving

1.configuring the archivelog mode
1. shut down database cleanly
2. open the parameter file [add the parameters]
Log_archive_start=true
Log_archive_dest=/ora1/oracle9/arch
1. ] $ sqlplus ‘/as sysdba’
2. create spfile from pfile
3. startup mount
4. alter database archivelog
5. alter database open

NOTE: To check archivelog configured or not :

SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Enabled
Archive destination /ora1/ora9i/ORADATA/ARCH/
Oldest online log sequence 62
Current log sequence 63
Enter the following command at the operation system prompt:
$ ps -ef|grep arc
oracle 29296 1 0 03:19:51 ? 0:00 ora_arc0_db01
oracle 29298 1 0 03:19:51 ? 0:00 ora_arc1_db01

2. Execute the ALTER SYSTEM SWITCH LOGFILE command twice, then show the
values of the ARCHIVE parameters. Do you see any archived log files? What is the
format of the filename?
SQL> alter system switch logfile;
System altered.

SQL> alter system switch logfile;
System altered.
SQL> column name format A25
SQL> column value format A35

SQL> select name, value
2 from v$parameter
3 where name like 'log_archive_dest%';
NAME VALUE
------------------------ -------------------------------
log_archive_start TRUE
log_archive_dest
log_archive_duplex_dest
log_archive_dest_1 LOCATION=/ora1/ora9i/ORADATA/ARCH/
MANDATORY
log_archive_dest_2 LOCATION=/ora1/ora9i/ORADATA/ARCH/
OPTIONAL

log_archive_dest_10
log_archive_dest_state_1 enable
log_archive_dest_state_2 enable

3. Stop automatic archiving by executing the ALTER SYSTEM ARCHIVE LOG STOP
command.
SQL> alter system archive log stop;
System altered.

4. Enable automatic archiving by using the ALTER SYSTEM ARCHIVE LOG START
command.
SQL> alter system archive log start;
System altered.

11. Execute the ALTER SYSTEM SWITCH LOGFILE command enough times to cycle
through all the online redo log groups. What happened and why?
SQL> alter system switch logfile;
System altered.
SQL> alter system switch logfile;
The database is in ARCHIVELOG mode. Automatic archiving is disabled the next redo
log file cannot be used because it has not been archived.

12. Stop automatic archiving by executing the ALTER SYSTEM ARCHIVE LOG STOP
SQL> alter system archive log stop;
System altered.

No comments:

Post a Comment