How to add space in ACFS filesystem?

The below post explains the step-by-step process to add storage to a mountpoint in ACFS filesystem


1.Before extending the mountpoint storage we need to add an LVM of required Storage Capacity on the server.


For checking the LUN’s available on the server, click here


For now, assume the LUN added is /dev/sdf1


2. As root User, check the available disks by running the below command


$ /usr/sbin/oracleasm listdisks
DATA01
OCR_VOTE01
OCR_VOTE02
OCR_VOTE03


3. Create a new disk using the below command


/usr/sbin/oracleasm createdisk DATA02 /dev/sdf1 


Where DATA02 is the name of new disk added
/dev/sdf1 is the LUN added for storage extension.


4. Verify the disk is added by running the below command.


 $/etc/init.d/oracleasm  listdisks
DATA01
DATA02
OCR_VOTE01
OCR_VOTE02
OCR_VOTE03


5. Navigate to the other cluster nodes and run the scandisks command to reflect the newly added disk on all the nodes of cluster.


$/etc/init.d/oracleasm  scandisks
Scanning the system for Oracle ASMLib disks:               [  OK  ]


 $/etc/init.d/oracleasm  listdisks
DATA01
DATA02
OCR_VOTE01
OCR_VOTE02
OCR_VOTE03


6. Now login to the database server as GRID user (Where ASM instance is running) to add space to ACFS.


Set the environment as required




export ORACLE_HOME=/u01/app/12.1.0/grid
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=+ASM1


$sqlplus / as sysasm


SQL> alter diskgroup DATA add disk ‘/dev/oracleasm/disks/DATA02’;


Diskgroup altered.




7. Increase the space on filesystem


As root user,


$acfsutil size +1G /oradata
acfsutil size: new file system size: 591833071616 (564416MB)

How to Enable Database Vault in Oracle database Version 11gR1?



Steps to enable Database Vault in Oracle Database 11gR1:


1. In the command prompt, use DVCA utility to enable Oracle Database Vault.


e.g.


dvca -action enable 
  -oh /u01/app/oracle/product/11.1.0/db_1
  -service conn_alias 
  -instance orcl 
  -dbname orcl 
  -owner_account lbrown_dvowner 
  -logfile dvcalog.txt 


Enter SYS password: sys_password
Enter owner password: owner_password


Parameter Description:
======================


-service is the name of the database specifier. The specifier can be a connect descriptor or net service name. 


-instance is the name of the database instance.


-dbname is the database name.


-sys_passwd is the SYS password. If you use a cleartext password on the command line, you must include the nodecrypt option. If you omit the password, DVCA prompts you for it. Preferably, omit the password and then enter it interactively when prompted.


-owner_account is the Oracle Database Vault Owner account name.


-owner_passwd is the Oracle Database Vault Owner account password. If you use a cleartext password on the command line, you must include the nodecrypt option. If you omit the password, DVCA prompts you for it. Preferably, omit the password and then enter it interactively when prompted.


-logfile is an optional flag to specify a log file name and location. You can enter an absolute path, or enter a path that is relative to the location of the $ORACLE_HOME/bin directory.


-silent is the option to run in command line mode. This option is required if you are not running DVCA in an xterm window.


-nodecrypt is the option to read plaintext passwords.


-lockout is the flag to use to disable SYSDBA operating system authentication.


2. Stop the database, Database Control console process, and listener.


Enable the Oracle Database Vault option as follows:
 The make command enables both Oracle Database Vault (dv_on) and Oracle Label Security (lbac_on).
 You must enable Oracle Label Security before you can use Database Vault.


cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk dv_on lbac_on


cd $ORACLE_HOME/bin
relink all


3.Restart the database, Database Control console process, and listener.


4. Verify Oracle Database Vault and Oracle Label Security are enabled.


SELECT * FROM V$OPTION WHERE PARAMETER = ‘Oracle Label Security’;


SELECT * FROM V$OPTION WHERE PARAMETER = ‘Oracle Database Vault’;

How to create a Database link in GL to transfer FSG reports?



Some times, to migrate FSG reports from one environment to the other, its easy to create a dblink between the source and target environemnts and transfer the reports.


STep-by-Step Process to create database link using General Ledger Responbility.


1. Ensure that network connectivity is open between the Source and Target environments.


2. Login to database node of source instance and copy the contents of tnsnames.ora




Extract from tnsnames.ora


TEST1=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=localhost.domain.com)(PORT=1524))
            (CONNECT_DATA=
                (SID=TEST1)
            )
        )


4. Add the above tns entry in the tnsnames.ora file on the application server node of Target instance (Where db link need to be created)




5. Format the tns entry into a single line as below




(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.domain.com)(PORT=1524))(CONNECT_DATA=(SID=TEST1)))




6. Navigate to General Ledger Superuser Reponsibility.


Click on SEtup->>System–> Database links


A form will popup –> Click on “New Database Link”


Input the below values


Database Name: TEST1
Description :Database link for FSG reports
Connect String:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.domain.com)(PORT=1524))(CONNECT_DATA=(SID=TEST1)))
DOMAIN Name: DOMAIN.COM
Apps Username: APPS
APPS Password: <Password>


7. Verify that db link is created


select * from dba_db_links;

How to create directories in Oracle Database?

Database Directories are required to read/write to a filesystem location from plsql code.


Below is the syntax to create database directory


SQL> create directory PLSQL_DIR AS ‘/oratmp/code’;


Directory created.


Grant Read/write privileges to Required Schema (e.g . APPS)


SQL> GRANT READ,WRITE ON DIRECTORY PLSQL_DIR TO APPS;


Grant succeeded.

How to use coe_xfr_sql_profile.sql to Improve performance of a sql query?

Oracle SQL Performance tuning is one of the frequently reported issues in a Oracle Database administrator’s daily job.
Very often we notice that sql queries or concurrent Programs which were running within few minutes earlier are now taking hours to be completed.
Underlying reason is due to the plan_hash_value used by the query has been changed.
coe_xfr_sql_profile.sql is the script developed by Oracle Support which helps us to identify the plan_hash_value which will resolve the performance issue.


Steps to use the script coe_xfr_sql_profile.sql


1. Download the script to a temporary directory on the database server.
Script is also available in Oracle Metalink.


2. Before Running the coe_xfr_sql_profile.sql, we need to know the sql_id of the sql query which is taking longer time to complete than usual.


To find the sql_id use below query


2.1 If you know the database SID of the long running query.
select inst_id,sid,serial#,status,last_Call_et,sql_id from gv$session where sid= ‘&sessionid’;


2.2 If you know the query test, Use gv$sql and gv$sqlarea views to get the sql_id.


3. Login to sqlplus as sysdba and run coe_xfr_sql_profile.sql at the SQL prompt.


$ sqlplus “/as sysdba”
SQL> @coe_xfr_sql_profile.sql
Parameter 1:
SQL_ID (required)


Enter value for 1: 0a3f7vuks8d7y   (–this is the sql_id of long running sql)
PLAN_HASH_VALUE AVG_ET_SECS
————— ———–
1484137450 15.6
3622468234 4560.76


[Output shows the list of available plan hash values, which can be forced on to the sql query. We need to select the plan_hash_value with low ETA to resolve the performance issue]


Parameter 2:
PLAN_HASH_VALUE (required)


Enter value for 2: 1484137450 




++Based on the inputs provided, it generates a sql script with naming convention coe_xfr_sql_profile_0a3f7vuks8d7y_1484137450.sql as output


coe_xfr_sql_profile_<sql_id>_<plan_hash_value>.sql


4. Run the script as sysdba


SQL>coe_xfr_sql_profile_0a3f7vuks8d7y_1484137450.sql 


5. Verify that Performance issue is resolved by Re-running the sql.

How to check if Oracle Database Vault is enabled?



Below sql query can help us to identify if Oracle Database Vault is enabled or Disabled


SQL> SELECT * FROM V$OPTION WHERE PARAMETER = ‘Oracle Database Vault’;


PARAMETER                                          VALUE        CON_ID
————————————————– ——– ———-
Oracle Database Vault                              FALSE             0




Database Vault is Disabled.

How to Resolve ACFS-03008 : The volume expansion limit has been reached?

Issue: ACFS Filesystem resize operation fails with “ACFS-03008: The volume could not be resized.  The volume expansion limit has been reached.”


$acfsutil size +1G /oradata
acfsutil size: ACFS-03008: The volume could not be resized.  The volume expansion limit has been reached.
acfsutil size: ACFS-03216: The ADVM compatibility attribute for the diskgroup was below the required version (11.2.0.4.0) for unlimited volume expansions.


Analysis:


Compatible attribute for advm and rdbms is below the required version.


 SQL>  select group_number, name, value from v$asm_attribute where name like ‘compatible%’ ;


GROUP_NUMBER
————
NAME
——————————————————————————–
VALUE
——————————————————————————–
           1
compatible.asm
12.1.0.0.0


           1
compatible.rdbms
11.2.0.0.0


           1
compatible.advm
11.2.0.0.0


           2
compatible.asm


12.1.0.0.0


           2
compatible.rdbms
10.1.0.0.0








Solution:


SQL> ALTER DISKGROUP DATA SET ATTRIBUTE ‘compatible.advm’=’11.2.0.4.0’ ;


Diskgroup altered.


SQL>  ALTER DISKGROUP DATA SET ATTRIBUTE ‘compatible.rdbms’=’11.2.0.4.0’ ;


Diskgroup altered.


Now verify the issue is resolved.
$ acfsutil size +10G /oradata
acfsutil size: new file system size: 603644231680 (575680MB)

ACFS-03171: Insufficient contiguous free ASM Diskgroup space

Issue:  


ACFS file resize operation operation fails with ACFS-03171: Insufficient contiguous free ASM Diskgroup space




[root@erptestdb01 ~]# cd /sbin
[root@erptestdb01 sbin]# acfsutil size +100M /oradata
acfsutil size: ACFS-03171: Insufficient contiguous free ASM Diskgroup space.  Check the ASM alert log.


Solution:


Increase size in smaller chunks until the required size is reached
[root@erptestdb01 bin]# acfsutil size +10M /oradata
acfsutil size: new file system size: 590625112064 (563264MB)