Monday, February 27, 2017

Wednesday, January 25, 2017

Move a tablespace from ASM to filesystem

Move a tablespace to ASM from filesystem

Follow the below step to move tablespace to ASM from filesystem
Steps are as below.

1. Offilne the tablespace
2. Copy using RMAN
3. Rename datafile
4. Make it online, recover if required
5. Delete the old datafile

SQL> set line 300
SQL> set pages 300
SQL> col FILE_NAME for a100
SQL> SELECT FILE_NAME , tablespace_name FROM DBA_DATA_FILES;

FILE_NAME                                                                                            TABLESPACE_NAME
---------------------------------------------------------------------------------------------------- ------------------------------
/u01/app/oracle/product/12.1.0.2/orcltst/dbs/ORA_TEST                                                ORA_TEST

SQL>  ALTER TABLESPACE ORA_TEST  offline;

Tablespace altered.

SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
localhost:/db/home/oracle > rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Wed Jan 25 09:48:59 2017

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

connected to target database: ORCLTST (DBID=3881831134)

RMAN> copy datafile '/u01/app/oracle/product/12.1.0.2/orcltst/dbs/ORA_TEST' to  '+ORCLTST';

Starting backup at 25-JAN-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00022 name=/u01/app/oracle/product/12.1.0.2/orcltst/dbs/ORA_TEST
output file name=+ORCLTST/ORCLTST/DATAFILE/ora_test.463.934210303 tag=TAG20170125T095142 RECID=4 STAMP=934192303
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 25-JAN-17

Starting Control File and SPFILE Autobackup at 25-JAN-17
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of Control File and SPFILE Autobackup command on ORA_DISK_1 channel at 01/25/2017 09:51:45
ORA-07217: sltln: environment variable cannot be evaluated.

RMAN>

SQL> alter database rename file '/u01/app/oracle/product/12.1.0.2/orcltst/dbs/ORA_TEST' to '+ORCLTST/ORCLTST/DATAFILE/ora_test.463.934210303';

Database altered.

SQL> col FILE_NAME for a100
SQL> set line 300
SQL> set pages 300
SQL> SELECT FILE_NAME , tablespace_name FROM DBA_DATA_FILES;

FILE_NAME                                                                                            TABLESPACE_NAME
---------------------------------------------------------------------------------------------------- ------------------------------
+ORCLTST/ORCLTST/DATAFILE/ora_test.463.934210303                                                      ORA_TEST

22 rows selected.

SQL> select * from gv$recover_file;

   INST_ID      FILE# ONLINE  ONLINE_ ERROR                                                                CHANGE# TIME          CON_ID
---------- ---------- ------- ------- ----------------------------------------------------------------- ---------- --------- ----------
         2         22 OFFLINE OFFLINE OFFLINE NORMAL                                                             0                    0
         1         22 OFFLINE OFFLINE OFFLINE NORMAL                                                             0                    0

8 rows selected.

SQL> alter tablespace ORA_TEST  online;

Tablespace altered.

SQL>  select * from gv$recover_file;

no rows selected

SQL> select count(*) from ;


  COUNT(*)
----------
         1

SQL> alter system switch all logfile;

System altered.

SQL> SELECT FILE_NAME , tablespace_name FROM DBA_DATA_FILES;

FILE_NAME                                                                                            TABLESPACE_NAME
---------------------------------------------------------------------------------------------------- ------------------------------
+ORCLTST/ORCLTST/DATAFILE/ora_test.463.934210303                                                      ORA_TEST

SQL>

Wednesday, December 14, 2016

Srvctl is not able to start database (ORA-12547: TNS:lost contact)

Srvctl is not able to start database

[oracle@orcldb-n2 ~]$ srvctl start database -d orcl
PRCR-1079 : Failed to start resource ora.orcl.db
ORA-12547: TNS:lost contact
CRS-5017: The resource action "ora.orcl.db start" encountered the following error:
ORA-12547: TNS:lost contact
. For details refer to "(:CLSN00107:)" in "/u01/app/oracle/diag/crs/orcldb-n1/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.orcl.db' on 'orcldb-n1' failed
ORA-12547: TNS:lost contact
CRS-5017: The resource action "ora.orcl.db start" encountered the following error:
ORA-12547: TNS:lost contact
. For details refer to "(:CLSN00107:)" in "/u01/app/oracle/diag/crs/orcldb-n2/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.orcl.db' on 'orcldb-n2' failed
ORA-12547: TNS:lost contact
CRS-2632: There are no more servers to try to place resource 'ora.orcl.db' on that would satisfy its placement policy
ORA-12547: TNS:lost contact
[oracle@orcldb-n2 ~]$


Below document can help you. It can happen if the it is a cloned env.

Local SQL*Plus Connection and DBCA Fails With: ORA-12547: TNS:Lost Contact (Doc ID 422173.1)

1. Check kernel parameters settings
2. Check permission of permissions on the ORACLE executable, and config.o
[oracle@orcldb-n2 orcl]$ ls -lrt $ORACLE_HOME/rdbms/lib/config.o
-rw-r--r-- 1 oracle dba 1328 Dec 14 13:06 /u01/app/oracle/product/12.1.0.2/orcl/rdbms/lib/config.o
[oracle@orcldb-n2 orcl]$ ls -lrt $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle dba 324021455 Dec 14 13:06 /u01/app/oracle/product/12.1.0.2/orcl/bin/oracle
[oracle@orcldb-n2 orcl]$
3. Do relink all  on the database nodes
[oracle@orcldb-n2 orcl]$ relink all
writing relink log to: /u01/app/oracle/product/12.1.0.2/orcl/install/relink.log
[oracle@orcldb-n2 orcl]$ 

Monday, December 12, 2016

ORA-04061: existing state of has been invalidated

Getting below error.

ORA-04061: existing state of has been invalidated
ORA-04061: existing state of package "" has been invalidated
ORA-04065: not executed, altered or dropped package
ORA-06508: PL/SQL: could not find program unit being called:

Do below step to resolve this issue.

1. If it is EBS, then check workflow notification mailer , and OPMN services.
2. If it is other application or does not resolved after 1 search the search the session which is holding this ovject in cache.
3. Kill that session.

java.sql.SQLDataException: ORA-01861: literal

Oracle Concurrent programs are getting below error.

Debug Flag: N
{P_END_DATE=2016/12/02 00:00:00, P_START_DATE=2016/11/01 00:00:00, P_TYPE=AMEX}
Calling XDO Data Engine...
--SQLException
java.sql.SQLDataException: ORA-01861: literal does not match format string
 
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
        at oracle.apps.xdo.dataengine.XMLPGEN.processQuery(XMLPGEN.java:1947)
        at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:501)
        at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
        at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:308)
        at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
        at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
        at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
        at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
        at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
        at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:334)
        at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:294)
        at oracle.apps.fnd.cp.request.Run.main(Run.java:157) 

There are below things that you can check to troubleshoot.

1. Check the template file if any date field is creating any issue.
2. Any data it is pulling are triggering this issue.
 

SMTP Error. Getting below error while trying to send email in XXXXXXX instance

Getting below error in EBS R12.1.3 in Oracle Database 

SMTP Error. Getting below error while trying to send email in XXXXXXX instance
 
Oracle Error in Send Mail prog--ORA-29277: invalid SMTP operation
ORA-06512: at "SYS.UTL_SMTP", line 82
ORA-06512: at "SYS.UTL_SMTP", line 540
ORA-06512: at "SYS.UTL_SMTP", line 525
ORA-29278: SMTP transient error: 421 Service not available 

It can be below different issues.

1. You don't have enough privileges.
2. SMTP server not given properly.
3. Check WF config to validate SMTP server.
4. Firewall ports are opened for the SMTP mail. Use command prompt to send email.

FNDLOAD gives error

FNDLOAD apps/password Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct CISTON.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
Cannot complete applications logon. You may have entered an invalid applications password, or there may have been a database connect error.
Attempt to connect to the database using dbcfile .dbc and Applications User apps/password has failed. The dbcfile may be configured incorrectly or the Applications Username and Password may not match.

It can be related to the below incidents.

1. Wrong password
2. Wrong dbc file, try download to test it.
3. syntax error of FNDLOAD


Troubleshooting ACFS-07981: Metadata Validation Errors

  Troubleshooting ACFS-07981: Metadata Validation Errors Introduction The ACFS-07981 error indicates that an attempt to run an online file ...