After installation parameter adjustment oracle

Close 11g New Features to open archives

oracle 11g installation to be modified:
1, to close the audit
alter system set audit_trail = none scope = spfile sid = '*';

Preventing ORA-03113: the end of the communication channel error file.

alter system set open_cursors=800 scope=both;


truncate table SYS.AUD$;

session_max_open_files 12c:

alter system set session_max_open_files=200 scope=spfile; 至少200

12c plsql can visit:

Add the following sqlnet.ora

SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8


2, 180 days period Change Password and login failures limit
the SELECT * = the FROM DBA_PROFILES the WHERE Profile 'the DEFAULT' the AND resource_name = 'PASSWORD_LIFE_TIME';
SELECT Profile, WHERE limit from DBA_PROFILES resource_name = 'FAILED_LOGIN_ATTEMPTS';

alter profile default limit password_life_time unlimited;
alter profile default limit failed_login_attempts unlimited;


3, prohibits direct path read the database level, when the session a lot of time, frequent FTS will seriously affect SQL performance
should consider turning off this feature at the database level, especially to invest in such a multiuser OLTP system
can be set to hidden parameters _serial_direct_read or is never
alter system set event = '10949 trace name context forever, level 1' scope = spfile;


4, after the database is created, before the data import, immediately change the parameters deferred_segment_creation FALSE
ALTER System deferred_segment_creation SET = FALSE scope = both;


5, modify the default date format
alter system set nls_date_format = 'yyyy- mm-dd hh24: mi: ss' scope = spfile;

6、改归档
alter system set log_archive_dest_1='location=/oracle/archivelog' scope=spfile sid='*';

alter system set log_archive_dest_1='location=D:\app\Administrator\arch' scope=spfile sid='*';
alter system set log_archive_format='arch_%t_%s_%r.arc' scope=spfile sid='*';

su - grid
srvctl stop database -d tzjy
srvctl start database -d tzjy -o mount

7. change db_files (database need to be modified, the maximum data files)

ALTER SYSTEM SET db_files=2000 SCOPE=SPFILE;


alter database archivelog;

srvctl start database -d tzjy

alter system archive log current


- View user's default table space
select username, default_tablespace from dba_users;

select TYPE,RECORDS_TOTAL from v$controlfile_record_section;

7. temporary table space
alter tablespace TEMP add tempfile '+ datadg ' size 5000M;

alter tablespace TEMP add tempfile 'D:\app\Administrator\oradata\ORCL\DATAFILE\temp02.dbf' size 5000M autoextend on ;

set lin 140
SELECT d.status "Status", d.tablespace_name "Name", d.CONTENTS "Type",
d.extent_management "Extent Management",
TO_CHAR (NVL (a.BYTES / 1024 / 1024, 0), '99,999,990.900') "Size (M)",
TO_CHAR (NVL (t.BYTES, 0) / 1024 / 1024, '99999999.999')
|| '/'
|| TO_CHAR (NVL (a.BYTES / 1024 / 1024, 0), '99999999.999') "Used (M)",
TO_CHAR (NVL (t.BYTES / a.BYTES * 100, 0), '990.00') "Used %"
FROM SYS.dba_tablespaces d,
(SELECT tablespace_name, SUM (BYTES) BYTES
FROM dba_temp_files
GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM (bytes_cached) BYTES
FROM v$temp_extent_pool
GROUP BY tablespace_name) t
WHERE d.tablespace_name = a.tablespace_name(+)
AND d.tablespace_name = t.tablespace_name(+)
AND d.extent_management LIKE 'LOCAL'
AND d.CONTENTS LIKE 'TEMPORARY';
8.undo表空间:
alter tablespace UNDOTBS1 add datafile '+datadg' size 5000M autoextend on;

alter tablespace UNDOTBS1 add datafile 'D:\app\Administrator\oradata\ORCL\DATAFILE\undo02.dbf' size 5000M autoextend on;
alter tablespace UNDOTBS2 add datafile '+datadg' size 5000M autoextend on;

alter database datafile '+DATADG/gzdb/datafile/undotbs1.309.913913585' autoextend on;


col tablespace_name for a20
col file_name for a60
set lin 140
set pagesize 50
with
D as (SELECT TABLESPACE_NAME ,
ROUND(SUM(BYTES)/(1024*1024)) SPACE,
SUM(BLOCKS) BLOCKS
FROM DBA_DATA_FILES
GROUP BY TABLESPACE_NAME),
F as (SELECT TABLESPACE_NAME,ROUND(SUM(BYTES)/(1024*1024))
FREE_SPACE FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME),
T as (select distinct TABLESPACE_NAME,AUTOEXTENSIBLE from dba_data_files)
SELECT D.TABLESPACE_NAME,
SPACE "SUM_SPACE(M)" ,
SPACE-NVL(FREE_SPACE,0) "USED_SPACE(M)",
FREE_SPACE "FREE_SPACE(M)" ,
ROUND((1-NVL(FREE_SPACE,0)/SPACE) *100) "USED_RATE(%)",t.AUTOEXTENSIBLE
from D,F,T
WHERE T.TABLESPACE_NAME(+)=D.TABLESPACE_NAME AND D.TABLESPACE_NAME=F.TABLESPACE_NAME(+)
ORDER BY "USED_RATE(%)";

9. Log

10.standby_file_management (default is auto, heterogeneous platforms to open)

Auto System = SET standby_file_management ALTER scope = both;

11.asm
the PROCESSES parameters affect ASM instance, the default value for this parameter is generally sufficient.
If there are a plurality of database instances using the same ASM instance, we need to change the parameters, calculated as follows:
the PROCESSES = 50 + 50 * n-

11.show parameter standby_file_management prepared by the library to automatically create a table space data file (enabled by default).

show parameter standby_file_management;

alter system set show parameter standby_file_management=auto scope=spfile;
-----------------------------------------------------------------------------------

12 Asynchronous IO (default none)
archiving of large, db file sequential read this waiting for the appropriate parameters proposed changes:

alter system set filesystemio_options=setall scope=spfile;


In general, asynchronous I / O synchronization is I O comparison and / is, if synchronous I / O, when an I / O operation is performed, the application must wait until the I / O executed. Instead , asynchronous I / O operations run in the background, I / O operations and applications can be run simultaneously, improving system performance; use asynchronous I / O improves I / O traffic, if the application is a raw device to operate, this advantage more evident, so as databases, file servers, etc., often using the asynchronous I / O, so that a plurality of I / O operations performed simultaneously

after a period of operation ----- service, the UNDO size settings.

SQL> show parameter undo

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL>
SQL> SELECT undoblks / ((end_time - begin_time) * 86400) "Peak Undo Block Generation"
FROM gv$undostat
WHERE undoblks = (SELECT MAX(undoblks) FROM gv$undostat);

Peak Undo Block Generation
--------------------------
.127147766

SQL> select 0.13*900*8192/1024/1024 G from dual;

G
----------
.9140625
need 0.9G undo

SQL> SELECT tablespace_name, retention FROM dba_tablespaces;

TABLESPACE_NAME RETENTION
------------------------------ -----------
SYSTEM NOT APPLY
SYSAUX NOT APPLY
UNDOTBS1 NOGUARANTEE
TEMP NOT APPLY
USERS NOT APPLY
EXAMPLE NOT APPLY

6 rows selected.

 


RAC may need results * 2.

查看ORACLE 进程的大小:
select USERNAME,SPID, PGA_ALLOC_MEM/1024/1024 m from v$process;
select USERNAME,sum(PGA_ALLOC_MEM)/1024/1024 m from v$process group by USERNAME;

View background processes:
desc v $ BGPROCESS;

13、

After the oracle10g R2 environment, DISTINCT because of its HASH UNIQUE sorting algorithm will not lead to its adjustment

ALTER SESSION SET "_gby_hash_aggregation_enabled" = FALSE

 


- parameter modification

- Turn off the password is case sensitive:

alter system set sec_case_sensitive_logon=false scope=spfile sid='*';


--设置PASSWORD_LIFE_TIME为unlimit:
alter profile default limit PASSWORD_LIFE_TIME unlimited;
alter profile default limit PASSWORD_LOCK_TIME unlimited;
alter profile default limit PASSWORD_GRACE_TIME unlimited;
alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;

More than several tens of G trace dump file maximum size setting appears, avoiding abnormal, the file system will explode -:
ALTER System MAX_DUMP_FILE_SIZE = SET '4096M' = SPFILE scope SID = '*';
- adjusting the default partition size
- when -11g partition the default partition size is 8M, the need to close, because it avoids creating a lot of future ahead of partition, even an empty partition, but the size of the entire table is already very large, the whole partition scan occurs, or logical backup SQL performance low:
ALTER SET System "_partition_large_extents" = SID = SPFILE to false scope = '*';


- Close the automatic adjustment undo_retention, BUG more:
ALTER SET System "_undo_autotune" = SID = SPFILE to false scope = '*';
ALTER System = 10800 undo_retention scope SET = SPFILE SID = '*';

- manually set the maximum number of parallel sub-process is the number of CPU * 2, a database automatically calculated to avoid too large a value, the parallel run out of resources:
ALTER System PARALLEL_MAX_SERVERS SET = 128 = SPFILE scope SID = '*';

- Retention time set in the control file, can be restored to ensure that any day within a month:
ALTER System 31 is SET = CONTROL_FILE_RECORD_KEEP_TIME scope SID = SPFILE = '*';

- Close DRM (DRM cause problems due to the very large):
ALTER SET System "_gc_policy_time" = 0 = SPFILE scope SID = '*';

alter system set "_gc_undo_affinity"=false sid='*' scope=spfile;


- Close a delay initialized extent 11g create:
ALTER System SET = deferred_segment_creation to false scope = SPFILE SID = '*';


--不用result_cache:
alter system set result_cache_max_size=0 scope=spfile sid='*';

- increases the delay downgrade lock Example 3 seconds long, avoid some instances lead to the crash bugs:
ALTER SET System "_gc_defer_time" scope. 3 = = SPFILE SID = '*';

- is recommended to adjust AWR for 2 weeks or more, to facilitate post-maintenance:
Exec DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS (The RETENTION => 14 * 24 * 60, the INTERVAL => 60);


Adaptive cursor sharing --11g might bring too much of a problem child cursor, we turn it off:
the ALTER the SET System "_optimizer_adaptive_cursor_sharing" = false sid = '*' scope = SPFILE;
the ALTER the SET System "_optimizer_extended_cursor_sharing" sid = none = '*' = SPFILE scope;
ALTER SET System "_optimizer_extended_cursor_sharing_rel" = none SID = '*' = SPFILE scope;


--11g of Cardinality feedback may lead to instability in the implementation of the plan:
the ALTER the SET System "_optimizer_use_feedback" = false sid = '*' scope = SPFILE;

- Set 28401 and 10949 events, closed wrong password logon delay, direct path read
alter system set event = '28401 trace name context forever, level 1', '10949 trace name context forever, level 1' sid = '*' scope = spfile;


- Concurrent Session make the pool to use Large
ALTER SET System "_PX_use_large_pool" to true = SID = '*' = SPFILE scope;

- Recovery of LGWR post / wait mode notification
alter system set "_use_adaptive_log_file_sync" = false sid = '*' scope = spfile;

 

Guess you like

Origin www.cnblogs.com/hmwh/p/11563574.html