export ORACLE_SID=OEM #Where oracle home is /u01/app/oracle/Middleware/oms11g . oraenv emctl stop oms -all # The -all stops the web tier as well export ORACLE_SID=AGENT . oraenv emctl stop agent emctl start agent export ORACLE_SID=OEM . oraenv emctl start oms |
Monday, 11 July 2011
Oracle : Restart Grid Control 11GR2
Posted by
Ook
at
03:48
0
comments
Labels: Oracle
Tuesday, 5 July 2011
Oracle : Deinstall 11.2 Single-node Cluster on ASM
* Remove oracle home for databases using deinstall usign downloaded deinstall cd /u01/app/oracle/media/deinstall ./deinstall -home /u01/app/oracle/product/11.2/db_1 * Stop and remove the asm service (?) srvctl stop asm -force -n bangor srvctl remove asm -f -n bangor * Using local deinstaller - run local deinstall cd /u01/grid/product/grid ./deinstall -local # Answer various questions by accepting all defaults # Prompted to run the folloiwng as root (all one line) /u01/app/oracle/media/deinstall/./perl/bin/perl -I/u01/app/oracle/media/deinstall/./perl/lib \ -I/u01/app/oracle/media/deinstall/./crs/install \ /u01/app/oracle/media/deinstall/./crs/install/rootcrs.pl -force -deconfig -paramfile \ "/local/home/grid/deinstall_noHomeName.rsp" # Process continues and finally prompts to run followng as root rm -rf /etc/oraInst.loc rm -rf /opt/ORCLfmap* Remove oracle home for databases using deinstall usign downloaded deinstall cd /u01/app/oracle/media/deinstall ./deinstall -home /u01/app/oracle/product/11.2/db_1 * Stop and remove the asm service (?) srvctl stop asm -force -n bangor srvctl remove asm -f -n bangor |
Posted by
Ook
at
01:34
0
comments
Labels: Oracle
Friday, 24 June 2011
Oracle : Startup 9.2 dataguard
startup nomount |
Posted by
Ook
at
07:54
0
comments
Labels: Oracle
Thursday, 2 June 2011
Oracle : Dropping queue tables
alter session set events '10851 trace name context forever, level 2'" , followed by a DROP TABLE tname |
Posted by
Ook
at
05:12
0
comments
Labels: Oracle
Thursday, 5 May 2011
Oracle : Clone grid control agent
In Grid Control->Deployments->Install Agent->Clone Agent On source server in dir above the agent home zip -r agent11g_201105v1.zip agent11g Copy to target server or the OEM server Take care to pick the correct OS in the drop down, linux != linux x64! |
Posted by
Ook
at
03:19
0
comments
Thursday, 7 April 2011
Linux : Faster file transfer via ssh and tar compression
time scp ARCHIVE_01.dbf oracle@remote.server.com:/b04/volbackupnew/oradata/NEWDEV5/dataguard/test real 41m5.699s time tar cvfz - ARCHIVE_01.dbf | ssh oracle@remote.server.com "tar zxvf - --directory /b04/volbackupnew/oradata/NEWDEV5/dataguard/test " real 0m57.987s |
Posted by
Ook
at
09:23
0
comments
Saturday, 2 April 2011
Jira : Dragging issues direct from the (Oracle) db
col c1 format a900 set lines 2000 pages 0 head off long 2000 longchunksize 2000 wrap on trimspool on trim on with base_data as ( select i.id iid, -1 aid, to_char('######### '||i.pkey ||' - '||i.assignee ||' - '||i.summary || ' #########') c1 from jira_dbo.jiraissue i where 1=1 and i.assignee like 'data%' union all select i.id iid, 0 aid, to_char(substr(i.DESCRIPTION,0,1000)) c1 from jira_dbo.jiraissue i where 1=1 and i.assignee like 'data%' union all select i.id, a.id, to_char(substr(a.ACTIONBODY,0,1000)) c1 from jira_dbo.JIRAISSUE i, jira_dbo.jiraaction a where 1=1 and a.issueid = i.id and i.assignee like 'data%' ) select c1 from base_data order by iid,aid |
Posted by
Ook
at
02:37
0
comments
Thursday, 10 March 2011
Oracle : oraenv gives XPointer evaluation failed
In 11G+ this is due ORACLE_BASE not being set in the course of running oraenv What is happening is $ORACLE_HOME/bin/orabase is being run to update $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml and erroring as the particular key it is looking for is not in the file ( PROPERTY NAME="ORACLE_BASE" I guess) - however the error is ignored resulting in $ORACLE_BASE being unset Made a one line change to oraenv to check the return value and use the OLD_ORACLE_BASE - which will probably work most of the time ;) ORACLE_BASE=`$ORABASE_EXEC` [ "$?" -ne 0 ] && { echo "Warning - failure of $ORABASE_EXEC"; ORACLE_BASE=$OLD_ORACLE_BASE; } # New line |
Posted by
Ook
at
03:51
1 comments
Labels: Oracle
Thursday, 19 August 2010
Oracle : Auditing object access in 9i
Peter Lawes added a comment - 19/Aug/10 11:40 AM
|
Posted by
Ook
at
03:40
0
comments
Labels: Oracle
Monday, 26 July 2010
Oracle : Impdp - objects that can be included/excluded
-- for database level export/import: |
Posted by
Ook
at
07:00
0
comments
Labels: Oracle
Thursday, 22 July 2010
Oracle : Drop a temp tablespace temp file
alter database tempfile '/u03/volnewdev7data/oradata/NEWDEV3/temp_02.dbf' drop including datafiles; |
Posted by
Ook
at
02:42
0
comments
Labels: Oracle
Wednesday, 21 July 2010
Oracle : Password file
At command line |
Posted by
Ook
at
06:49
0
comments
Labels: Oracle
Thursday, 15 July 2010
Oracle : Remove 11.1 RAC cluster
Use cluster remove tool found : http://download.oracle.com/otndocs/products/clustering/deinstall/clusterdeconfig.zip This is a command line tool - unzip on node and de-install database home then crs home ./clusterdeconfig -home /u01/app/crs/11.1.0/crs -checkonly ./clusterdeconfig -home /u01/app/crs/11.1.0/crs ./clusterdeconfig -home /u01/app/oracle/product/11.1.0/db_1 -checkonly ./clusterdeconfig -home /u01/app/oracle/product/11.1.0/db_1 Need to run a 3 root scripts on each node |
Posted by
Ook
at
03:22
0
comments
Labels: Oracle
Monday, 14 June 2010
RMAN : Simple restore of archive log to default location
$ORACLE_HOME/bin/rman nocatalog connect target dba_cron/password run { ALLOCATE CHANNEL c1 DEVICE TYPE DISK; restore archivelog sequence 214629; restore archivelog sequence 214630; } |
Posted by
Ook
at
06:16
0
comments
Labels: Oracle
Thursday, 29 April 2010
MS Sql : Ctas = SELECT INTO
In Oracle create table T1 as select * from T1 The equivalent of that in Sql Server is SELECT INTOselect * into T2 from T1 |
Posted by
Ook
at
09:02
0
comments
Labels: Oracle
Friday, 5 March 2010
Oracle Dataguard : dgmgrl - various commands
<b>Start dgmgrl
<b>Check the configuration status<br /></b>
<b>Create/enable configuration<br /></b>
<b>Stop transmit of dbs from primary <br /></b>
<b>Temporarily stop broker managing and monitoring a standby database.<br /></b>Switchover
<b>Manual Failover<br /></b>
|
Posted by
Ook
at
06:33
0
comments
Labels: Oracle
Wednesday, 10 February 2010
Oracle Dataguard : Bring standby in line using rman
* ON STANDBY {noformat} sqlplus / as sysdba SQL>startup mount SQL>select current_scn from v$database; CURRENT_SCN ----------- 151214061 {noformat} * ON LIVE {noformat} export ORACLE_SID=FOSDB . oraenv $ORACLE_HOME/bin/rman nocatalog RMAN>connect target DBA_CRON/DBA_CRON RMAN>backup incremental from scn 151214061 database format '/b01/volbackupfos/FOSDB/201002/ForStandby_%U' tag 'FORSTANDBY'; RMAN>backup current controlfile for standby format '/b01/volbackupfos/FOSDB/201002/ForStandby_ctl.bkp'; scp * oracle@slofosdb01:/u03/volfoslivedata01/oradata/201002 {noformat} OR - actually did a full backup and transfer {noformat} RMAN>backup full database format '/b01/volbackupfos/FOSDB/201002/ForStandby_%U' tag 'FORSTANDBY'; RMAN>backup current controlfile for standby format '/b01/volbackupfos/FOSDB/201002/ForStandby_ctl.bkp'; scp * oracle@slofosdb01:/u03/volfoslivedata01/oradata/201002 {noformat} {noformat} * Must stop dataguard or recovery complains cannot get unique lock on files sqlplus / as sysdba SQL> alter database recover managed standby database cancel; {noformat} * ON STANDBY {noformat} $ORACLE_HOME/bin/rman nocatalog RMAN> connect target DBA_CRON/DBA_CRON RMAN> shutdown immediate; RMAN> startup nomount; RMAN> restore standby controlfile from '/u03/volfoslivedata01/oradata/201002/ForStandby_ctl.bkp'; RMAN> shutdown immediate; RMAN> startup mount RMAN> -- Catalog the copied files RMAN> catalog start with '/u03/volfoslivedata01/oradata/201002/' RMAN> restore database; RMAN> recover database noredo; RMAN> exit {noformat} {noformat} sqlplus / as sysdba SQL>startup mount SQL> alter database recover managed standby database disconnect; {noformat} * Needed to recreate STANDBY LOGFILEs as named differently from source db {noformat} sqlplus / as sysdba SQL> alter database recover managed standby database cancel; Database altered. select 'alter database drop standby logfile group ' group# ';' from v$standby_log; --Run generated script --This plus others ALTER DATABASE ADD STANDBY LOGFILE '/u02/volfoslivelogs01/oradata/FOSDGFOSDB_1srl2.f' SIZE 100M REUSE; {noformat} sqlplus / as sysdba SQL>startup mount SQL> alter database recover managed standby database disconnect; {noformat} |
Posted by
Ook
at
04:44
0
comments
Labels: Oracle
Oracle Dataguard : Check status from SQL
--On secondary select current_scn from v$database --On primary select scn_to_timestamp(287481398) from v$database union all select scn_to_timestamp(current_scn) from v$database; If too far apart may need to force log switch on primary ALTER SYSTEM SWITCH LOGFILE; Also see select * from V$DATAGUARD_STATUS; |
Posted by
Ook
at
04:44
0
comments
Labels: Oracle
Friday, 5 February 2010
Oracle : Rolling sequences forward
declare dummy number; begin for sq in ( select sequence_owner||'.'||sequence_name nm from dba_sequences where sequence_owner in ( 'CLIENTDBO','DEALERTOOLS_DBO','GAINDBO','IT_JOB_LOG','MXDBO','MYBROKERDBO', 'NEWTOPSDBO','ODFSDBO','ODL_DBADMIN_DBO','ODL_DBSERVICES_DBO','ODL_USERAPPS_DBO', 'PRODUCTDBO','RECONCILIATIONSDBO','SETTLEMENTSDBO','USER_ADMIN_SYS','WEB') ) loop dbms_output.put_line(sq.nm); for i in 1..10000 loop execute immediate 'select '||sq.nm||'.nextval from dual' into dummy; end loop; end loop; end; |
Posted by
Ook
at
08:30
0
comments
Labels: Oracle
Friday, 9 October 2009
Oracle : SQL Developer Data Modeller
Pros
|
Posted by
Ook
at
01:48
0
comments
[ Show » ]
Peter Lawes
added a comment - 19/Aug/10
10:47 AM