Monthly Archives: February 2016

ORA-38500: USING CURRENT LOGFILE option not available without standby redo logs

bash-3.2$ sqll SQL*Plus: Release Production on Sun Feb 28 01:04:13 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> SQL> SQL> SQL> SQL> SQL> STARTUP NOMOUNT ORACLE instance started. Total System Global Area 2.0583E+10 bytes Fixed Size 2190488 bytes Variable Size 3087012712 bytes Database Buffers 1.7448E+10 bytes Redo […]

Warning: lost write detection is not enabled on the standby while it is enabled on the primary

Warning: lost write detection is not enabled on the standby while it is enabled on the primary The above error is caused because of the following parameter set to NONE in standby whereas it has been set to TYPICAL in primary database. So we have altered the below parameter to TYPICAL in standby and the […]


bash-3.00$ pwd /export/anar/oradata/ANARDB bash-3.00$ cp /export/anar/oradata/ANARDB/backup/control01.ctl . bash-3.00$ cp control01.ctl control02.ctl bash-3.00$ cp control01.ctl control03.ctl bash-3.00$ ls *.ctl control01.ctl control02.ctl control03.ctl bash-3.00$ rm *.dbf bash-3.00$ bash-3.00$ bash-3.00$ ls arch control01.ctl control02.ctl control03.ctl redo01.log redo02.log redo03.log backup bash-3.00$ rm *.ctl bash-3.00$ cp ./backup/*.dbf . bash-3.00$ cp /export/anar/oradata/ANARDB/backup/control01.ctl . bash-3.00$ cp control01.ctl control02.ctl bash-3.00$ cp control01.ctl control03.ctl […]


bash-3.00$ ls -lrt total 3720312 -rw-r—– 1 oracle oinstall 69214208 Nov 27 17:41 temp02.dbf -rw-r—– 1 oracle oinstall 10493952 Nov 27 17:41 ttstest.dbf -rw-r—– 1 oracle oinstall 52429312 Nov 27 17:45 redo02.log -rw-r—– 1 oracle oinstall 52429312 Nov 27 18:14 redo03.log drwxr-xr-x 2 oracle oinstall 1024 Nov 27 18:14 arch -rw-r—– 1 oracle oinstall 5251072 […]


SQL> show parameter control_file NAME TYPE VALUE ———————————— ———– —————————— control_files string /export/anar/oradata/ANARDB/control01.ctl, /export/anar/oradata/ANARDB/control02.ctl, /export/anar/oradata/ANARDB/control03.ctl SQL> shu abort ORACLE instance shut down. SQL> SQL> exit Disconnected from Oracle Database 10g Enterprise Edition Release – 64bit Production With the Partitioning, OLAP and Data Mining options bash-3.00$ ls arch control02.ctl cooldata01.dbf redo01.log redo03.log system01.dbf ttstest.dbf users01.dbf […]

Point-in-time recovery used by AVAMAR

Sqlplus “/ as sysdba”; Shut immediate startup nomount RMAN> @@ANARTEST-72.tmp 2> connect target *; 3> **end-of-file** 4> run { 5> allocate channel c0 type sbt PARMS=”SBT_LIBRARY=/opt/AVMRclnt/lib/” format ‘%d_%U’; 6> send channel ‘c0’ ‘”–libport=45603″ “–cacheprefix=ANARTEST_c0” “–sysdir=/opt/AVMRclnt/etc” “–bindir=/opt/AVMRclnt/bin” “–vardir=/opt/AVMRclnt/var/clientlogs” “–logfile=/opt/AVMRclnt/var/clientlogs/MOD-1455616226902-2002-OracleANARTEST-avtar.log0” “–ctlcallport=45201″‘; 7> set until scn 884703403597; 8> restore database; 9> recover database; 10> } 11> alter database […]

ORA-19930: file string has invalid checkpoint SCN string

In alert log: Tue Feb 16 11:51:02 2016 alter database mount Tue Feb 16 11:51:07 2016 Successful mount of redo thread 1, with mount id 958201638 Database mounted in Exclusive Mode Lost write protection disabled Completed: alter database mount Tue Feb 16 11:54:26 2016 Errors in file /u01/app/oracle/diag/rdbms/ANARTEST/ANARTEST/trace/ANARTEST_ora_10509.trc: ORA-19930: file /u01/app/oracle/fast_recovery_area/ANARTEST/control02.ctl has invalid checkpoint SCN […]

flashback restore points in oracle

To create a normal restore point, we require either one of the following privileges. SELECT ANY DICTIONARY FLASHBACK ANY TABLE For example: SQL> CREATE TABLE t (x,y,z) 2 ENABLE ROW MOVEMENT 3 AS 4 SELECT object_id 5 , object_name 6 , object_type 7 FROM all_objects 8 WHERE ROWNUM <= 5; Table created. SQL> SELECT * […]

Use Flashback Query

SQL> select text from dba_source where name=’ANAR_UPD_SALES’ order by line; TEXT ——————————————————————————– procedure ANAR_UPD_SALES as begin for i in 1..10000 loop update sales set amount_sold=amount_sold*1 where rownum<2; commit; end loop; end; 7 rows selected. SQL> drop procedure ANAR_UPD_SALES; Procedure dropped. SQL> connect / as sysdba Connected. SQL> select text from dba_source as of timestamp systimestamp […]

Duplicate PDB / Database 12c

Target CDB = ANAR_CDB12C1 Auxiliary CDB = ANAR_CDB12C3 PDB to duplicate = Only ANAR_PDB1 [bash-3.2$ ]$ rman target sys/<password>@ANAR_CDB12C1 auxiliary sys/<password>@ANAR_CDB12C3 Recovery Manager: Release – Production on Sat Jul 20 13:15:57 2016 Copyright (c) 1982, 2016, Oracle and/or its affiliates. All rights reserved. connected to target database: ANAR_CDB12C1 (DBID=2076797181) connected to auxiliary database: ANAR_CDB12C3 […]


echo “—————————————————————————-” echo Report by Anar Godjaev Oracle 9i/10g/11g OCA,OCP,SQL Expert, PL/SQL Prof,RAC echo “—————————————————————————-” #!/bin/ksh # This shell script performs the following steps # shutdown the database with immediate mode # log file ORACLE_HOME=/data1/oracle/product/8.1.7 ; export ORACLE_HOME ORACLE_SID=ORCL export ORACLE_SID LOGFILE=/data1/oracle/admin/ORCL/log/anar.log clear echo “Obase-1 the database is closed.” echo ” Are you sure you? […]

Export Import / usuful command

Practical: D:\ORACLE_HOME\BIN> Impdp -help D:\ORACLE_HOME\BIN> Expdp -help Table Level: E:>EXPDP  system/oracle TABLES=anar.test1,anar.test2 DIRECTORY=DAILY_BK_DIR  DUMPFILE=test1_test2.dmp  LOGFILE=test1_test2.log E:>EXPDP  system/oracle TABLES=hr.test1 DIRECTORY=DAILY_BK_DIR  DUMPFILE=test1_backup_%date:~7,2%%date:~4,2%%date:~10,4%_%time:~0,2%%time:~3,2%%time:~6,2%.dmp  LOGFILE=test1_backup_logfile%date:~7,2%%date:~4,2%%date:~10,4%_%time:~0,2%%time:~3,2%%time:~6,2%.log Day     (DD) = %date:~7,2% Month (MM)=%date:~4,2% Year    (YY)=%date:~10,4% Hour   (HH)=%time:~0.2% Minutes(MM)=%time:~3,2% Seconds(SS)=%time:~6,2% E:>IMPDP  TABLES=anar.test1 DIRECTORY=DAILY_BK_DIR  DUMPFILE=test1_test2.DMP LOGFILE=imp_test1test2.log OR E:>IMPDP  schemas_name/password      DIRECTORY=DAILY_BK_DIR  DUMPFILE= test1_test2.DMP LOGFILE= imp_test1test2.log OR E:>IMPDP  FULL=Y           DIRECTORY=DAILY_BK_DIR  DUMPFILE=anar_test1.DMP LOGFILE=imp_test1test2.log Note: If the […]

Apache Tomcat –shutdown/startup script (shell)   /  Script is useful for you !!!!!!!!! #!/bin/sh # —————————————————————————– # Stop script for the CATALINA Server # # $Id:,v 1.3 2002/08/04 18:19:43 patrickl Exp $ # —————————————————————————– # resolve links – $0 may be a softlink PRG=”$0″ while [ -h “$PRG” ] ; do   ls=`ls -ld “$PRG”`   link=`expr “$ls” : […]

RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece

RMAN> restore controlfile from autobackup; Starting restore at 19-FEB-15 using channel ORA_DISK_1 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150219 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150218 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150217 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150216 channel ORA_DISK_1: looking for AUTOBACKUP on day: 20150215 channel ORA_DISK_1: looking […]

How can Restore SPFILE (on Windows)

C:\Documents and Settings\oracle>rman target / Recovery Manager: Release – Production on Sat Feb 18 00:02:33 2015 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database: PROD (DBID=183876134) RMAN> show all; using target database control file instead of recovery catalog RMAN configuration parameters for database with db_unique_name PROD are: […]

The new ORAchk release is now available

ORAchk replaces the popular RACcheck tool, extending the coverage based on prioritization of top issues reported by users, to proactively scan for known problems within the area of: +Oracle Database +Enterprise Manager Cloud Control (12c only) +E-Business Suite +Oracle Hardware Systems +Oracle Identity and Access Management +Oracle Siebel +Oracle PeopleSoft ORAchk features: Proactively scans for […]

Oracle Data Pump Single parititon export/transport

[oracle@anardbrac1 ~]$ sqlplus ‘/as sysdba’ SQL> CREATE TABLESPACE transport_test_ts_1 DATAFILE ‘tt_ts1.dbf’ SIZE 128K AUTOEXTEND ON NEXT 128K; SQL> CREATE TABLESPACE transport_test_ts_2 DATAFILE ‘tt_ts2.dbf’ SIZE 128K AUTOEXTEND ON NEXT 128K; SQL> ALTER USER test QUOTA UNLIMITED ON transport_test_ts_1 QUOTA UNLIMITED ON transport_test_ts_2; SQL> CONN test/test SQL> CREATE TABLE transport_test_tab ( id NUMBER NOT NULL, code VARCHAR2(10) […]

Using ftp to transfer files in batch mode

bash-3.2$ uname -a SunOS bakudbtstora1 5.10 Generic_150400-11 sun4v sparc sun4v bash-3.2$ ftp -inv <<-EOD > open bakudbtstora1 > user oracle ora123 > cd ftproot > binary > mput test*.txt > bye > EOD Connected to localhost. 220 vmx01 FTP server ready. 331 Password required for oracle. 230 User oracle logged in. 250 CWD command successful. […]

Enable And/Or Disable Oracle Database Vault on Windows machines

1.) Before disabling the database vault , the following oracle database server components needs to be stopped : Oracle Database Instance . Oracle Listener. Oracle Enterprise Manager. In general the following commands can be used to stop the above components after setting the following environment variables PATH ORACLE_HOME ORACLE_SID TNS_ADMIN LD_LIBRARY_PATH. $emctl stop dbconsole $lsnrctl […]

Range partitioning

Partition on a numeric value range: CREATE TABLE anar ( anarno NUMBER(4), ename VARCHAR2(30), sal NUMBER ) PARTITION BY RANGE(anarno) ( partition e1 values less than (1000) tablespace tablespace_anar1, partition e2 values less than (2000) tablespace tablespace_anar2, partition e3 values less than (MAXVALUE) tablespace tablespace_anar3 ); Partition on a VARCHAR2 string: CREATE TABLE anar ( […]