Oracle中alter system命令参数之scope

SCOPE

The SCOPE clause lets you specify when the change takes effect. Scope depends on whether you started up the database using a client-side parameter file (pfile) or server parameter file (spfile).

scope可指定对system的修改何时生效,scope=memory|spfile|both ,值取决于数据库使用pfile还是spfile启动

MEMORY

MEMORY indicates that the change is made in memory, takes effect immediately, and persists until the database is shut down. If you started up the database using a parameter file (pfile), then this is the only scope you can specify.

scope=memory,表示修改立即生效,持续到数据库关闭为止,若数据库使用pfile启动,这是唯一可选值,也是默认值。

SPFILE

SPFILE indicates that the change is made in the server parameter file. The new setting takes effect when the database is next shut down and started up again. You must specify SPFILE when changing the value of a static parameter that is described as not modifiable in Oracle Database Reference.

scope=spfile ,会修改spfile参数,新设置只有在重新使用spfile启动数据库的时候生效。

另外,若是修改静态参数(不能直接生效的参数),必须指定scope=spfile,否则若指定memory或者both会报如下错误:

ORA-02095: specified initialization parameter cannot be modified

因为静态参数不能直接通过修改内存而生效,只能通过修改spfile然后重启数据库生效。

BOTH

BOTH indicates that the change is made in memory and in the server parameter file. The new setting takes effect immediately and persists after the database is shut down and started up again.

scope=both,表示修改会发生在内存上立即生效,并修改spfile保证数据库重启后也生效。

If a server parameter file was used to start up the database, then BOTH is the default. If a parameter file was used to start up the database, then MEMORY is the default, as well as the only scope you can specify.

若数据库使用spfile启动,则scope=both是默认值

若数据库使用pfile启动,则scope=memory是默认值,也是唯一值。

静态参数,不能通过修改内存(默认scope值或scope=memory或scope=both)来生效,要通过修改spfile(),重启数据库来生效。

时间: 2024-08-27 18:22:19

Oracle中alter system命令参数之scope的相关文章

自己整理的oracle中常见的命令

自己整理的oracle中常见的命令: oracle11g已经不支持isqlplus了.内置了oracle sql developer 1-----用户多次登录错误,被锁定: ALTER USER username ACCOUNT UNLOCK: 2-----修改用户密码: alter user system identifid by manager; 3-----创建/删除用户: create user lisi identified by lisi; drop user lisi cascad

Oracle中用exp/imp命令参数详解【转】

Oracle中用exp/imp命令参数详解 [用 exp 数 据 导 出]:1  将数据库TEST完全导出,用户名system 密码manager 导出到D:\daochu.dmp中   exp system/[email protected]   rows=y  indexes=y compress=n buffer=65536   feedback=100000full=y  file=d:\daochu.dmp  log=d:\daochulog.txt   owner=(ECC_BIZ,

在Oracle中如何创建带参数的视图?

本文介绍了oracle数据库中创建带参数视图的例子,有需要的朋友参考下. 在Oracle中如何创建带参数的视图? 在Oracle数据库中,视图不像存储过程和函数一样,可以定义输入参数,但可以变个方式,使用程序包来实现. 首先,定义程序包: 复制代码 代码示例: /* 按个人需要定义,我定义三个参数 ,因我项目程序需要,所以三个参数都是number ,当然可定义其它类型但切记,第二个create 的参数类型等需以第一个create一致,否则程序包创建失败*/create or replace pa

Oracle中shrink space命令

shrink_clause:   http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_3001.htm#i2192484 首先oracle shrink 是10g之后才引出的,有shrink table 和shrink space两种,这里介绍shrink space 压缩分两个阶段: 1.数据重组:这个过程是通过一系列的insert delete操作,将数据尽量排在列的前面进行重新组合. 2.HWM调整:这个过程是对

[转]Oracle中INITRANS和MAXTRANS参数

每个块都有一个块首部.这个块首部中有一个事务表.事务表中会建立一些条目来描述哪些事务将块上的哪些行/元素锁定.这个事务表的初始大小由对象的INITRANS 设置指定.对于表,这个值默认为2(索引的INITRANS 也默认为2).事务表会根据需要动态扩展,最大达到MAXTRANS 个条目(假设块上有足够的自由空间).所分配的每个事务条目需要占用块首部中的23-24 字节的存储空间.注意,对于Oracle 10g,MAXTRANS 则会忽略,所有段的MAXTRANS 都是255. 也就是说,如果某个

Oracle中password file的作用及说明 orapwd命令的使用

在数据库没有启动之前,数据库内建用户是无法通过数据库来验证身份的 口令文件中存放sysdba/sysoper用户的用户名及口令允许用户通过口令文件验证,在数据库未启动之前登陆从而启动数据库 如果没有口令文件,在数据库未启动之前就只能通过操作系统认证. 使用Rman,很多时候需要在nomount,mount等状态对数据库进行处理所以通常要求sysdba权限如果属于本地DBA组,可以通过操作系统认证登陆如果是远程sysdba登陆,需要通过passwordfile认证. 1.remote_login_

MySQL的system命令在渗透测试中的使用以及UDF提权

一.MySQL中的system命令 在MySQL 5.x中增加了system命令,简单的符号是\!,从而使MySQL可以执行系统的命令 1 mysql> system echo "12345" 2 12345 因为突发奇想,可以使用这个办法反弹shell 结果OK: 尝试和select拼接执行,这样是成功的 想到这里其实可以拼接在SQL注入语句中执行OS命令,或者能连上MySQL之后直接执行OS命令反弹shell. 二.MySQL UDF提权 这里按照linux类操作系统举例了,

Oracle中开启一张表的审计

Oracle使用audit_trail参数控制审计是否启用 audit_trail的参数有下面几种: NONE:不开启审计 OS:说明审计信息放在系统汇总,如果是Linux那么由audit_file_dest决定,如果是Windows 那么由事件查看器决定 DB 或 TRUE :表示审计信息存放在数据库里,也就是sys 用户的aud$ 表. audit_sys_operations参数的含义: false:不审计sys用户,默认不审计 true:审计sys用户 审计范围分为session 和 a

oracle中spfile和pfile详解

在9i 以前,Oracle 使用pfile 存储初始化参数配置,这些参数在实例启动时被读取,任何修改需要重起实例才能生效:使用spfile 您能够使用ALTER SYSTEM 或ALTER SESSION来动态修改那些可动态修改的参数,任何更改能够立即生效,您能够选择使更改只应用于当前实例还是同时应用到spfile.这就使得任何对spfile 的修改都能够在命令行完成,我们能够完全告别手工修改初始化参数文档,这就大大减少了人为错误的发生.SPFILE 是个二进制文档,能够使用RMAN 进行备份,