[Problem]:
1. Oracle control files and online redo logs do not implement multi-path mirroring, resulting in reduced database reliability.
2. data files are not adjusted based on the I/O load, resulting in Io imbalance between disks and high I/O of individual disks.
AV
Tablespace reads/s writes/s
----------------------------------------------
Datalist 539,798 152 101,605 29
Temp 187,745 53 110,712 31
Indexflux 125,182 35 25,469 7
Dataflux 55,270 16 852 0
Datacfg 48,725 14 5,365 2
Undotbs1 1,463 0 39,789 11
Indexlist 11,268 3 15,265 4
Indexcfg 13,359 4 4,512 1
System 6,557 2 325 0
Dataexam 3,016 1 451 0
Sysaux 2,231 1 386 0
Indexpath 671 0 278 0
Indexexam 405 0 19 0
Datapath 326 0 84 0
-----------------------------------------
1. Planning Principles:
- Deploy control files to different disks.
A) alter system set control_files = "/oradata1/dbnms/control01.ctl,/oradata2/dbnms/control02.ctl ';
B) shut down the database.
C) physically move the control file to the specified directory
- Online redo logs must be divided into at least three groups, with at least two members in each group deployed on different disks.
(1) Add a log group:
Alter database add logfile group <n> 'Log file' size <n>;
(2) Delete A log group:
Alter database drop logfile group <n>;
(3) add log members:
Alter database add logfile member 'Log file' to group <n>;
(4) Delete A log member:
Alter database drop logfile member 'Log file ';
- Distribute the tablespace evenly to different disks according to the IO load.
- Redo logs and rollback tablespace files and temporary tablespaces must be placed on disks with high I/O speeds. Raid 10 has better Io than RAID 5.
[Onsite]
Sys as sysdba> archive log list
Database Log mode non-archive Mode
Disable automatic archiving
[Problem]
The risk of unrecoverable databases is extremely high. Because archiving is not enabled for multiple database faults, the recovery time is extended from half an hour to several hours or even days.
2. Enable archiving logs
- Enable the database archive Mode
1. Shut down the database
SQL> shutdown immediate;
2. Start the database in Mount mode.
SQL> startup Mount
3. Display and modify the archive Mode
SQL>ArchiveLog list
SQL> alter database archivelog;
SQL> alter database open
4. Set the format of archived logs
SQL> alter system set log_archive_format = 'arc % S % T % R. log' scope = spfile;
6. Forcibly switch the archive day
SQL> alter system switch logfile;
7. Cancel Archiving
SQL> alter database noarchivelog;
- Modify database parameters and set the archive log directory to a disk partition with a large space.
Set the path for storing archived logs
SQL> alter system set log_archive_dest = '+ Data/arcl' scope = spfile;
SQL> shutdown immediate
SQL> startup
- Set the script to automatically clear archived logs. The longer the archived logs are retained, the better.
- Start flash back database
Http://blog.sina.com.cn/s/blog_a3813a410101066l.html
SQL> select flashback_on from V $ database;
Flashback_on
------------------------------------
Yes
SQL> startup Mount
SQL> alter database flashback on;
The database has been changed.
SQL> alter database open;
The database has been changed.
- Set flash back database Parameters
If the flash recovery zone is set, log_archive_dest and log_archive_duplex_dest are unavailable.
- Log_archive_dest_n and log_archive_dest cannot coexist in Oracle.
Sys as sysdba> show parameters flash
Name type value
-----------------------------------------------------------------------------
Db_flashback_retention_target integer 1440
Sys as sysdba> show parameters recover
Name type value
-----------------------------------------------------------------------------
Db_recovery_file_dest string/Oracle/flash_recovery_area
Db_recovery_file_dest_size big integer 2G
- Monitor usage of flash back database space
SQL> select * from V $ flash_recovery_area_usage;
Increase the size of the flash recovery area.
SQL> alter system set db_recovery_file_dest_size = 20g scope = both SID = '*';
3. Database Mode
In the private mode and shared mode, select the private mode first.
4. Parameter Adjustment
Dbfiles-> 2000 total number of database data files
Processes-> 2000 number of service processes supported by the database
Sessions-> 3000 maximum number of sessions supported by the database
Shared_servers-> 0 private | shared mode switch, 0-> private
Db_recovery_file_dest/Oracle/flash_recovery_area
Sga_max_size-> physical memory 50%
Sga_target-> 50% of physical memory
Pga_aggregate_target-> 2 M * Estimated number of sessions
Cursor_sharing-> exact
Db_writer_processes-> Number of CPU cores/2
job_queue_processes-> 5. If the value is 0, Oracle jobs are not executed.