Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
74 views15 pages

Workshop DBA Operation 2023

This document provides an agenda and instructions for daily monitoring and maintenance activities for Oracle GoldenGate, the Oracle database system, and the database itself. It covers checking status and metrics for GoldenGate replication, the operating system, and the database. It also describes additional operational tasks like managing tablespaces, users, and sessions.

Uploaded by

Samuel Juana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views15 pages

Workshop DBA Operation 2023

This document provides an agenda and instructions for daily monitoring and maintenance activities for Oracle GoldenGate, the Oracle database system, and the database itself. It covers checking status and metrics for GoldenGate replication, the operating system, and the database. It also describes additional operational tasks like managing tablespaces, users, and sessions.

Uploaded by

Samuel Juana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Oracle Database & GoldenGate Basic

Daily Operation Workshop


Agenda
➢ Daily Monitoring & Maintenance Activity (OGG)

➢ Daily Monitoring & Maintenance Activity (OS)


▪ Check oracle base mount point utilization
▪ Housekeeping oracle base
▪ Check memory & CPU utilization
▪ Check database service running
▪ Check database environment used

➢ Daily Monitoring & Maintenance Activity (DB)


▪ Check database status
▪ Check tablespace utilization
▪ Check daily backup status
▪ Explanation for oracle system parameters
▪ Find and check database log
Agenda
➢ Additional Operation Activities
▪ How to create, add, alter and drop tablespaces and datafiles/tempfiles
▪ Check blocking & blocked sessions
▪ How to kill session
▪ Check, create, alter and drop user
▪ Explanation for database states
▪ Explanation for database shutdown options
▪ Start or stop database
▪ Check, Start and stop listener
Daily Monitoring & Maintenance Activity (OGG)
Check Info Group:
GGSCI > info all
GGSCI > info <group_name>

Check Lag/Gap Data:


GGSCI > lag <group_name>

Check Statistic:
GGSCI > stats <group_name>

Check Checkpoint Group:


GGSCI > info <group_name> showch 1-10

Check Report Group:


GGSCI > view report <group_name>

Check ggserr Log:


tail -f $GG_HOME/dirrtp/ggserr.log
Daily Monitoring & Maintenance Activity (OS)
Check oracle base mount point utilization
Command :
df -h/-k
Housekeeping oracle base
Command :
du -sh * | sort -h
nohup find . -name “<file_name_pattern>” -mtime +<num_days>
-exec <command> {} \; &
Check memory & CPU utilization
Command :
top & free -m/-g
Check database service running
Command :
ps -ef | grep pmon
Check database environment used
Command :
echo $ORACLE_SID & echo $ORACLE_HOME
Daily Monitoring & Maintenance Activity (DB)
Check database status
Query :
select instance_name,status from v$instance;

Check tablespace utilization


Query :
set linesize 170
set pages 300
col tablespace_name format a30
select a.tablespace_name,
sum(a.bytes)/1048576 "total size ",
round(b.total/1048576) " free space",
round(b.total*100/sum(a.bytes)) "% free"from dba_data_files
a, (select tablespace_name, sum(bytes) total from
dba_free_space group by tablespace_name) b where
a.tablespace_name = b.tablespace_name(+) group by
a.tablespace_name,b.total order by 4;
Daily Monitoring & Maintenance Activity (DB)
Check daily backup status
RMAN backup status query:
set linesize 300
set pagesize 30
col duration format a8
col status format a30
col input_bytes_display format a10
col output_bytes_display format a10
col per_sec format a10
col COMMAND_ID for a20
col START_TIME for a17
col device format a8
alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS';

SELECT end_time, status, session_key, session_recid, session_stamp,


command_id, start_time, time_taken_display duration, input_type,
output_device_type device, input_bytes_display, output_bytes_display,
output_bytes_per_sec_display per_sec FROM (SELECT end_time, status,
session_key, session_recid, session_stamp, command_id,
to_char(start_time,'dd/mm/yyyy hh24:mi') start_time, time_taken_display,
input_type, output_device_type, input_bytes_display, output_bytes_display,
output_bytes_per_sec_display FROM v$rman_backup_job_details ORDER BY
end_time ASC);
Daily Monitoring & Maintenance Activity (DB)
Check daily backup status
RMAN backup log query:
set lines 200
set pages 1000
select output
from GV$RMAN_OUTPUT
where session_recid = &SESSION_RECID
and session_stamp = &SESSION_STAMP
order by recid;

Explanation for oracle system parameters


Command:
Show parameter <parameter_name> (Blank will show all
parameters)

Find and check database log


Command:
Show parameter core_dump_dest
Cd /home/app/oracle/diag/rdbms/ibank/ibank/trace
tail -50f alert_ibank.log
Additional Operation Activities
How to create, add, and alter tablespaces and datafiles/tempfiles
Create tablespace query:
create tablespace <tablespace_name> datafile
'/home/app/oracle/oradata/datafile/IBANK/datafile/IBANKDATA
12.dbf' size 100M autoextend on/off next 10M maxsize 1G,
'<full_path_datafile_name2>' size 10M autoextend on/off
next 10M maxsize 1G,
'<full_path_datafile_name3>' size 10M autoextend on/off
next 10M maxsize 1G;

Add datafile to tablespace query:


Alter tablespace IBANKDATA add datafile
'/home/app/oracle/oradata/datafile/IBANK/datafile/IBANKDATA
12.dbf’ size 10M autoextend on/off next 10M maxsize 1G;

Alter datafile in tablespace query:


Alter database datafile
'/home/app/oracle/oradata/datafile/IBANK/datafile/IBANKDATA
12.dbf’ resize 100M autoextend on/off next 100M maxsize 5G;
Additional Operation Activities
How to create, add, and alter tablespaces and datafiles/tempfiles
Create temporary tablespace command:
create temporary tablespace <temp_tablespace_name> tempfile
'< full_path_datafile_name 1>' size 10M autoextend on/off
next 10M maxsize 1G,
'< full_path_datafile_name 2>' size 10M autoextend on/off
next 10M maxsize 1G,
'< full_path_datafile_name 3>' size 10M autoextend on/off
next 10M maxsize 1G;

Add tempfile to temporary tablespace command:


Alter tablespace <tablespace_name> add tempfile
'<destination1>' size 10M autoextend on/off next 10M
maxsize 1G;

Alter tempfile in tablespace command:


Alter database tempfile '<full_path_datafile_name>' resize
100M autoextend on/off next 100M maxsize 5G;
Additional Operation Activities
Check blocking & blocked sessions
Check blocked session:
Select sid,serial#,blocking_session,seconds_in_wait from
v$session where blocking_session is not null;
Check blocking session sql_id:
Select sid,serial#,sql_id from v$session where sid=&sid;
Check blocking session full query:
set long 3000 lines 3000 pages 300
Select sql_fulltext from v$sqlarea where SQL_ID =
'&SQL_ID';
How to kill session
Alter system kill session '1011,39564' immediate;
Additional Operation Activities
Check, create, alter and drop user
Check user query:
Select <username,account_status>/* from dba_users;
Create user query:
Create user <username> identified by <password> default
tablespace <tablespace_name> quota unlimited/<integer>M/G;
Grant connect, resource to <username>;
Grant create session to <username>;
Alter user query:
Alter user <username> identified by <new_password> account
lock/unlock default tablespace <tablespace_name> quota
unlimited/<integer>M/G;

Drop user query:


Drop user <username> cascade;
Additional Operation Activities
Explanation for database states
• Started (startup nomount)
When the instance is started, it has read the init.ora (or spfile) and allocated the SGA.

• Mounted database (startup mount)


The instance has opened the control files, but not yet opened the database. In order to
find the control files, the instance uses the init parameter control_files which it has read
when it started.
A database can be mounted by any number of instances at the same time. If it is
mounted by two more instances, this is a Oracle Parallel Server environment.

• Open database (startup)


An opened database is available for normal operations. When the database is opened,
the instance opens the redo log files and the online database files.
A database cannot be opened if any of the online datafiles need media recovery.

• Restricted mode
When the instance is in restricted mode, only users with the restricted session system
privilege can connect to the database.
Additional Operation Activities
Explanation for database shutdown options
• Shutdown normal:
This is the default mode of shutting down the database. During this state, the oracle
server waits for all the users to disconnect.

• Shutdown Transactional:
Waits until all the transactions are completed and then shuts down the database.
During this state, no new connections are permitted.

• Shutdown immediate:
This option will disconnect all the sessions; roll back all the running transactions and
shut down the database. During the next startup, no instance recovery is needed.

• Shutdown abort:
This option doesn't roll back any transactions and simply brings down the database. In
layman's terms, it is just like pulling the power plug of the television. Any subsequent
database startup needs an instance recovery to be initiated by smon.
Additional Operation Activities
Start or stop database
Start database command:
Startup <state>;

Startup nomount;
Alter database mount;
Alter database open;

startup mount;
Alter database open;

startup;

Stop database command:


Shutdown <option>;

Check, Start and stop listener


ps –ef | grep tns
lsnrctl status <listener_name>

You might also like