Monday, July 24, 2023

automation of listener and database and RMAN

 For Listener must start at reboot automatically:-

[oracle@kayyum ~]$ cat start_listener.sh
#!/bin/sh
# we will add below environment variable of oracle db
export ORACLE_HOME=/u02/app/oracle/product/19c/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
# we will trigger listener command
lsnrctl start



[oracle@kayyum ~]$ crontab -l
@reboot /u02/app/oracle/product/19c/dbhome_1/bin/dbstart > /dev/null 2>&1

@reboot /home/oracle/start_listener.sh > /dev/null 2>&1


#!/bin/sh
export ORACLE_HOME=/u02/app/oracle/product/19c/dbhome_1
export ORACLE_SID=emcdb
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

rman target \/ << EOF  > rman_$ORACLE_SID_$(DATE).log
run 
{
alter system checkpoint;
backup database format '/path/to/backup/location/%d_%t_%U';
}
EOF


No comments:

Post a Comment

Enable OpenSSH on Windows 11

Step 1: Install OpenSSH Server You can do this via PowerShell (run as Administrator ): Check if it's already available: Get-WindowsCapab...