Linux

Change Diskgroup Redundancy – ASM

 

(Change Diskgroup Redundancy)

1. Create a new Diskgroup with desired redundancy and move the existing data to newly created Diskgroup.
2. Drop the existing Diskgroup after backing up data and create a new Diskgroup with desired redundancy.
Create a new diskgroup with desired redundancy and move the existing data to newly created diskgroup.
1) If we have extra disk space available,then we can create a new diskgroup and move the files from old diskgroup to it.
— Initially we have two diskgroup with external redundancy as:
SQL> select state,name from v$asm_diskgroup;
STATE NAME———– ——————–MOUNTED ERMAN

2) Create a new diskgroup with normal redundancy as :
SQL > create diskgroup ERMANNEW normal redundancy failgroup
SQL> select state,name,type from v$asm_diskgroup;
STATE NAME TYPE———– ——————- ——MOUNTED ERMAN EXTERNMOUNTED ERMANNEW NORMAL
3)Backup the current database as follows:
SQL> show parameter db_name
NAME TYPE VALUE—————- ———– —————————-db_name string orcl10g
SQL> create pfile=’/tmp/ermantest/demo/initorcl+ASM.ora’ from spfile;
SQL> alter database backup controlfile to ‘+ERMANNEW’;
SQL> alter system set control_files=’+ERMANNEW\ORCL11G\CONTROLFILE\<system generated control file name from diskgroup ERMANNEW>’ SCOPE=SPFILE;

— Connect to rman$ rman target /
RMAN > shutdown immediate;
RMAN > startup nomount;
RMAN> restore controlfile to ‘<new_diskgroup +ERMANNEW>’ from ‘+ERMAN\ORCL10G\CONTROLFILE\mycontrolfile.ctl’;
RMAN > alter database mount;
RMAN> backup as copy database format ‘+ERMANNEW’;

4)Switch the database to copy. At this moment we are switching to the new Diskgroup
RMAN> switch database to copy;
RMAN> recover database ;
This will recover the backup controlfile taken and restored before to be in sync with database/datafiles

RMAN> alter database open resetlogs;

5)Add new tempfile to newly created database.
SQL> alter tablespace TEMP add tempfile ‘+ERMANNEW’ SIZE 10M;

Drop any existing tempfile on the old diskgroup

SQL> alter database tempfile ‘+ERMAN/orcl10g/tempfile/temp.265.626631119’ drop;

6)Find out how many members we have in redolog groups, make sure that we have only one member in each log group.(drop other members).
Suppose we have 3 log groups, then add one member to each log group as following:
SQL> alter database add logfile member ‘+ERMANNEW’ to group 1;
SQL> alter database add logfile member ‘+ERMANNEW’ to group 2;;
SQL> alter database add logfile member ‘+ERMANNEW’ to group 3;
Then we can drop the old logfile member from earlier diskgroups as:
SQL> alter database drop logfile member ‘complete_name’;

7)Use the following query to verify that all the files are moved to new diskgroup with desired redundancy:

SQL> select name from v$controlfileunionselect name from v$datafileunionselect name from v$tempfileunionselect member from v$logfileunionselect filename from v$block_change_tracking;

+ERMANNEW/orcl/controlfile/backup.261.980091055
+ERMANNEW/orcl/datafile/sysaux.263.980093225
+ERMANNEW/orcl/datafile/system.262.980093223
+ERMANNEW/orcl/datafile/undotbs1.264.980093229
+ERMANNEW/orcl/datafile/users.265.980093229
+ERMANNEW/orcl/onlinelog/group_1.266.980093395
+ERMANNEW/orcl/onlinelog/group_3.268.980093417
+ERMANNEW/orcl/tempfile/temp.267.980094287

good.
8) Enable block change tracking using  ALTER DATABASE command.
SQL> alter database enable block change tracking using file ‘<FILE_NAME>’;

asm disk group changed fto erman to ermannew. have a good day.

ASM

Advertisements
Standard
AIX, Linux

Aix/Linux/Solaris commands for DBA

1) How many Oracle instances running on OS
ps -aef | grep pmon

2) Seting unix Prompt.
export PS1=”`hostname`:$ORACLE_SID:$PWD>”

PS1 – The value of this parameter is expanded (see PROMPTING below) and used as the primary prompt string. The default value is \s-\v\$ .
PS2 – The value of this parameter is expanded as with PS1 and used as the secondary prompt string. The default is >
PS3 – The value of this parameter is used as the prompt for the select command
PS4 – The value of this parameter is expanded as with PS1 and the value is printed before each command bash displays during an execution trace. The first character of PS4 is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default is +

(ref : https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html )

3) Useful commands in Aix/Linux/Solaris.
Ekran Alıntısı1

Standard
Linux

How to check character set in Oracle

One of the requirements for samePage is that the character set should be UTF-8.

You can either check with your DBA or run the following SQL to determine whether your database character set is UTF-8. 

 
SELECT value$ FROM sys.props$ WHERE name = ‘NLS_CHARACTERSET’ ;


It should return the value AL32UTF8.

Another option is to run the following SQL :

 
SELECT * FROM NLS_DATABASE_PARAMETERS


The value against 
NLS_CHARACTERSET should be UTF8.

ee
Standard
Linux

Linux Unix d.bin command

Hello, Some useful Oracle RAC Database commands in daily use

  • Background Processes
fraudms80:/dev#cd
fraudms80:/home/oracle#ps -ef |grep d.bin
oracle 7536914 1 0 10:17:18 - 0:00 /oracle/product/11.2.0.4/grid/bin/ohasd.bin reboot
oracle 12452116 1 0 10:17:38 - 0:00 /oracle/product/11.2.0.4/grid/bin/evmd.bin
oracle 14287240 1 0 10:17:38 - 0:00 /oracle/product/11.2.0.4/grid/bin/oraagent.bin
oracle 23200164 12452116 0 10:17:39 - 0:00 /oracle/product/11.2.0.4/grid/bin/evmlogger.bin -o /oracle/product/11.2.0.4/grid/evm/log/evmlogger.info -l /oracle/product/11.2.0.4/grid/evm/log/evmlogger.log
fraudms80:/home/oracle#

 

Standard
Linux, Oracle

Install the Oracle Oracle ASM rpm Packages and configuring oracle asm disks

 Os version : OEL 6u8
DB version : Oracle 11g,
  • Install the ASMLib kernel module package as root using the following command:
    # yum install kmod-oracleasm
    
  • Install the ASMLib library package obtained from step 2 as root using the following command, with the downloaded package:
    # yum localinstall oracleasmlib-<version>.x86_64.rpm    # Where <version> is the revision downloaded in the previous step
    
  • Install the ASMLib utilities package obtained from step 2 as root using the following command, with the downloaded package:
    # yum localinstall oracleasm-support-<version>.x86_64.rpm
    

    All three required ASMLib components should now be installed on your system.

  • Configure ASMLib using the following command: 
    # oracleasm init
    
or install the oracle asm .rpm packages in this URL:
[root@ermankara ~]# cd Downloads/
[root@ermankara Downloads]# ls
oracleasmlib-2.0.12-1.el6.x86_64.rpm  oracleasmlib-2.0.4-1.el6.x86_64.rpm
oracleasmlib-2.0.12-1.el7.x86_64.rpm  oracleasm-support-2.1.8-1.el6.x86_64.rpm
[root@ermankara Downloads]# rpm -ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm
Preparing…                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
[root@ermankara Downloads]# rpm -ivh oracleasmlib-2.0..rpm
error: open of oracleasmlib-2.0..rpm failed: No such file or directory
[root@ermankara Downloads]# rpm -ivh oracleasmlib-2.0.
oracleasmlib-2.0.12-1.el6.x86_64.rpm  oracleasmlib-2.0.4-1.el6.x86_64.rpm
oracleasmlib-2.0.12-1.el7.x86_64.rpm
[root@ermankara Downloads]# rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
Preparing…                ########################################### [100%]
    package oracleasmlib-2.0.4-1.el6.x86_64 is already installed
[root@ermankara Downloads]# cd
[root@ermankara ~]# cd /etc/i
idmapd.conf  init.d/      inputrc      iproute2/    issue.net
init/        inittab      ipa/         issue
[root@ermankara ~]# cd /etc/in
init/    init.d/  inittab  inputrc
[root@ermankara ~]# cd /etc/init.d/oracleasm configure -i
bash: cd: /etc/init.d/oracleasm: Not a directory
[root@ermankara ~]# service oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets (‘[]’).  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]
#
[root@ermankara dev ~]# service oracleasm createdisk DATA1 /dev/sdb1
Marking disk “DATA1” as an ASM disk: [ OK ]

# service oracleasm listdisks

DATA1

DATA2

FRA

have a good day.

Standard
Linux

UDI-27140: operation generated ORACLE error 27140 Error Solutions

Hello,  UDI-27140: operation generated ORACLE error 27140 error

solutions:

connect to root  ( Oracle home and Grid home )

chmod 6751 /$ORACLE_HOME/bin/oracle
chmod 6751  /oracle/product/11.2.0.4/grid/bin/oracle

 

have a good day.

 

Standard