Posts

How to rename a Pluggable database in oracle database?

How to  rename a Pluggable database??? SQL> -- we will change the  name of container database STSPDB to WALPDB SQL> show pdbs     CON_ID CON_NAME                       OPEN MODE  RESTRICTED ---------- ------------------------------ ---------- ----------          3 STSPDB                         READ WRITE NO SQL> shutdown immediate; Pluggable Database closed. SQL> SQL> SQL> show pdbs     CON_ID CON_NAME                       OPEN MODE  RESTRICTED ---------- ------------------------------ ---------- ----------           3 STSPDB                         MOUNTED SQL> startup open restrict; Pluggable Database opened...

Oracle database failover

#################################FAIL OVER#################################### --Primary Database Crushes Due to several reason like Hardware failure. On Standby Database: #Stop Redo Apply:-   ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; #Finish applying all received redo data:- ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH; #Verify that the target standby database is ready to become a primary database:- SELECT SWITCHOVER_STATUS FROM V$DATABASE; #A value of either TO PRIMARY or SESSIONS ACTIVE indicates that the standby database is ready to be switched to the primary role. #Perform failover: ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN; /* Session shutdown is optional if  switchover status returns TO_PRIMARY */ srvctl status database -d ORCL_PRODRAC2 -v Thanks & Regards Nikhil Kumar.

AWR (automatic workload repository) of Oracle

#################### AWR (automatic workload repository) of Oracle #################### Retention period of AWR report: select retention from dba_hist_wr_control; /*If we have more than 7 days,we can reduce it to 7 day which is 7*24*60 = 10080 minutes. the retention period is modified to 7 days (10080 minutes) and  the interval between each snapshot is 60 minutes through below query. */ execute dbms_workload_repository.modify_snapshot_settings (interval => 60,retention => 10080); In case while reducing the retention period if we face an  error then check the MOVING_WINDOW_SIZE value with below query SELECT moving_window_size FROM dba_hist_baseline WHERE baseline_type = 'MOVING_WINDOW'; exec DBMS_WORKLOAD_REPOSITORY.modify_baseline_window_size( window_size =>7); Then update it to correct value and then execute the above AWR retention query. execute dbms_workload_repository.modify_snapshot_settings (interval => 60,retention => 10080); Once the...

Sysaux tablespace and it's object

Image
#################Check whats occupying SYSAUX tablespace######################## SQL> --Check whats occupying SYSAUX tablespace: SQL> --Occupent occupying space  in sysaux tablespac SQL> SQL> set pages 333 lines 222 SQL> select occupant_name,occupant_desc,space_usage_kbytes from v$sysaux_occupants; Thanks & Regards Nikhil Kumar.

How to find the assigned privileges to a user in oracle database

How to find the assigned privileges to a user in oracle database : In order to find this, below queries will be helpful. 1) select dbms_metadata.get_granted_ddl('ROLE_GRANT','&SCHEMA') from dual union all select dbms_metadata.get_granted_ddl('SYSTEM_GRANT','&&SCHEMA') from dual; 2) select * from dba_role_privs connect by prior granted_role = grantee start with grantee = '&SCHEMA' order by 1,2,3;  select * from dba_sys_privs  where grantee = '&&SCHEMA' or grantee in (select granted_role from dba_role_privs connect by prior granted_role = grantee start with grantee = '&&SCHEMA') order by 1,2,3; select * from dba_tab_privs  where grantee = '&&SCHEMA' or grantee in (select granted_role from dba_role_privs connect by prior granted_role = grantee start with grantee = '&&SCHEMA') order by 1,2,3,4; Thanks & Regards Nikhil Kumar.   

Oracle database interview questions

Explain Logical structure of the database. Explain Physical structure of the database. What is difference between hot and cold backup. what are your day to day activity. what steps and checks will you take if application team informs you that they are getting slowness? Explain what do you understand by blocking and locking. what can cause the archive log gap issue in standby database and how do you intend to solve it? what are the different parameters required for oracle standby database? what is the enhanced feature in 12c? what is startup sequence for oracle rac? how to create grid database? how to restore database? explain in details. what are the deamon processes in rac? overview of cluster configuration. how to check long running queries?  how to take archive log backup? what is difference between L0 backup and database full backup? explain backup policy in RMAN. why OCR and voting disks are required? How to convert physical standby da...

Calculate oracle database size.

select "Reserved_Space(GB)", "Reserved_Space(GB)" - "Free_Space(GB)" "Used_Space(GB)","Free_Space(GB)" from( select (select sum(bytes/(1024*1024*1024)) from dba_data_files) "Reserved_Space(GB)", (select sum(bytes/(1024*1024*1024)) from dba_free_space) "Free_Space(GB)" from dual ); Note: Used space is the actual database size. Thanks & Regards Nikhil Kumar.