title: Create user through procedure on another database via database link
body: <p>I'd like to create users through procedure on another database via database link.I am getting error while executing procedure.
  Here are the code which i used.</p>
  
  <pre><code>create or REPLACE PROCEDURE hostname   
  (host_name in varchar2,user_name in VARCHAR2, pass_word in VARCHAR2,    
  table_space in varchar2,pro_file in varchar2)    
  as    
  db_link_name varchar2(30);    
  begin    
  select db_link into db_link_name from all_db_links where host=host_name;    
  EXECUTE IMMEDIATE 'dbms_utility.exec_ddl_statement@'||db_link_name||('CREATE     USER '||user_name||' IDENTIFIED BY '||pass_word||'     
  DEFAULT TABLESPACE '||table_space||' PROFILE '|| pro_file||' ACCOUNT UNLOCK');    
  EXECUTE IMMEDIATE 'dbms_utility.exec_ddl_statement@'||db_link_name||    
  ('GRANT CONNECT,RESOURCE,EXECUTE_CATALOG_ROLE,Create table,create session,create     view,create sequence,create procedure,create job,create synonym TO '||user_name);    
  end;    
  /    
  execute hostname('orcl1','rahul1','rahul','users','default');    
  </code></pre>
  
  <blockquote>
    <p>Error:     ORA-00900: invalid SQL statement     ORA-06512: at
    "SYS.HOSTNAME", line 6     ORA-06512: at line 1<br>
    00900. 00000 -  "invalid SQL statement"<br>
    *Cause:<br>
    *Action:</p>
  </blockquote>