What data type should I use: CHAR or VARCHAR2???

Hi,

We all know that CHAR and VARCHAR2 are two different datatypes used for storing strings in Oracle. When I asked many people about what’s the difference exactly, all were saying VARCHAR2 can be used for variable sized character strings. As I’m not satesfied with the answer, as always, I’ve decided to do my own experiments on these two. Please find the exercise I’ve performed below.

SQL> create table t1 (col1 char(10), col2 varchar2(10));

Table created.

SQL> insert into t1 values(‘Oracle’,’Oracle’);

1 row created.

SQL> commit;

Commit complete.

Now try to query the table like this

SQL> select * from t1 where col1= ‘Oracle’;

COL1                COL2
———-          ———-
Oracle              Oracle

SQL> variable v1 varchar2(10)

SQL> exec :v1 := ‘Oracle’

PL/SQL procedure successfully completed.

SQL> select * from t1 where col1 = :v1;

no rows selected

SQL> select * from t1 where col1 = rpad(:v1,10);

COL1                COL2
———-          ———-
Oracle              Oracle

So you could clearly see the side effect: To get a hit in comparing a character value with a varchar2 variable, you need to use rpad, which appends blank spaces at the end of the variable v1. This is because

CHAR data will be stored in the Database with padding BLANK SPACES at the tail end. i.e. the string ‘Oracle’ in a column with CHAR(10) will be stored as ‘Oracle<space><space><space><space>’

You can prove this by issuing the below queries

SQL> select replace(col1,’ ‘,’*’),replace(col2,’ ‘,’*’) from t1;

REPLACE(CO           REPLACE(CO
———-                      ———-
Oracle****                Oracle

So, CHAR(10) and VARCHAR2(10) don’t have significant differences if we use them store data of exactly 10 characters (like IDs, Phone numbers etc…).

But if you are sure the data varies, it’s better to use VARCHAR2 for better space utilization and performance (You need not to consume 10 memory locations for 6 character data and need not include the blank spaces while doing the search operations).

So, I personally feel using CHAR is really not suggestible in any kind of scenarios. Oracle retained it just for backward compatibility.  I feel we can use it in case of CHAR(1) as typing VARCHAR2(1) takes more time than the CHAR(1) 😉

If you observed or not, how does this statement returned one row?

SQL> select * from t1 where col1= ‘Oracle’;

COL1                COL2
———-          ———-
Oracle              Oracle

If col1 have a string ‘Oracle<space><space><space><space>’ then we should give the comparison condition like  select * from t1 where col1= ‘Oracle<space><space><space><space>’;. Isn’t it?

That’s incorrect assumption because Oracle always trim trailing spaces on both the predicates involved in comparison operation if one of the predicate is a CHAR column.

That’s why you could see the results even if you give

SQL> select * from t1 where col1= ‘Oracle <space><space><space><space><space><space><space><space>’;

COL1                     COL2
———-               ———-
Oracle                  Oracle

I always welcome your queries and feedback 🙂

How restoring individual datafile effects the constraints and logical consistency ???

Hi all,

Last week when I was in a discussion with one of my friends, who is an Oracle Database consultant, a question turned up regarding Oracle’s feature of restoring individual datafiles.

Oracle documentation says, we can restore individual datafiles if that particular file is corrupt or not available. Queries can be issued against, transactions can be performed on all objects in a tablespace except the ones present in the file being restored. This helps us in reducing the downtime.

Of-course this is a great feature and contributes towards the Oracle’s vision of Maximum Availability. But the question that’s turned up in our discussion is,

what if we have 2 tables in two different datafiles, they have referential integrity constraints defined on them and one of the files is being restored from a backup?

To be clear I have a table student in datafile 7 and dept in datafile 8. The structure of the tables is

DEPT

ID             NOT NULL          NUMBER                      PK

NAME                                     VARCHAR2(10)

STUDENT

ID                                           NUMBER
NAME                                  VARCHAR2(10)
DID                                        NUMBER(10)                 FK

I’m planning to restore datafile 7 from old backup as i lost that file. I couldn’t access the object DEPT as the datafile in which DEPT is present is being restored. But I can access the table STUDENT as that is in a different datafile (A different Tablespace probably).

So, if i try to insert the data which is not complying the PK-FK releation, while the restore operation is going on, what Oracle’ll do?

  • Won’t it allow?
  • Will it allow but validate the data after the restore
  • Will it disable the constraints and allow the transactions but error out if we/Oracle try to enable the constraints again?

So, I thought of testing this myself and simulated the operation. See the exercise below

I’m creating a tablespace RMANTST with a datafile

SQL> create tablespace RMANTST datafile ‘/XXX/rmantst1.dbf’ size 10M;

Tablespace created.

Now create a table DEPT in RMANTST.

SQL> create table dept (id number,name varchar2(10), constraint dept_pk primary key (id)) tablespace RMANTST;

Table created.

My intention is to create another table in a different datafile of the same tablespace. so I made the current datafile offline and added a new datafile to this tablespace. After that I’ve created a table in the tablespace RMANTST so my new table will go into the other datafile.

SQL> alter database datafile ‘/XXX/rmantst1.dbf’ offline;

Database altered.

SQL> alter tablespace RMANTST add datafile ‘/XXX/rmantst2.dbf’ size 10M;

Tablespace altered.

SQL> create table student (id number,name varchar2(10),did number(10), constraint STUD_fk FOREIGN KEY (did) references dept(id)) tablespace RMANTST;

Table created.

SQL> alter database datafile ‘/XXX/rmantst1.dbf’ online;

Database altered.

SQL> select a.FILE_NAME,b.SEGMENT_NAME from dba_data_files a,dba_extents b where a.file_id=b.file_id and b.segment_name=’DEPT’;

FILE_NAME
——————————————————————————–
SEGMENT_NAME
——————————————————————————–
/XXX/rmantst1.dbf

DEPT
SQL> select a.FILE_NAME,b.SEGMENT_NAME from dba_data_files a,dba_extents b where a.file_id=b.file_id and b.segment_name=’STUDENT’;

FILE_NAME
——————————————————————————–
SEGMENT_NAME
——————————————————————————–
/XXX/rmantst2.dbf

STUDENT

Now I’ve inserted some sample data

SQL> insert into dept values (10,’maths’);

1 row created.

SQL> insert into dept values (20,’physics’);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from dept;

ID NAME
———- ———-
10 maths
20 physics

SQL> insert into student values (110,’tom’,10);

1 row created.

SQL> insert into student values (120,’jonathan’,20);

1 row created.

SQL> commit;

Commit complete.

SQL> select * from student;

ID NAME DID
———- ———- ———-
110 tom 10
120 jonathan 20

I’ve taken the backup of the datafile 7 (rmantst1)

 rman target /

Recovery Manager: Release 11.2.0.3.0 – Production on Wed Aug 29 06:44:00 2012

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: CSM2 (DBID=105970236)

RMAN> backup datafile 7 format ‘/XXX/bkp_rmantst1’;

Starting backup at 29-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=3 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/XXX/rmantst1.dbf
channel ORA_DISK_1: starting piece 1 at 29-AUG-12
channel ORA_DISK_1: finished piece 1 at 29-AUG-12
piece handle=/XXX/bkp_rmantst1 tag=TAG20120829T064454 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-AUG-12

RMAN> exit
Recovery Manager complete.

Now i’m putting the datafile 7 into offline mode as I want to restore it

SQL> alter database datafile ‘/XXX/rmantst1.dbf’ offline;

Database altered.

Checking the constraints once to make sure they’re enabled.

SQL> select CONSTRAINT_NAME,status from dba_constraints where CONSTRAINT_NAME like ‘%STUD%’;

CONSTRAINT_NAME STATUS
—————————— ——–
STUD_FK ENABLED

SQL> select CONSTRAINT_NAME,status from dba_constraints where CONSTRAINT_NAME like ‘%DEPT%’;

CONSTRAINT_NAME STATUS
—————————— ——–
DEPT_PK ENABLED

Now I’m trying to insert some data which violates the referential integrity

SQL> insert into student values (130,’tanel’,50);
insert into student values (130,’tanel’,50)
*
ERROR at line 1:
ORA-00376: file 7 cannot be read at this time
ORA-01110: data file 7: ‘/XXX/rmantst1.dbf’

and if i try to restore without bringing that datafile into offline mode, RMAN obviously throws “ORA-19573: cannot obtain exclusive enqueue for datafile 7” error.

Here we don’t have a record with dept id 50 in the Department table (PK). When I try to insert a row, Oracle complained that file 7 can’t be read. So Oracle tries to validate the data before inserting/updating and reporting an error if the data required for validation (data from PK table) is not available. So there’s no question of inserting the violating data. This way Oracle guarantees the logical consistence among the tables.

Observe one more typical scenarios here

I’m inserting one more row into the DEPT(Pk table)

SQL> insert into dept values (50,’computers’);

1 row created.

SQL> commit;

Commit complete.

and a row into the FK table

SQL> insert into student values (130 ,’tanel’,50);

1 row created.

SQL> commit;

Commit complete.

What if I want to restore data from backup taken earlier which doesn’t contain this new entry (50,’computers’). How does Oracle behaves in that case

SQL> !strings /XXX/bkp_rmantst1
}|{z
CSM2
TAG20120829T064454
physics,
maths
CSM2
=/tg
RMANTST

See, the backup doesn’t have “computers”

Now I’m restoring the datafile

RMAN> restore datafile 7;

Starting restore at 29-AUG-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=52 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00007 to /XXX/rmantst1.dbf
channel ORA_DISK_1: reading from backup piece /XXX/bkp_rmantst1
channel ORA_DISK_1: piece handle=/XXX/bkp_rmantst1 tag=TAG20120829T064454
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 29-AUG-12

Now if you see the restored datafile

nearside*[itl2t53r]> strings /XXX/rmantst1.dbf
}|{z
CSM2
=/tg
RMANTST
physics,
maths

See it too doesn’t contain “computers”; that’s obvious as the datafile is restored from the backup which doesn’t contain “computers”.

But how Oracle deal with this case???

Oracle is quite intelligent, It won’t allow you to make the datafile online until you recover the datafile

SQL> alter database datafile ‘/XXX/rmantst1.dbf’ online;
alter database datafile ‘/XXX/rmantst1.dbf’ online
*
ERROR at line 1:
ORA-01113: file 7 needs media recovery
ORA-01110: data file 7: ‘/XXX/rmantst1.dbf’

Once you’re done with the recovery, you can bring it back online.

SQL> recover datafile 7;
Media recovery complete.
SQL> !strings /XXX/rmantst1.dbf
}|{z
CSM2
=/tg
RMANTST
3 computers,
physics,
maths

 

Please find the part-2 here https://querycsm.wordpress.com/2012/09/03/can-we-do-point-in-time-recovery-of-datafiles-or-tablespaces/

 

CSM

Can we create indexes on views?

Hi friends,

Recently one of the members of OTN forums has asked this question: Can we create indexes on views?

I told him absolutely not, because a view is nothing but a stored SQL query. It’s the window through which you can see the data of your choice. As the ultimate data container is the table, you impose all the required conditions(constraints, indexes etc…) on the table itself; they’ll be reflected in the view.

So it’s true that we can’t impose any constraints on views. OK, then what’s the case with the MVs (Materialized views)?? Can’t we create views on them too?

If you say we can’t, it’s wrong. We can create constraints, indexes on MVs as MVs contains the actual data i.e. the result of the query at the instant the query is executed.

create materialized view abc as select col1, col2 from t1;

ALTER MATERIALIZED VIEW abc add constraint 
abc_constraint check ( col2 < 10 ) deferrable;

So when you design applications, keep in mind that we can apply specific constraints, create indexes to attain the performance gains, on the selected set of data (of course through MVs).

There’s a caveat for this, which I’ve noticed while doing some time-pass testing 🙂

See that exercise here

SQL> create table t1 as select rownum rnm,'row_number:'||rownum rnmstr 
     from user_objects where rownum<=5;

Table created.  

SQL> alter table t1 add primary key(rnm);

Table altered.

SQL> create unique index t1_uk on t1(rnmstr);

Index created.

SQL> create materialized view mvt1 refresh fast with primary key 
     as select * from t1;

Materialized view created.

SQL> create unique index mvt1_uk on mvt1(rnmstr);

Index created.

SQL> select * from t1;

         R RNMSTR
---------- -------------------------------------------
         1 row_number:1
         2 row_number:2
         3 row_number:3
         4 row_number:4
         5 row_number:5

Now,we’ll interchange the positions of two of the rows

SQL> update t1 set RNMSTR='TEMP' where rnm=1;
1 row updated. 

SQL> update t1 set RNMSTR='row_number:1' where rnm=2; 

1 row updated. 

SQL> update t1 set RNMSTR='row_number:2' where rnm=1;

 1 row updated. 

SQL> commit; 

Commit complete. 

SQL> select * from t1;

         R RNMSTR
---------- -------------------------------------------
         1 row_number:2
         2 row_number:1
         3 row_number:3
         4 row_number:4
         5 row_number:5

Now when we try to refresh the mview we get the error.

SQL> exec dbms_mview.refresh('MVT1');
BEGIN dbms_mview.refresh('MVT1'); END;

*
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-00001: unique constraint (YAS.MVT1_UK) violated
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 820
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 877
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 858
ORA-06512: at line 1

If we drop the unique index and recreate it as nonunique we can refresh the mview without errors.

SQL> drop index MVT1_UK;

Index dropped.

SQL> create index MVT1_AK on MVT1(rnmstr);

Index created.

SQL> exec dbms_mview.refresh('MVT1');

PL/SQL procedure successfully completed.

SQL> select * from MVT1;
         R RNMSTR
---------- -------------------------------------------
         1 row_number:2
         2 row_number:1
         3 row_number:3
         4 row_number:4
         5 row_number:5

The reason of this error is explained in Metalink note 284101.1. According to that note the refresh mechanism may temporarily leave the data in an inconsistent state during the refresh. The modifications are not made with the same order as the modifications to the base table. Because of this creating unique indexes, foreign keys or primary keys on mviews can cause problems in the refresh process. An mview is just a selective copy of the base table, so if we define the integrity constraints on the base table the mview will definitely comply to you expected constraints as the data in base table comply them. But you can create indexes without any fear if you are seeing a scope for performance gains.

Hope you liked it. I’m always welcome to suggestions/ comments

Regards,

CSM

How to change the default tablespace of your Oracle Database?

Hi Guys,

This week I’ve come across a requirement to change the default tablespace of one my users. I can do it using the “ALTER USER” command (http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_4003.htm).

Then the requirement has turned out to do it for all the users in the Database.

I thought of doing it by altering every user individually but noticed that my Database contains more than hundred users… Then I thought of writing a small PL/SQL anonymous block and run that.

Isn’t there any other, simple , solution for this?

it wouldn’t be if my Database is running on a version lower than 10g. But in 10g Oracle introduced a new feature which could help in this kind of scenarios.

There’s parameter introduced called ‘DEFAULT_PERMANENT_TABLESPACE’ has been introduced which could change the default tablespace for all users in the Database with a single command.

Please see the demo below,

SQL> SELECT PROPERTY_VALUE FROM DATABASE_PROPERTIES WHERE PROPERTY_NAME = ‘DEFAULT_PERMANENT_TABLESPACE‘;

PROPERTY_VALUE
——————————————————————————–
USERS

Now we’ll create a table without specifying any tablespace clause.

SQL> create table t1(col1 number(10));

Table created.

Now observe the tablespace in which the table, t1, is created.

SQL> select tablespace_name from user_segments where segment_name=’T1′;

TABLESPACE_NAME
——————————
USERS

Now we’ll change the default tablespace of the Database to CSMTEST

SQL> alter database default tablespace csmtest;

Database altered.

So, csmtest is our new default permanent tablespace. Try creating a new table again the same we did earlier

SQL> create table t2(col1 number(10));

Table created.

Now see what tablespace the object, T2, has gone into.

SQL> select tablespace_name from user_segments where segment_name=’T2‘;

TABLESPACE_NAME
——————————
CSMTEST

This is the way we can change the default tablespaces of an Oracle Database. The good thing with this is we can do this online without bouncing the instance/ doing any extra things…just issue a one line command, Oracle will take care of everything else…

And a bonus for you is, we can use the same strategy for changing the default temporary tablespaces as well.

The parameter for that iiiiis… yes your guess is correct 🙂 it’s DEFAULT_TEMP_TABLESPACE and the statement to change the default temporary tablespace is

alter database default temporary tablespace <temp_tablespace_of_your_choice>;

Hope you like it and this trick could be helpful to you guys.

I’m always happy to receive your suggestions/ feedback. Have a great day ahead 🙂

Regards,

CSM

Adding targets to OEM 12C System in silent mode

Hi Guys,

In this article I’m going to tell you how to add targets to the OEM 12C system.

I’ve already illustrated how to install OEM here (https://querycsm.wordpress.com/2012/07/31/installing-oem-12c-in-silent-mode-part-i-basic-prerequisites/ and https://querycsm.wordpress.com/2012/07/31/installing-oem-12c-in-silent-mode-part-ii-preparing-the-response-files-and-running-the-installer/) and deploying the agents (https://querycsm.wordpress.com/2012/08/06/deploying-oem-12c-agents-in-silent-mode/).

After setting up the OEM and deploying the agents into the machines which contain our targets to be monitored, the next step is to add the actual targets into the OEM system. This allows you to monitor the targets (Databases etc…) through the OEM console. This is the last but most important step in the entire process of setting up the OEM as you can’t monitor any Database (I mean to say any target but i mostly use the term ‘Database’ in the context of the word ‘target’ as my main focus is to monitor the Databases through OEM) or can’t see it in the console until you add it to the OEM System.

It’s pretty easy to add targets in GUI mode but you have to be a bit patient if you want to do any automation through silent mode 🙂

Let’s see how we could add the targets in silent mode.

The first step for adding the targets in silent mode is to install the EMCLI (Enterprise Manager Command Line Interface). This is a tool provided by Oracle to perform all the admin activities like adding targets, dropping targets etc… through the command line. You can find more about emcli @ http://docs.oracle.com/cd/B19306_01/em.102/b40004/cli.htm

  • Download emcli to your desktop by typing https://oms_host:port/em/console/emcli/download in the browser
  • Ftp this to all the machines where our targets are present (machines in which we deployed agents earlier).
  • Install emcli by issuing
    java -jar <emclikit.jar> client -install_dir=<Some directory which is considered as the EMCLI_HOME>
  • After finishing up the installation do,
    cd $EMCLI_HOME
    ./emcli setup -url=”https://oms_host:port/em&#8221; -username=sysman -password=<sysman password> -dir=$EMCLI_HOME -trustall

This will finish up the emcli installation – setup process. Do this on all the hosts which holds our targets of interest.

After the setup the next thing remained is to add the targets.

You can do that with a simple command like

cd $EMCLI_HOME

./emcli add_target -name=”ORACLE_SID” -type=”oracle_database” -host=”$oemhost” -credentials=”UserName:dbsnmp;password:dbsnmp_password;Role:Normal” -properties=”SID:ORACLE_SID;Port:1521;OracleHome:<Oracle home of the target>;MachineName:<Machine where the target is present (current machine)>\”

This will cleanly add you Database to the OEM 12C and you can start to see this Database and it’s monitoring statistics in the OEM console.

refer this for further reading on emcl: http://docs.oracle.com/cd/E24628_01/doc.121/e24473/toc.htm

regards,

CSM

Deploying OEM 12C Agents in silent mode

Hi Friends, A Happy Friendship day to you all 🙂

I’ve already posted 2 articles on how to install OEM 12c in silent mode (https://querycsm.wordpress.com/2012/07/31/installing-oem-12c-in-silent-mode-part-i-basic-prerequisites/  and https://querycsm.wordpress.com/2012/07/31/installing-oem-12c-in-silent-mode-part-ii-preparing-the-response-files-and-running-the-installer/).

As an extension to them, I’m posting a new article on ‘Deploying OEM Agents’ . Please go through it to get an ideas of how to deploy the OEM 12C agents in silent mode.

We typically deploy agents on the machines which have our targets to be monitored.

For Eg: You want a Database called DB1, which is on machine MACH1, to be monitored. Then you need to deploy agents in that machine MACH1 which collects data from DB1 and uploads into the central OEM repository.

So you have to the agent deployment in all the machines which contain the targets you want to monitor through the OEM.

The main steps in deploying OEM 12C  agents are

  • Download OEM Agent software (latest software available is 12.1.0.1.0_AgentCore_226.zip) — One time activity
  • Copy the zip file to all the hosts in which you want to install the Agent software (The hosts which holds your targets like the Databases to be monitored) — Do this for every host in which you want to install agent software
  • Prepare a response file like we did for OEM software installation — Do this for every host in which you want to install agent software as this file contain some common attributes and some specific to the host
  • Deploy the agents — Do this for every host in which you want to install agent software

Download OEM Agent software:

On the host where you installed OMS (OEM software), launch emcli

Go to OMS_HOME/bin and give

./emcli login -username=sysman -password=XXXXXXX

Login successful

Then you need to synchronize emcli

./emcli sync

Synchronized successfully

Now check the platforms for which the Management Agent software is available on the OMS host

./emcli get_supported_platforms

Getting list of platforms …

Check the logs at /XXXXX/oms/bin/agent.log

About to access self-update code path to retrieve the platforms list..

Getting Platforms list  …

———————————————–

Version = 12.1.0.1.0

Platform = Linux x86-64

———————————————–

Platforms list displayed successfully.

Now get the Management Agent software from Oracle Software Library to the directory of your choice (on the OMS host)

./emcli get_agentimage -destination=/tmp/agent_software -platform=”Linux x86-64″ -version=”12.1.0.1.0″

Platform:Linux x86-64

Destination:/tmp/agent_software

=== Partition Detail ===

Space free : 14 GB

Space required : 1 GB

Check the logs at /tmp/agent_software/get_agentimage_2012-07-14_23-10-00-PM.log

Setting property ORACLE_HOME to:/XXXXX/oms

calling pulloneoffs with arguments:/XXXXX/oms/sysman/agent/12.1.0.1.0_AgentCore_226.zip 12.1.0.1.0 linux_x64

Check this logs for more information: /XXXXXX/oms/sysman/prov/agentpush/logs

Now go and check for the Agent software zip file under /tmp

You’ll find a file like “12.1.0.1.0_AgentCore_226.zip”; This is the Agent Software you needed.

Copy it to the machine where you want to install the agent software.

Now you go ahead preparing the response files needed for the Agent software installation

Prepare a response file

Below are the parameters you must have in the response file to start the agent software installation

EM_INSTALL_TYPE=”AGENT”
OMS_HOST=<Enter Your OMS host name (machine in which you installed the OEM software initially)>
EM_UPLOAD_PORT=7799 <This is the default port>
AGENT_REGISTRATION_PASSWORD=<Give a password of your choice>
AGENT_INSTANCE_HOME=<Absolute path of the directory in which you’re planning to install the agent software>
AGENT_PORT=1832<This is a default port>
ORACLE_HOSTNAME=<The host in which you want to install the agent software>
s_agentHomeName=”agent12gR1″ <This is the default value provided by Oracle>

After entering all the necessary values, you can move to next step i.e. launching the Agent installer.

Deploying the Agents

Unzip the 12.1.0.1.0_AgentCore_226.zip we downloaded in the first step

You will find a file like agentDeploy.sh in the unzipped files.

Now run

./agentDeploy.sh AGENT_BASE_DIR=<The directory in which you want to install the agent software> RESPONSE_FILE=<Absolute path of the agent response file we’ve prepared in the above step>

After the installation is finished, run the below script

$AGNET_HOME/core/12.1.0.1.0/root.sh

and this will windup the installation task.

You can check if the agent is running by giving

$AGNET_HOME/core/12.1.0.1.0/bin/emctl status agent

So you are done with the OEM software installation:  https://querycsm.wordpress.com/2012/07/31/installing-oem-12c-in-silent-mode-part-i-basic-prerequisites/ and https://querycsm.wordpress.com/2012/07/31/installing-oem-12c-in-silent-mode-part-ii-preparing-the-response-files-and-running-the-installer/

and

Agent installation: https://querycsm.wordpress.com/2012/08/06/deploying-oem-12c-agents-in-silent-mode/

Now, we’ll go ahead adding targets to be monitored to the enterprise manager which actually completes the OEM setup. Unless you add the targets, you can’t see anything about them in the OEM console.

See my next post on how to add targets(I’ll be focusing on how to add Databases, which are main point of concern for any DBA) in silent mode.

regards,

CSM