Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
-
Spool respcal.sql
SQL> select 'alter tablespace '||tablespace_name||' begin backup;' from
dba_data_files;
'ALTERTABLESPACE'||TABLESPACE_NAME||'BEGINBACKUP;'
-------------------------------------------------------------
alter tablespace USERS begin backup;
alter tablespace SYSAUX begin backup;
alter tablespace UNDOTBS1 begin backup;
alter tablespace SYSTEM begin backup;
alter tablespace EXAMPLE begin backup;
'!TAR-CVF/U01/RESPALDO/'||TABLESPACE_NAME||'.TAR'||FILE_NAME||''
--------------------------------------------------------------------------------
!tar -cvf /u01/respaldoUSERS.tar /u01/app/oracle/oradata/admonbd2/users01.dbf
!tar -cvf /u01/respaldoSYSAUX.tar /u01/app/oracle/oradata/admonbd2/sysaux01.dbf
!tar -cvf /u01/respaldoUNDOTBS1.tar /u01/app/oracle/oradata/admonbd2/undotbs01.
dbf
'ALTERTABLESPACE'||TABLESPACE_NAME||'ENDBACKUP;'
-----------------------------------------------------------
alter tablespace USERS end backup;
alter tablespace SYSAUX end backup;
alter tablespace UNDOTBS1 end backup;
alter tablespace SYSTEM end backup;
alter tablespace EXAMPLE end backup;
3.-
SQL> !imp system/admonbd2 file=/u01/expscott.dmp fromuser=scott
touser=hr
TABLE_NAME TABLE_TYPE
------------------------------ -----------
REGIONS TABLE
COUNTRIES TABLE
LOCATIONS TABLE
DEPARTMENTS TABLE
JOBS TABLE
EMPLOYEES TABLE
JOB_HISTORY TABLE
LOCATIONS_SEQ SEQUENCE
DEPARTMENTS_SEQ SEQUENCE
EMPLOYEES_SEQ SEQUENCE
EMP_DETAILS_VIEW VIEW
TABLE_NAME TABLE_TYPE
------------------------------ -----------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE
15 rows selected.
SQL> select owner,table_name,constraint_name from dba_constraints
where owner like '%HR%';
OWNER TABLE_NAME
------------------------------ ------------------------------
CONSTRAINT_NAME
------------------------------
HR REGIONS
REG_ID_PK
HR REGIONS
REGION_ID_NN
HR COUNTRIES
COUNTRY_C_ID_PK
HR COUNTRIES
COUNTR_REG_FK
HR COUNTRIES
COUNTRY_ID_NN
HR LOCATIONS
LOC_ID_PK
HR LOCATIONS
LOC_C_ID_FK
HR LOCATIONS
LOC_CITY_NN
HR DEPARTMENTS
DEPT_ID_PK
HR DEPARTMENTS
DEPT_LOC_FK
HR DEPARTMENTS
DEPT_MGR_FK
HR DEPARTMENTS
DEPT_NAME_NN
HR JOBS
JOB_ID_PK
HR JOBS
JOB_TITLE_NN
HR EMPLOYEES
EMP_EMP_ID_PK
HR EMPLOYEES
EMP_EMAIL_UK
HR EMPLOYEES
EMP_DEPT_FK
HR EMPLOYEES
EMP_JOB_FK
HR EMPLOYEES
EMP_MANAGER_FK
HR EMPLOYEES
EMP_SALARY_MIN
HR EMPLOYEES
EMP_JOB_NN
HR EMPLOYEES
EMP_HIRE_DATE_NN
HR EMPLOYEES
EMP_EMAIL_NN
HR EMPLOYEES
EMP_LAST_NAME_NN
HR JOB_HISTORY
JHIST_EMP_ID_ST_DATE_PK
HR JOB_HISTORY
JHIST_DEPT_FK
HR JOB_HISTORY
JHIST_JOB_FK
HR JOB_HISTORY
JHIST_EMP_FK
HR JOB_HISTORY
JHIST_DATE_INTERVAL
HR JOB_HISTORY
JHIST_JOB_NN
HR JOB_HISTORY
JHIST_END_DATE_NN
HR JOB_HISTORY
JHIST_START_DATE_NN
HR JOB_HISTORY
JHIST_EMPLOYEE_NN
HR EMP_DETAILS_VIEW
SYS_C005383
34 rows selected.
4.-
SQL> !imp system/admonbd2 file=/u01/sia_full.dmp fromuser=deptos
touser=dept rows=no
"ODO","A?O","ID","MATERIA_TXT","CREDITOS","CARRERA_ID","PLAN_ID","
ESP_ID","B"
"LOQUE","PROF_ID","PROF_TXT","CAPACIDAD","INSCRITOS","H_LUN","H_MA
R","H_MIE""
","H_JUE","H_VIE","GPO_REAL") AS "
"SELECT hg.periodo, hg.a?o, hg.id, m.nom_cto, m.creditos,
hg.carrera_id, hg."
"plan_id, hg.esp_id, hg.bloque, hg.prof_id, p.apellidos||'
'||p.nombre, hg.c"
"apacidad,"
" hg.inscritos, hg.h_lun, hg.h_mar, hg.h_mie, hg.h_jue,
hg.h_vie, hg"
".gpo_real"
" FROM hist_grupos hg, ser_esc.materias m, rec_hum.profesores
p"
" WHERE m.id=TRUNC(hg.id/100) AND p.id(+)=hg.prof_id"
IMP-00003: ORACLE error 911 encountered
ORA-00911: invalid character
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_VW" TO "SER_ESC""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_VW" TO "SE01""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_VW" TO "SE02""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_VW" TO "DEP""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_VW" TO "DIRECTOR""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_VW" TO "SUBACA""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 911:
"CREATE FORCE VIEW "DEPT"."HIST_GRUPOS_PROF_VW"
("
""PERIODO","A?O","ID","CARRERA_ID","PLAN_ID","ESP_ID","PROF_ID","H
_LUN","H_M"
"AR","H_MIE","H_JUE","H_VIE","PROFESOR","MATERIA","CARRERA","ESPEC
IALIDAD") "
"AS "
"SELECT hg.periodo, hg.a?o, hg.id, hg.carrera_id, hg.plan_id,
hg.esp_id, hg."
"prof_id, hg.h_lun,"
" hg.h_mar, hg.h_mie, hg.h_jue, hg.h_vie,
pr.apellidos||' '|"
"|pr.nombre profesor,"
" m.nombre materia,c.nom_cto carrera, e.nombre
especialidad"
" FROM DEPTOS.hist_grupos hg, REC_HUM.profesores pr,
SER_ESC.mate"
"rias m,"
" SER_ESC.carreras c, SER_ESC.especialidades e"
" WHERE (c.id=TRUNC(hg.plan_id/100)) AND"
" (e.plan_id=hg.plan_id AND e.id=hg.esp_id) AND"
" (hg.prof_id=pr.id) AND"
" (m.id=TRUNC(hg.id/100)) AND"
" (periodo,a?o) in"
" ( SELECT p1.NUM, p2.NUM"
" FROM SIA.PARAMETROS p1,SIA.PARAMETROS p2"
" WHERE p1.ID='PER_ACTUAL' and
p2.id='A?O_ACTUAL')"
IMP-00003: ORACLE error 911 encountered
ORA-00911: invalid character
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_VW" TO "SER_ESC""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_VW" TO "SE01""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_VW" TO "SE02""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_VW" TO "DEP""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_VW" TO "DIRECTOR""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_VW" TO "SUBACA""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 911:
"CREATE FORCE VIEW "DEPT"."HIST_GRUPOS_ACTUAL_VW"
"
"
("PERIODO","A?O","ID","CARRERA_ID","PLAN_ID","ESP_ID","GPO_REAL","
PROF_ID""
","H_LUN","H_MAR","H_MIE","H_JUE","H_VIE","PROFESOR","MATERIA","CA
RRERA","ES"
"PECIALIDAD") AS "
"SELECT hg.periodo, hg.a?o, hg.id, hg.carrera_id, hg.plan_id,
hg.esp_id,hg.g"
"po_real,hg.prof_id, hg.h_lun,"
" hg.h_mar, hg.h_mie, hg.h_jue, hg.h_vie,
pr.apellidos||' '|"
"|pr.nombre profesor,"
" m.nombre materia,"
" c.nom_cto carrera, e.nombre especialidad"
" FROM DEPTOS.hist_grupos hg, REC_HUM.profesores pr,
SER_ESC.mate"
"rias m,"
" SER_ESC.carreras c, SER_ESC.especialidades e"
" WHERE (c.id=TRUNC(hg.plan_id/100)) AND"
" (e.plan_id=hg.plan_id AND e.id=hg.esp_id) AND"
" (hg.prof_id=pr.id) AND"
" (m.id=TRUNC(hg.id/100)) AND"
" (HG.PERIODO,HG.A?O) IN"
" ( SELECT p1.NUM, p2.NUM"
" FROM SIA.PARAMETROS p1,SIA.PARAMETROS p2"
" WHERE p1.ID='PER_ACTUAL' and
p2.id='A?O_ACTUAL')"
IMP-00003: ORACLE error 911 encountered
ORA-00911: invalid character
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_ACTUAL_VW" TO "SER_ESC""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_ACTUAL_VW" TO "SE01""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_ACTUAL_VW" TO "SE02""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_ACTUAL_VW" TO "DEP""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_ACTUAL_VW" TO "DIRECTOR""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_ACTUAL_VW" TO "SUBACA""
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 911:
"CREATE FORCE VIEW "DEPT"."HIST_GRUPOS_PROF_CAL_VW"
"
"
("PERIODO","A?O","ID","CARRERA_ID","PLAN_ID","ESP_ID","PROF_ID","H
_LUN","
""H_MAR","H_MIE","H_JUE","H_VIE","PROFESOR","MATERIA","CARRERA","E
SPECIALIDA"
"D") AS "
"SELECT hg.periodo, hg.a?o, hg.id, hg.carrera_id, hg.plan_id,
hg.esp_id, hg."
"prof_id, hg.h_lun,"
" hg.h_mar, hg.h_mie, hg.h_jue, hg.h_vie,
pr.apellidos||' '|"
"|pr.nombre profesor,"
" m.nombre materia,c.nom_cto carrera, e.nombre
especialidad"
" FROM DEPTOS.hist_grupos hg, REC_HUM.profesores pr,
SER_ESC.mate"
"rias m,"
" SER_ESC.carreras c, SER_ESC.especialidades e"
" WHERE (c.id=TRUNC(hg.plan_id/100)) AND"
" (e.plan_id=hg.plan_id AND e.id=hg.esp_id) AND"
" (hg.prof_id=pr.id) AND"
" (m.id=TRUNC(hg.id/100)) AND"
" (hg.prof_id=SUBSTR(USER,6)) AND"
" (periodo,a?o) in"
" ( SELECT HGA.NUM,HGB.NUM"
" FROM SIA.PARAMETROS HGA,SIA.PARAMETROS HGB"
" WHERE hga.ID='PER_ACTUAL' and
hgb.id='A?O_ACTUAL')"
IMP-00003: ORACLE error 911 encountered
ORA-00911: invalid character
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_CAL_VW" TO "SER_ESC" WITH
GRANT OPTION"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_CAL_VW" TO "SE01" WITH GRANT
OPTION"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
IMP-00017: following statement failed with ORACLE error 942:
"GRANT SELECT ON "HIST_GRUPOS_PROF_CAL_VW" TO "SE02" WITH GRANT
OPTION"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
Import terminated successfully with warnings.
5.-
SQL> create tablespace rman_tab datafile '/u01/rman_tab' size 10m
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
Tablespace created.
User created.
Grant succeeded.
Grant succeeded.
SQL> !rman