[20191122]schama建立同義詞.txt
[20191122]schama建立同義詞.txt
--//建立同義詞基本是表或者檢視,其它物件相對較少.schema能建立嗎?
SYS@book> CREATE SCHEMA SYNONYM scotest for scott;
CREATE SCHEMA SYNONYM scotest for scott
*
ERROR at line 1:
ORA-00901: invalid CREATE command
--//實際上有一個隱含引數_enable_schema_synonyms可以實現:
SYS@book> @ hide _enable_schema_synonyms
NAME DESCRIPTION DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE ISSES ISSYS_MOD
----------------------- ------------------------------------------------------------------ ------------- ------------- ------------ ----- ---------
_enable_schema_synonyms enable DDL operations (e.g. creation) involving schema synonyms TRUE FALSE FALSE FALSE FALSE
1.環境:
SYS@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> alter system set "_enable_schema_synonyms"=true ;
alter system set "_enable_schema_synonyms"=true
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
SYS@book> alter system set "_enable_schema_synonyms"=true scope=spfile;
System altered.
2.測試:
SYS@book> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@book> startup
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
Database opened.
SYS@book> CREATE SCHEMA SYNONYM scotest for scott;
Schema synonym created.
SYS@book> select user#,name,type#,ctime,spare2 from sys.user$ where name like 'SCO%';
USER# NAME TYPE# CTIME SPARE2
---------- ---------------------------------------- ---------- ------------------- ----------
112 SCOTEST 3 2019-11-22 10:28:10 83
83 SCOTT 1 2013-08-24 12:04:21
--//OK!!
SYS@book> select * from scotest . dept where rownum=1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
SYS@book> alter user oe account unlock identified by book;
User altered.
SYS@book> grant dba to oe;
Grant succeeded.
--//以oe使用者登入:
OE@book> select * from scotest.dept where deptno=20;
DEPTNO DNAME LOC
---------- -------------- -------------
20 RESEARCH DALLAS
--//真心不知道這個是否有這樣的需求.最好不要這樣做.
3.收尾還原:
SYS@book> revoke dba from oe;
Revoke succeeded.
SYS@book> alter user oe account lock ;
User altered.
SYS@book> drop SCHEMA SYNONYM scotest ;
Schema synonym dropped.
SYS@book> select user#,name,type#,ctime,spare2 from sys.user$ where name like 'SCO%';
USER# NAME TYPE# CTIME SPARE2
---------- ---------------------------------------- ---------- ------------------- ----------
83 SCOTT 1 2013-08-24 12:04:21
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2665305/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 自動為新建的表建立同義詞
- [20191122]RMAN-03999.txt
- [20191122]oracel SQL parsing function qcplgte.txtSQLFunction
- 中考常見同義詞和同義短語總結
- 匯出oracle公有同義詞Oracle
- 6.5. 常用物件——6.5.4. 同義詞物件
- 同義詞相似度可以怎樣計算
- 【學習】SQL基礎-017-同義詞SQL
- Elasticsearch:使用同義詞 synonyms 來提高搜尋效率Elasticsearch
- oralce 跨使用者訪問表 同義詞
- Kibana的Dev Tools中建立自定義分詞器dev分詞
- 工廠模式建立物件和自定義建構函式建立物件的異同模式物件函式
- Elasticsearch 近義詞詞庫配置Elasticsearch
- oracle學習筆記(十四) 資料庫物件 索引 檢視 序列 同義詞Oracle筆記資料庫物件索引
- python 計算txt文字詞頻率Python
- [20201110]oracle建立索引nosrt.txtOracle索引
- [20190531]建立job與commit.txtMIT
- [20181113]Logical Standby建立2.txt
- es 自定義分詞外掛分詞
- 大資料---單詞釋義大資料
- №20191122簡易操作1~7(今期:上=下=3)
- 如何用python建立詞雲圖片Python
- elasticsearch之ik分詞器和自定義詞庫實現Elasticsearch分詞
- day88-ElasticSearch-分詞- 自定義擴充套件詞庫Elasticsearch分詞套件
- 【RMAN】同時建立多個備份(建立多重備份)
- python讀取txt文字資料進行分詞並生成詞雲圖片Python分詞
- [20200115]重新建立awr report.txt
- [20190510]快速建立執行指令碼.txt指令碼
- [20210311]如何建立bbed安裝包.txt
- [20210218]bash echo 建立順序號.txt
- [20201124]建立Socket proxy使用SSH.txt
- [20181108]with temp as 建立臨時表嗎.txt
- [20200107]vim 按鍵與金山詞霸衝突.txt
- pyhanlp 停用詞與使用者自定義詞典功能詳解HanLP
- Mac怎麼建立txt檔案?如何設定新建txt的快捷鍵?Mac
- [20231115]建立enable novalidate約束2.txt
- [20230210]建立完善swcnm.sql指令碼.txtSQL指令碼
- [20200108]線上建立索引失敗分析.txt索引