Visit Counter

Sunday, January 22, 2017

Oracle 12c database cannot log in as a local user




I created database in Oracle 12c ...and I created local user but when I connect to database getting below error.

SQL> connect / as sysdba

SQL> alter session set container=ptest

SQL> alter user bsp
  2  identified by test123;

User altered.

SQL> conn bsp/test123@ptest
ERROR:

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

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
--------------------------------------------------------------------------------------------------------------

-bash-4.1$ cat listener.ora
# listener.ora Network Configuration File: /ora/app/oracle/product/12.1.0/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = inforln)
      (ORACLE_HOME = /ora/app/oracle/product/12.1.0)
      (SID_NAME = inforln)
    )
)
#    (SID_DESC =
#      (GLOBAL_DBNAME = inforln)
#      (ORACLE_HOME = /ora/app/oracle/product/12.1.0)

#      (SID_NAME = pinforln)
#    )
#  )

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.0.106)(PORT = 1522))
  )

ADR_BASE_LISTENER = /ora/app/oracle12c

-bash-4.1$



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

-bash-4.1$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /ora/app/oracle/product/12.1.0/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.




TEST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.0.144)(PORT = 1522))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TEST)
    )
  )

LISTENER_TEST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.0.144)(PORT = 1522))


PTEST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.0.144)(PORT = 1522))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ptest)
    )
  )

-bash-4.1$

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

Solution:



We have to change the local_listener parameter in spfile.



SQL> connect / as sysdba



SQL> show parameter local_listener

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string




SQL> alter system set local_listener=inforln;

System altered.


SQL> show parameter local

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string      INFORLN
parallel_force_local                 boolean     FALSE



SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit


-bash-4.1$ ./sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Sun Jan 22 15:07:51 2017

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

SQL> conn / as sysdba
Connected.
SQL> alter session set container=ptest;

Session altered.

SQL> connect bsp/test123@pitest;
Connected.

SQL> alter session set container=ptest;

Session altered.

SQL> connect bsp/test123@ptest;
Connected.

Friday, January 13, 2017

Oracle11g: create a Recovery Catalog for RMAN




Database must be archivelog
to perform backup through rman the database must be in archivelog mode


SQL> archive log list
Database log mode       Archive Mode
Automatic archival       Enabled
Archive destination       /export/home/oracle/app/oracle/oradata/archive1
Oldest online log sequence      241
Next log sequence to archive   243
Current log sequence             243
SQL>


Create the tablespace used by the catalog




SQL> create tablespace oracat
  2  datafile '/export/home/oracle/app/oracle/oradata/catsserp/catalogdb.dbf' size 5G;

Tablespace created.


Create the database owner of the RMAN catalog



SQL> create user catman identified by catman
  2  TEMPORARY TABLESPACE TEMP
  3  DEFAULT TABLESPACE oracat
  4  quota unlimited on oracat;

User created.


Grant the RECOVERY_CATALOG_OWNER role to to catman user



SQL> grant RECOVERY_CATALOG_OWNER to catman;

Grant succeeded.


The RECOVER_CATALOG_OWNER grants the following system privileged





SQL> select * from dba_sys_privs where grantee='RECOVERY_CATALOG_OWNER';

GRANTEE       PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
RECOVERY_CATALOG_OWNER       CREATE TABLE NO
RECOVERY_CATALOG_OWNER       CREATE SYNONYM NO
RECOVERY_CATALOG_OWNER       CREATE TRIGGER NO
RECOVERY_CATALOG_OWNER       CREATE DATABASE LINK NO
RECOVERY_CATALOG_OWNER       CREATE SEQUENCE NO
RECOVERY_CATALOG_OWNER       CREATE PROCEDURE NO
RECOVERY_CATALOG_OWNER       ALTER SESSION NO
RECOVERY_CATALOG_OWNER       CREATE SESSION NO
RECOVERY_CATALOG_OWNER       CREATE TYPE         NO
RECOVERY_CATALOG_OWNER       CREATE VIEW         NO
RECOVERY_CATALOG_OWNER       CREATE CLUSTER NO

11 rows selected.

SQL>

connect to the instance and create the RMAN catalog



oracle@aficatsvr:/ora/oracle/app/oracle/product/11.2.0/dbhome_1/bin$ ./rman

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Jan 13 13:37:58 2017

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

RMAN> connect catalog catman/catman

connected to recovery catalog database

RMAN> create catalog;

recovery catalog created

RMAN>









Thursday, January 12, 2017

ORA-00119: invalid specification for system




While creating database using DBCA I getting below error.

ORA-00119: invalid specification for system parameter LOCAL_LISTENER




Solution:



Before creating database I changed the host name and I forget to add entry in /etc/hosts......

Ensure the hostname information is added to /ect/hosts file and you are able to ping the hostname.

After I added the entry in /etc/hosts issue was resolved.




Reference:

ORA-119, ORA-132 ORA-1078 Received From DBCA (Doc ID 433817.1)

Monday, January 9, 2017



Netbackup server 7.6.1

root@backupserver-baan:/netbackup-software/NetBackup_7.6.1_Solaris_Sparc64# ./install


Symantec Installation Script
Copyright 1993 - 2014 Symantec Corporation, All Rights Reserved.


Installing NetBackup Server Software


Please review the SYMANTEC SOFTWARE LICENSE AGREEMENT located on
the installation media before proceeding.  The agreement includes
details on the NetBackup Product Improvement Program.

For NetBackup installation and upgrade information specific to your
platform and to find out if your installed EEBs or hot fixes are
contained in this release, check out the Symantec Operations Readiness
Tools (SORT) Installation and Upgrade Checklist and Hot fix and EEB
Release Auditor, respectively, at https://sort.symantec.com/netbackup.

ATTENTION!  To help ensure a successful upgrade to NetBackup 7.6.1,
please visit the NetBackup 7.x Upgrade Portal:
http://www.symantec.com/docs/TECH74584.

Do you wish to continue? [y,n] (y)

NetBackup installs to the running root environment, by default.

Are you installing to the running root environment? [y,n] (y)
Starting NetBackup Deduplication installer
testing: /tmp/pdde_pkg_dir_9236
NetBackup Deduplication preinstall check passed

Participate in the NetBackup Product Improvement Program? [y,n] (y)


Checking for required system conditions...

ok nbdb_ntfs_dir_symlink: inapplicable on solaris: skipping
ok remote_emm: NetBackup is not installed: skipping

Checking for recommended system conditions...

not ok semaphore_limits: unable to determine semaphore limits:
  Symantec recommends that a project named "NetBackup" be created for
  NetBackup server processes, and semaphore limits be set on that
  project.

  Performance of NetBackup Master and Media Servers can be affected
  adversely if the system is configured with low semaphore limits.  This
  test checks whether the current semaphore limits are set as
  recommended.  See https://www.symantec.com/docs/TECH203066 for
  details.
not ok ulimit_nofiles: nofiles ulimit 1024 is too low.
  NetBackup Master and Media Server processes may run slower if they are
  limited to fewer than 8000 open file descriptors.  This test runs
  'ulimit -n' and checks that the result is at least 8000 on NetBackup
  servers.  See
    https://www.symantec.com/docs/TECH75332
  for more information.
ok nb_761_hotfix_auditor: No potential for regression of hotfixes or EEBs was detected.

WARNING: One or more non-critical preinstall checks have failed.

Do you wish to continue? [y,n] (n)



File /tmp/install_trace.9076 contains a trace of this install.
That file can be deleted after you are sure the install was successful.

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

root@backupserver-baan:/#  projects -l
system
projid : 0
comment: ""
users  : (none)
groups : (none)
attribs:
user.root
projid : 1
comment: ""
users  : (none)
groups : (none)
attribs:
noproject
projid : 2
comment: ""
users  : (none)
groups : (none)
attribs:
default
projid : 3
comment: ""
users  : (none)
groups : (none)
attribs: project.max-shm-memory=(privileged,10737418240,deny)
group.staff
projid : 10
comment: ""
users  : (none)
groups : (none)
attribs:
root@backupserver-baan:/# projects -l NetBackup
projects: project "NetBackup" does not exist
root@backupserver-baan:/# /usr/sbin/projadd -U root -c "NetBackup resource project" -p 1000 NetBackup
root@backupserver-baan:/# /usr/sbin/projmod -a -K 'project.max-msg-ids=(privileged,256,deny)' NetBackup
root@backupserver-baan:/# /usr/sbin/projmod -a -K 'project.max-sem-ids=(privileged,1024,deny)' NetBackup
root@backupserver-baan:/# /usr/sbin/projmod -a -K 'project.max-shm-ids=(privileged,1024,deny)' NetBackup
root@backupserver-baan:/# /usr/sbin/projmod -a -K 'project.max-shm-memory=(privileged,8589934592,deny)' NetBackup
root@backupserver-baan:/#
root@backupserver-baan:/#
root@backupserver-baan:/# projects -l NetBackup
NetBackup
projid : 1000
comment: "NetBackup resource project"
users  : root
groups : (none)
attribs: project.max-msg-ids=(privileged,256,deny)
        project.max-sem-ids=(privileged,1024,deny)
        project.max-shm-ids=(privileged,1024,deny)
        project.max-shm-memory=(privileged,8589934592,deny)
root@backupserver-baan:/#
root@backupserver-baan:/#
root@backupserver-baan:/#ulimit -n 8000









Changing the hostname in Oracle Solaris 11





root@afi-backupsrv:~# hostname
afi-backupsrv


root@afi-backupsrv:~# svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/loopback             astring
config/nodename             astring     afi-backupsrv



root@afi-backupsrv:~# svccfg -s system/identity:node setprop config/nodename=
"backupserver-baan"

root@afi-backupsrv:~#  svccfg -s system/identity:node setprop config/loopback="backupserver-baan"

root@afi-backupsrv:~# svccfg -s system/identity:node refresh

root@afi-backupsrv:~# svcadm restart system/identity:node

root@afi-backupsrv:~# svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     backupserver-baan
config/loopback             astring     backupserver-baan



root@afi-backupsrv:~# hostname
backupserver-baan

root@afi-backupsrv:~#

Sunday, January 8, 2017

VT-X IS BEING USED BY ANOTHER HYPERVISOR (VERR_VMX_IN_VMX_ROOT_MODE)




It depend on your cpu.



If you get a error saying that the service is still running, then run the follwing command to stop the service before removing it.:
# rmmod -f kvm_intel

Reboot the computer after that :


# apt-get remove libvirt-bin
And finally, the modprobe command :



modprobe -r kvm_intel
After that, you can run Virtualbox wihtout any error.

Wednesday, January 4, 2017

Create Database with 32K Block Size Oracle 12c



This parameter in the init.ora is the most important. This can be done only during creation time. If you have already created the Database you cannot change this value. You will have to re-create the Database with a different size.
When you start to think about larger block sizes, remember that a 32KB undo block size can be a source of wasted I/O.
This block size is used for the SYSTEM tablespace and by default in other tablespaces.


Solaris Sparc 64-bit
Oracle 12c





























SQL> conn / as sysdba
Connected.
SQL> show parameter db_block_size

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_block_size                        integer     32768


SQL>

Sunday, January 1, 2017

Fix for ORA-03113: end-of-file on communication channel


While startup the database getting error.



SQL> startup
ORACLE instance started.

Total System Global Area  209235968 bytes
Fixed Size                  1332188 bytes
Variable Size             125832228 bytes
Database Buffers           75497472 bytes
Redo Buffers                6574080 bytes
Database mounted.
Database opened.
SQL> select instance_name from v$instace;
select instance_name from v$instace
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 43880
Session ID: 170 Serial number: 5


Solution:


SQL> alter database recover database until cancel;

database altered


SQL> alter system set db_recovery_file_dest_size=8000m scope=both;

database altered


SQL> alter database open resetlogs;

database altered




ORA-19809: limit exceeded for recovery files tips





SQL> alter database open resetlogs;



ERROR at line 1
ORA-19809: Limit exceeded for recovery files
ORA-19804: cannot reclaim 52428800 bytes disk space from 10 limit




SQL> show parameter db_recovery



NAME                                            TYPE            VALUE
---------------------------------------------------------------------------------------------------------------------

db_recovery_file_dest                     string               /ora/oracle/oracle12/fast_recovery_file_dest_size
db_recovery_file_dest_Size             big integer         10


SQL> alter system set db_recovery_file_dest_size=8000m scope=both



SQL> alter database open resetlogs;

database altered.

12c Grid Infrastructure diskmon Will be Offline by Default in Non-Exadata Environment




As Grid Infrastructure daemon diskmon.bin is used for Exadata fencing, started from 11.2.0.3, resource ora.diskmon will be offline in non-Exadata environment. This is expected behaviour change.




$ crsctl stat res -t -init
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.asm
      1        ONLINE  ONLINE       pricedev1-lnx            Started             
ora.cluster_interconnect.haip
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.crf
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.crsd
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.cssd
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.cssdmonitor
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.ctssd
      1        ONLINE  ONLINE       pricedev1-lnx            OBSERVER            
ora.diskmon
      1        OFFLINE OFFLINE                                                   
ora.drivers.acfs
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.evmd
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.gipcd
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.gpnpd
      1        ONLINE  ONLINE       pricedev1-lnx                                
ora.mdnsd
      1        ONLINE  ONLINE       pricedev1-lnx  







Refer:
11.2.0.3 Grid Infrastructure diskmon Will be Offline by Default in Non-Exadata Environment (Doc ID 1346881.1)