ITPub博客

首页 > Linux操作系统 > Linux操作系统 > setting up deployment template---part 2

setting up deployment template---part 2

原创 Linux操作系统 作者:wisdomone1 时间:2009-04-21 13:18:34 0 删除 编辑

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流程图

http://picasaweb.google.com/wisdomone1/Oracle10gAdvancedReplicationRelatedPicture#5327010924369179010

1,before setting up deployment template ,for supportting fast refresh for mv

begin setting up deployment template

  step1 create the deployment template

clear
bash-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
[?1h="afiedt.buf" 10 \u884C\uFF0C252 \u5B57\u7B26 declare a number;
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;
/

~"afiedt.buf" 10 \u884C\uFF0C252 \u5B57\u7B26

 

 

template_comment=>'s
template_comment=>'cott user's emp table deployment template',

template_comment=>'ott user's emp table deployment template',

template_comment=>'tt user's emp table deployment template',

template_comment=>'t user's emp table deployment template',

template_comment=>' user's emp table deployment template',

template_comment=>'user's emp table deployment template',

template_comment=>'ser's emp table deployment template',

template_comment=>'er's emp table deployment template',

template_comment=>'r's emp table deployment template',

template_comment=>''s emp table deployment template',

template_comment=>'s emp table deployment template',

template_comment=>' emp table deployment template',

template_comment=>'emp table deployment template',

:wq
"afiedt.buf" 10 \u884C\uFF0C239 \u5B57\u7B26
[?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
[?1h="afiedt.buf" 9 \u884C\uFF0C219 \u5B57\u7B26 begin
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;
/
~
~
~
~
~
~
~
~
~
~
~
~
~
~"afiedt.buf" 9 \u884C\uFF0C219 \u5B57\u7B26

 


new_prompt_string=>'
new_prompt_string=>'nter your master site:',


:wq
"afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26
[?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
[?1h="afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26 begin
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;
/
~
~
~
~
~
~
~
~
~
~
~
~
~
~"afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26

 

 

new_user_override=>'
new_user_override=>'');y');
new_user_override=>'y');
:wq
"afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26
[?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
[?1h="afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26 begin
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;
/
~
~
~
~
~
~
~
~
~
~
~
~
~
~"afiedt.buf" 9 \u884C\uFF0C218 \u5B57\u7B26

 


7
8~78M8CC7
8~new_user_override=>'
new_user_override=>'');Y');
new_user_override=>'Y');
:wq
"afiedt.buf" 8 \u884C\uFF0C173 \u5B57\u7B26
[?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
[?1h="afiedt.buf" 8 \u884C\uFF0C173 \u5B57\u7B26 begin
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;
/
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~"afiedt.buf" 8 \u884C\uFF0C173 \u5B57\u7B26

 

new_default_par
new_default_parm_value=>'dg1',m_value=>'dg1',
new_default_parm_value=>'dg1',
78M8iX
iXinew_prompt_string=>'enter master site',
new_prompt_string=>'enter master site',
:wq
"afiedt.buf" 9 \u884C\uFF0C212 \u5B57\u7B26
[?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
[?1h="afiedt.buf" 8 \u884C\uFF0C137 \u5B57\u7B26 declare
a number;
begin
a:=dbms_repcat_rgt.create_user_authorization(
user_name>'scott',
refresh_template_name=>'scott_refg_dt');
end;
/
~
~"afiedt.buf" 8 \u884C\uFF0C137 \u5B57\u7B26

 

user_name=>'scott',
user_name=>'scott',
:wq
"afiedt.buf" 8 \u884C\uFF0C138 \u5B57\u7B26
[?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博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-591206/,如需转载,请注明出处,否则将追究法律责任。

下一篇: setting up a mv group
请登录后发表评论 登录
全部评论
提供针对oracle初学者及进阶的数据库培训,欢迎大家咨询: 微信: wisdomone 微信公众号: lovedb qq: 305076427 微博: wisdomone9

注册时间:2008-04-04

  • 博文量
    2150
  • 访问量
    11860684