Amazon books

Monday, May 10, 2010

Cloning ORACLE_HOME Agent installation

If you need to clone your ORACLE_HOME Agent installation to another server execute the following steps:

1-TAR your OH source
tar -cvhf agent10g.tar agent10g

2-Transfer file to destination server

3-Create the new OH Agent directories and OS user

4-UnTAR the file
tar -xvf agent10g.tar

5-Run root.sh as root user

6-Clean old files from source installation
cd $AGENT_HOME/sysman/emd/collection
rm *

7-Run runInstaller to clone source OH as on example below:

./runInstaller -clone -forceClone ORACLE_HOME=/ora01/emagent/agent10g ORACLE_HOME_NAME=OraAgent10g -noconfig -silent

8-Configure the new agent
$ORACLE_HOME/bin/agentca -f

9-Run root.sh again

$ORACLE_HOME/root.sh --as root user

Generating statistics facing "ORA-38029: object statistics are locked" error

--If you try to analyze an object, or an entirely schema or even all database objects (using dbms_utility for instance) and face this error below:
ORA-38029: object statistics are locked
ORA-06512: at "SYS.DBMS_DDL", line 257
ORA-06512: at "SYS.DBMS_UTILITY", line 488
ORA-06512: at line 2


Fix this problem by following these next steps:

1-Find which schemas have locked tables
select
owner,
table_name,
stattype_locked
from
dba_tab_statistics
where
stattype_locked is not null;

2-Unlock table or all schema statistics using dbms_stats package:

begin
dbms_stats.unlock_schema_stats(ownname => 'SYS');
dbms_stats.unlock_schema_stats(ownname => 'USER1');
dbms_stats.unlock_schema_stats(ownname => 'USER2');
end;
/

3-Execute the analyze_database procedure again (or the procedure that you attempted before). (it must work).


Best Regards,
Paulo Portugal

OUI-10197:Unable to create a new Oracle Home at /ora01/emagent. Oracle Home already exists at this location. Select another location.

If you want to unregister your OH use command simmilar to this one below:

--Error displayed
OUI-10197:Unable to create a new Oracle Home at /ora01/emagent. Oracle Home already exists at this location. Select another location.

--Solution (cleaning inventory)
./runInstaller -silent -detachHome -invPtrLoc /etc/oraInst.loc ORACLE_HOME="/ora01/emagent" ORACLE_HOME_NAME="OraAgent10g"


Best Regards,
Paulo Portugal

Sunday, May 9, 2010

Oracle Secure Backup commands

Some OSB commands:

--Check volumes
lsdev -lvg

--Check jobs
lsjob --all --long

--Change the host characteristics
obtool -u admin chhost -r client,admin,mediaserver "f2c07"

--Create a library
obtool -u admin mkdev -t library -o -a f2c07:/dev/obl0 test22

--Create a tape
obtool -u admin mkdev -t tape -o -a f2c07:/dev/obt0 -l test22


I will post more soon.

Regards,
Paulo Portugal

Friday, May 7, 2010

--Oracle Secure Backup Oracle Secure Backup error: 'no preauth config ound for OS user (OB tools) orasb

If you found an error like this one below:
################################################################################

released channel: devite
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on devite channel at 05/07/2010 16:28:55
ORA-19506: failed to create sequential file, name="01ld3fm6_1_1", parms=""
ORA-27028: skgfqcre: sbtbackup returned error
ORA-19511: Error received from media manager layer, error text:
sbt__rpc_cat_query: Query for piece 01ld3fm6_1_1 failed.
(Oracle Secure Backup error: 'no preauth config found for OS user (OB tools) orasb').
################################################################################


Fix it goint to your Web Tool Amin Configure>Users>Add (add the user name owner of database binaries) and then
go back to this page, click in user just created and click on Edit>Preauthorized Access. Here you will add the host and attributes that this user needs to have.

Try runing your backup again!

Best Regards,
Paulo Portugal

Thursday, May 6, 2010

Using new Oracle Database 11g ADRCI utility example

ADRCI is a command line utility that can be used in order to help find and fix problems in database.
The name stands for Automatic Diagnostic Repository Command Interpreter.

Command line exaples:

adrci> SHOW PROBLEMS --Used to show problems founded on databases
ADR Home = /u01/app/oracle/diag/rdbms/dbms/dbms:
*************************************************************************
PROBLEM_ID PROBLEM_KEY LAST_INCIDENT LASTINC_TIME
-------------------- ----------------------------------------------------------- -------------------- ----------------------------------------
9 ORA 7445 [jsv_udf_init()+62] 102465 2010-05-05 22:01:26.759000 -03:00
8 ORA 7445 [ktspfsall()+1079] 99828 2010-04-30 15:02:42.091000 -03:00
7 ORA 1578 91582 2010-04-27 21:05:44.602000 -03:00


adrci> show base --Used to show current ORACLE_BASE
ADR base is "/u01/app/oracle"

adrci> SET BASE /u01/app/oraebs --Uset to change ORACLE_BASE of database to be analyzed


adrci> set homepath diag/rdbms/dbms/dbms --Setting just one homepath

--To show ADR information use this command below
adrci> show control
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------
1824989551 720 8760 2009-10-27 11:01:08.204025 -02:00 2010-05-03 09:49:12.845517 -03:00 2009-11-16 12:57:16.833107 -02:00 1 2 76 1 2009-10-27 11:01:08.204025 -02:00
1 rows fetched