Monday, September 19, 2022

::: Enable Automate Startup/Shutdown of Oracle Database and Listener on Linux :::.

continue from
https://teguhth.blogspot.com/2021/11/install-database-oracle-19c-in-linux.html

1. check /etc/oratab

The Y on the end of the string signifies that the database can be started and stopped by the ORACLE_HOME/bin/dbstart and ORACLE_HOME/bin/dbshut scripts.

[oracle@teguhth bin]$ cat /etc/oratab
#


# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , 'Y', or should not,
# 'N', be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
#tgh:/u01/app/oracle/product/19.0.0/dbhome_1:N
tgh:/u01/app/oracle/product/19.0.0/dbhome_1:Y
[oracle@teguhth bin]$

 

Thursday, September 8, 2022

.::: List Index, size Index, unusage index, duplicate index & drop Index in SQL Server :::.


1. list index all

use [AdventureWorks2019]
go

select @@servername as ServerName, db_name() as [DBName],object_id, name from sys.indexes
where object_id in (select object_id from sys.objects )

 
2. size index all
 

Wednesday, September 7, 2022

.::: Load log file & insert into table in MariaDB MySQL (sample mariadb audit) :::.


continue from http://teguhth.blogspot.com/2022/08/enable-server-audit-in-mariadb-mysql.html

1.    Create table tbl_mariadb_audit
create database teguhthtools;
use teguhthtools;

CREATE TABLE `tbl_mariadb_audit`
(   `date` varchar(64) DEFAULT NULL,
    `host` varchar(64) DEFAULT NULL,
    `userdb` varchar(64) DEFAULT NULL,
    `client` varchar(64) DEFAULT NULL,
    `id` int,
    `connection_id` int NULL,
    `type` varchar(64) DEFAULT NULL,
    `db` varchar(64) DEFAULT NULL,
    `sqltext` varchar(64) DEFAULT NULL,
    `status` varchar(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

MariaDB [teguhthtools]> select * from teguhthtools.tbl_mariadb_audit;
Empty set (0.00 sec)

MariaDB [teguhthtools]>

Popular Posts