All technological notes.
Initialization parameters
initialization parameters from a file at startup.Only a few of parameters must be explicitly set because the default values are usually adequate.
initialization parameters are used to optimize performance by adjusting memory structures. 实际上参数作用于内存结构.
Most initialization parameters belong to one of the following groups: 功能上
Parameters that name entities such as files or directories
Parameters that set limits for a process, database resource, or the database itself
variable parameters:
Initialization parameters are divided into two groups: basic and advanced.性能上
Typically, only the approximately 30 basic parameters to obtain reasonable performance.
modification to the advanced parameters may be required for optimal performance.
Derived parameters:
sessions = (1.5 \* PROCESSES) + 22Operating System-Dependent Parameters
V$PARAMETER & V$PARAMETER2V$PARAMETER:
initialization parameters that are currently in effect for the session.V$PARAMETER2:
V$PARAMETER, but more readableKey Column
ISSES_MODIFIABLEISSYS_MODIFIABLEISPDB_MODIFIABLEV$PARAMETER# current in root
show con_name
select name, open_mode from v$pdbs;
alter pluggable database all open;
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,con_id
from V$PARAMETER
order by name;

V$PARAMETER & V$PARAMETER2select name, value, isses_modifiable, issys_modifiable, ispdb_modifiable,con_id
from V$PARAMETER
where name ='control_files';


V$SYSTEM_PARAMETER vs V$SYSTEM_PARAMETER2V$SYSTEM_PARAMETER
V$SYSTEM_PARAMETER2
V$SYSTEM_PARAMETER, but more readableISDEFAULT:
TRUE). Otherwise, the parameter value was specified in the parameter file (spfile or pfile) (FALSE)V$SYSTEM_PARAMETERselect name, value, con_id, ISDEFAULT, isses_modifiable, issys_modifiable, ispdb_modifiable
from V$SYSTEM_PARAMETER
order by name;

ISDEFAULT for audit_file_dest is fault


select name, value, ISDEFAULT, con_id, isses_modifiable, issys_modifiable, ispdb_modifiable
from V$SYSTEM_PARAMETER
where ISDEFAULT='FALSE'
AND CON_ID=0
order by name;

V$SYSTEM_PARAMETER & V$SYSTEM_PARAMETER2select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,con_id
from V$SYSTEM_PARAMETER
where name ='control_files';
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,con_id
from V$SYSTEM_PARAMETER2
where name ='control_files';

V$SYSTEM_PARAMETER vs V$PARAMETERV$PARAMETER, not in the V$SYSTEM_PARAMETER# Query instance level parameter
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$SYSTEM_PARAMETER
where name='nls_date_format';
#nls_date_format TRUE FALSE TRUE TRUE 0
# alter session parameter
alter session set nls_date_format='dd-mm-yyyy';
# Query instance level parameter
# value not changed, null
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,con_id
from V$SYSTEM_PARAMETER
where name='nls_date_format';
# nls_date_format TRUE FALSE TRUE 0
# Query session level parameter
# value change
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,con_id
from V$PARAMETER
where name='nls_date_format';
# nls_date_format dd-mm-yyyy TRUE FALSE TRUE 1
When the isses_modifiable=True, this session parameter can be changed in the session; Otherwise, it cannnot be changed.
When the current session is terminated, the setting will not be available for the new session.
Alter:
ALTER SESSION SET parameter=value;
--can you query all the para that we can change it on session level
select name,value, isses_modifiable, issys_modifiable, ispdb_modifiable
from V$PARAMETER
where isses_modifiable='TRUE'
# query parameters
select name,value from V$PARAMETER
order by name;
# query a parameter with modifiable details
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable
from V$PARAMETER
where name ='nls_date_format';

# query before alter
select sysdate from dual;
#28-Feb-2024
# alter parameter
alter session set nls_date_format='dd-mm-yyyy';
# confirm new value of parameter
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable
from V$PARAMETER
where name ='nls_date_format';
# confirm after alter
select sysdate from dual;
#28-02-2024

issys_modifiable:issys_modifiable |
Description |
|---|---|
FALSE |
could be changed, in Spfile only, need restart |
IMMEDIATE |
changes can take effect IMMEDIATE |
DEFERRED |
take effect for future sessions |
ALTER SYSTEM SET parameter=value;
select name, value, ISDEFAULT, con_id, isses_modifiable, issys_modifiable, ispdb_modifiable
from V$SYSTEM_PARAMETER
where ISDEFAULT='FALSE'
AND CON_ID=0
order by name;
SCOPE| value of scope | current session | restart | future session |
|---|---|---|---|
MEMORY |
Yes | - | No |
SPFILE |
No | required | Yes |
BOTH |
Yes | - | Yes |
DEFERRED |
No | - | Yes |
Alter system set parameter=value| Startup with | Defautl | Equivalent |
|---|---|---|
| spfile | BOTH |
Alter system set parameter=value scope=both |
| pfile | MEMORY |
Alter system set parameter=value scope=memory |
DB can read but cannot write a pfile.
scope=memory: changes only effects the instance, not the spfile.show parameter max_idle_time;
# 0
ALTER SYSTEM SET max_idle_time=30 scope=memory;
show parameter max_idle_time;
# 30

SELECT value FROM v$parameter WHERE name='max_idle_time';
# 30
SELECT value FROM v$system_parameter WHERE name='max_idle_time';
# 30


ALTER SYSTEM SET max_idle_time=50 scope=spfile;
SELECT value FROM v$system_parameter WHERE name='max_idle_time';
# 0



ALTER SYSTEM SET max_idle_time=20 scope=both;
SELECT value FROM v$system_parameter WHERE name='max_idle_time';


ALTER SYSTEM RESET max_idle_time scope=both;
SELECT value FROM v$system_parameter WHERE name='max_idle_time';

Query v$parameter
Query v$system_PARAMETER
Query spfile
show con_name;
# CON_NAME
# ------------------------------
# CDB$ROOT
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,con_id
from V$PARAMETER
where name='open_cursors';
# open_cursors 300 FALSE IMMEDIATE TRUE 1
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 300 FALSE IMMEDIATE TRUE FALSE 0
show parameter spfile;
# NAME TYPE VALUE
# ------ ------ ----------------------------------------------------------
# spfile string /u01/app/oracle/product/19.0.0/dbhome_1/dbs/spfileorcl.ora
Alter system using default scope
Query confirm the value in the memory has been changed.
alter system set open_cursors=301;
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 301 FALSE IMMEDIATE TRUE FALSE 0

startup pfile=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/test.ora
show parameter spfile;

ALTER system SET open_cursors=301 scope=spfile;

SELECT value FROM v$parameter WHERE name='open_cursors';
SELECT value FROM v$system_parameter WHERE name='open_cursors';
ALTER system SET open_cursors=302;
SELECT value FROM v$parameter WHERE name='open_cursors';
SELECT value FROM v$system_parameter WHERE name='open_cursors';


When the ispdb_modifiable=FALSE, this session parameter cannot be changed in PDB.
Inheritance
A PDB can override the root’s setting for the parameters whoseISPDB_MODIFIABLE is TRUE.
V$system_PARAMETEROverride:
CONTAINER = CURRENT| current | CONTAINER | apply to | Description |
|---|---|---|---|
root |
CONTAINER=ALL |
root + pdb | includ pdb’s customized value |
root |
CONTAINER=CURRENT |
root + pdb | except pdb’s customized value |
pdb |
CONTAINER=CURRENT |
pdb |
alter system register; # register service in listener.
show con_name;
# CON_NAME
# ------------------------------
# CDB$ROOT
select name, value, isses_modifiable, issys_modifiable, ispdb_modifiable,ISDEFAULT, con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 301 FALSE IMMEDIATE TRUE FALSE 0
alter system set open_cursors=400 container=current;
# Query in the root
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 400 FALSE IMMEDIATE TRUE FALSE 0
alter session set container=orclpdb;
show con_name
# CON_NAME
# ------------------------------
# ORCLPDB
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 400 FALSE IMMEDIATE TRUE FALSE 0
alter system set open_cursors=500 container=all;
# Error report -
# ORA-65050: Common DDLs only allowed in root.
# 65050. 00000 - "Common DDLs only allowed in root."
# *Cause: An attempt was made to issue a common DDL in a pluggable database.
# *Action: Switch to CDB$ROOT or application root and issue the common DDL.
alter system set open_cursors=500 container=current;
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 500 FALSE IMMEDIATE TRUE FALSE 3
alter session set container=cdb$root;
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 400 FALSE IMMEDIATE TRUE FALSE 0
# open_cursors 500 FALSE IMMEDIATE TRUE FALSE 3
alter system set open_cursors=410 container=current;
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 410 FALSE IMMEDIATE TRUE FALSE 0
# open_cursors 500 FALSE IMMEDIATE TRUE FALSE 3
alter system set open_cursors=410 container=all;
select name,value,isses_modifiable , issys_modifiable , ispdb_modifiable ,ISDEFAULT,con_id
from V$system_PARAMETER
where name='open_cursors';
# open_cursors 410 FALSE IMMEDIATE TRUE FALSE 0