5 System Maintenance 5.1 Solaris system involved in Sercount1 (218.29.0.239), Account2 (218.29.0.244), ORADB2 (218.29.0.245) 5.1.1 System Overview 1. Operating System Basic Information: Uname -a will display the operating system name, HostName, operating system, the operating system small version information, hardware type, CPU type, platform information. 2. Core information: Modify the / etc / system file Change the default kernel parameters, MODINFO display module information, sysdef display driver and kernel parameter information. 3. CPU information: / usr / sbin / psrinfo -v Displays CPU status, quantity, CPU type, and frequency. 4. Memory information: prtconf | grep "memory size" shows the memory size. 5. Hard disk / optical drive information: iostat -en displays hardware addresses, various status information, model, and hard disk size of the hard disk and the optical drive. You can check if you have an error. 6. NIC information: ifconfig -a, display network card name, status, maximum transmission unit MTU, IP address, subnet mask, broadcast address. 7. HA information: 8. Network information: NetStat -RN Displays static routing and default routes. 9. Pack PKG information: pkginfo -l pkgname. By determining if a PKG is installed, there is also PKGADD, PKGRM, PKGCHK. 10. Patch PATCH Information: Showrev -p. Install some software requires a specific Patch, which is judged. 11. File system information: DF -K monitoring CAPACITY determines whether there is short space. 12. User information: The WHO displays the current online user. WhODO displays the current user's operation. Use UserAdd, GroupAdd, or Admintool to manage users. ID displays the current user's login name, login ID, group name group name. 5.1.2 System Monitoring 1. CPU Performance Monitoring: VMSTAT / MPSTAT and SAR, VMSTAT and SAR Displays summary information in the SMP system, and MPSTAT can display the load of each CPU. VMSTAT monitors the number of R and B under the procs, which reflects the number of processes currently running and block state, if the R number is greater than the number of US SY> 80 under the CPU long-term, indicating that the CPU processing capacity is insufficient. 2. Memory monitoring: VMSTAT, the PI / PO under Free and Page under Memory, the PI / PO reflects the number of replacements / replacement in K as k. If the number of free is small, the number of PI / PO is greater than 0, indicating that memory is insufficient. 3. Hard disk monitoring: iostat -d and sar -d, you can see the working conditions of each partition of each hard disk and hard disk 4. Exchange area monitoring: swap -l and swap -s, should be placed in the switch area Loads a lighter hard drive. At the same time, the percentage of use of the exchange area should not be too high. 5. HA system monitoring: 6. Network monitoring: netstat -in displays the workload of each network card. IPKTS / OPKTS sends a package and acceptable package. Ierrs / Oerrs, Collis represents errors and conflicts.
Ierrs / IPKTS or OerRS / OPKTS> 2%, indicating that the network conflict is serious. 7. Port Monitoring: Monitor if a service is started or running normally, netstat -an | grep portnum or tcpdump | grep portnum. 8. Hardware troubleshooting: / usr / planform / `uname -m` / sbin / prtdiag -v Decide having no hardware failure by output results. 9. Syslogd log monitoring, the syslogd background process writes the information in the system runs into the / var / us, through it to monitor the appearance of unusually hardware and hardware error messages. The earlier information exists in the Messages.0 and Message.1 files under the same directory. 10. Mail monitoring: Some users perform tasks via the crontab timing, after the task is completed, the cron process will send Mail to the user, and the MAIL judgment task is completed. In the case of an abnormality of the system, Syslogd will send the root user Mail. Therefore, the root user's MAI needs special attention. 11. Process monitoring: Monitor special consumption resources through the PS, PRSTAT command, or / USR / DT / BIN / SDTPROCESS tool. SDTProcess is a graphics tool that can be sorted in accordance with the use of CPU and MEM. The PRSTAT statistical system activity process is sorted in desired order. 12. System Run Time Monitoring: Uptime Measures a command for a machine to open and system load. The larger the time displayed by the uPtime, the more stabilizing the machine. 13. System Run Level Monitoring: WHO -R Displays the current machine of the current machine.
5.2 Terminals involved in Linux systems: FEP1 (218.29.0.228), FEP2 (218.29.0.229), FEP4 (218.29.0.230), FEP5 (218.29.0.231), FEP6 (218.29.0.232 ), FEP7 (218.29.0.234), FEP8 (218.29.0.235), FEP10 (218.29.0.236), FEP11 (218.29.0.237), FEP12 (218.29.0.238) 5.2.1 System Overview 1. Operating system basic information: uname -a2. Kernel information: / proc / sys / kernel directory records each core parameter, MODINFO display module information, sysdef display driver and kernel parameter information. 3. CPU information:. 4. Memory information: prtconf | grep "memory size" shows the memory size. 5. Hard disk / optical drive information:. 6. NIC information: ifconfig -a, display network card name, status, maximum transmission unit MTU, IP address, subnet mask, broadcast address. 7. Network information: NetStat -RN Displays static routing and default routes. 8. Package PKG information: RPM (Redhat package manager). By determining if a PKG is installed, RPM -Q query, rpm -i installation 9. Patch PATCH information: File system information: DF -K monitoring CAPACITY determines whether there is short space. 10. User information: The WHO shows the current online user. Add users to the USER Manager tool through KDE. ID displays the current user's login name, login ID, group name group name. 5.2.1 System Monitoring 1. CPU Performance Monitoring: VMSTAT and SAR. VMSTAT monitors the number of R and B under the procs, which reflects the number of processes currently running and block state, if the R number is greater than the number of US SY> 80 under the CPU long-term, indicating that the CPU processing capacity is insufficient. 2. Memory monitoring: VMSTAT, the PI / PO under Free and Page under Memory, the PI / PO reflects the number of replacements / replacement in K as k. If the number of free is small, the number of PI / PO is greater than 0, indicating that memory is insufficient. 3. Hard disk monitoring: iostat -d and sar -d 4. Exchange area monitor SWAP -L5. Network monitor netstat -in6. Port monitoring: monitoring a service to start netstat -an | grep portnum or tcpdump | grep portnum7. Hardware failure diagnosis:. 8. Syslogd log monitoring, the syslogd background process writes the information in / var / the information in the system run, and the appearance of the abnormal hardware and hardware error information is monitored. The earlier information exists in the Messages.0 and Message.1 files under the same directory. 9. Mail monitoring: Some users perform tasks via crontab timing, after the task is completed, the cron process will send MAIL to the user, pass whether the MAIL judgment task is completed. In the case of an abnormality of the system, Syslogd will send the root user Mail. Therefore, the root user's MAI needs special attention.
10. Process monitoring: Monitor the process of special consumption resources through PS or TOP. 6. Editorial changes modify the database maintenance 6.1 database kernel parameters Preparations 1. Installation 6.1.1 OS / etc / system file set shmsys: shminfo_shmmax = 4294967295set shmsys: shminfo_shmmin = 1set shmsys: shminfo_shmmni = 100set shmsys: shminfo_shmseg = 10set semsys: seminfo_semmns = 2000set semsys: seminfo_semmsl = 1000set semsys: seminfo_semmni = 100set semsys: seminfo_semopm = 100set semsys: seminfo_semvmx = 327672 checks need to download a specific operating system patch version of the patch set by the sunsolve.sun.com and install it. It can meet the installation needs of Oracle. 3. Operating system User / Group Add L GroupAdd Dbal GroupAdd Oinstalll UseRadd -c "Oracle DBA" -d / home / oracle -g oinstall -g dbal modify / etc / passwd file, change users to log in to Shell or other information 4. User Environment Variable Setting 6.1.2 Database Installation 6.1.3 Database Patch Installation 1. Patch Download: Oracle Database Download from Oracle's Metalink website, after logging in, the Product Family dropped box in the PATCH page Select "Oracle Database", select "RDBMS Server" in the Product drop-down box; select "Oracle 8.1.7.4" in the release drop-down box; select "Sun Solaris OS (SPARC) 64-bit", Language drop-down box in the Platform drop-down box Select "American English (US)", Limit Search to drop-down box Select "Latest Product Patches Or MiniPacks" and click Submit Submit. Click Download Download Patch in the page that appears. 2. Patch Installation: After the Patch download, first need to decompress, install similar to the database installation method, start the RunInstaller installer, select the PRODUCT file under the PATCH directory after completion of the decompression. Special attention When Patch installation, the database must be in normal shutdown. 3. After the installation is complete: Select * from v $ version; check if the version number of each product is upgraded from 8.1.7.0 to 8.1.7.4. 6.2 Database Basic Information Summary 1. Version Information SQL> SELECT * FROM V $ Version; 2. Database Name, Archive Status SQL> Col Name Format A12SQL> SELECT NAME, LOG_MODE, OPEN_MODE from V $ Database; 3. Database Installation Option SQL> Col Parameter Format A50SQL> SELECT * FROM V $ OPTION;
4. Database files include three categories: control files Control file, log file log file, data file DataFilel control file SQL> SELECT NAME FROM V $ controlfile; l log file name and size col Group # format 999 Heading 'Group' Col Member Format a45 heading 'Member' justify c col status format a10 heading 'Status' justify c col archived format a10 heading 'Archived' col fsize format 999 heading 'Size | (MB)' select l.group #, member, archived, l.status (bytes / 1024/1024) fsize from v $ log l, v $ logfile f where f.group # = l.group # ORDER BY 1; L. Data file name, the table space and size col file_name format A50 Heading ' DataFile Name'col tablespace_name format a18 heading 'Related Tablespace'select substr (FILE_ID, 1,3) "ID #", FILE_NAME, tABLESPACE_NAME, BYTES / (1024 * 1024) "M", STATUS from sys.dba_data_files where tablespace_name <> 'Perfstat' Order by TableSpace_name, file_name; 5. Table Space Information (Percentage of Size Space) Select DBA.TABLESPACE_NAME TABLESPACE, NVL (Round (used.bytes / (1024 * 1024), 0), 0) "Used MB" , NVL (Round (Free.BYTES / (1024 * 1024), 0), 0) "Free MB", ROUND ((NVL (NVL) Used.bytes, 0) NVL (Free.Bytes, 0)) / (1024 * 1024), 0) Total -, - NVL (Round (used.bytes / (1024 * 1024), 0), 0) / ROUND (NVL (used.bytes, 0) NVL (Free.Bytes, 0)) / (1024 * 1024), 0) Rate from DBA_TABLESPACES DBA, (SELECT TABLESPACE_NAME, SUM (Bytes) Bytes from DBA_SEGFFments Group by TableSpace_name ) used, (select tablespace_name, sum (bytes) bytes from dba_free_space Group by tablespace_name) free where dba.tablespace_name = used.tablespace_name ( ) and dba.tablespace_name = free.tablespace_name ( ) and dba.tablespace_name <> 'PERFSTAT' Order by dba.tablespace_name;
6. The information of the rollback segment will look back the grouse name, size, table space, and status. Select Substr (sys.dba_rollback_segs.segment_id, 1,5) "ID #", Substr (sys.dba_segments.owner, 1, 8) "Owner", Substr (sys.dba_segments.tablespace_name, 1, 17) "TableSpace Name" Substr (sys.dba_segments.segment_name, 1, 17) "rollback name", substr (sys.dba_segments.bytes, 1, 15) "SIZE (BYTES)", SUBSTR (sys.dba_segments.EXTENTS, 1, 6) " Extent # ", substr (sys.dba_rollback_segs.STATUS, 1,10)" Status "from sys.dba_segments, sys.dba_rollback_segs where sys.dba_segments.segment_name = sys.dba_rollback_segs.segment_name and sys.dba_segments.segment_type = 'ROLLBACK' order BYS.DBA_ROLLBACK_SEGS.SEGMENT_ID; 7. Database parameter information See the parameter of the default value Col Name Format A20 SELECT NAME, VALUE FROM V $ Parameter Where isdefault = 'false'; 8. Database User Information Check if there is user's default Or temporary table space is System table space
select user_id, substr (username, 1,15) UserName, substr (password, 1,15) Password, substr (DEFAULT_TABLESPACE, 1,15) "Default TBS", substr (TEMPORARY_TABLESPACE, 1,15) "Temporary TBS", CREATED Substr (Profile, 1, 10) profilefrom sys.dba_users order by username;
6.3 Database Optimization and Main Parameters Adjustment Oracle Database When you start reading naming rules for initial parameter files for init
It can also be set a big bigger and will not have a negative impact. It is recommended to be 2000. l Open_CURSORS: The number of cursors can be opened at the same time. The setting is not a negative impact. If the child is small, the error cannot be opened. It is recommended to configure to be 500. l DB_Files: The number of database data files. It is recommended to be 200. l Rollback_SEGMENTS: The name of the rollback segment, the user adds the name here after you create a return segment. In the OLTP environment, the number of returning segments is the maximum number of concurrent transaction numbers 1/3 ~ 1 / 4.6.5 Database backup / recovery 6.5 database monitoring / maintenance 6.5.1 Survey method recommended STATSPACK introduction: Statspack is the performance monitoring kit for Oracle, which is for Oracle Enterprise Edition 8.1.6 and above. Used to replace the original UTLBSTAT / UTLESTAT. More data can be collected than UTLBSTAT / UTLESTAT, including SQL that consumes more resources. There are also many ratios (Ratios) that are useful for performance tuning. It can make more comprehensive monitoring of the overall operation of data. At the same time, the generated Report file can be sent to Oracle for assistance analysis. The surveillance range is: l The size of the main memory parameters (db_block_buffers, db_block_size, log_buffer, shared_pool_size). l System load: The logical read, physical read, transaction number, etc. generated every second. l Various cache hits. Such as the library bursts hits the hive rate, the dictionary buffer hits, the DB Block buffer hits, the ratio of sorting in memory, etc. l Several types of events that cause slow system response time, improve system response speed by optimizing these events. l Sorting SQL statements sorted by various types of resource. Usually the system response speed is slowless than the parameter settings, it is also related to the written unregistered SQL statement. Improve the response speed by optimizing the captured SQL statement. l The I / O load of each table space and various documents of the table space. Decades if each file I / O is balanced by this part of the content. l Roll Rolling Segment Information: It reflects whether there is a competition of the rollback segment, whether there is too much expansion of the rollback segment. l All the parameters that do not set by default. Creation of the StatsPack package: l Installing files: Under UNIX operating system, installation files are stored in the $ ORACLE_HOME / RDBMS / Admin Directory. l Create the user and execution of the user and execution file SQL> Connect InterNal; SQL> @? / rdbms / admin / spcreate.sql; l The main action during the installation process: 1 Installation Generate a user perfstat / perfstat => spcusr.sql , Enter the installation: Default TableSpace / Temporary TableSpace 2 Establish required Table => spctab.sql 3 Generate dbms_shared_pool and dbms_job pl / sql package => spcpkg.sqlstatsPack package execution / data acquisition When the system response speed has decreased significantly Time to run data collection through StatsPack, and generate report files, and analyze. l Initial preparation: Set timed_statistics = true in INIT