数据库安装后需要根据实际情况修改相关参数。
1.生成pfile以防万一。
SQL> create pfile from spfile;
2.修改内存参数
只要设置MEMORY_MAX_TARGET 和 MEMORY_TARGET 就可以了,SGA_MAX_SIZE 可以设置为0 。
SQL> ALTER SYSTEM SET MEMORY_MAX_TARGET = 1000M SCOPE = SPFILE; System altered. SQL> ALTER SYSTEM SET MEMORY_TARGET = 1000M SCOPE = SPFILE; System altered. SQL> ALTER SYSTEM SET SGA_TARGET =0 SCOPE = SPFILE; System altered. SQL> ALTER SYSTEM SET PGA_AGGREGATE_TARGET = 0 SCOPE = SPFILE; System altered. SQL> ALTER SYSTEM SET SGA_MAX_SIZE = 0 SCOPE = SPFILE; System altered. SQL>
3.修改密码默认有效期180天
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; Profile altered.
4.修改数据文件默认参数:
alter system set db_files=500 scope=spfile;
5.增加相应的redo日志文件
--查看redo信息
select group#,sequence#,status,bytes/1024/1024 from v$log; --添加redo日志文件
alter database add logfile group 4('/home/oracle/data/oracle/oradata/gnss/redo04.log\') size 200M;
alter database add logfile group 5('/home/oracle/data/oracle/oradata/gnss/redo05.log\') size 200M;
alter database add logfile group 6('/data/app/oradata/ORCL/onlinelog/redo06.log') size 200m;
注意:12c是默认有俩个文件也可以一个,一般一个:必须在cdb下执行。
--切换日志
alter system checkpoint;
alter system switch logfile;
alter system checkpoint;
alter system switch logfile;
--状态当为 INACTIVE 时,可删除日志
alter database drop logfile group 1; 并且手动删除对应的物理文件