Monday, February 17, 2014

ORA-01194: file 1 needs more recovery to be consistent : No archivelog database asking for recovery

ORA-01194: file 1 needs more recovery to be consistent

This is the case datafiles were inconsistent and it is asking for recovery when you try to start the noarchivelog mode database.

Step 1: Start the database in mount.
$sqlplus / as sysdba

SQL>startup mount;

Step 2: Check the datafiles which required recovery.
SQL>select * from v$recover_file;

Step 3: As you do not have the needed archivelogs to recover those files, you should drop them offline then recover database and open.

SQL>alter database datafile <FILE#> offline drop;

NOTE: For sure you will loose data inside those files.

Step 4: Recover the database.
SQL>recover database;

If you come across below error

ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

then, do the following
SQL>recover database using backup controlfile until cancel;

It will ask to Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

When the session request a sequence for recovery please point write the path of the each online redolog one after another untill its say database recovered. You can select the redolog member from below query.

SQL>select group#, member FROM v$logfile;
    GROUP#
----------
MEMBER
--------------------------------------------------------------------------------
         3
/home/oracle/u01/oradata/SID/redo03.log

         2
/home/oracle/u01/oradata/SID/redo02.log

         1
/home/oracle/u01/oradata/SID/redo01.log
NOTE: Please repeat the recovery process, When the session request a sequence for recovery please point write the path of the online redolog:

Step 5: Then open the database resetlogs.
SQL>alter database open resetlogs;

Wednesday, February 12, 2014

Nano – Shortcuts, Syntax Highlight And Nanorc Config File

I have been using nano as my favorite console editor (i use emacs/kate for the rest) for some time now. It’s simplicity, the speed and usefulness of it made it what it is. But recently, i’ve been trying to find out more features that i might been missing. One of those were the shortcuts. The other was syntax highlighting! Meanwhile, the things i discovered!

Before we start, here’s some useful links:

So let’s start with the basic shortcuts!
“Special functions use the Control (Ctrl) key, displayed in the help and shortcut lists as ^; the Meta key, displayed as M; or the Escape (Esc) key.”
The help system in nano is available by pressing ^G.

Thursday, December 26, 2013

Subversion, webdav, LDAP and folder restrictions

If you need to configure a svn server on Linux with LDAP authentication, webdav and insert specific directory restrictions you can follow these instructions.
1: you need to install subversion and apache in your Linux server (I will omit this part).
2: you need to configure webdav to access svn over http and configure LDAP access.

Make sure to have the following apache modules installed and configured:
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule dav_module modules/mod_dav.so
LoadModule authn_alias_module modules/mod_authn_alias.so
I am usual to configure subversion in /srv/svn folder.
The users allowed to access the SVN have to belong to the LDAP group CN=SVN-AUTHORIZATION,OU=Groups GSO,DC=test,DC=example,DC=com

Tuesday, December 24, 2013

Apply Oracle patch

1. Shutdown Oracle instance
Login with oracle user, type the command:
$dbstop $ORACLE_HOME

2. Download patches, go to https://support.oracle.com then search patch name/number. Upload patches (ex: 16902043, 17762528) to server (ex: /home/oracle) and extract.

3. Download Oracle opatch tool (ex: 68806880)

4. Copy OPatch folder in $ORACLE_HOME to another backup place

$cp $ORACLE_HOME/OPatch /backup
$ rm -r $ORACLE_HOME/OPatch/*

 5. Copy opatch to $ORACLE_HOME

$cp p68806880....zip $ORACLE_HOME
$cd $ORACLE_HOME
$ unzip p68806880....zip

6. Apply patch

$cd 16902043
$$ORACLE_HOME/OPatch/opatch apply
$cd 17762528
$$ORACLE_HOME/OPatch/opatch apply

7. Start oracle database

$dbstart $ORACLE_HOME

Tuesday, December 17, 2013

How to upgrade oracle 11.2.0.1 to 11.2.0.3 through PUTTY or SILENT MODE

Upto 10g release 2 database upgradation means first you need to install base version then apply the upgrade patch. Ex: If you want to install 10.2.0.5 database software first install the base version i.e 10.2.0.1 then apply the upgrade patch(ex 10.2.0.5) on that base version so that software will upgraded.

Coming to 11g Release 2 upgradation means each version patch is equalent to base version [Here is there no concept of base version]. You can directly install that patch version and upgrade the database.

You are installing 11.2.0.3 software and migrating the database to 11.2.0.3.