Option 1:
If schema refresh is carried out by dropping schema then Created column in DBA_USERS will give the answer.
| Select username,created from dba_users where username='USR40'; USERNAME CREATED |
Option 2:
If schema refresh is carried out by dropping the tables, then we can check the created and last_ddl_time in DBA_OBJECTS
| SELECT OWNER,OBJECT_NAME,CREATED,LAST_DDL_TIME FROM DBA_OBJECTS WHERE OWNER='USR40'
|
| col owner format a15 |
Error:
| ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ORA-06512: at "SIV.PKG1_CHG_DB_CNFG", |
Investigation:
Find the locking sessions
| select do.owner,do.object_name,do.object_type,dl.session_id,vs.serial#, vs.program,vs.machine,vs.osuser |
Solution:
Kill the session locking the object then resubmit
| alter system kill sessions 'sid,serial#' immediate; |
The query will return the backup status and timings of database backups -
Run the query run in the database, not on the catalog.
Login as sysdba -
This script will report on all backups – full, incremental and archivelog backups -
| col STATUS format a9 |
Query
| SQL> SET long 200000000 |
Output
| DBMS_METADATA.GET_DDL('USER','SIVA') CREATE USER "SIVA" IDENTIFIED BY VALUES 'S:1A6727A1D45324587FCFCFEAD63BBD96B |
| SET lines 120 pages 100 select * from DBA_ROLE_PRIVS where GRANTEE = 'SIVA'; select * from DBA_SYS_PRIVS where GRANTEE = 'SIVA'; select * from DBA_TAB_PRIVS where GRANTEE = ‘SIVA’'; select * from dba_ts_quotas where username = 'SIVA'; |
| select username from dba_users minus select distinct owner from dba_objects ; |
| select distinct owner from dba_objects |
In Oracle Schema defined as;
A schema is a collection of logical structures of data, or schema objects.
A schema is owned by a database user and has the same name as that user.
| SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner |
Option 1:
| select status from v$instance; |
| select open_mode from v$database; |
Option 3:
Search Alert Log for string of “Database” or “alter database”.
Method 1: By Querying
1. Query dba_hist_snapshot to find the snap id for the interval you are looking for.
| SELECT dbid, snap_id, begin_interval_time, end_interval_time from dba_hist_snapshot |
2.
| spool siv_awr_201109.lst |
Method 2:
| @?/rdbms/admin/awrrpt.sql |
| @?/rdbms/admin/awrrpti.sql | Script can be used for the specified database and instance so the script in addition will prompt for dbid and instance number. |
| @?/rdbms/admin/awrddrpt.sql | Script can be used to generate a combine report of 2 different snapshots for comparison of performance in one report so it will prompt for two pairs of snapshot snapshots to compare against. |
| @?/rdbms/admin/awrinfo.sql | Script print AWR information like space usage by AWR, subset of AWR snap ids, Automatic Database Diagnostic Monitor (ADDM), Active Session History (ASH) information. |
Error: ORA-00980: synonym translation is no longer valid
Cause:
1. Synonym created on non-existing object by mistake.
2. The synonyms referencing the object is dropped but synonym is not dropped
3. Dropped a user, but the synonyms referencing the objects owned by that dropped user.
Query to find the invalid synonyms
| select * from dba_synonyms s |
select'drop '||decode (s.owner,'PUBLIC','PUBLIC SYNONYM ','SYNONYM'||s.owner||'.')||s.synonym_name||';'fromdba_synonyms swheretable_owner not in('SYSTEM','SYS')anddb_link is nullandnot exists(select 1from dba_objects owhere s.table_owner=o.ownerand s.table_name=o.object_name)The query above generate the script to drop the synonyms whose translation is no longer valid
1. How to check Unix O.S Version?
uname -a
2. How to check Oracle Version?
select * from v$version;
3. How to find the Start up time of Oracle Instance?
SELECT instance_name,host_name,
TO_CHAR(startup_time,'DD-MON-YYY HH:MM:SS AM')
FROM v$instance;