Para ver el resultado:
Copiar
select * from v$instance
select status from v$instance
select * from v$system_parameter
select value from v$system_parameter where name = 'compatible'
select value from v$system_parameter where name = 'spfile'
select value from v$system_parameter where name = 'control_files'
select value from v$system_parameter where name = 'db_name'
select osuser, username, machine, program from v$session order by osuser
select program Aplicacion, count(program) Numero_Sesiones from v$session group by program order by Numero_Sesiones desc
select username Usuario_Oracle, count(username) Numero_Sesiones from v$session group by username order by Numero_Sesiones desc
select owner, count(owner) Numero from dba_objects group by owner order by Numero desc
select * from dictionary select table_name from dictionary
select * from ALL_ALL_TABLES where upper(table_name) like '%EMPLO%'
select * from ALL_TRIGGERS
select * from user_tables
select * from user_catalog
Select t.tablespace_name "Tablespace", t.status "Estado", ROUND(MAX(d.bytes)/1024/1024,2) "MB Tamaño", ROUND((MAX(d.bytes)/1024/1024) - (SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024),2) "MB Usados", ROUND(SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024,2) "MB Libres", t.pct_increase "% incremento", SUBSTR(d.file_name,1,80) "Fichero de datos" FROM DBA_FREE_SPACE f, DBA_DATA_FILES d, DBA_TABLESPACES t WHERE t.tablespace_name = d.tablespace_name AND f.tablespace_name(+) = d.tablespace_name AND f.file_id(+) = d.file_id GROUP BY t.tablespace_name, d.file_name, t.pct_increase, t.status ORDER BY 1,3 DESC
select * from product_component_version
select * from role_sys_privs
select constraint_name, column_name from sys.all_cons_columns
SELECT table_owner, table_name from sys.all_synonyms where table_owner like 'HR'
SELECT DISTINCT TABLE_NAME FROM ALL_ALL_TABLES WHERE OWNER LIKE 'HR'
SELECT v.name, v.value value, decode(ISSYS_MODIFIABLE, 'DEFERRED', 'TRUE', 'FALSE') ISSYS_MODIFIABLE, decode(v.isDefault, 'TRUE', 'YES', 'FALSE', 'NO') "DEFAULT", DECODE(ISSES_MODIFIABLE, 'IMMEDIATE', 'YES','FALSE', 'NO', 'DEFERRED', 'NO', 'YES') SES_MODIFIABLE, DECODE(ISSYS_MODIFIABLE, 'IMMEDIATE', 'YES', 'FALSE', 'NO', 'DEFERRED', 'YES','YES') SYS_MODIFIABLE , v.description FROM V$PARAMETER v WHERE name not like 'nls%' ORDER BY 1
Select * FROM dba_users
select owner, decode(partition_name, null, segment_name, segment_name || ':' || partition_name) name, segment_type, tablespace_name,bytes,initial_extent, next_extent, PCT_INCREASE, extents, max_extents from dba_segments Where 1=1 And extents > 1 order by 9 desc, 3
select distinct vs.sql_text, vs.sharable_mem, vs.persistent_mem, vs.runtime_mem, vs.sorts, vs.executions, vs.parse_calls, vs.module, vs.buffer_gets, vs.disk_reads, vs.version_count, vs.users_opening, vs.loads, to_char(to_date(vs.first_load_time, 'YYYY-MM-DD/HH24:MI:SS'),'MM/DD HH24:MI:SS') first_load_time, rawtohex(vs.address) address, vs.hash_value hash_value , rows_processed , vs.command_type, vs.parsing_user_id , OPTIMIZER_MODE , au.USERNAME parseuser from v$sqlarea vs , all_users au where (parsing_user_id != 0) AND (au.user_id(+)=vs.parsing_user_id) and (executions >= 1) order by buffer_gets/executions desc
select * from V$DATAFILE
select * from V$TEMPFILE
select * from V$TABLESPACE
select * from V$BACKUP select * from V$ARCHIVE select * from V$LOG select * from V$LOGFILE select * from V$LOGHIST select * from V$ARCHIVED_LOG select * from V$DATABASE
select name,to_number(value) bytes from v$parameter where name ='shared_pool_size' union all select name,bytes from v$sgastat where pool = 'shared pool' and name = 'free memory'
select b.sid, a.username, b.value Cursores_Abiertos from v$session a, v$sesstat b, v$statname c where c.name in ('opened cursors current') and b.statistic# = c.statistic# and a.sid = b.sid and a.username is not null and b.value >0 order by 3
select sum(pins) Ejecuciones, sum(reloads) Fallos_cache, trunc(sum(reloads)/sum(pins)*100,2) Porcentaje_aciertos from v$librarycache where namespace in ('TABLE/PROCEDURE','SQL AREA','BODY','TRIGGER');
SELECT c.sid, d.piece, c.serial#, c.username, d.sql_text FROM v$session c, v$sqltext d WHERE c.sql_hash_value = d.hash_value and upper(d.sql_text) like '%WHERE CAMPO LIKE%' ORDER BY c.sid, d.piece
SELECT c.sid, d.piece, c.serial#, c.username, d.sql_text FROM v$session c, v$sqltext d WHERE c.sql_hash_value = d.hash_value and sid = 105 ORDER BY c.sid, d.piece
select sum(BYTES)/1024/1024 MB from DBA_EXTENTS
select sum(bytes)/1024/1024 MB from dba_data_files
select sum(bytes)/1024/1024 MB from user_segments where segment_type='TABLE' and segment_name='NOMBRETABLA'
select sum(bytes)/1024/1024 Table_Allocation_MB from user_segments where segment_type in ('TABLE','INDEX') and (segment_name='NOMBRETABLA' or segment_name in (select index_name from user_indexes where table_name='NOMBRETABLA'))
select sum(vsize('NOMBRECOLUMNA'))/1024/1024 MB from NOMBRETABLA
SELECT owner, SUM(BYTES)/1024/1024 FROM DBA_EXTENTS MB GROUP BY owner
SELECT SEGMENT_TYPE, SUM(BYTES)/1024/1024 FROM DBA_EXTENTS MB GROUP BY SEGMENT_TYPE
SELECT SEGMENT_NAME, SUM(BYTES)/1024/1024 FROM DBA_EXTENTS MB GROUP BY SEGMENT_NAME ORDER BY 2 DESC
SELECT distinct object_name FROM all_arguments WHERE package_name = 'STANDARD' order by object_name
select * from DBA_ROLES
select privilege from dba_sys_privs where grantee = 'NOMBRE_ROL'
select utl_inaddr.get_host_address IP from dual
select username, action_name, priv_used, returncode from dba_audit_trail
select name, value from v$parameter where name like 'audit_trail'
[oragrid@exa2adbadm01 ~]$ crsctl query crs activeversion Oracle Clusterware active version on the cluster is [12.1.0.0.0]
Run the pre root script. As the root user execute: # /crs/install/rootcrs.pl -unlock
/u01/app/grid/12.1.0.2/OPatch/opatch napply -oh /u01/app/grid/12.1.0.2 -local -silent /u01/patches/BP/26610322/26609798 /u01/app/grid/12.1.0.2/OPatch/opatch napply -oh /u01/app/grid/12.1.0.2 -local -silent /u01/patches/BP/26610322/26609945 /u01/app/grid/12.1.0.2/OPatch/opatch napply -oh /u01/app/grid/12.1.0.2 -local -silent /u01/patches/BP/26610322/25869830 /u01/app/grid/12.1.0.2/OPatch/opatch napply -oh /u01/app/grid/12.1.0.2 -local -silent /u01/patches/BP/26610322/21436941 /u01/app/grid/12.1.0.2/OPatch/opatch napply -oh /u01/app/grid/12.1.0.2 -local -silent /u01/patches/ONEOFF/23727148 exit
As the root user execute: # /rdbms/install/rootadd_rdbms.sh # /crs/install/rootcrs.pl -patch
[oragrid@exa2adbadm01 ~]$ crsctl query crs activeversion Oracle Clusterware active version on the cluster is [12.1.0.2.0]
[oragrid@exa2adbadm01 ~]$ crsctl status resource -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA_EXA2A.dg ONLINE ONLINE exa2adbadm01 STABLE ONLINE ONLINE exa2adbadm02 STABLE ora.DBFS_DG.dg ONLINE ONLINE exa2adbadm01 STABLE ONLINE ONLINE exa2adbadm02 STABLE ora.LISTENER.lsnr ONLINE ONLINE exa2adbadm01 STABLE ONLINE ONLINE exa2adbadm02 STABLE ora.RECO_EXA2A.dg ONLINE ONLINE exa2adbadm01 STABLE ONLINE ONLINE exa2adbadm02 STABLE ora.asm ONLINE ONLINE exa2adbadm01 Started,STABLE ONLINE ONLINE exa2adbadm02 Started,STABLE ora.net1.network ONLINE ONLINE exa2adbadm01 STABLE ONLINE ONLINE exa2adbadm02 STABLE ora.ons ONLINE ONLINE exa2adbadm01 STABLE ONLINE ONLINE exa2adbadm02 STABLE
Lo importante en todo esto, es estar dentro del catalogo correspondiente, sino el crosscheck NO FNCIONA !! oracle backup of logfiles is ...