Thursday, July 23, 2015

Connecting with a user which has SYSDBA privilege, you act like SYS user

bash-3.2$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 23 11:12:10 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL>
SQL> show user
USER is "SYS"
SQL>
SQL>
SQL>
SQL> show parameter REMOTE_LOGIN_PASSWORDFILE

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE
SQL>
SQL>

SQL>
SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE

SQL>
SQL>
SQL>
SQL> create user admin identified by admin;

User created.

SQL> grant sysdba to admin;

Grant succeeded.

SQL> grant dba to admin;

Grant succeeded.

SQL>
SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE
ADMIN                          TRUE  FALSE FALSE

SQL>

SQL>
SQL> grant sysoper to admin;

Grant succeeded.

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE
ADMIN                          TRUE  TRUE  FALSE


SQL>conn admin/admin
SQL> show user
USER is "ADMIN"
SQL>
SQL> select * from v$tablespace;

       TS# NAME                           INC BIG FLA ENC
---------- ------------------------------ --- --- --- ---
         0 SYSTEM                         YES NO  YES
         1 SYSAUX                         YES NO  YES
         4 USERS                          YES NO  YES
         3 TEMP                           NO  NO  YES
         6 EXAMPLE                        YES NO  YES
         5 UNDOTBS2                       YES NO  YES

6 rows selected.

but when you go to shutdown  databasethen use sysdba role

SQL>
SQL> conn admin/admin as sysdba
Connected.
SQL>
SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

SQL> conn admin/admin as sysdba
Connected.
SQL> show user
USER is "SYS"
SQL>
SQL>

if use without  as sysdba so you got ora error

SQL>
SQL> conn admin/admin
Connected.
SQL>
SQL> shut immediate
ORA-01031: insufficient privileges
SQL>


Wednesday, July 22, 2015

OS Authentication on Oracle Server in 11gr2



Connect as sysdba

should be oracle user and os user same
in my case oracle is os user

SQL>
SQL>
SQL>
SQL> create user "OPS$ORACLE" identified by externally;

User created.

SQL> grant connect,resource to "OPS$ORACLE";

Grant succeeded.

SQL> show parameter auth

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
ldap_directory_sysauth               string      no
os_authent_prefix                    string      ops$
remote_os_authent                    boolean     FALSE
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
bash-3.2$
bash-3.2$
bash-3.2$ sqlplus /

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 22 12:06:26 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> show user
USER is "OPS$ORACLE"
SQL>

Wednesday, July 15, 2015

Oracle Error: ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [4], [18313], [18410], [], [], [], [], [], [], []

oracle 11gr2,solaris10

After Power Fail Alter database open fails with

ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr]


======================================================================================

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1],
[4], [18313], [18410], [], [], [], [], [], [], []


SQL> shut abort;
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area  647204864 bytes
Fixed Size                  2213816 bytes
Variable Size             423626824 bytes
Database Buffers          218103808 bytes
Redo Buffers                3260416 bytes
Database mounted.
SQL> recover database until cancel using backup controlfile;
ORA-00279: change 1046055 generated at 07/15/2015 11:46:31 needed for thread 1
ORA-00289: suggestion :
/opt/oracle/flash_recovery_area/TEST11G/archivelog/2015_07_15/o1_mf_1_4_%u_.arc
ORA-00280: change 1046055 for thread 1 is in sequence #4


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
'/opt/oracle/flash_recovery_area/TEST11G/archivelog/2015_07_15/o1_mf_1_4_%u_.arc
'
ORA-27037: unable to obtain file status
Solaris-AMD64 Error: 2: No such file or directory
Additional information: 3


ORA-00308: cannot open archived log
'/opt/oracle/flash_recovery_area/TEST11G/archivelog/2015_07_15/o1_mf_1_4_%u_.arc
'
ORA-27037: unable to obtain file status
Solaris-AMD64 Error: 2: No such file or directory
Additional information: 3


SQL> recover database until cancel using backup controlfile;
ORA-00279: change 1046055 generated at 07/15/2015 11:46:31 needed for thread 1
ORA-00289: suggestion :
/opt/oracle/flash_recovery_area/TEST11G/archivelog/2015_07_15/o1_mf_1_4_%u_.arc
ORA-00280: change 1046055 for thread 1 is in sequence #4


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs;

Database altered.

SQL>
SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Current log sequence           1
SQL>
SQL>

Tuesday, June 23, 2015

SOLARIS 11 INSTALLATION STEPS

SOLARIS 11 INSTALLATION STEP BY STEP

















Friday, May 22, 2015

FULL DATABASE EXPORT BACKUP USING DATAPUMP (EXPDP)


Change path as per your requirment



bash-3.2$
bash-3.2$ cat full_export.sh

ORACLE_SID=TESTRE
ORACLE_HOME=/opt/oracle/product/10.2.0/db_1; export ORACLE_HOME
PATH=$ORACLE_HOME/bin; export PATH
expdp system/manager dumpfile=full_backup14012015.dmp logfile=full_backuplog.log directory=datapump_dir full=y
bash-3.2$
bash-3.2$


save with 

full_export_sh

and run with ./full_export.sh


You can also run in background

nohup ./full_export.sh &

press enter

bash-3.2$ tail -f nohup.out
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT



SCHEMA IMPORT FROM FULL DATAPUMP BACKUP.


Change path as per your requirement



bash-3.2$
bash-3.2$ cat import_schema.sh
#!/bin/sh

ORACLE_SID=TESTRE
ORACLE_HOME=/opt/oracle/product/10.2.0/db_1; export ORACLE_HOME
PATH=$ORACLE_HOME/bin; export PATH
impdp  system/manager dumpfile=sprt_schema_backup14012015.dmp logfile=sprt_importlog.log directory=datapump_dir schemas=SPRTSG4
bash-3.2$
bash-3.2$


save with 

import_schema.sh

and run with ./import_schema.sh


You can also run in background

nohup ./full_export.sh &

press enter

bash-3.2$ tail -f nohup.out
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT

Solution ORA-01940: cannot drop a user that is currently connected



SQL> drop user sprtsg4 cascade;
drop user sprtsg4 cascade
*
ERROR at line 1:
ORA-01940: cannot drop a user that is currently connected



///
Before the kill session lock the account for further connection establish.


SQL>
SQL> alter user sprtsg4 account lock;

User altered.

SQL>
SQL> SET LINESIZE 100
SQL> COLUMN spid FORMAT A10
SQL> COLUMN username FORMAT A10
SQL> COLUMN program FORMAT A45
SQL>
SQL> SELECT s.inst_id,
  2         s.sid,
  3         s.serial#,
  4         p.spid,
       s.username,
  5    6         s.program
  7  FROM   gv$session s
  8         JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE  s.type != 'BACKGROUND';  9

   INST_ID        SID    SERIAL# SPID       USERNAME   PROGRAM
---------- ---------- ---------- ---------- ---------- ---------------------------------------------
         1         49       7543 4360       SYS        sqlplus@acs7 (TNS V1-V3)
         1        100       4663 4153       SYS        sqlplus@acs7 (TNS V1-V3)
         1        141      15044 4626       SPRTSG4    JDBC Thin Client
         1         16      33035 4628       SPRTSG4    JDBC Thin Client
         1         71      16974 4630       SPRTSG4    JDBC Thin Client
         1         83      58119 4632       SPRTSG4    JDBC Thin Client
         1         90      61930 4634       SPRTSG4    JDBC Thin Client
         1        121      28526 3065       SYSMAN     OMS
         1         31      44985 3076       SYSMAN     OMS
         1        122      31487 3078       SYSMAN     OMS
         1        140      11579 3366       DBSNMP     emagent@acs7 (TNS V1-V3)

   INST_ID        SID    SERIAL# SPID       USERNAME   PROGRAM
---------- ---------- ---------- ---------- ---------- ---------------------------------------------
         1        129        121 25590      DBSNMP     emagent@acs7 (TNS V1-V3)
         1        152       3737 4636       SPRTSG4    JDBC Thin Client
         1         79        615 4615       SYSMAN     OMS
         1        119      22358 4638       SPRTSG4    JDBC Thin Client
         1          6       6899 4640       SPRTSG4    JDBC Thin Client
         1         46       7585 4644       SPRTSG4    JDBC Thin Client
         1        151      38346 4648       SPRTSG4    JDBC Thin Client

18 rows selected.

SQL> alter system kill session '&id,&serial';
Enter value for id: 151
Enter value for serial: 38346
old   1: alter system kill session '&id,&serial'
new   1: alter system kill session '151,38346'

System altered.

SQL> /
Enter value for id: 46
Enter value for serial: 7585
old   1: alter system kill session '&id,&serial'
new   1: alter system kill session '46,7585'

System altered.


SQL>
SQL>
SQL> drop user sprtsg4 cascade;






User dropped.

SQL> SQL> SQL> SQL> SQL> SQL>





Tuesday, April 28, 2015

ERROR DURING OEM CONFIGURE:SEVERE: Dbcontrol Repository already exists. Fix the error(s) and run EM Configuration Assistant again in standalone mode


bash-4.3$
bash-4.3$ emca -config dbcontrol db -repos create

STARTED EMCA at Apr 25, 2015 9:07:52 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: SBDV
Listener port number: 1522
Listener ORACLE_HOME [ /u01/app/oracle/product ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product

Local hostname ................ HMSISBDVDB
Listener ORACLE_HOME ................ /u01/app/oracle/product
Listener port number ................ 1522
Database SID ................ SBDV
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 25, 2015 9:08:21 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/SBDV/emca_2015_04_25_21_07_52.log.
Apr 25, 2015 9:08:22 PM oracle.sysman.emcp.DatabaseChecks performReposChecks
SEVERE: Dbcontrol Repository already exists.  Fix the error(s) and run EM Configuration Assistant again in standalone mode.
bash-4.3$


######################SEVERE: Dbcontrol Repository already exists.  Fix the error(s) and run EM Configuration Assistant again in standalone mode.################################





bash-4.3$
bash-4.3$ hostname
HMSISBDVDB
bash-4.3$
bash-4.3$ emca -config dbcontrol db -repos recreate

STARTED EMCA at Apr 25, 2015 9:14:09 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: SBDV
Listener port number: 1522
Listener ORACLE_HOME [ /u01/app/oracle/product ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product

Local hostname ................ HMSISBDVDB
Listener ORACLE_HOME ................ /u01/app/oracle/product
Listener port number ................ 1522
Database SID ................ SBDV
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 25, 2015 9:14:32 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/SBDV/emca_2015_04_25_21_14_08.log.
Apr 25, 2015 9:14:33 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Apr 25, 2015 9:15:39 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Apr 25, 2015 9:15:39 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...

Apr 25, 2015 9:18:42 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Apr 25, 2015 9:18:45 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...

Apr 25, 2015 9:20:06 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Apr 25, 2015 9:20:08 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Apr 25, 2015 9:20:17 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Apr 25, 2015 9:20:17 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Apr 25, 2015 9:20:39 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Apr 25, 2015 9:20:39 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://HMSISBDVDB:1158/em <<<<<<<<<<<
Apr 25, 2015 9:20:43 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/HMSISBDVDB_SBDV/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 25, 2015 9:20:43 PM
bash-4.3$
bash-4.3$
bash-4.3$
bash-4.3$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
https://HMSISBDVDB:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/HMSISBDVDB_SBDV/sysman/log
bash-4.3$
bash-4.3$

CREATE AND DROP ORACLE ENTERPRISE MANAGER IN ORACLE 11GR2

#####################DROP OEM##############################

[oracle@node1 ~]$
[oracle@node1 ~]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Apr 24, 2015 9:35:26 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: ora11g
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:

Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 24, 2015 9:35:49 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/ora11g/emca_2015_04_24_21_35_23.log.
Apr 24, 2015 9:35:49 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Apr 24, 2015 9:35:49 PM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: Error initializing SQL connection. SQL operations cannot be performed
Apr 24, 2015 9:35:49 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Apr 24, 2015 9:38:11 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 24, 2015 9:38:11 PM
[oracle@node1 ~]$
[oracle@node1 ~]$

###########################CREATE OEM######################


During First time installation you give sysman user password give any password as usual

[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ emca -config dbcontrol db -repos create

STARTED EMCA at Apr 24, 2015 11:57:19 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: ora11g
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/db_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1

Local hostname ................ node1
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1
Listener port number ................ 1521
Database SID ................ ora11g
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Apr 24, 2015 11:57:47 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/ora11g/emca_2015_04_24_23_57_18.log.
Apr 24, 2015 11:57:49 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
^[OB^[OB^[OB^[OB^[OB^[OB

Apr 25, 2015 12:03:37 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Apr 25, 2015 12:03:40 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Apr 25, 2015 12:04:47 AM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Apr 25, 2015 12:04:49 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Apr 25, 2015 12:04:49 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Apr 25, 2015 12:05:13 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Apr 25, 2015 12:05:13 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Apr 25, 2015 12:06:24 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Apr 25, 2015 12:06:24 AM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Apr 25, 2015 12:08:00 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Apr 25, 2015 12:08:00 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://node1:1158/em <<<<<<<<<<<
Apr 25, 2015 12:08:14 AM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/db_1/node1_ora11g/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Apr 25, 2015 12:08:14 AM
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$
login as: oracle
oracle@192.168.68.40's password:
Last login: Sat Apr 25 00:04:45 2015 from 192.168.68.44
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation.  All rights reserved.
https://node1:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/node1_ora11g/sysman/log
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$

Wednesday, April 15, 2015

AUTO START STOP ORACLE DATABASE SCRIPT



Save this script with oracle.sh

 execute with root user.


#! /bin/sh
##! /usr/bin/ksh
# Description: Starts and stops the Oracle database and listeners
# See how we were called.
export ORACLE_HOME=/u01/app/oracle/product
export LISTENER_NAME=LISTENER
case "$1" in
  start)
        echo -n "Starting Oracle Listeners: "
        su - oracle -c "lsnrctl start ${LISTENER_NAME}" >> /var/log/oracle
        echo "Done."
        echo ""
        echo -n "Starting Oracle Databases: "
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Starting Oracle Databases as part of system up." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        su - oracle -c dbstart ${ORACLE_HOME} >> /var/log/oracle
        echo "Done."
        echo ""
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Finished." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        ;;
  stop)
        echo -n "Shutting Down Oracle Listeners: "
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Shutting Down Oracle Databases as part of system down." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        su - oracle -c "lsnrctl stop ${LISTENER_NAME}" >> /var/log/oracle
        echo "Done."
        echo -n "Shutting Down Oracle Databases: "
        su - oracle -c dbshut ${ORACLE_HOME} >> /var/log/oracle
        echo "Done."
        echo ""
        echo "----------------------------------------------------" >> /var/log/oracle
        date +"! %T %a %D : Finished." >> /var/log/oracle
        echo "----------------------------------------------------" >> /var/log/oracle
        ;;
  *)
        echo "Usage: oracle {start|stop}"
        exit 1
esac
bash-4.3# ./oracle.sh start
bash-4.3# ./oracle.sh stop

Enjoy


Monday, April 6, 2015

PATCH APPLY USING OPATCH UTILITY



Unzip the patch file and read carefully README.html file.
and follow step by step as per your environment.

below single instance database patching p9352237_112010_LINUX


[oracle@node1 oraInventory]$ export opatch
[oracle@node1 oraInventory]$ export PATH=$PATH:$HOME:$ORACLE_HOME/OPatch:/bin
[oracle@node1 oraInventory]$

[oracle@node1 oraInventory]$ cd 9352237/
[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-32-12PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch apply
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-32-33PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '9352237' to OH '/u01/app/oracle/product/11.2.0/db_1'

Running prerequisite checks...
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:


Following executables are active :
/u01/app/oracle/product/11.2.0/db_1/bin/oracle
ApplySession failed during prerequisite checks: Prerequisite check "CheckActiveFilesAndExecutables" failed.
System intact, OPatch will not attempt to restore the system

OPatch failed with error code 74
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch apply
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-34-28PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch '9352237' to OH '/u01/app/oracle/product/11.2.0/db_1'

Running prerequisite checks...

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.


Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0/db_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '9352237' for restore. This might take a while...
Backing up files affected by the patch '9352237' for rollback. This might take a while...
Execution of 'sh /u01/app/oraInventory/9352237/custom/scripts/pre -apply 9352237 ':


Return Code = 0

Patching component oracle.rdbms.rsf, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libpls11.a"  with "lib/libpls11.a/phd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libpls11.a"  with "lib/libpls11.a/ph2drv.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libpls11.a"  with "lib/libpls11.a/ph2oa.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kot.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kgh.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kgl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kgl2.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/kgl4.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libgeneric11.a"  with "lib/libgeneric11.a/qct.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libcommon11.a"  with "lib/libcommon11.a/kdzt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libcommon11.a"  with "lib/libcommon11.a/sagedata.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libcommon11.a"  with "lib/libcommon11.a/kdzilcs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libcommon11.a"  with "lib/libcommon11.a/kdzc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/libdbtools11.a"  with "rdbms/lib/libdbtools11.a/krmq.o"

Patching component oracle.rdbms.dbscripts, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/prvtamgt.plb"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/utlu112i.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/utlu112x.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/catexp.sql"

Patching component oracle.rdbms, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kspt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxtt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktcnq.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktur.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjbr.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/k2g.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfafo.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfcfg.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfmboot.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfmedd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfmrole.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/rfsicd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdo.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktcn.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktg.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktfa.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktud.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/aud.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kzam.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kks.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kks1.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kksc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfda.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfdp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfds.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kff.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfio.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfio0.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfn.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfnb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfnc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfns.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kfnm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksfd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kkopq.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxfp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxfr.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kxfxq.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjbl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksucln.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksk.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdlw.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdst00.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdst01.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdst11.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdstrr.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcfis.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbz.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktsla.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktslm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/koks3.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kqf.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kwqa.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kwqm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kko.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjxgf.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjxgg.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjxgm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjxgr.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qesrc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qkna.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qksrc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kkqtutl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kkqs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/knlb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbk.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kzu.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktt.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kjbm.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qksvc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ksmg.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdbl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdzh.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdblc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdst.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktein.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbz.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktsp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdblc.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdo.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktsf.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/atb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kwqid.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdlrci.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdlxdup.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kmgs.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kmgsb.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kzvdve.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/qks3t.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kcbi.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdli.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/skptch.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/ktslj.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libserver11.a"  with "lib/libserver11.a/kdza.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/libknlopt.a"  with "rdbms/lib/libknlopt.a/ktd.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/libknlopt.a"  with "rdbms/lib/libknlopt.a/jox.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgf.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgfdp.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgfdputl.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgfn.o"
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.a"  with "lib/libasmclnt11.a/kgfo.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ktd.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/jox.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/kfod.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/mkpatch.o"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/ins_rdbms.mk"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/lib/env_rdbms.mk"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/xml/xsl/kulob.xsl"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/xml/xsl/kustorag.xsl"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/cpu/scripts/bug9371993.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/cpu/scripts/bug9016295.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/psu/scripts/bug8820324.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/psu/11.2.0.1.1/catpsu.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/psu/11.2.0.1.1/catpsu_rollback.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/bundledata_PSU.xml"

Patching component oracle.oraolap, 11.2.0.1.0...
Updating archive file "/u01/app/oracle/product/11.2.0/db_1/lib/liboraolap11.a"  with "lib/liboraolap11.a/xscarrot.o"

Patching component oracle.rdbms.deconfig, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/db_1/lib/libasmclnt11.so"

Patching component oracle.javavm.server, 11.2.0.1.0...
Copying file to "/u01/app/oracle/product/11.2.0/db_1/javavm/install/jvm_exp.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/javavm/install/initjvm.sql"
Copying file to "/u01/app/oracle/product/11.2.0/db_1/javavm/install/jvmursc.sql"
Running make for target client_sharedlib
Running make for target irman
Running make for target ikfod
Running make for target irenamedg
Running make for target idgmgrl
Running make for target imkpatch
Running make for target client_sharedlib
Running make for target ioracle
ApplySession adding interim patch '9352237' to inventory

Verifying the update...
Inventory check OK: Patch ID 9352237 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 9352237 are present in Oracle Home.

--------------------------------------------------------------------------------
********************************************************************************
********************************************************************************
**                                ATTENTION                                   **
**                                                                            **
** Please note that the Patch Set Update Installation (PSU Deinstallation)    **
** is not complete until all the Post Installation (Post Deinstallation)      **
** instructions noted in the Readme accompanying this PSU, have been          **
** successfully completed.                                                    **
**                                                                            **
********************************************************************************
********************************************************************************

--------------------------------------------------------------------------------

Execution of 'sh /u01/app/oraInventory/9352237/custom/scripts/post -apply 9352237 ':


Return Code = 0

The local system has been patched and can be restarted.


OPatch succeeded.
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch lsinv
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-47-55PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-04-06_15-47-55PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  9352237      : applied on Mon Apr 06 15:44:11 IST 2015
Unique Patch ID:  12243774
   Created on 24 Mar 2010, 05:22:35 hrs PST8PDT
   Bugs fixed:
     8661168, 8769239, 8898852, 8801119, 9054253, 8706590, 8725286, 8974548
     8778277, 8780372, 8769569, 9027691, 9454036, 9454037, 9454038, 8761974
     7705591, 8496830, 8702892, 8639114, 8723477, 8729793, 8919682, 8818983
     9001453, 8475069, 9328668, 8891929, 8798317, 8820324, 8733749, 8702535
     8565708, 9036013, 8735201, 8684517, 8870559, 8773383, 8933870, 8812705
     8405205, 8822365, 8813366, 8761260, 8790767, 8795418, 8913269, 8897784
     8760714, 8717461, 8671349, 8775569, 8898589, 8861700, 8607693, 8642202
     8780281, 9369797, 8780711, 8784929, 8834636, 9015983, 8891037, 8828328
     8570322, 8832205, 8665189, 8717031, 8685253, 8718952, 8799099, 8633358
     9032717, 9321701, 8588519, 8783738, 8796511, 8782971, 8756598, 9454385
     8856497, 8703064, 9066116, 9007102, 8721315, 8818175, 8674263, 9352237
     8753903, 8720447, 9057443, 8790561, 8733225, 9197917, 8928276, 8991997, 8837736



--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@node1 9352237]$
[oracle@node1 9352237]$
[oracle@node1 9352237]$

[oracle@node1 9352237]$
[oracle@node1 9352237]$ opatch lsinventory
Invoking OPatch 11.1.0.6.6

Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.6
OUI version       : 11.2.0.1.0
OUI location      : /u01/app/oracle/product/11.2.0/db_1/oui
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-04-06_15-57-56PM.log

Patch history file: /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2015-04-06_15-57-56PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (1) :

Patch  9352237      : applied on Mon Apr 06 15:44:11 IST 2015
Unique Patch ID:  12243774
   Created on 24 Mar 2010, 05:22:35 hrs PST8PDT
   Bugs fixed:
     8661168, 8769239, 8898852, 8801119, 9054253, 8706590, 8725286, 8974548
     8778277, 8780372, 8769569, 9027691, 9454036, 9454037, 9454038, 8761974
     7705591, 8496830, 8702892, 8639114, 8723477, 8729793, 8919682, 8818983
     9001453, 8475069, 9328668, 8891929, 8798317, 8820324, 8733749, 8702535
     8565708, 9036013, 8735201, 8684517, 8870559, 8773383, 8933870, 8812705
     8405205, 8822365, 8813366, 8761260, 8790767, 8795418, 8913269, 8897784
     8760714, 8717461, 8671349, 8775569, 8898589, 8861700, 8607693, 8642202
     8780281, 9369797, 8780711, 8784929, 8834636, 9015983, 8891037, 8828328
     8570322, 8832205, 8665189, 8717031, 8685253, 8718952, 8799099, 8633358
     9032717, 9321701, 8588519, 8783738, 8796511, 8782971, 8756598, 9454385
     8856497, 8703064, 9066116, 9007102, 8721315, 8818175, 8674263, 9352237
     8753903, 8720447, 9057443, 8790561, 8733225, 9197917, 8928276, 8991997, 8837736



--------------------------------------------------------------------------------

OPatch succeeded.



//////////////////////


[oracle@node1 ~]$ cd $ORACLE_HOME/rdbms/admin
[oracle@node1 admin]$
[oracle@node1 admin]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 6 15:48:52 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL>  CONNECT / AS SYSDBA
Connected to an idle instance.
SQL>
SQL>  STARTUP
ORACLE instance started.

Total System Global Area  393375744 bytes
Fixed Size                  1336764 bytes
Variable Size             285215300 bytes
Database Buffers          100663296 bytes
Redo Buffers                6160384 bytes
Database mounted.
Database opened.
SQL> @catbundle.sql psu apply

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.




SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 6 16:15:53 2015

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from sys.v$version ;


[oracle@node1 9352237]$

ACTION_TIME                    ACTION NAMESP VERSION                                ID COMMENTS             BUNDLE_SERIES
------------------------------ ------ ------ ------------------------------ ---------- -------------------- ------------------------------
06-APR-15 03.51.39.966420 PM   APPLY  SERVER 11.2.0.1                                1 PSU 11.2.0.1.1       PSU


Thursday, January 15, 2015

DATABASE NAME AND DBID CHANGE USING NID UTILITY

login as: oracle
Using keyboard-interactive authentication.
Password:
Last login: Mon Jan 12 13:09:43 2015 from 192.168.68.38
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
$
$
$ bash

bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:18:19 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL>
SQL>
SQL> startup mount
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  1281576 bytes
Variable Size             163578328 bytes
Database Buffers          427819008 bytes
Redo Buffers                2912256 bytes
Database mounted.
SQL>
SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- ----------
NMS       MOUNTED

SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:20:12 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> alter database open;

Database altered.

SQL> alter user sys identified by sys;

User altered.

SQL> conn sys/sys as sysdba
Connected.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:21:02 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:21:50 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  1281576 bytes
Variable Size             163578328 bytes
Database Buffers          427819008 bytes
Redo Buffers                2912256 bytes
Database mounted.
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ nid target =/ dbname=nms1

DBNEWID: Release 10.2.0.2.0 - Production on Mon Jan 12 14:22:22 2015

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to database NMS (DBID=2769379598)

Connected to server version 10.2.0

Control Files in database:
    /opt/oracle/oradata/NMS/control01.ctl
    /opt/oracle/oradata/NMS/control02.ctl
    /opt/oracle/oradata/NMS/control03.ctl

Change database ID and database name NMS to NMS1? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 2769379598 to 858488030
Changing database name from NMS to NMS1
    Control File /opt/oracle/oradata/NMS/control01.ctl - modified
    Control File /opt/oracle/oradata/NMS/control02.ctl - modified
    Control File /opt/oracle/oradata/NMS/control03.ctl - modified
    Datafile /opt/oracle/oradata/NMS/system01.dbf - dbid changed, wrote new name
    Datafile /opt/oracle/oradata/NMS/undotbs01.dbf - dbid changed, wrote new nam
    Datafile /opt/oracle/oradata/NMS/sysaux01.dbf - dbid changed, wrote new name
    Datafile /opt/oracle/oradata/NMS/users01.dbf - dbid changed, wrote new name
    Datafile /opt/oracle/oradata/NMS/example01.dbf - dbid changed, wrote new nam
    Datafile /opt/oracle/oradata/NMS/temp01.dbf - dbid changed, wrote new name
    Control File /opt/oracle/oradata/NMS/control01.ctl - dbid changed, wrote new
    Control File /opt/oracle/oradata/NMS/control02.ctl - dbid changed, wrote new
    Control File /opt/oracle/oradata/NMS/control03.ctl - dbid changed, wrote new
    Instance shut down

Database name changed to NMS1.
Modify parameter file and generate a new password file before restarting.
Database ID for database NMS1 changed to 858488030.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.

bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:23:07 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> exit
Disconnected
bash-3.00$
bash-3.00$
bash-3.00$
bash-3.00$
bash-3.00$
bash-3.00$ su - oracle
Password:
Sun Microsystems Inc.   SunOS 5.10      Generic January 2005
$
$
$ bash
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:24:03 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  1281576 bytes
Variable Size             163578328 bytes
Database Buffers          427819008 bytes
Redo Buffers                2912256 bytes
ORA-01103: database name 'NMS1' in control file is not 'NMS'


SQL> select open_mode from v$database;
select open_mode from v$database
                      *
ERROR at line 1:
ORA-01507: database not mounted


SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:24:44 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shut immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:25:00 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL>
SQL> exit
Disconnected
bash-3.00$
bash-3.00$
bash-3.00$ export ORACLE_SID=NMS1
bash-3.00$
bash-3.00$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jan 12 14:26:42 2015

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Connected to an idle instance.

SQL> startup mount pfile='/opt/oracle/admin/NMS/pfile/init.ora.112520141420'
ORACLE instance started.

Total System Global Area  595591168 bytes
Fixed Size                  1281576 bytes
Variable Size             163578328 bytes
Database Buffers          427819008 bytes
Redo Buffers                2912256 bytes
Database mounted.
SQL>
SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      NMS1
SQL>
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open RESETLOGS;


Database altered.

SQL> SQL>