Saturday, January 2, 2016

How to setup a local YUM repository on OEL6

mkdir  -p /var/www/html/oel6

service httpd start

service iptables stop

 cd /media/OL6.5\ x86_64\ Disc\ 1\ 20131125/

 cp -ar . /var/www/html/oel6/

cd /etc/yum.repos.d/

ls
vim oel6.repo

[OEL6DVD]
name=OEL6 DVD hosted locally
baseurl=http://localhost/oel6
enable=1
gpgcheck=0

[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# cat oel6.repo
[OEL6DVD]
name=OEL6 DVD hosted locally
baseurl=http://localhost/oel6
enable=1
gpgcheck=0
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#


---------------------------------------------------------------------
If your repo location different like other mount point
==================================================
[root@test yum.repos.d]#
[root@test yum.repos.d]# cat oel6.repo
[OEL6DVD]
name=OEL6 DVD hosted locally
baseurl=file:///repo/oel6
enable=1
gpgcheck=0

[root@test yum.repos.d]#
[root@test yum.repos.d]#
[root@test yum.repos.d]# df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/vg_test-lv_root  8.3G  5.1G  2.8G  65% /
tmpfs                        2.0G   76K  2.0G   1% /dev/shm
/dev/sda1                    477M   55M  397M  13% /boot
/dev/sdb1                    9.8G  3.7G  5.6G  40% /repo
/dev/sr0                     3.7G  3.7G     0 100% /media/OL6.5 x86_64 Disc 1 20131125
[root@test yum.repos.d]#





yum repolist all



[root@test Packages]#
[root@test Packages]# yum install oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64.rpm
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Examining oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64.rpm: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
Marking oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-7.el6 will be installed
--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64
--> Running transaction check
---> Package ksh.x86_64 0:20120801-10.el6 will be installed
---> Package libaio-devel.x86_64 0:0.3.107-10.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                         Arch              Version                      Repository                                                         Size
========================================================================================================================================================================
Installing:
 oracle-rdbms-server-11gR2-preinstall            x86_64            1.0-7.el6                    /oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64             32 k
Installing for dependencies:
 ksh                                             x86_64            20120801-10.el6              OEL6DVD                                                           755 k
 libaio-devel                                    x86_64            0.3.107-10.el6               OEL6DVD                                                            13 k

Transaction Summary
========================================================================================================================================================================
Install       3 Package(s)

Total size: 800 k
Total download size: 768 k
Installed size: 1.7 M
Is this ok [y/N]: y
Downloading Packages:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                    23 MB/s | 768 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libaio-devel-0.3.107-10.el6.x86_64                                                                                                                   1/3
  Installing : ksh-20120801-10.el6.x86_64                                                                                                                           2/3
  Installing : oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64                                                                                                3/3
  Verifying  : oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64                                                                                                1/3
  Verifying  : ksh-20120801-10.el6.x86_64                                                                                                                           2/3
  Verifying  : libaio-devel-0.3.107-10.el6.x86_64                                                                                                                   3/3

Installed:
  oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-7.el6

Dependency Installed:
  ksh.x86_64 0:20120801-10.el6                                                   libaio-devel.x86_64 0:0.3.107-10.el6

Complete!
[root@test Packages]#



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>