Posts

Calculate the Space Requirements

Sl. No.   Task           Command 1.   Undo tablespace undo_space = UNDO_RETENTION * UPS + overhead undo_space= no. of undo blocks. UNDO_RETENTION= UNDO_RETENTION parameter value (in seconds). UPS= no. of undo blocks for each second. overhead= minimal overhead for metadata (transaction tables, etc.). SQL>  SELECT ur.value AS undo_retention_seconds, ups.ups_blocks_per_sec, dbs.dbs_bytes, ROUND((ur.value * (ups.ups_blocks_per_sec * dbs.dbs_bytes)) / (1024*1024*1024), 2) AS undo_space_gb FROM (SELECT value FROM v$parameter WHERE name = 'undo_retention') ur,  (SELECT SUM(undoblks) / NULLIF(SUM((end_time - begin_time) * 86400), 0) AS ups_blocks_per_sec     FROM v$undostat) ups,  (SELECT block_size AS dbs_bytes     FROM dba_tablespaces     WHERE tablespace_name = (SELECT value FROM v$parameter WHERE name = 'undo_tablespace')) ...

DDL Commands

Sl. No.   Task           Command 1. TABLE DDL      select dbms_metadata.get_ddl('TABLE','&TABLE_NAME','&OWNER') from dual; 2. INDEX DDL select dbms_metadata.get_ddl('INDEX','&INDEX_NAME','&OWNER') from dual; 3. VIEW DDL select dbms_metadata.get_ddl('VIEW','&VIEW_NAME','&OWNER') from dual;      4. SYNONYM DDL select dbms_metadata.get_ddl('SYNONYM','&SYNONYM_NAME','&OWNER') from dual; 5.    DB LINK DDL select dbms_metadata.get_ddl('DB_LINK','&DB_LINK_NAME','&OWNER') from dual; 6. USER DDL select dbms_metadata.get_ddl('USER','&USERNAME') from dual; 7. TABLESPACE DDL select dbms_metadata.get_ddl('TABLESPACE','&TABLESPACENAME') from dual; 8. PROCED...

Performance Hub Active Report

Performance Hub active report enables to view all performance data available for a specified time period. Different tabs are available in the Performance Hub, depending on whether real-time or historical data is selected for the time period. When real-time data is selected, more granular data is presented, because real-time data for the last hour is displayed. When historical data is selected, more detailed data is presented, but the data points are averaged out to the Automatic Workload Repository (AWR) interval for the selected time period. To generate a Performance Hub active report 1.         At the SQL prompt, enter: Sql> @$ORACLE_HOME/rdbms/admin/perfhubrpt.sql 2.         Specify the desired report type:         Please enter report type: typical 3.         Enter the value for the database identifier of the database you wan...

Transporting Automatic Workload Repository Data

To extract AWR data: 1.     At the SQL prompt, enter:         SQL> @$ORACLE_HOME/rdbms/admin/awrextr.sql 2.     Specify the database from which AWR data will be extracted:         Enter value for db_id: 1377863381 3.     Specify the number of days for which you want to list snapshot IDs.         Enter value for num_days: 2 4.     Define the range of snapshots for which AWR data will be extracted by specifying a beginning and ending snapshot ID:         Enter value for begin_snap: 30         Enter value for end_snap: 40 5.     Specify the directory object pointing to the directory where the export dump file will be stored:         Enter value for directory_...

Database Network : Configuration Parameters

LSNRCTL> command [listener_name] lsnrctl @file_name  #to execute in batch mode. REM or # to identify comments in the batch script Listener.ora file parameters: ·          PASSWORDS_listener_name  #an unencrypted password ·          LSNRCTL> change_password #to establish an encrypted password ·          LSNRCTL> SAVE_CONFIG  #Any changes are stored in listener.ora ·          LSNRCTL> SET PASSWORD  #If a password is set, then issue SET PASSWORD command before changing the password. Use the command SET PASSWORD prior to privileged Listener Control utility commands ·          Reload : the database services, instances, service handlers, and listening endpoints that were dynamically registered with the listener will be unregistered and subseque...