Monday, December 8, 2014

ORACLE - ORA-01031: insufficient privileges


[root@cacti ~]# sqlplus /nolog

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 8 10:04:53 2014

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

SQL> connect sys as sysdba
Enter password: 
ERROR:
ORA-01031: insufficient privileges


SQL> connect siltech/siltech
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0



SQL> exit
[root@cacti ~]# less .bash_profile 
[root@cacti ~]# su - oracle
-bash-4.1$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
-bash-4.1$ export ORACLE_SID=xe
-bash-4.1$ export PATH=$PATH:$ORACLE_HOME/bin
-bash-4.1$ export ORACLE_BASE=/u01/app/oracle; 
-bash-4.1$ export ORACLE_TER=Mxterm; 
-bash-4.1$ export PATH=/usr/sbin:$PATH; 
-bash-4.1$ export PATH=$ORACLE_HOME/bin:$PATH; 
-bash-4.1$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; 
-bash-4.1$ export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; 
-bash-4.1$ 
-bash-4.1$ sqlplus /nolog

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 8 10:07:37 2014

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

SQL> connect sys as sysdba
Enter password: 
ERROR:
ORA-01031: insufficient privileges


SQL> exit
-bash-4.1$
-bash-4.1$ pwd
/u01/app/oracle
-bash-4.1$ ll
total 24
drwxr-x---. 4 oracle dba  4096 Nov 11 11:42 admin
-rw-r--r--  1 oracle dba     0 Dec  8 10:05 connect
drwxrwxr-x. 4 oracle dba  4096 Nov 26 08:06 diag
-rw-r--r--  1 oracle dba     0 Dec  8 10:06 exit
drwxr-x---. 3 oracle dba  4096 Nov 11 11:42 fast_recovery_area
drwxr-x---. 3 oracle dba  4096 Nov 11 11:42 oradata
drwxr-xr-x. 3 oracle dba  4096 Nov 11 11:42 oradiag_oracle
drwxr-xr-x. 3 root   root 4096 Nov 11 11:40 product
-bash-4.1$ 
[root@cacti /]# chown oracle:dba -R /u01/
[root@cacti oracle]# ll
total 24
drwxr-x---. 4 oracle dba 4096 Nov 11 11:42 admin
-rw-r--r--  1 oracle dba    0 Dez  8 10:05 connect
drwxrwxr-x. 4 oracle dba 4096 Nov 26 08:06 diag
-rw-r--r--  1 oracle dba    0 Dez  8 10:06 exit
drwxr-x---. 3 oracle dba 4096 Nov 11 11:42 fast_recovery_area
drwxr-x---. 3 oracle dba 4096 Nov 11 11:42 oradata
drwxr-xr-x. 3 oracle dba 4096 Nov 11 11:42 oradiag_oracle
drwxr-xr-x. 3 oracle dba 4096 Nov 11 11:40 product

[root@cacti ~]# sqlplus /nolog

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 8 10:13:13 2014

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

SQL> connect sys as sysdba
Enter password: 
ERROR:
ORA-12547: TNS:lost contact


SQL>exit
[root@cacti bin]# su - oracle
-bash-4.1$ cd /u01/app/oracle/product/11.2.0/xe/bin/
-bash-4.1$ ./sqlplus 
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
-bash-4.1$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe/
-bash-4.1$ ./sqlplus
SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 8 10:24:13 2014

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

Enter user-name: system
Enter password: 
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
-bash-4.1$ export ORACLE_SID=XE
-bash-4.1$ ./sqlplus 
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
SQL> connect sys as sysdba
Enter password: 
ERROR:
ORA-01017: invalid username/password; logon denied

-bash-4.1$ ll
total 20
-rw-rw----. 1 oracle dba 1544 Nov 11 11:43 hc_XE.dat
-rwxr-xr-x. 1 oracle dba 2851 Aug 29  2011 init.ora
-rw-r-----. 1 oracle dba   24 Nov 11 11:42 lkXE
-rw-r-----. 1 oracle dba 1536 Nov 11 11:43 orapwXE
-rw-r-----  1 oracle dba 2560 Dec  4 10:48 spfileXE.ora
-bash-4.1$ pwd
/u01/app/oracle/product/11.2.0/xe/dbs
-bash-4.1$ orapwd 
Usage: orapwd file=<fname> entries=<users> force=<y/n> ignorecase=<y/n> nosysdba=<y/n>

  where
    file - name of password file (required),
    password - password for SYS will be prompted if not specified at command line,
    entries - maximum number of distinct DBA (optional),
    force - whether to overwrite existing file (optional),
    ignorecase - passwords are case-insensitive (optional),
    nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).
    
  There must be no spaces around the equal-to (=) character.
-bash-4.1$ orapwd file=orapwXE password=123456

OPW-00005: File with same name exists - please delete or rename
-bash-4.1$ rm -rf orapwXE 
-bash-4.1$ orapwd file=orapwXE password=123456
-bash-4.1$ sqlplus /nolog

SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 8 10:50:50 2014

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


SQL> connect sys as sysdba
Enter password: 
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area  784998400 bytes
Fixed Size     2230608 bytes
Variable Size   583009968 bytes
Database Buffers   197132288 bytes
Redo Buffers     2625536 bytes
Database mounted.
Database opened.
SQL> 










0 comentários:

Post a Comment