domingo, 26 de enero de 2014

"Un camino de mil millas comienza con un solo paso." Lao Tsé

"La confianza en sí mismo es el primer secreto del éxito."-Ralph W. Emerson.

domingo, 9 de junio de 2013

sinonimos


 DROP  PUBLIC  SYNONYM tabla_sinonimo1;
 DROP  PUBLIC  SYNONYM tabla_sinonimo2;
 DROP  PUBLIC  SYNONYM tabla_sinonimo3;
 DROP  PUBLIC  SYNONYM tabla_sinonimo4;
COMMIT;

 CREATE   PUBLIC  SYNONYM tabla_sinonimo1   FOR esquema1.tabla1;
 CREATE   PUBLIC  SYNONYM tabla_sinonimo2   FOR esquema1.tabla2;
COMMIT:
-------------------------

Pueden estar mal generados sin embargo:


SELECT ' *

 FROM ALL_TABLES WHERE OWNER in ('esquema1','esquema2', 'esquema3','esquema4', 'esquema5','esquema6')
 AND  TABLE_NAME='tabla1'



 select *
from DBA_synonyms where
--TABLE_OWNER in ('esquema1','esquema6', 'esquema2','esquema3', 'esquema4','esquema5')
-- AND
TABLE_NAME='tab'le1


--- LOS BUSCAMOS COMO TABLAS

-- PARA VER SU ESQUEMA



SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'table1' UNION
SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'table2' UNION
SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'table3' UNION
SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'table4' UNION
SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'table5' UNION
SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'table6' UNION
SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'table7' UNION
SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'table8' UNION
ORDER BY 2,1
-------------------------------------------------
ALTER TABLE esquema1.tabla1MOVE TABLESPACE tbspace1;


--------------------------------


SELECT * FROM dba_objects  WHERE status = 'INVALID'


SELECT DISTINCT owner  FROM all_synonyms;

SELECT *  FROM all_synonyms;


-------------------------------


select s.TABLE_OWNER, count(*)Cantidad from all_synonyms s
where not exists(select 1 from all_objects o where s.TABLE_OWNER=o.OWNER and s.TABLE_NAME=o.OBJECT_NAME )
and owner not in ('SYS','SYSTEM')
group by s.TABLE_OWNER;


SELECT *  FROM USER_synonyms;




SELECT sy.OWNER, sy.SYNONYM_NAME, sy.TABLE_OWNER, sy.TABLE_NAME, ta.TABLESPACE_NAME
FROM user_tables ta, all_synonyms sy
WHERE ta.TABLE_NAME = sy.TABLE_NAME


SELECT sy.SYNONYM_NAME, sy.TABLE_OWNER, sy.TABLE_NAME, ta.TABLESPACE_NAME
FROM user_tables ta, user_synonyms sy
WHERE ta.TABLE_NAME = sy.TABLE_NAME


SELECT * FROM dba_synonyms



SELECT * FROM ALL_TABLES;



--- ==============================
--- &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&



SELECT    'CREATE PUBLIC SYNONYM '
       || synonym_name
       || ' FOR '
       || table_owner
       || '.'
       || table_name
       || ';'
  FROM dba_synonyms
WHERE   TABLE_OWNER = 'esquema1' OR TABLE_OWNER = 'esquema2' OR  TABLE_OWNER = 'esquema3'
OR TABLE_OWNER = 'esquema4'  OR TABLE_OWNER = 'esquema5' OR   TABLE_OWNER = 'esquema6'



select 'CREATE SYNONYM '||SYNONYM_NAME||' FOR '||TABLE_OWNER||'.'||TABLE_NAME||';'
from DBA_synonyms where TABLE_OWNER in ('esquema1','esquema2');



En cada esquema de origen en la BD de origen ejecutar las siguientes querys:

Sinónimos:

select 'CREATE SYNONYM '||SYNONYM_NAME||' FOR '||TABLE_OWNER||'.'||TABLE_NAME||';' from user_synonyms where TABLE_OWNER in ('UN_ESQUEMA','OTRO_ESQUEMA');

Privilegios:
select 'GRANT '||PRIVILEGE||' ON '||TABLE_NAME||' TO '||GRANTEE||';' from all_tab_privs_made where GRANTOR='MI_ESQUEMA' and GRANTEE='OTROS_ESQUEMAS';

Secuencias:
select 'CREATE SEQUENCE '||sequence_name||' START WITH '||to_char(last_number+1)||';' from user_sequences order by sequence_name;


replace public synonym suppliers
for app.suppliers;

drop [public] synonym [schema .] synonym_name [force];


CREATE PUBLIC SYNONYM WCTG_REG FOR CB_CVP_001.WCTG_REG;

Drop PUBLIC  SYNONYM  WCTG_REG;
           ROLLBACK;

select ' DROP  PUBLIC  SYNONYM '||SYNONYM_NAME||';'
from DBA_synonyms where TABLE_OWNER in ('esquema1','esquema2', 'esquema3','esquema4', 'esquema5'   );


select ' CREATE   PUBLIC  SYNONYM '||SYNONYM_NAME||' FOR '||TABLE_OWNER||'.'||TABLE_NAME||';'

from DBA_synonyms where TABLE_OWNER in ('esquema1');


select ' CREATE   PUBLIC  SYNONYM '||SYNONYM_NAME||' FOR '||TABLE_OWNER||'.'||TABLE_NAME||';'

from DBA_synonyms where TABLE_OWNER in ('esquema1','esquema2', 'esquema4','esquema5', 'esquema6'   );


--  WHERE   TABLE_OWNER = 'esquema1' OR TABLE_OWNER = 'esquema2' OR  TABLE_OWNER = 'esquema3'
-- OR TABLE_OWNER = 'esquema4'  OR TABLE_OWNER = 'esquema5' OR   TABLE_OWNER = 'esquema6'



SELECT * from DBA_synonyms;

-- REPLACE  PUBLIC SYNONYM tabla1 FOR esquema1.tabla1;


SELECT * FROM dba_objects   --WHERE OBJECT_NAME = 'tabla1' AND  OBJECT_TYPE ='SYNONYM'

 where status = 'INVALID'



viernes, 20 de julio de 2012

SPC Servicio Profesional de Carrera


Campus México 

Descarga del Servicio Profesional de Carrera para Concurso.

http://www.rhnet.gob.mx/sse_generico/espanol/sse_descargas_campus_temp.jsp


El Aprendizaje

http://www.rhnet.gob.mx/camp_1/espanol/Aprendizaje.jsp

1.- Visión del Servicio Público

1.1. Integridad.
1.2. Transparecnia.
1.3. Rendición de cuentas.
1.4. Bien Común.


2.- Gerenciales o directivas.

2.1. Visión Estrátegica.
2.2. Liderazgo.
2.3. Orientación a Resultados.
2.4. Trabajo en equipo.
2.5. Negociación.

3.- Técnicas Transversales

3.1. Visión Profesional de la Administración Pública Federal.

4.- Técnicas Especificas