Showing posts with label Oracle Database 12c. Show all posts
Showing posts with label Oracle Database 12c. Show all posts

Tuesday, September 13, 2016

Replace corrupted undo tablespace SOA 10g


In certain cases, Oracle Products doesn't get corrupted, because bad stopping or something, this commands help us to change the undo and common tablespaces that fail commonly


In this case SOA doesn't start up because the undo tbs was currupted.

ALTER SYSTEM SET UNDO_TABLESPACE = UNDOTBS2;

--Resize undo datafile
--ALTER DATABASE DATAFILE '/u01/oradata/soa/undotbs02.dbf' RESIZE 10000M;

--Create undo tablespace
--CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE '/u01/oradata/soa/undotbs02.dbf' SIZE 1000M AUTOEXTEND ON;

--Drop undo tablespace
--drop tablespace UNDOTBS2;

select * from user_tablespaces;

--Drop undo tablespace including contents and datafiles
--DROP TABLESPACE undotbs1 INCLUDING CONTENTS AND DATAFILES;

--Parameters
select * from  V$OPTION;


select
   file_name,
   bytes,
   autoextensible
from
   dba_data_files;

select * from
all_users;

select * from user_tablespaces;


SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS


ORABPEL


ALTER tablespace ORABPEL

alter tablespace ORABPEL add DATAFILE '/u01/oradata/soa/orabpe2.dbf' SIZE 5980M AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED;

alter tablespace ORABPEL add DATAFILE '/u01/oradata/soa/orabpe3.dbf' SIZE 5980M AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED;

alter tablespace ORABPEL add DATAFILE '/u01/oradata/soa/orabpe4.dbf' SIZE 5980M AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED;

alter tablespace ORABPEL add DATAFILE '/u01/oradata/soa/orabpe5.dbf' SIZE 5980M AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED;

alter TABLESPACE SYSAUX add DATAFILE  '/u01/oradata/soa/sysaux02.dbf' SIZE 550M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;

alter TABLESPACE SYSAUX add DATAFILE  '/u01/oradata/soa/sysaux03.dbf' SIZE 550M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;

CREATE UNDO TABLESPACE UNDOTBS2 DATAFILE '/u01/oradata/zucprod/undotbs02.dbf' SIZE 30000M AUTOEXTEND ON;

CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE
  '/u01/oradata/zucprod/undotbs01.dbf' SIZE 30000M AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED
ONLINE
RETENTION NOGUARANTEE
BLOCKSIZE 8K
FLASHBACK ON;


ALTER SYSTEM SET UNDO_TABLESPACE = UNDOTBS2;

DROP TABLESPACE UNDOTBS2 INCLUDING CONTENTS AND DATAFILES;

UNDOTBS2

Tuesday, May 17, 2016

Install APEX 4.2 in OLS 6


Helo guys, Now we are going to install APEX 4.02  in OLS 6

There are two ways to install it.

1.- When you have install the database with this option.
2.- When you don't.

Here we are going to use the first option.

The database:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options

1.- Locate the database home, in my case:

/u01/app/oracle/product/12c/db_1

2.- Search if you have de apex folder

[oracle@alexdb db_1]$ ls
addnode      dbs            javavm   odbc         precomp       sqlpatch
apex         dc_ocm         jdbc     olap         QOpatch       sqlplus
assistants   deinstall      jdk      OPatch       R             srvm
bin          demo           jlib     opmn         racg          suptools
ccr          diagnostics    ldap     oracore      rdbms         sysman
cdata        dmu            lib      oraInst.loc  relnotes      ucp
cfgtoollogs  dv             log      ord          rest          usm
clone        has            md       oui          root.sh       utl
crs          hs             mgw      owm          scheduler     wwg
css          install        network  perl         slax          xdk
ctx          instantclient  nls      plsql        sqldeveloper

If you don't have it, you must download it from:

http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

3.- Run script 
@apex_epg_config.sql /u01/app/oracle/product/12c/db_1

4.- Run script
@apxconf.sql

Voilá!


Notes:
Please be sure you have this users unlocked and not expired: Example: If EXPIRED - Change password for following users : ANONYMOUS,XDB,APEX_PUBLIC_USER
,FLOWS_FILES,APEX_040200.
IF LOCKED - Unlock: ALTER USER ANONYMOUS ACCOUNT UNLOCK; ALTER USER XDB ACCOUNT UNLOCK; ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK; ALTER USER FLOWS_FILES ACCOUNT UNLOCK; ALTER USER APEX_040200 ACCOUNT UNLOCK; SQL > ALTER USER ANONYMOUS IDENTIFIED BY anonymous; SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK; SQL> ALTER USER XDB IDENTIFIED BY xdb; SQL> ALTER USER XDB ACCOUNT UNLOCK;
That's because APEX is going to prompt you about XDB Credentials if something is wrong

=)