SELECT MAX(LENGTHB(LOB_COLUMN)) FROM TABLE;
Dream Always Dream , if you don't work on it : Real-world Oracle DBA troubleshooting guides for RAC, Data Guard, RMAN, performance tuning, upgrades, backups, and cloud migration. Tested in production environments.
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA demo_admin TO demo_rw;
GRANT USAGE ON SCHEMA demo_admin TO demo_rw;
grant demo_rw to demo_app;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA demo_admin TO demo_rw;
How to grant access to users in PostgreSQL?
Here are some common statement to grant access to a PostgreSQL user:
=> Grant CONNECT to the database:
GRANT CONNECT ON DATABASE database_name TO username;
=> Grant USAGE on schema:
GRANT USAGE ON SCHEMA schema_name TO username;
=> Grant on all tables for DML statements: SELECT, INSERT, UPDATE, DELETE:
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA schema_name TO username;
=> Grant all privileges on all tables in the schema:
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema_name TO username;
=> Grant all privileges on all sequences in the schema:
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA schema_name TO username;
=> Grant all privileges on the database:
GRANT ALL PRIVILEGES ON DATABASE database_name TO username;
=> Grant permission to create database:
ALTER USER username CREATEDB;
=> Make a user superuser:
ALTER USER myuser WITH SUPERUSER;
=> Remove superuser status:
ALTER USER username WITH NOSUPERUSER;
=> Those statements above only affect the current existing tables. To apply to newly created tables, you need to use alter default.
For example:
ALTER DEFAULT PRIVILEGES FOR USER username IN SCHEMA schema_name
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO username;
[root@oraclesrc-2 ~]#
[root@oraclesrc-2 ~]# vi /etc/ssh/sshd_config
[root@oraclesrc-2 ~]#
[root@oraclesrc-2 ~]#
[root@oraclesrc-2 ~]# systemctl status sshd.service
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2024-05-10 12:11:33 UTC; 1h 3min ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 3883 (sshd)
Tasks: 1
Memory: 3.6M
CGroup: /system.slice/sshd.service
└─3883 /usr/sbin/sshd -D
May 10 12:11:33 oraclesrc-2 sshd[3883]: Server listening on :: port 22.
May 10 12:11:33 oraclesrc-2 systemd[1]: Started OpenSSH server daemon.
May 10 12:11:47 oraclesrc-2 sshd[3896]: reverse mapping checking getaddrinfo for 192.240.103.in-addr.tripleplay.in [103.240...TTEMPT!
May 10 12:11:50 oraclesrc-2 sshd[3896]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= r...=oracle
May 10 12:11:51 oraclesrc-2 sshd[3896]: Failed password for oracle from 10.0.0.0 port 3952 ssh2
May 10 12:11:56 oraclesrc-2 sshd[3896]: Failed password for oracle from 10.0.0.0 port 3952 ssh2
May 10 12:12:17 oraclesrc-2 sshd[3896]: Accepted password for oracle from 10.0.0.0 port 3952 ssh2
May 10 12:12:19 oraclesrc-2 sshd[3982]: reverse mapping checking getaddrinfo for 192.240.103.in-addr.tripleplay.in [103.240...TTEMPT!
May 10 12:12:20 oraclesrc-2 sshd[3982]: Accepted password for oracle from 10.0.0.0 port 3969 ssh2
May 10 12:16:22 oraclesrc-2 sshd[4671]: Accepted publickey for azureadm from 10.0.1.4 port 44574 ssh2: RSA SHA256:/3WBXn4cT...7muuY2k
Hint: Some lines were ellipsized, use -l to show in full.
[root@oraclesrc-2 ~]#
[root@oraclesrc-2 ~]#
[root@oraclesrc-2 ~]# systemctl restart sshd.service
[root@oraclesrc-2 ~]#
[root@oraclesrc-2 ~]#
curl -v telnet://92.154.243.54:1521
telnet 92.154.243.54 1521
[root@oraclesrc-5 ~]#
[root@oraclesrc-5 ~]# firewall-cmd --zone=public --permanent --add-port=1521/tcp
success
[root@oraclesrc-5 ~]#
[root@oraclesrc-5 ~]# firewall-cmd --reload
success
[root@oraclesrc-5~]#
[azureadm@oracletgt-1 ~]$
[azureadm@oracletgt-1 ~]$ sudo su - root
Last login: Fri May 3 07:09:49 UTC 2024
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: CC07BBFF-E48E-4614-B09E-BFD7ED16E3D9
# Start End Size Type Name
1 1026048 2050047 500M Microsoft basic
2 2050048 62912511 29G Microsoft basic
14 2048 10239 4M BIOS boot
15 10240 1024000 495M EFI System EFI System Partition
Disk /dev/sdb: 17.2 GB, 17179869184 bytes, 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xe5bd4e29
Device Boot Start End Blocks Id System
/dev/sdb1 2048 33552383 16775168 7 HPFS/NTFS/exFAT
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: CC07BBFF-E48E-4614-B09E-BFD7ED16E3D9
# Start End Size Type Name
1 1026048 2050047 500M Microsoft basic
2 2050048 62912511 29G Microsoft basic
14 2048 10239 4M BIOS boot
15 10240 1024000 495M EFI System EFI System Partition
Disk /dev/sdb: 17.2 GB, 17179869184 bytes, 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xe5bd4e29
Device Boot Start End Blocks Id System
/dev/sdb1 2048 33552383 16775168 7 HPFS/NTFS/exFAT
Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# fidk /dev/sdc
-bash: fidk: command not found
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x4c1bf713.
The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
Command (m for help): p
Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x4c1bf713
Device Boot Start End Blocks Id System
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-104857599, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):
Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set
Command (m for help): p
Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x4c1bf713
Device Boot Start End Blocks Id System
/dev/sdc1 2048 104857599 52427776 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: CC07BBFF-E48E-4614-B09E-BFD7ED16E3D9
# Start End Size Type Name
1 1026048 2050047 500M Microsoft basic
2 2050048 62912511 29G Microsoft basic
14 2048 10239 4M BIOS boot
15 10240 1024000 495M EFI System EFI System Partition
Disk /dev/sdb: 17.2 GB, 17179869184 bytes, 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xe5bd4e29
Device Boot Start End Blocks Id System
/dev/sdb1 2048 33552383 16775168 7 HPFS/NTFS/exFAT
Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x4c1bf713
Device Boot Start End Blocks Id System
/dev/sdc1 2048 104857599 52427776 83 Linux
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Feb 11 10:36:35 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/sda2 / btrfs subvol=root 0 0
UUID=90b82350-a900-475f-8d8f-23db65d7f70a /boot xfs defaults 0 0
UUID=3B29-C04C /boot/efi vfat defaults,uid=0,gid=0,umask=0077,shortname=winnt 0 0
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs tmpfs 3.8G 8.6M 3.8G 1% /run
tmpfs tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/sda2 btrfs 30G 19G 11G 65% /
/dev/sda1 xfs 497M 329M 169M 67% /boot
/dev/sda15 vfat 495M 7.4M 488M 2% /boot/efi
//oraclemigrsa.file.core.windows.net/transfer01 cifs 5.0T 3.3G 5.0T 1% /mnt/Backup
tmpfs tmpfs 766M 0 766M 0% /run/user/995
tmpfs tmpfs 766M 0 766M 0% /run/user/54322
[root@oracletgt-1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 16G 0 disk
└─sdb1 8:17 0 16G 0 part
sdc 8:32 0 50G 0 disk
└─sdc1 8:33 0 50G 0 part
sda 8:0 0 30G 0 disk
├─sda2 8:2 0 29G 0 part /
├─sda14 8:14 0 4M 0 part
├─sda15 8:15 0 495M 0 part /boot/efi
└─sda1 8:1 0 500M 0 part /boot
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: CC07BBFF-E48E-4614-B09E-BFD7ED16E3D9
# Start End Size Type Name
1 1026048 2050047 500M Microsoft basic
2 2050048 62912511 29G Microsoft basic
14 2048 10239 4M BIOS boot
15 10240 1024000 495M EFI System EFI System Partition
Disk /dev/sdb: 17.2 GB, 17179869184 bytes, 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xe5bd4e29
Device Boot Start End Blocks Id System
/dev/sdb1 2048 33552383 16775168 7 HPFS/NTFS/exFAT
Disk /dev/sdc: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x4c1bf713
Device Boot Start End Blocks Id System
/dev/sdc1 2048 104857599 52427776 83 Linux
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# mkfs -t xfs /dev/sdc
mkfs.xfs: /dev/sdc appears to contain a partition table (dos).
mkfs.xfs: Use the -f option to force overwrite.
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# mkfs -t xfs /dev/sdc1
meta-data=/dev/sdc1 isize=256 agcount=4, agsize=3276736 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=0 finobt=0, sparse=0, rmapbt=0
= reflink=0
data = bsize=4096 blocks=13106944, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=6399, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
Discarding blocks...Done.
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# mount /dev/sdc1 /u02
mount: mount point /u02 does not exist
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# mkdir /u02
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# mount /dev/sdc1 /u02
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs 3.8G 8.6M 3.8G 1% /run
tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/sda2 30G 19G 11G 65% /
/dev/sda1 497M 329M 169M 67% /boot
/dev/sda15 495M 7.4M 488M 2% /boot/efi
//oraclemigrsa.file.core.windows.net/transfer01 5.0T 3.3G 5.0T 1% /mnt/Backup
tmpfs 766M 0 766M 0% /run/user/995
tmpfs 766M 0 766M 0% /run/user/54322
/dev/sdc1 50G 33M 50G 1% /u02
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# blkid
/dev/sda2: LABEL="btr_pool" UUID="f6f5bfb0-4864-48a6-9a16-2d143b78c40d" UUID_SUB="3bd8c97c-a996-43b4-801c-70bb51b5ea22" TYPE="btrfs" PARTUUID="2006f71f-46a3-48f3-acfe-d17a895b899d"
/dev/sda1: UUID="90b82350-a900-475f-8d8f-23db65d7f70a" TYPE="xfs" PARTUUID="2018006f-a0e6-4796-9b0d-3f4a2ed5321d"
/dev/sda14: PARTUUID="63bb33c1-4d38-4651-98f8-3f604016aa35"
/dev/sda15: SEC_TYPE="msdos" UUID="3B29-C04C" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="a73c2ce6-b3b3-4d7b-8c2c-817217f5958e"
/dev/sdb1: LABEL="Temporary Storage" UUID="6232F43632F410B1" TYPE="ntfs"
/dev/sdc1: UUID="f4022ae4-936f-48d5-b477-0fc06f5740a9" TYPE="xfs"
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# vi /etc/fstab
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs 3.8G 8.6M 3.8G 1% /run
tmpfs 3.8G 0 3.8G 0% /sys/fs/cgroup
/dev/sda2 30G 19G 11G 65% /
/dev/sda1 497M 329M 169M 67% /boot
/dev/sda15 495M 7.4M 488M 2% /boot/efi
//oraclemigrsa.file.core.windows.net/transfer01 5.0T 3.3G 5.0T 1% /mnt/Backup
tmpfs 766M 0 766M 0% /run/user/995
tmpfs 766M 0 766M 0% /run/user/54322
/dev/sdc1 50G 33M 50G 1% /u02
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]#
[root@oracletgt-1 ~]# cd /u02/
[root@oracletgt-1 u02]# ls -lrt
total 0
[root@oracletgt-1 u02]#
[root@oracletgt-1 u02]# touch anurag_mark.txt
[root@oracletgt-1 u02]#
[root@oracletgt-1 u02]#
[root@oracletgt-1 u02]# ls -lrt
total 0
-rw-r--r--. 1 root root 0 May 3 10:17 anurag_mark.txt
[root@oracletgt-1 u02]#
[root@oracletgt-1 u02]#
Automatically mount an attached storage volume after reboot
[root@oracletgt-1 u02]#
[root@oracletgt-1 u02]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Feb 11 10:36:35 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/sda2 / btrfs subvol=root 0 0
UUID=90b82350-a900-475f-8d8f-23db65d7f70a /boot xfs defaults 0 0
UUID=3B29-C04C /boot/efi vfat defaults,uid=0,gid=0,umask=0077,shortname=winnt 0 0
UUID=f4022ae4-936f-48d5-b477-0fc06f5740a9 /u02 xfs defaults,nofail 0 2
[root@oracletgt-1 u02]#
Link :
https://docs.aws.amazon.com/ebs/latest/userguide/ebs-using-volumes.html
[root@ip-10.0.0.0]#
[root@ip-10.0.0.0]# dnf install python3-pip
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use "rhc" or "subscription-manager" to register.
Last metadata expiration check: 0:45:58 ago on Tue 30 Apr 2024 01:17:25 PM UTC.
Dependencies resolved.
==============================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================
Installing:
python3-pip noarch 21.2.3-8.el9 rhel-9-appstream-rhui-rpms 2.0 M
Transaction Summary
==============================================================================================================================
Install 1 Package
Total download size: 2.0 M
Installed size: 8.7 M
Is this ok [y/N]: y
Downloading Packages:
python3-pip-21.2.3-8.el9.noarch.rpm 24 MB/s | 2.0 MB 00:00
------------------------------------------------------------------------------------------------------------------------------
Total 17 MB/s | 2.0 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-pip-21.2.3-8.el9.noarch 1/1
Running scriptlet: python3-pip-21.2.3-8.el9.noarch 1/1
Verifying : python3-pip-21.2.3-8.el9.noarch 1/1
Installed products updated.
Installed:
python3-pip-21.2.3-8.el9.noarch
Complete!
[root@ip-10.0.0.0]#
What is Oracle BaseDB (Oracle Base Database Service)? Oracle BaseDB is the common shorthand used for Oracle Base Database Service , a man...