spool CSV in Oracle 12.2

Now we can spool spool CSV or JSON from Oracle Database. Prior to 12.2 , we can spool as text or html, but from 12.2 onward, the SET MARKUP command now has a CSV option to output data in CSV format. Syntax CSV {ON|OFF} [DELIMI[TER] character] [QUOTE {ON|OFF}] Traditionally you wiill get formatted output (without […]

Read More

Size of Oracle Database

select ( select sum(bytes)/1024/1024/1024 data_size from dba_data_files ) + ( select nvl(sum(bytes),0)/1024/1024/1024 temp_size from dba_temp_files ) + ( select sum(bytes)/1024/1024/1024 redo_size from sys.v_$log ) + ( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024/1024 controlfile_size from v$controlfile) “Size in GB” from dual;

Read More

Display the columns related to redaction in Oracle 12c

SELECT object_owner, object_name, column_name, function_type, function_parameters, regexp_pattern, regexp_replace_string, regexp_position, regexp_occurrence, regexp_match_parameter, column_description FROM redaction_columns WHERE object_owner = DECODE(UPPER(‘&1’), ‘ALL’, object_owner, UPPER(‘&1’)) AND object_name = DECODE(UPPER(‘&2’), ‘ALL’, object_name, UPPER(‘&2’)) ORDER BY 1, 2, 3;

Read More

Number of archived redo by day

SELECT TRUNC(first_time) AS day, ROUND(SUM(blocks * block_size)/1024/1024/1024,2) size_gb FROM v$archived_log WHERE TRUNC(first_time) >= TRUNC(SYSDATE) – &1 GROUP BY TRUNC(first_time) ORDER BY TRUNC(first_time);

Read More

dbaascli database stop

The database stop subcommand of the dbaascli utility can be used to shut down the database. Execute this command as the oracle user. dbaascli database stop

Read More

dbaascli database status

The database status subcommand of the dbaascli utility can be used to check the status of the database in your database deployment. Execute this command as the oracle user. dbaascli database status

Read More

dbaascli database start

The database start subcommand of the dbaascli utility can be used to start the database instance and open the database. Execute this command as the oracle user. dbaascli database start

Read More

Creating an SSH Key Pair on the Command Line

UNIX and UNIX-like platforms (including Solaris and Linux) include the ssh-keygen utility to generate SSH key pairs. To create an SSH key pair on the command line using ssh-keygen: Open a shell for entering the commands. At the prompt, enter the following: ssh-keygen -t rsa -N “” -b “2048” -C “key comment” -f path/root_name Alternatively, […]

Read More

Oracle Database 12cR2 (12.2) On-Prem

Finally Oracle Database 12cR2 (12.2) On-Prem is available. Previously it was available only on cloud services. You can download it from eDelivery or OTN. Good Thing is that , now only zip file for Database Home as well as Grid Home. Prior to 12.2, There are 2 zip files for each of them. We can […]

Read More

Restore and Backup the current OLR

Backup current OLR and all available OLR backups # ocrconfig -local -manualbackup rac1     2017/03/01 20:52:12     /u01/app/grid/cdata/rac1/backup_20170301_205212.olr Verify available backups # ocrconfig -local -showbackup rac1    2017/03/01 20:52:12    /u01/app/grid/cdata/rac1/backup_20170301_205212.olr Verify available backups from OS # ls -l /u01/app/grid/cdata/rac1/* -rw——-. 1 root root 6803456 Feb 12 13:04 /u01/app/grid/cdata/rac1/backup_20170212_130457.olr -rw——-. 1 root root 7016448 Mar 01 09:08 /u01/app/grid/cdata/rac1/backup_20170301_090842.olr […]

Read More