You cannot use deployment templates to instantiate the following types of objects:
■ User-defined types
■ User-defined type bodies
■ User-defined operators
■ Indextypes
Nor can you use deployment templates to instantiate any objects based on these types
of objects.
构建 deployment template流程图
1,before setting up deployment template ,for supportting fast refresh for mv
begin setting up deployment template
step1 create the deployment template
clear
[H[Jbash-2.05b$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.2.0 - Production on Tue Apr 21 13:39:14 2009
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> conn scott/system@dg1
Connected.
SQL> create mar^H terialized view log on scott.emp;
Materialized view log created.
SQL> //set /setp setp tep1 setp ^H^H tep1 create the deployment template
SP2-0734: unknown command beginning "step1 crea..." - rest of line ignored.
SQL> conn repadmin/repadmin@dg1
Connected.
SQL> declare a number;
2 begin
3 a:=dbms_repcat_rgt.g create_refresh_template(
4 wner=>'scott',
5 f- refresh_group_name=>'scott_refg',
6 template_ refresh_template_name=>'scott_e refg_dt',
7 template_comment=>'scott user 's emp table deployment template',
8 public_template=>'N');
9 end;
10 /
ERROR:
ORA-01756: quoted string not properly terminated
SQL> l
1 declare a number;
2 begin
3 a:=dbms_repcat_rgt.create_refresh_template(
4 wner=>'scott',
5 refresh_group_name=>'scott_refg',
6 refresh_template_name=>'scott_refg_dt',
7 template_comment=>'scott user's emp table deployment template',
8 public_template=>'N');
9* end;
SQL> /
ERROR:
ORA-01756: quoted string not properly terminated
SQL> show user
USER is "REPADMIN"
SQL> define _editor=vi
SQL> ed
Wrote file afiedt.buf
[40;1H[?1h="afiedt.buf" 10 \u884C\uFF0C252 \u5B57\u7B26 [H[Jdeclare a number;[H
begin
a:=dbms_repcat_rgt.create_refresh_template(
owner=>'scott',
refresh_group_name=>'scott_refg',
refresh_template_name=>'scott_refg_dt',
template_comment=>'scott user's emp table deployment template',
public_template=>'N');
end;
/
~[H[39B"afiedt.buf" 10 \u884C\uFF0C252 \u5B57\u7B26[H
template_comment=>'s
template_comment=>'cott user's emp table deployment template',[K
[19C
template_comment=>'ott user's emp table deployment template',[K
[19C
template_comment=>'tt user's emp table deployment template',[K
[19C
template_comment=>'t user's emp table deployment template',[K
[19C
template_comment=>' user's emp table deployment template',[K
[19C
template_comment=>'user's emp table deployment template',[K
[19C
template_comment=>'ser's emp table deployment template',[K
[19C
template_comment=>'er's emp table deployment template',[K
[19C
template_comment=>'r's emp table deployment template',[K
[19C
template_comment=>''s emp table deployment template',[K
[19C
template_comment=>'s emp table deployment template',[K
[19C
template_comment=>' emp table deployment template',[K
[19C
template_comment=>'emp table deployment template',[K
[19C
[33B[K:wq
"afiedt.buf" 10 \u884C\uFF0C239 \u5B57\u7B26
[J[?1l>
1 declare a number;
2 begin
3 a:=dbms_repcat_rgt.create_refresh_template(
4 wner=>'scott',
5 refresh_group_name=>'scott_refg',
6 refresh_template_name=>'scott_refg_dt',
7 template_comment=>'emp table deployment template',
8 public_template=>'N');
9* end;
SQL> r
1 declare a number;
2 begin
3 a:=dbms_repcat_rgt.create_refresh_template(
4 wner=>'scott',
5 refresh_group_name=>'scott_refg',
6 refresh_template_name=>'scott_refg_dt',
7 template_comment=>'emp table deployment template',
8 public_template=>'N');
9* end;
PL/SQL procedure successfully completed.
SQL> begin
2 tempstring:=';
3 /
ERROR:
ORA-01756: quoted string not properly terminated
SQL> declare
2 tempstring varchar2(3000);
3 a number;
4 begin
5 tempstring:='create materialized view scott.emp_mv
6 fre refresh fast with primary key for update as
7 selectx t t empno,ename,job from scott.emp@:dblink';
8 a:=dbms_repcat_rgt.create_template_objet ct(
9 refresh_template_name=>'scott_f refg_dt',
10 object_name=>'m emp_mv',
11 object_type=>'MATERIALIZED VIEW',
12 ddl_text=>tempsring gtri tring,
13 master_rollback_seg=>'rbs');
14 end;
15 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_repcat_rgt.alter_templc ate_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dept emp dblink',
5 new_default_param_value=>'dg1',
6 new_prompt_string=>'enter your master site', :',
7 new_user_override=>'Y');
8 end;
9 /
dbms_repcat_rgt.alter_template_parm(
*
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00306: wrong number or types of arguments in call to 'ALTER_TEMPLATE_PARM'
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
SQL> ed
Wrote file afiedt.buf
[24;1H[?1h="afiedt.buf" 9 \u884C\uFF0C219 \u5B57\u7B26 [H[Jbegin[H
dbms_repcat_rgt.alter_template_parm(
refresh_template_name=>'scott_refg_dt',
parameter_name=>'dblink',
new_default_param_value=>'dg1',
new_prompt_string=>'enter your master site:',
new_user_override=>'Y');
end;
/
~
~
~
~
~
~
~
~
~
~
~
~
~
~[H[23B"afiedt.buf" 9 \u884C\uFF0C219 \u5B57\u7B26[H
new_prompt_string=>'
new_prompt_string=>'nter your master site:',[K
[20C
[17B[K:wq
"afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26
[J[?1l>
1 begin
2 dbms_repcat_rgt.alter_template_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dblink',
5 new_default_param_value=>'dg1',
6 new_prompt_string=>'nter your master site:',
7 new_user_override=>'Y');
8* end;
SQL> r
1 begin
2 dbms_repcat_rgt.alter_template_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dblink',
5 new_default_param_value=>'dg1',
6 new_prompt_string=>'nter your master site:',
7 new_user_override=>'Y');
8* end;
dbms_repcat_rgt.alter_template_parm(
*
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00306: wrong number or types of arguments in call to 'ALTER_TEMPLATE_PARM'
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
SQL> ed
Wrote file afiedt.buf
[24;1H[?1h="afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26 [H[Jbegin[H
dbms_repcat_rgt.alter_template_parm(
refresh_template_name=>'scott_refg_dt',
parameter_name=>'dblink',
new_default_param_value=>'dg1',
new_prompt_string=>'nter your master site:',
new_user_override=>'Y');
end;
/
~
~
~
~
~
~
~
~
~
~
~
~
~
~[H[23B"afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26[H
new_user_override=>'
new_user_override=>'');[Ky');
new_user_override=>'y');
[17B[K:wq
"afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26
[J[?1l>
1 begin
2 dbms_repcat_rgt.alter_template_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dblink',
5 new_default_param_value=>'dg1',
6 new_prompt_string=>'nter your master site:',
7 new_user_override=>'y');
8* end;
SQL> r
1 begin
2 dbms_repcat_rgt.alter_template_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dblink',
5 new_default_param_value=>'dg1',
6 new_prompt_string=>'nter your master site:',
7 new_user_override=>'y');
8* end;
dbms_repcat_rgt.alter_template_parm(
*
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00306: wrong number or types of arguments in call to 'ALTER_TEMPLATE_PARM'
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
SQL> showuse user
USER is "REPADMIN"
SQL> ed
Wrote file afiedt.buf
[24;1H[?1h="afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26 [H[Jbegin[H
dbms_repcat_rgt.alter_template_parm(
refresh_template_name=>'scott_refg_dt',
parameter_name=>'dblink',
new_default_param_value=>'dg1',
new_prompt_string=>'nter your master site:',
new_user_override=>'y');
end;
/
~
~
~
~
~
~
~
~
~
~
~
~
~
~[H[23B"afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26[H
7[6;24r[24;1H
[1;24r8[17B~[K[6;1H7[6;24r8M[1;24r8[18B[K[6;1HCC[K7[6;24r[24;1H
[1;24r8[17B~[6;1Hnew_user_override=>'
new_user_override=>'');[KY');
new_user_override=>'Y');
[18B:wq
"afiedt.buf" 8 \u884C\uFF0C173 \u5B57\u7B26
[J[?1l>
1 begin
2 dbms_repcat_rgt.alter_template_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dblink',
5 new_default_param_value=>'dg1',
6 new_user_override=>'Y');
7* end;
SQL> r
1 begin
2 dbms_repcat_rgt.alter_template_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dblink',
5 new_default_param_value=>'dg1',
6 new_user_override=>'Y');
7* end;
dbms_repcat_rgt.alter_template_parm(
*
ERROR at line 2:
ORA-06550: line 2, column 1:
PLS-00306: wrong number or types of arguments in call to 'ALTER_TEMPLATE_PARM'
ORA-06550: line 2, column 1:
PL/SQL: Statement ignored
SQL> ed
Wrote file afiedt.buf
[24;1H[?1h="afiedt.buf" 8 \u884C\uFF0C173 \u5B57\u7B26 [H[Jbegin[H
dbms_repcat_rgt.alter_template_parm(
refresh_template_name=>'scott_refg_dt',
parameter_name=>'dblink',
new_default_param_value=>'dg1',
new_user_override=>'Y');
end;
/
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~[H[23B"afiedt.buf" 8 \u884C\uFF0C173 \u5B57\u7B26[H
new_default_par
new_default_parm_value=>'dg1',[K[15Dm_value=>'dg1',
new_default_parm_value=>'dg1',
7[6;24r8M[1;24r8[18B[K[6;1HiX
iXi[K[Knew_prompt_string=>'enter master site',
new_prompt_string=>'enter master site',
[18B:wq
"afiedt.buf" 9 \u884C\uFF0C212 \u5B57\u7B26
[J[?1l>
1 begin
2 dbms_repcat_rgt.alter_template_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dblink',
5 new_default_parm_value=>'dg1',
6 new_prompt_string=>'enter master site',
7 new_user_override=>'Y');
8* end;
SQL> r
1 begin
2 dbms_repcat_rgt.alter_template_parm(
3 refresh_template_name=>'scott_refg_dt',
4 parameter_name=>'dblink',
5 new_default_parm_value=>'dg1',
6 new_prompt_string=>'enter master site',
7 new_user_override=>'Y');
8* end;
PL/SQL procedure successfully completed.
SQL> declare
2 a number;
3 begin
4 a:=dbms_repcat_rgt.create_user_parm_value(
5 refresh_template_name=>'scott_refg_dt',
6 parameter_name=>'dblink',
7 user_name=>'scott',
8 para m_value=>'dg1');
9 end;
10 /
PL/SQL procedure successfully completed.
SQL> declare
2 an number;
3 begin
4 a:=dbms_repcat)_ _rgt.create_user_auto horization(
5 user_name>'hr scott',
6 f refresh_template_name=>'scott_f refg_dt');
7 end;
8 /
user_name>'scott',
*
ERROR at line 5:
ORA-06550: line 5, column 1:
PLS-00201: identifier 'USER_NAME' must be declared
ORA-06550: line 4, column 1:
PL/SQL: Statement ignored
SQL> ed
Wrote file afiedt.buf
[24;1H[?1h="afiedt.buf" 8 \u884C\uFF0C137 \u5B57\u7B26 [H[Jdeclare[H
a number;
begin
a:=dbms_repcat_rgt.create_user_authorization(
user_name>'scott',
refresh_template_name=>'scott_refg_dt');
end;
/
~
~[H[23B"afiedt.buf" 8 \u884C\uFF0C137 \u5B57\u7B26[H
user_name=>'scott',[9D
user_name=>'scott',[10D
[19B[K:wq
"afiedt.buf" 8 \u884C\uFF0C138 \u5B57\u7B26
[J[?1l>
1 declare
2 a number;
3 begin
4 a:=dbms_repcat_rgt.create_user_authorization(
5 user_name=>'scott',
6 refresh_template_name=>'scott_refg_dt');
7* end;
SQL> r
1 declare
2 a number;
3 begin
4 a:=dbms_repcat_rgt.create_user_authorization(
5 user_name=>'scott',
6 refresh_template_name=>'scott_refg_dt');
7* end;
PL/SQL procedure successfully completed.
SQL>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-591206/ ,如需转载,请注明出处,否则将追究法律责任。