发布时间: 2017-06-16 13:48:20
#(1)在主库上操作,先备份一个pfile SQL> create pfile='/oracle/pfile_4.ora' from spfile; File created. #(2)开始在线调整sga、pga SQL> alter system set sga_max_size=8192M scope=spfile; System altered. SQL> ALTER system SET sga_target=3072M scope=spfile; System altered. SQL> #(3)将调整过的保存到启动参数里面 SQL> create pfile from spfile; File created. SQL> #(4)查看主库的sga、pga配置,调整已经生效了 SQL> show parameter sga; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 8G sga_target big integer 3G SQL> show parameter pga; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_target big integer 4940M SQL> SQL> #(5)这里其实也不用shutdown、startup已经生效了,不过为了验证下,所以我这里做了这个操作 SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 8551575552 bytes Fixed Size 2270360 bytes Variable Size 8120175464 bytes Database Buffers 419430400 bytes Redo Buffers 9699328 bytes Database mounted. Database opened. SQL> SQL> SQL> #(6)再次查看主库的sga、pga配置,重启后,仍然生效 SQL> show parameter sga; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 8G sga_target big integer 3G SQL> show parameter pga; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_target big integer 4940M SQL> |
# (1)在备库上操作,先备份参数文件 SQL> create pfile='/oracle/pfile_4.ora' from spfile; File created. SQL> #(2)开始在线调整 SQL> alter system set sga_max_size=8192M scope=spfile; System altered. SQL> ALTER system SET sga_target=2048M scope=spfile; System altered. SQL> #(3)将修改保存到启动参数文件 SQL> create pfile from spfile; File created. SQL> #(4)重启备库,验证配置,其实在线生效也不用做shutdown、startup,这里只是验证下 SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> SQL> SQL> startup ORACLE instance started. Total System Global Area 8551575552 bytes Fixed Size 2270360 bytes Variable Size 7247760232 bytes Database Buffers 1291845632 bytes Redo Buffers 9699328 bytes Database mounted. Database opened. SQL> # (5)开启备库日志应用 SQL> alter database recover managed standby database using current logfile disconnect from session; Database altered. SQL> #(6)查看备库的sga、pga配置已经生效 SQL> show parameter sga; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 8G sga_target big integer 2G SQL> show parameter gpa SQL> show parameter pga NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_target big integer 4940M SQL> |
#(1)在主库创建临时表 SQL> create table z_tim(id number); Table created. SQL> insert into z_tim values(1); 1 row created. SQL> commit; Commit complete. SQL> #(2)切换日志 SQL> alter system switch logfile; System altered. SQL> |
# 在备库上查询这个临时表,看到数据存在 SQL> select * from z_tim; ID ---------- 1 SQL> |
SQL> select sequence#,applied from v$archived_log order by sequence# asc; ………. SEQUENCE# APPLIED ---------- --------- 934 YES 935 YES 936 YES 937 YES 938 IN-MEMORY 918 rows selected. SQL> |
上一篇: 如何利用Docker生成SSL证书
下一篇: Linux系统新手学习的11点建议