RAC

March 14, 2023

crsctl commands

- as grid owner
$crs_stat -t             # 10g
$crsctl status res -t
$crsctl status res -t -init (if crs not up)

- quick check for cluster processes
$ps -ef|grep -i d.bin

- as root
cd $CRS_home\bin\
#crsctl stop crs
#crsctl start crs

- as grid
$cd $CRS_home\bin\
$sudo crsctl stop crs
$sudo crsctl start crs
-- alternatively - depending on sudo permissions
$sudo $CRS_home\bin\crsctl stop crs

 
- Oracle Restart - as grid
crsctl status has
crsctl start has
crsctl stop has

sudo crsctl stop has
sudo crsctl start has


-- relocate vip #  /usr/local/bin/sudo
sudo $CRS_HOME/bin/crs_reloacte ora.hostname.vip #11g 

sudo $CRS_HOME/bin/crsctl stat res -t  # 11g, 12c
sudo $CRS_HOME/bin/crsctl ocrcheck     # 11g, 12c
sudo $CRS_HOME/bin/crsctl check crs    # 11g, 12c, 18c
sudo $CRS_HOME/bin/crsctl check css    # 11g, 12c
sudo $CRS_HOME/bin/crsctl query css votedisk # 11g, 12c

- start / stop cluster nodes and resources
sudo $CRS_HOME/bin/crsctl stop has           #11g
sudo $CRS_HOME/bin/crsctl start has          #11g
sudo $CRS_HOME/bin/crsctl stop crs           #11g, 12c
sudo $CRS_HOME/bin/crsctl start crs          # 11g, 12c
sudo $CRS_HOME/bin/crsctl stop crs -f        # 11g, 12c
sudo $CRS_HOME/bin/crsctl start res ora.crsd          # 11g
sudo $CRS_HOME/bin/crsctl start res ora.cssd
sudo $CRS_HOME/bin/crsctl start res ora.cluster_interconnect.haip -init
sudo $CRS_HOME/bin/crsctl stop cluster -all -f  # 12c - shutdown all nodes of the cluster

-- checks
crsctl check cssd
crsctl check crsd
crsctl check evmd

-- find cluster name
$cd $CRS_HOME/bin
$./cemutlo -n+

-- crs debug
$export SRVM_TRACE=true
$export SRVM_TRACE=false

srvctl commands

-- restart database
srvctl status database -d MYDB
srvctl stop database -d MYDB
srvctl start database -d MYDB

- restart instance
srvctl status instance -d MYDB -n NODE1
srvctl stop instance -d MYDB -n NODE1
srvctl start instance -d MYDB -n NODE1
srvctl status instance -d MYDB -n NODE1

- stop asm
srvctl status asm
srvctl status asm -n NODE1
srvctl stop asm -n NODE1
srvctl stop asm -n NODE1 -f
-- 10g
srvctl start asm -n server_name -i +ASM1
srvctl status asm -n server_name
srvctl stop asm -n server_name

--automatic restart
http://docs.oracle.com/cd/E11882_01/server.112/e25494/restart.htm#ADMIN5026
srvctl status database -d MYDB
srvctl config database -d MYDB -a
srvctl disable database -d MYDB
srvctl enable database -d MYDB


- service
srvctl status service -d MYDBD -s MYDBD_SVC
srvctl start service -d MYDBD -s MYDBD_SVC
srvctl stop service -d MYDBD -s MYDBD_SVC

dbms_service

SQL>exec dbms_service.stop_service('MYDBP_SVC','MYDBP1');
SQL>exec dbms_service.stop_service('MYDBP_SVC','MYDBP2');

- ASM


====
cd $ORACLE_HOME\bin\
srvctl stop database -d db_name
srvctl stop asm -n node
srvctl stop nodeapps -n node

- scan status check/relocation
srvctl status scan
srvctl config scan
srvctl relocate scan -i 3 -n NODE2

Logs locations

-crs logs 10g, 11g
$ cd $CRS_HOME/log/NODE1
$ tail -100 alertNODE1.log

$ tail -100 cssd/ocssd.log
$ tail -100 ohasd/ohasd.log
$ tail -100 evmd/evmd.log
$ tail -100 crsd/crsd.log
$ tail -100 mdsn/mdsn.log
$ tail -100 gipcd/gipcd.log
$ tail -100 gpnpd/gpnpd.log

$ tail -100 agent/ohasd/oraagent_oracle/oraagent_oracle.log
$ tail -100 agent/ohasd/oracssdagent_root/oracssdagent_root.log
$ tail -100 agent/ohasd/oracssdmonitor_root/
$ tail -100 agent/ohasd/orarootagent_root/
$ tail -100 agent/ohasd/

-crs logs 12c
$ cd $GRID_BASE/diag/crs/NODE1/crs/trace
$ tail -100 alert.log

$ tail -100 ocssd.trc
$ tail -100 crsd_oraagent_oracle.trc      #db,diskgroup,asm,network,ons,services,gsd,listener,scanlistener
$ tail -100 crsd_orarootagent_root.trc    #gns,acfs,scan vip,gnd,vip
$ tail -100 mdnsd.trc
$ tail -100 evmd.trc
$ tail -100 gipcd.trc

$ tail -100 ohasd.trc
$ tail -100 ohasd_orarootagent_root.trc
$ tail -100 ohasd_oraagent_oracle_trc
$ tail -100 ohasd_cssdmonitor_root.trc
$ tail -100 ohasd_cssagent_root.trc


- crs logs 18c
CRS_HOME/log/hostname/alerthostname.log
cd $CRS_HOME/log/hostname

RAC network checks

cat /etc/hosts
ip a s
ping [private interconnect] #pingable
ping [vipip] # pingable after install
nslookup [vip]
nslookup [clu-scan]


Cluvfy checks


cluvfy comp clu -n node01,node02 -verbose  #11g

cluvfy comp asm -n all

cluvfy comp nodecon -n node01,node02 -i vnet1 -verbose #e.g public interface
cluvfy comp nodecon -n node01,node02 -i vnet2 -verbose #e.g. private interconnect
cluvfy comp nodecon -n node01,node02 -verbose
cluvfy comp nodecon -n node01 -verbose

cluvfy comp nodereach -n node01,node02 -verbose
cluvfy comp nodereach -n node01 -verbose

cluvfy stage -post hwos -n node01
cluvfy stage -post crsinst -n node01,node02 -verbose

Logical Standby – Quick Check

March 4, 2023

check the apply process running/ stop/start


!ps -ef|grep lsp

ALTER DATABASE START LOGICAL APPLY IMMEDIATE; -- NEWER SYSTEMS
ALTER DATABASE START LOGICAL APPLY; -- START OLD SYSTEMS
ALTER DATABASE STOP LOGICAL APPLY; -- TO STOP

check apply status DBA_LOGSTDBY_LOG

select count(*) from dba_logstdby_log where APPLIED <> 'YES';

alter session set NLS_DATE_FORMAT = 'DD-MM-YY HH24:MI:SS';

col file_name for a70
col mydate for a20
set lines 200 pages 200
select file_name,sequence#,first_change#,next_change#,to_char(timestamp,'DD-MM-YY HH24:MI:SS') mydate,dict_begin,dict_end,applied
from dba_logstdby_log
where APPLIED<>'YES'
ORDER BY TIMESTAMP;

select file_name,sequence#,first_change#,next_change#,to_char(timestamp,'DD-MM-YY HH24:MI:SS') mydate,dict_begin,dict_end,applied
from dba_logstdby_log
where APPLIED='CURRENT'
ORDER BY TIMESTAMP;

DBA_LOGSTBY_PROGRESS

alter session set NLS_DATE_FORMAT = 'DD-MM-YY HH24:MI:SS';

select applied_sequence#,applied_scn,applied_time from dba_logstdby_progress;

V$MANAGED_STANDBY

col file_name for a70
col mydate for a20
set lines 200 pages 200
select process, status, thread#, sequence#, block#, blocks from v$managed_standby;

V$LOGSTDBY


set lines 200 pages 200
col type for a20
col status for a80
col high_scn for 99999999999999999

select pid, type, status, high_scn from v$logstdby;

DBA_LOGSTDBY_EVENTS

set lines 200 pages 200
col status for a57
col event for a55

select event_time, status, dbms_log.substr(event,80,1) event
--select event_time, status, event
from dba_logstdby_events
where 1=1
and event_timestamp >sysdate-1
and status like 'ORA-%'
order by event_timestamp desc, comit_scn,current_scn
/

select dbms_lob.substr(event,4000,1) from dba_logstdby_events where event_timestamp >sysdate-1;

Skip Failed transaction


alter database start logical standby apply skip failed transaction;


EXECUTE DBMS_LOGSTDBY.SKIP_TRANSACTION(10,14,165); 
EXECUTE DBMS_LOGSTDBY.SKIP_TRANSACTION(stmt => 'DML', schema => 'SCHEMANAME', object_name => 'TABLEETC', proc_name => null);

ALTER DATABASE START LOGICAL APPLY;

Oracle Memory Parameters

June 23, 2015

Oracle7-11-memory-params


Oracle Cloud – Whats New in 2013

March 1, 2013

Oracle is reaping the fruit of years of their strategy alignment to the evolving cloud technology and is well prepared to address the challenges of all aspects the cloud service delivery.

Oracle CloudWorld has arrived with its comprehensive portfolio of cloud services.

Software as a Service (SaaS) offering that started in 2011 with Customer Relations Management (CRM), Human Capital Management (HCM) and Enterprise Resource Planning (ERP) suites is further enriched to include Talent Management and Sales and Marketing, with more being rolled out later this year.

The recently announced Oracle Cloud offering of Infrastructure as a Service (IaaS) takes care of the hardware requirements of the IT infrastructure. It allows deployment of Virtual Machines, OS Servers and ample storage on the Oracle Cloud.

Oracle Virtual Machine VBox, and Linux operating systems are Industry Standard solutions ensuring compatibility and portability of the solutions. The processing capacity is available elastically upon demand using a utility company model and treating computing resources in the same way as we treat our electricity supply.

Platform as a Service (PaaS) encompasses the Oracle Database, widely acknowledged as the number one database engine, the Java programming language, Fusion Middleware and Oracle Social Relationship Management (SRM).

Oracle Database 11gR2 is available as Database as a Service (DBaaS) since October 2012 and is deployed on Oracle Exadata with Oracle Exalogic.

It is an out of the box database with the standard Oracle development tools i.e. SQL, PL/SQL, SQL Developer, Oracle Application Express as well as the RESTful Web Services wizard. It is available in three database sizes: 5GB, 30GB, 50GB with data transfer volumes six times the database size (30GB,120GB,300GB respectively). The monthly subscription costs are currently given as $175 for a 5GB database, $900 for a 20GB and $2000 for a 50GB database. While it is in most cases not suitable for a heavy production solution, it allows for instantaneous provisioning of environments without commitment of long-term capital expenditure.

Oracle Database 12c with Enterprise Manager 12c is set to deliver unparalleled performance using Oracle new Exadata X3 In-Memory Machine. Its new architecture simplifies multi-database environments and thus enables considerable cost savings. It is part of the Oracle Managed Private Cloud offering announced in October 2012.

Oracle stresses its commitment to the support of both Private and Public areas of Oracle Cloud as well as comprehensive delivery across all three architectural cloud levels: SaaS, PaaS and Iaas. Oracle solution challenges the way the cloud services have been delivered until now and promises flexible and scalable solutions for businesses of all sizes.


On Oracle DataGuard and licensing in general

January 20, 2012

Oracle licensing is very well explained in the following link

http://docs.oracle.com/cd/B28359_01/license.111/b28287/editions.htm#BABDJGGI

Oracle licenses the database servers by Oracle Database Editions. In 11g there are 5 editions with Oracle Enterprise Edition being the most inclusive one.

Other licenses relevant to business are Standard Edition One (entry level) and Standard Edition.

On the top of the ‘Edition’ licenses there are ‘Extra Cost Options’.

Enterprise Edition, for example comes with Data Guard included, but Active DataGuard is an ‘Extra Cost Option’. Partitioning is always ‘Extra Cost Option’.

On the subject of the DataGuard, experienced DBA can set up standby databases on Standard Edition without using DataGuard, and thus provide necessary redundancy to the system. DataGuard is in a way an automated management on the top of the basic functionality of the standby databases. It is very slick, but at a price.

Other useful linkes on licensing :

http://www.oracle.com/technetwork/community/database-11g-product-family-technic-133664.pdf
http://www.oracle.com/us/corporate/pricing/sig-070616.pdf


11g – RMAN

February 21, 2009

Oracle Recovery Manager (RMAN) – What’s new in Oracle 11g

Author: Guru Ananth

 

A complete high availability and disaster recovery strategy requires dependable data backup, restore, and recovery procedures. Oracle Recovery Manager (RMAN), a command-line and Enterprise Manager-based tool, is the Oracle-preferred method for efficiently backing up and recovering your Oracle database. RMAN is designed to work intimately with the server, providing block-level corruption detection during backup and restore. RMAN optimizes performance and space consumption during backup with file multiplexing and backup set compression, and integrates with Oracle Secure Backup and third party media management products for tape backup.

RMAN takes care of all underlying database procedures before and after backup or restore, freeing dependency on OS and SQL*Plus scripts. It provides a common interface for backup tasks across different host operating systems, and offers features not available through user-managed methods, such as parallelization of backup/recovery data streams, backup files retention policy, and detailed history of all backups. Overview of RMAN Functional Components The RMAN environment consists of the utilities and databases that play a role in backing up your data. At a minimum, the environment for RMAN must include the following: The target database to be backed up The RMAN client, which interprets backup and recovery commands, directs server sessions to execute those commands, and records your backup and recovery activity in the target database control file.

Some environments will also use these optional components: A flash recovery area, a disk location in which the database can store and manage files related to backup and recovery Media management software, required for RMAN to interface with backup devices such as tape drives A recovery catalog database, a separate database schema used to record RMAN activity against one or more target databases

New Features in Oracle Database 11g Data Recovery Advisor The Data Recovery Advisor is a new tool aimed at reducing a user’s time spent analyzing and formulating a suitable recovery plan for a given failure. A ‘failure’ in the context of the DRA can be a missing, inaccessible, or wrong version of a file (e.g. control file, data file), physical corruptions resulting from I/O errors, or logical block inconsistency. After identifying all current failures, the DRA then recommends the optimal, feasible recovery plan, and if the user desires, automatically executes a selected recovery plan. All DRA functions can be accessed via EM or RMAN’s command-line interface. Multisection Backups

RMAN can back up or restore a single file in parallel by dividing the work among multiple channels. Each channel backs up one file section, which is a contiguous range of blocks. This speeds up overall backup and restores performance, and particularly for bigfile tablespaces, in which a data file can be sized upwards of several hundred GB to TB’s.

Fast Backup Compression In addition to the Oracle Database 10g backup compression algorithm (BZIP2), RMAN now supports the ZLIB algorithm, which offers 40 lower compression ratio, versus BZIP2.

Network-enabled Database Duplication A clone database on a remote site can now be easily created directly over the network with the enhanced DUPLICATE command, without the need for existing backups.

Virtual Private Catalog A recovery catalog administrator can grant visibility of a subset of registered databases in the catalog to specific RMAN users.

Integration with Windows Volume Shadow Copy Services (VSS) The Oracle database can participate in the VSS infrastructure on Windows platforms, with compatible backup management applications and storage systems. This feature allows VSS-enabled backup management applications to snapshot the Oracle database and restore at the datafile, tablespace, or database level.

Source: https://www.amazines.com/article_detail.cfm/589481?articleid=589481


Oracle RAC implementation

January 6, 2009

Excellent article for all aspects of RAC implementation 🙂

Project Guide for Oracle RAC Implementation
by Christopher Haskins

 

A guide for defining, designing, and delivering a successful Oracle RAC project.

Oracle Real Application Clusters (RAC) is the premier database clustering solution in the RDBMS market space. Oracle RAC’s configuration options and features offer companies a wide range of flexibility for designing their high-availability solutions. However, with all the configuration options, features, and flexibility, how do you guarantee a successful implementation?

This article is a guide for defining, designing, and delivering a successful Oracle RAC project. It details the steps required to reduce risks and increase your chances of a successful implementation. In addition, it highlights many major pitfalls you may encounter during your Oracle RAC project and offers suggestions on how to avoid them.

Although this article focuses on Oracle RAC, the following steps are applicable to many types of Oracle implementation projects. (Note that this guide is intended for informational purposes only; under no circumstances should you consider it a consulting offering.)

So let’s get started! ……

http://www.oracle.com/technology/pub/articles/haskins-rac-project-guide.html

 

 


LDAP, OID, Net8 Directory Naming – What it’s all about …

June 16, 2008

In Oracle 9i we could use Server version of OID as well as Oracle Application Server to configure LDAP for Net*8 Names Resolution

 

This is no longer available in Oracle 10g, the only option is  installation of OAS components.

OID can be deployed on Windows or Unix. 

 

Bits of terminology and theory :

 

LDAP:  The Lightweight Directory Access Protocol (LDAP) is a standard, extensible directory access protocol. It is a common language that LDAP clients and servers use to communicate

 

Online directory: An online directory is a specialized database that stores and retrieves collections of information about objects.

Although an online directory is a database i.e. structured collection of data, it is not necessarily a relational database.

 

OID: Oracle Internet Directory is a general purpose directory service that enables fast retrieval and centralized management of information about dispersed users and network resources.

It combines Lightweight Directory Access Protocol (LDAP) Version 3 with the high performance, scalability, robustness, and availability of Oracle

 

Oracle Internet Directory includes:

        Oracle directory server, which responds to client requests for information about people and resources, and to updates of that information, using a multi-tiered architecture directly over TCP/IP

        Oracle directory replication server, which replicates LDAP data between Oracle directory servers (optional)

        Oracle Directory Manager, a Java-based graphical user interface administration tool

        A variety of command line administration and data management tools

 

Net8 LDAP Directory Naming

 

Directory naming is the process of resolving an alias using an LDAP-compliant directory service (specifically, Oracle Internet Directory).

Net8 directory naming allows net service names to be stored in and retrieved from Oracle Internet Directory.

Net service names stored in OID are accessible by any client machine in the network as long as the client has sufficient access privileges.

 

The process for establishing a client session using directory naming is as follows:

        The client initiates a connect request providing a connect identifier.

        The connect identifier is resolved to a connect descriptor by a directory server. This information is returned to the client.

        The client makes the connect request to the address provided in the connect descriptor.

        A listener receives the request and directs it to the appropriate server.

        The connection is accepted by the server.

 

 

Lets get started :

 

The kits can be easily downloaded from Oracle, look for

‘Oracle Identity Management Infrastructure and Oracle Identity Federation’ for x86 :

as_windows_x86_oim_oif_101401_disk1.zip

as_windows_x86_oim_oif_101401_disk2.zip


What is Oracle Data Guard – do you need a License ?

March 17, 2008

Hello All,

I have been asked many times this question – here is what Oracle says :

“Oracle Data Guard is available only as a feature of Oracle Database Enterprise Edition.”

So if you already run The Enterprise Edition, there is no additional licensing involved. 

“It is not available with Oracle Database Standard Edition. This means the same release of Oracle Database Enterprise Edition must be installed on the primary database and all standby databases in a Data Guard configuration.”


“It is possible to simulate a standby database environment with databases running Oracle Database Standard Edition. You can do this by manually transferring archived redo log files using an operating system copy utility or using custom scripts that periodically send archived redo log files from one database to the other. The consequence is that this configuration does not provide the ease-of-use, manageability, performance, and disaster-recovery capabilities available with Data Guard.”


“A Data Guard configuration consists of one primary database and up to nine standby databases. The databases in a Data Guard configuration are connected by Oracle Net and may be dispersed geographically. There are no restrictions on where the databases are located if they can communicate with each other. For example, you can have a standby database on the same system as the primary database, along with two standby databases on another system.

Check Oracle link for more info : http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/title.htm