Oracle 12.2 使用Database Link優化Standby Database Workload
從Oracle 12.2開始,可以通過在database_link_to引數來指定一個資料庫鏈路來優化備庫workload。由於安全原因,Oracle建議使用私有資料庫鏈路。這個鏈路必須屬於sys使用者並且能讓有許可權的使用者來訪問。Oracle資料庫包含一個預設的許可權使用者名稱為SYS$UMF。
在主庫中使用sys使用者建立表t1與配置sys$umf使用者,這個使用者預設是被鎖定的,所以需要先解鎖這個使用者並設定密碼:
SQL> alter user sys$umf account unlock identified by xxzx7817600; User altered. SQL>create table t1 as select * from user_tables; Table created. SQL> create index idx_t1_tablename on t1(table_name); Index created. SQL> exec dbms_stats.gather_table_stats('sys','t1',degree => 4,cascade => true); PL/SQL procedure successfully completed.
建立一個備庫(cs_dg)到主庫的鏈路,由於ADG是隻讀的,所以建立資料庫鏈路操作都需要在主庫中執行:
SQL> create database link cs_dg2_to_cs2 connect to sys$umf identified by abcd1234 using 'CS'; Database link created.
在備庫中驗證資料庫鏈路是否建立成功
col owner for a20 SQL> col object_name for a50 SQL> select owner,object_name from dba_objects where object_type='DATABASE LINK'; OWNER OBJECT_NAME -------------------- -------------------------------------------------- SYS CS_DG2_TO_CS2 SYS SYS_HUB SQL> select table_name from user_tables@cs_dg2_to_cs2; no rows selected SQL> select sysdate from dual@cs_dg2_to_cs2; SYSDATE ------------ 24-JAN-19
在備庫中對錶t1執行查詢,database_link_to引數用來指定備庫到主庫的資料鏈路名cs_dg2_to_cs2
SQL> variable tname varchar2(30); SQL> variable query varchar2(500); SQL> exec :tname := 'jy_task'; PL/SQL procedure successfully completed. SQL> exec :query := 'select /*+ full(t)*/ col1 from t1 t where table_name=''T1'''; PL/SQL procedure successfully completed. SQL> begin 2 :tname := dbms_sqltune.create_tuning_task 3 ( 4 sql_text => :query, 5 task_name => :tname, 6 database_link_to => 'CS_DG2_TO_CS2', 7 scope=>'COMPREHENSIVE', 8 time_limit=>60, 9 description=>'Task to tune a query_on adg'); 10 end; 11 / PL/SQL procedure successfully completed. SQL> exec dbms_sqltune.execute_tuning_task(:tname); PL/SQL procedure successfully completed. SQL> select dbms_sqltune.report_tuning_task(:tname) from dual; DBMS_SQLTUNE.REPORT_TUNING_TASK(:TNAME) -------------------------------------------------------------------------------- GENERAL INFORMATION SECTION ----------------------------------------------------
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26015009/viewspace-2564690/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle database link 的使用OracleDatabase
- oracle database linkOracleDatabase
- Database Link使用Database
- Oracle Database Link ProblemsOracleDatabase
- standby database to primary database.Database
- Oracle database link 詳解OracleDatabase
- oracle database link 應用OracleDatabase
- oracle12.2 adg ORA-46952: standby database format mismatch for password fileOracleDatabaseORM
- standby databaseDatabase
- Oracle 11g Data Guard 使用 duplicate from active database 建立 standby databaseOracleDatabase
- Oracle 11g Data Guard 使用duplicate from active database 建立 standby databaseOracleDatabase
- Oracle DG Standby Database型別OracleDatabase型別
- Oracle DG建立Physical Standby DatabaseOracleDatabase
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- Oracle Database In-Memory Certified with EBS 12.2OracleDatabase
- Physical Standby Database 切換到 Snapshot Standby DatabaseDatabase
- Standby Database ---09Database
- Create RAC Standby Database for RAC Primary DatabaseDatabase
- Oracle DG建立Logical Standby DatabaseOracleDatabase
- Oracle Database 12.2本機配置ADGOracleDatabase
- database link概述Database
- CREATE DATABASE LINKDatabase
- 建立Database LinkDatabase
- Management on database linkDatabase
- oracle database link (dblink) 工作原理OracleDatabase
- Oracle Database Link Problems【Blog 搬家】OracleDatabase
- Oracle10G Physical Standby Database setupOracleDatabase
- Oracle DataGuard Standby database ID mismatch錯誤OracleDatabase
- standby database No RFS 程式Database
- Rman backup standby databaseDatabase
- Standby Database for reportDatabase
- Database Link的建立Database
- 使用rman建立standby database的過程Database
- Oracle Database 12.2新特性詳解 --該國強OracleDatabase
- ORACLE10g DataGuard 配置Physical Standby DatabaseOracleDatabase
- oracle 10g physical standby database creationOracle 10gDatabase
- 11g 新特性—— Active Database Duplication for A standby databaseDatabase
- Standby Database的工作原理Database