oracle中Alter system 命令的总结

it is from http://www.adp-gmbh.ch/ora/sql/alter_system.html

this is a good personal blog website!

Alter system archive log [start|stop|all|...]

alter system archive log all;
alter system archive log next;
alter system archive log sequence 104;
alter system archive log current;
alter system archive log current noswitch;

The following command can be used to stop arch.

alter system archive log stop

Similarly, arch is started with

alter system archive log start

However, changing the archiver this way doesn't last when the database is restarted. When the database is started, it consults log_archive_start in the initialization file to determine if arch is started.

Alter system archive log all

This command is used to manually archive redo logs.

alter system disconnect session

alter system kill session

alter system kill session 'session-id,session-serial'

This command kills a session. The session-id and session-serial parameters are found in the v$session view (columns sid and serial#.

alter system checkpoint

Performs a checkpoint

alter system checkpoint

alter system dump datafile

This command can be used in order to dump one ore more blocks of a datafile. The following command dumps blocks 50 through 55 of file 5. Which file 5 is can be found out with v$datafile

alter system dump datafile 5 block min 50 block max 55;

Note: trace files are only readable by the Oracle account. If you want to change this, set the undocumented initialization parameter _trace_files_public to true. Doing so will, however, cause a big security risk.

alter system flush buffer_cache

alter system flush buffer_cache;

This command is not available prior to 10g. It flushes the buffer cache in the SGA.

9i had an undocumented command to flush the buffer cache:

 set events = 'immediate trace name flush_cache';

alter system flush shared_pool

alter system flush shared_pool;

This command flushed the shared pool.

alter system quiesce restricted

alter system suspend|resume

alter system switch logfile

Causes a redo log switch.

alter system switch logfile;

If the database is in archive log mode, but the ARCH process hasn't been startedm, the command might hang, because it waits for the archiving of the 'next' online redo log.

alter system register

Forces the registration of database information with the listener.

alter system register

Alter system set timed_statistics

Setting timed_statistics=true might be usefule when using tk prof.

Alter system set sql_trace

Setting sql_trace=true is a prerequisite when using tk prof.

Alter system set .... deferred

Alter system can be used to change initialization parameters on system level. However, some parameters, when changed with alter system don't affect sessions that are already opened at the time when the statement is executet; it only affects sessions started later. These parameters must be changed with alter system set <initialization parameter> DEFERRED, otherwise a ORA-02096: specified initialization parameter is not modifiable with this option error is returned.

These parameters can be identified as they have a DEFERRED in the isses_modifiable column of v$parameter.

Alter system reset <parameter_name>

Resets a parameter.

alter system reset some_param scope=both sid='*';

scope

scope=memory

Changes the parameter's value for the running instance only. As soon as the instance is stopped and started, this change will be lost.

scope=spfile

Alters an initialization parameter in the spfile

scope=both

Alters an initialization parameter in the spfile as well as in the running instance.

时间: 2024-11-13 06:40:25

oracle中Alter system 命令的总结的相关文章

【Oracle】alter system set events 相关知识

alter system set events 相关知识: 格式:alter system|session set events [eventnumber|immediate] trace name eventname [forever] [, level levelnumber] : --.' 通过:符号,可以连续设置多个事件,也可以通过连续使用alter session set events来设置多个事件. 格式说明:eventnumber指触发dump的事件号,事件号可以是Oracle错误

Oracle中的TOPAS命令详解

Topas命令可以监控系统活动――memory,I/O,paging space,cpu,process. 此命令包含在perfagent.tools文件集里面. 命令使用方法: topas [ -d number_of_monitored_hot_disks ] [ -h ] [ -i monitoring_interval_in_seconds ] [ -n number_of_monitored_hot_network_interfaces] [ -p number_of_monitore

oracle中alter database create datafile 导致数据文件丢失恢复

alter database create datafile导致原始数据文件丢失 有客户一个小系统找我们恢复,通过Oracle Database Recovery Check 检测之后我们红框部分发现一奇怪现象 1.文件头fuzzy为NO,不符合数据库异常crash常识,也和其他文件该状态不匹配 2.文件的创建时间,scn均和checkpoint时间,scn一致(也就是说该文件是创建之后就checkpoint,然后就没有其他操作) 3.文件开始应用的归档为5,110和其他数据文件要求的3115相

Oracle中ALTER USER的REPLACE语句

ALTER USER语句有一个可选的REPLACE语句,用来在启动密码验证函数后,输入原始密码. 默认情况下,用户修改自己的密码不需要提供当前密码: SQL> create user test identified by test; 用户已创建. SQL> grant connect to test; 授权成功. SQL> select * from dba_profiles; PROFILE                        RESOURCE_NAME          

oracle中alter package时包含drop操作报错ORA-20008

一般情况下,我们如果alter操作,是不会触发drop操作.但是在某些特别的情况下,alter package的操作在递归SQL中,是能看到drop操作的. 我们这个环境中有trigger,一旦有drop操作的时候,是会报错ORA-20008,且被阻拦的. 我们看到下面,我们只是alter package而已.但是在关系到其关联对象的时候,竟然发生了drop的动作: SQL> alter package MYUSER1.MYP_IIA_IS_PACKAGE compile body; alter

oracle中alter package时包含drop操作

一般情况下,我们如果alter操作,是不会触发drop操作.但是在某些特别的情况下,alter package的操作在递归SQL中,是能看到drop操作的. 我们这个环境中有trigger,一旦有drop操作的时候,是会报错ORA-20008,且被阻拦的. 我们看到下面,我们只是alter package而已.但是在关系到其关联对象的时候,竟然发生了drop的动作: SQL> alter package MYUSER1.MYP_IIA_IS_PACKAGE compile body; alter

system命令-在代码中执行cmd命令如何不显示cmd

问题描述 在代码中执行cmd命令如何不显示cmd 在代码中执行system命令时,总有黑框一闪而过,怎样可以让他完全不显示 解决方案 shellexecute启动,showwindow参数设置为SW_HIDE 解决方案二: 直接执行那个命令,不要加上cmd.当然前提是那个命令本身不创建额外的控制台. 解决方案三: 如果用shellexecute执行cmd命令,的最后一个参数设置为SW_HIDE,隐藏窗口.shellexecuteex,createprocess也都可以设置 解决方案四: @ech

Oracle中查看引起Session阻塞的2个脚本分享_oracle

用户A执行删除,但是没有提交. 复制代码 代码如下: SQL> delete from test where object_id<10; 已删除8行. 用户B执行删除或者更新id<10的记录,则被阻塞. 复制代码 代码如下: SQL> update test set flag='N' where object_id<10; 遇到这种阻塞,首先需要确定问题.可以使用以下脚本. 复制代码 代码如下: select t2.username,t2.sid,t2.serial#,t2.

oracle中使用alter system events导致库crash

由于数据库导入大量数据的时候io等待比较高,新的存储无法直接挂过来,考虑使用nfs挂载过来,然后存放redo缓解io压力. 数据库版本信息 SQL> select * from v$version;   BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Rele