alter session set current_schema='XXX'语句用法
2009-11-13 11:08
525 查看
CURRENT_SCHEMA
Syntax:
CURRENT_SCHEMA = schema
The CURRENT_SCHEMA parameter changes the current schema of the session to the specified schema. Subsequent unqualified references to schema objects during the session will resolve to objects in the specified schema. The setting persists for the duration of the session or until you issue another ALTER SESSION SET CURRENT_SCHEMA statement.
This setting offers a convenient way to perform operations on objects in a schema other than that of the current user without having to qualify the objects with the schema name. This setting changes the current schema, but it does not change the session user or the current user, nor does it give you any additional system or object privileges for the session.
随便做了个小实验,贴出来看看。
Syntax:
CURRENT_SCHEMA = schema
The CURRENT_SCHEMA parameter changes the current schema of the session to the specified schema. Subsequent unqualified references to schema objects during the session will resolve to objects in the specified schema. The setting persists for the duration of the session or until you issue another ALTER SESSION SET CURRENT_SCHEMA statement.
This setting offers a convenient way to perform operations on objects in a schema other than that of the current user without having to qualify the objects with the schema name. This setting changes the current schema, but it does not change the session user or the current user, nor does it give you any additional system or object privileges for the session.
随便做了个小实验,贴出来看看。
SQL> create user tt1 identified by tt1; User created. SQL> grant connect,resource to tt1; Grant succeeded. SQL> conn tt1/tt1 Connected. SQL> create table dept(id number); Table created. SQL> insert into dept values(1); 1 row created. SQL> commit; Commit complete. SQL> select * from dept; ID ---------- 1 SQL> alter session set current_schema=scott; Session altered. SQL> select * from dept; select * from dept * ERROR at line 1: ORA-00942: table or view does not exist SQL> conn scott/tiger Connected. SQL> grant select on dept to tt1; Grant succeeded. SQL> conn tt1/tt1 Connected. SQL> select * from dept; ID ---------- 1 SQL> alter session set current_schema=scott; Session altered. SQL> select * from dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON SQL>
相关文章推荐
- 使用alter session set current_schema设置当前模式
- alter session set current_schema=Schema
- alter session set current_schema 指令
- 对alter session set events语句基本意思的说明
- alter session set events语句dump REDO日志文件头信息示例
- alter session set events语句dump 控制文件头信息示例
- C#中??和?分别是什么意思? 在ASP.NET开发中一些单词的标准缩写 C#SESSION丢失问题的解决办法 在C#中INTERFACE与ABSTRACT CLASS的区别 SQL命令语句小技巧 JQUERY判断CHECKBOX是否选中三种方法 JS中!=、==、!==、===的用法和区别 在对象比较中,对象相等和对象一致分别指的是什么?
- SQL语句中ALTER的用法
- MySQL之alter语句用法总结
- MySQL之alter语句用法总结
- Hibernate hql语句 find_in_set 用法
- alter system/session set
- .alter session set events
- MySQL之alter语句用法总结
- alter session set cursor_sharing=Exact;
- php session_set_save_handler 函数的用法(mysql)
- 修改instance_name的语句(alter system set instance_name)
- Oracle alter语句的用法
- MySQL之alter语句用法总结
- MySQL之alter语句用法总结