Oracle DBA Tips and Techniques

By Arjun Raja

Archive for February, 2012

Recovery in RAC

Posted by Arjun Raja on February 28, 2012

Purpose – Incomplete recovery to a point in time in a RAC database environment.

Recovery_in_RAC

Posted in Uncategorized | Leave a Comment »

Database upgrade using Cloud Control 12c

Posted by Arjun Raja on February 28, 2012

One of the new features of  Oracle Cloud Control 12c is that there is a built in database upgrade assistant.

Therefore from the Cloud Control Web page, a database which is monitored can be upgraded to a higher version with ease.

Attached is the documentation.

12c Oracle Database upgrade

Posted in Uncategorized | Leave a Comment »

Oracle 12c cloud control installation on Linux

Posted by Arjun Raja on February 3, 2012

On LINUX X86 64 BIT

Download foll files from oracle.com :

1. 11g Rel 2 for LINUX.

1. linux.x64_11gR2_database_1of2
2. linux.x64_11gR2_database_2of2

2. 12c Cloud Control – Enterprise Manager.

1. em12_linux64_disk1of2
2. em12_linux64_disk2of2

Copy both sets of zip files into separate directories on linux server and unzip them.

Begin installation

1. Install 11g rel2 Linux software.

2. Create database using 11g rel2 Linux software

Before creating database, make sure /etc/hosts file has name of host :

Otherwise dbca database creation will fail with:

ORA-00119: invalid specification for system parameter LOCAL_LISTENER ORA-00130: invalid listener address ‘(ADDRESS=
(PROTOCOL=TCP)(HOST=cloud.control)(PORT=1521))

Ø Hostname

[oracle@cloud oradata]$ hostname

cloud.control

[oracle@cloud flash_recovery_area]$ cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost

::1 localhost6.localdomain6 localhost6

10.254.8.200 cloud.control cloud

[oracle@cloud flash_recovery_area]$

Also make sure ulimit –n is unlimited.

[oracle@cloud bin]$ ulimit -n

1024

[oracle@cloud bin]$

Get unix to change it to unlimited or 4096.

Once database is created , remove the dbcontrol repository created by dbca for enterprise manager.

emca -deconfig dbcontrol db -repos drop -SYS_PWD -SYSMAN_PWD

emca -deconfig dbcontrol db -repos drop -SYS_PWD oracle12c -SYSMAN_PWD oracle12c

ALTER SYSTEM SET processes=300 SCOPE=SPFILE;
ALTER SYSTEM SET session_cached_cursors=200 SCOPE=SPFILE;
ALTER SYSTEM SET sga_target=2G SCOPE=SPFILE;
ALTER SYSTEM SET shared_pool_size=600M SCOPE=SPFILE;
ALTER SYSTEM SET pga_aggregate_target=1G SCOPE=SPFILE;
ALTER SYSTEM SET job_queue_processes=20 SCOPE=SPFILE;

Shutdown immediate;

Startup;

2. Cloud Control installation.

Create directory to hold Middleware ( Web Logic,etc)

cd /home/oracle

mkdir Middleware

cd /home/oracle/stage

[oracle@cloud stage]$ export DISPLAY=10.254.101.208:0.0

[oracle@cloud stage]$ ./runInstaller

Starting Oracle Universal Installer…

Checking Temp space: must be greater than 400 MB. Actual 98300 MB Passed

Checking swap space: must be greater than 150 MB. Actual 5951 MB Passed

Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed

Preparing to launch Oracle Universal Installer
from /tmp/OraInstall2011-12-09_10-59-46AM. Please wait …[oracle@cloud stage]$

(Embedded image moved to file: pic27071.jpg)

(Embedded image moved to file: pic15429.jpg)

(Embedded image moved to file: pic29688.jpg)

(Embedded image moved to file: pic24633.jpg)

(Embedded image moved to file: pic21062.jpg)

Click on warning row and ignore

Click OK and then Ignore

(Embedded image moved to file: pic28246.jpg)

(Embedded image moved to file: pic03762.jpg)

Note down the administrator passwords.

(Embedded image moved to file: pic07873.jpg)

(Embedded image moved to file: pic02961.jpg)

(Embedded image moved to file: pic02230.jpg)

(Embedded image moved to file: pic06947.jpg)

(Embedded image moved to file: pic10203.jpg)

Carry out checks

Agent checks

cd /home/oracle/Middleware/agent/agent_inst/bin

./emctl status agent

[oracle@cloud bin]$ ./emctl status agent

Oracle Enterprise Manager 12c Cloud Control 12.1.0.1.0

Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.

Posted in EM Grid Control, Uncategorized | Tagged: , | Leave a Comment »

ORACLE 12c Cloud Control installation

Posted by Arjun Raja on February 3, 2012

12c cloud_control_installation

Posted in EM Grid Control, Uncategorized | Tagged: | Leave a Comment »

SILENT INSTALL OF 12c Cloud Control Enterprise Manager agent .

Posted by Arjun Raja on February 1, 2012

SILENT INSTALL OF 12c Cloud Control Enterprise Manager agent :

Download the oracle12c agent software from technet.oracle.com-
Navigate to Enterprise manager area and then Enterprise Manager Agent Downloads (All Releases)
Finally under Enterprise Manager Agent 12.1 files for Self Update Feature .
Download the appropriate file as per your Operating system.
I chose this file for my AIX env – Agent file for AIX5L Based Systems
Copy this file – 12.1.0.1.0_AgentSoftware_212.sar to your server where the agent is being installed.

cd /u01/oracle/stage > ls

12.1.0.1.0_AgentSoftware_212.sar

unzip 12.1.0.1.0_AgentSoftware_212.sar

creates a directory called archives

cd archives

unzip 12.1.0.1.0_AgentCore_212.zip

Now make a copy of the agent.rsp file before editing it –

Make the following changes –

#——————————————————————————-
#OMS_HOST: OMS host info required to connect to OMS
#EM_UPLOAD_PORT: OMS port info required to connect to OMS
#AGENT_REGISTRATION_PASSWORD: Agent Registration Password needed to
# establish a secure connection to the OMS.
#AGENT_INSTANCE_HOME: Agent instance home is the location of agent state directory.
#AGENT_PORT: Agent port on which the agent process should be started.
#b_startAgent: Agent will not be started after configuration if the value specified is false.
#ORACLE_HOSTNAME: Fully qualified domain name of host where is the agent is deployed.
#s_agentHomeName:Customized Oracle home name for the agent home. Example: s_agentHomeName=”agent12gR1″
#——————————————————————————-
OMS_HOST=”middba3″
EM_UPLOAD_PORT=”4900″
AGENT_REGISTRATION_PASSWORD=”oracle12c”
AGENT_INSTANCE_HOME=”/u01/oracle/agent12c”
AGENT_PORT=”3872″
b_startAgent=true
ORACLE_HOSTNAME=”xxxxx036.xxxxxx.com”
s_agentHomeName=”agent12gR1″
#——————————————————————————-
#s_agentServiceName: Sets the agent Service Name and this variable can be
# used to overrite the agent service name calculated by the install. This is
# required for only Windows.
# Example:
# s_agentServiceName = “Oracleagent12gAgent” ; default value
# s_agentServiceName = “GridAgent” ; User specified value
#——————————————————————————-
#s_agentServiceName=””

####################################################################################
#Please Don’t change the values of these variables
####################################################################################
#——————————————————————————-
#EM_INSTALL_TYPE: install type
#——————————————————————————-
EM_INSTALL_TYPE=”AGENT”

Save the file agent.rsp –

Make sure the OMS server ip address and alias has an entry in the /etc/hosts if there is no dns entry.

xx.1.xxxx.xxx hostname

NOW INSTALL AGENT WITH SILENT INSTALL .

cd /u01/oracle/stage/archives > ./agentDeploy.sh AGENT_BASE_DIR=”/u01/oracle/agent12c” RESPONSE_FILE=”/u01/oracle/stage/archives/agent.rsp”
AGENT_BASE_DIR=/u01/oracle/agent12c

-e Validating the OMS_HOST & EM_UPLOAD_PORT
Executing command : /u01/oracle/agent12c/core/12.1.0.1.0/jdk/bin/java -classpath /u01/oracle/agent12c/core/12.1.0.1.0/jlib/agentInstaller.jar:/u01/oracle/agent12c/core/12.1.0.1.0/oui/jlib/OraInstaller.jar oracle.sysman.agent.installer.AgentInstaller /u01/oracle/agent12c/core/12.1.0.1.0 /u01/oracle/stage/archives /u01/oracle/agent12c -prereq

Validating oms host & port with url: http://middba3:4900/empbs/genwallet
Validating oms host & port with url: https://middba3:4900/empbs/genwallet
Return status:3
Unzipping the agentcoreimage.zip to /u01/oracle/agent12c ….
12.1.0.1.0_PluginsOneoffs_212.zip
-e
Checking the ownership of agent base directory:/u01/oracle/agent12c
Checking for proper ownership on the agent base directory.
Checks whether the agent base directory is owned by the agent user oracle and that its parent directory is owned by either the agent user or root.
….
Login name is : oracle & file owner is : oracle
……..
Agent Base directory verification completed Successfully.
-e
Ownership check completed.
Executing command : /u01/oracle/agent12c/core/12.1.0.1.0/jdk/bin/java -d64 -classpath /u01/oracle/agent12c/core/12.1.0.1.0/oui/jlib/OraInstaller.jar:/u01/oracle/agent12c/core/12.1.0.1.0/oui/jlib/xmlparserv2.jar:/u01/oracle/agent12c/core/12.1.0.1.0/oui/jlib/srvm.jar:/u01/oracle/agent12c/core/12.1.0.1.0/oui/jlib/emCfg.jar:/u01/oracle/agent12c/core/12.1.0.1.0/jlib/agentInstaller.jar:/u01/oracle/agent12c/core/12.1.0.1.0/oui/jlib/share.jar oracle.sysman.agent.installer.AgentInstaller /u01/oracle/agent12c/core/12.1.0.1.0 /u01/oracle/stage/archives /u01/oracle/agent12c AGENT_BASE_DIR=/u01/oracle/agent12c AGENT_BASE_DIR=/u01/oracle/agent12c RESPONSE_FILE=/u01/oracle/stage/archives/agent.rsp

Executing agent install prereqs…
Executing command: /u01/oracle/agent12c/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -prereqchecker -silent -ignoreSysPrereqs -waitForCompletion -prereqlogloc /u01/oracle/agent12c/core/12.1.0.1.0/cfgtoollogs/agentDeploy -entryPoint oracle.sysman.top.agent_Complete -detailedExitCodes PREREQ_CONFIG_LOCATION=/u01/oracle/agent12c/core/12.1.0.1.0/prereqs -J-DORACLE_HOSTNAME=xxxxu036.xxxxxx.com
Prereq Logs Location:/u01/oracle/agent12c/core/12.1.0.1.0/cfgtoollogs/agentDeploy/prereq.log
Agent install prereqs completed successfully

Cloning the agent home…
Executing command: /u01/oracle/agent12c/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -clone -forceClone -silent -waitForCompletion -nowait ORACLE_HOME=/u01/oracle/agent12c/core/12.1.0.1.0 -responseFile /u01/oracle/stage/archives/agent.rsp AGENT_BASE_DIR=/u01/oracle/agent12c AGENT_BASE_DIR=/u01/oracle/agent12c RESPONSE_FILE=/u01/oracle/stage/archives/agent.rsp -noconfig ORACLE_HOME_NAME=agent12gR1 -force
Clone Action Logs Location:/u01/oracle/oraInventory/logs/cloneActions.log
Cloning of agent home completed successfully

Attaching sbin home…
Executing command: /u01/oracle/agent12c/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -attachHome -waitForCompletion -nowait ORACLE_HOME=/u01/oracle/agent12c/sbin ORACLE_HOME_NAME=sbin12g1 -force
Attach Home Logs Location:/u01/oracle/agent12c/core/12.1.0.1.0/cfgtoollogs/agentDeploy/AttachHome.log
Attach home for sbin home completed successfully.

Updating home dependencies…
Executing command: /u01/oracle/agent12c/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -updateHomeDeps -waitForCompletion HOME_DEPENDENCY_LIST=”/u01/oracle/agent12c/sbin:/u01/oracle/agent12c/core/12.1.0.1.0″ -invPtrLoc /u01/oracle/agent12c/core/12.1.0.1.0/oraInst.loc -force
Update Home Dependencies Location:/u01/oracle/agent12c/core/12.1.0.1.0/cfgtoollogs/agentDeploy/UpdateHomeDeps.log
Update home dependency completed successfully.

Performing the agent configuration…
Executing command: /u01/oracle/agent12c/core/12.1.0.1.0/oui/bin/runConfig.sh ORACLE_HOME=/u01/oracle/agent12c/core/12.1.0.1.0 RESPONSE_FILE=/u01/oracle/agent12c/core/12.1.0.1.0/agent.rsp ACTION=configure MODE=perform COMPONENT_XML={oracle.sysman.top.agent.11_1_0_1_0.xml} RERUN=true
Configuration Log Location:/u01/oracle/agent12c/core/12.1.0.1.0/cfgtoollogs/cfgfw/CfmLogger.log
Agent Configuration completed successfully

The following configuration scripts need to be executed as the “root” user.
#!/bin/sh
#Root script to run
/u01/oracle/agent12c/core/12.1.0.1.0/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as “root”
3. Run the scripts
Agent Deployment Successful.
Agent deployment log location:
/u01/oracle/agent12c/core/12.1.0.1.0/cfgtoollogs/agentDeploy/agentDeploy_.log
Agent deployment completed successfully.
sid1d:/u01/oracle/stage/archives>

As root user run > /u01/oracle/agent12c/core/12.1.0.1.0/root.sh

Check status of agent –

cd /u01/oracle/agent12c/bin >

./emctl status agent

Oracle Enterprise Manager 12c Cloud Control 12.1.0.1.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
—————————————————————
Agent Version : 12.1.0.1.0
OMS Version : 12.1.0.1.0
Protocol Version : 12.1.0.1.0
Agent Home : /u01/oracle/agent12c
Agent Binaries : /u01/oracle/agent12c/core/12.1.0.1.0
Agent Process ID : 25952500
Parent Process ID : 15597582
Agent URL : https://xxxxxu036.xxxxxxx.com:3872/emd/main/
Repository URL : https://middba3:4900/empbs/upload
Started at : 2012-02-01 08:44:43
Started by user : oracle
Last Reload : (none)
Last successful upload : 2012-02-01 08:59:49
Last attempted upload : 2012-02-01 08:59:49
Total Megabytes of XML files uploaded so far : 0.04
Number of XML files pending upload : 0
Size of XML files pending upload(MB) : 0
Available disk space on upload filesystem : 32.16%
Collection Status : Collections enabled
Last attempted heartbeat to OMS : 2012-02-01 08:59:51
Last successful heartbeat to OMS : 2012-02-01 08:59:51

—————————————————————
Agent is Running and Ready
sid1d:/u01/oracle/agent12c/bin>

Posted in EM Grid Control | Tagged: , | Leave a Comment »