Tuesday, August 1, 2023

Startup Modes In Oracle Database

 nomount mode

only parameter file is accessible.

this mode is only use to modify parameter file content/paramter.

mount mode

read control file but not validate its file content.

certain maintenance operation requires mount mode. ( RMAN backup restore recovery)

Note:- ******* its mandatory for "recover database"  that db should be in mount mode*******

parameter file, processes gets started and memory allocated for the instance.

open mode

start to read data files and redo logs 

orapwd "Creating Password File In Oracle Database For Remote Login"

 orapwd FILE=path_to_password_file [ENTRIES=num_users] [FORCE={y|n}] [IGNORECASE={y|n}]

example:-

orapwd file=path_to_password_file entries=num_users force=y/n ignorecase=y/n 

SQL> show parameter password ;

NAME                                            TYPE              VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE

exclusive:- password file can only used by single database.

shared:- password file can be used by multiple database. 

  • FILE: Specifies the path and filename for the password file. The password file should be created in the $ORACLE_HOME/dbs directory.

  • ENTRIES: (Optional) Specifies the number of entries (user accounts) that the password file can hold. The default value is 5.

  • FORCE: (Optional) If set to 'y', the existing password file will be overwritten. If set to 'n', and if the password file already exists, the orapwd command will not create a new file.

  • IGNORECASE: (Optional) If set to 'y', passwords are case-insensitive. If set to 'n', passwords are case-sensitive.

original location of password file:- $ORACLE_HOME/dbs/orapw$ORACLE_SID

[oracle@rac1 dbs]$ orapwd --help
Usage 1: orapwd file=<fname> force={y|n} asm={y|n}
          dbuniquename=<dbname> format={12|12.2}
          delete={y|n} input_file=<input-fname>
          'sys={y | password | external(<sys-external-name>)
                | global(<sys-directory-DN>)}'
          'sysbackup={y | password | external(<sysbackup-external-name>)
                      | global(<sysbackup-directory-DN>)}'
          'sysdg={y | password | external(<sysdg-external-name>)
                  | global(<sysdg-directory-DN>)}'
          'syskm={y | password | external(<syskm-external-name>)
                  | global(<syskm-directory-DN>)}'

Usage 2: orapwd describe file=<fname>

  where
    file   - name of password file (required),
    password
           - password for SYS will be prompted
             if not specified at command line.
             Ignored, if input_file is specified,
    force  - whether to overwrite existing file (optional),
    asm    - indicates that the password to be stored in
             Automatic Storage Management (ASM) disk group
             is an ASM password. (optional),
    dbuniquename
           - unique database name used to identify database
             password files residing in ASM diskgroup only.
             Ignored when asm option is specified (optional),
    format - use format=12 for new 12c features like SYSBACKUP, SYSDG
             and SYSKM support, longer identifiers, SHA2 Verifiers etc.
             use format=12.2 for 12.2 features like enforcing user
             profile (password limits and password complexity) and
             account status for administrative users.
             If not specified, format=12.2 is default (optional),
    delete - drops a password file. Must specify 'asm',
             'dbuniquename' or 'file'. If 'file' is specified,
             the file must be located on an ASM diskgroup (optional),
    input_file
           - name of input password file, from where old user
             entries will be migrated (optional),
    sys    - specifies if SYS user is password, externally or
             globally authenticated.
             For external SYS, also specifies external name.
             For global SYS, also specifies directory DN.
             SYS={y | password} specifies if SYS user password needs
             to be changed when used with input_file,
    sysbackup
           - creates SYSBACKUP entry (optional).
             Specifies if SYSBACKUP user is password, externally or
             globally authenticated.
             For external SYSBACKUP, also specifies external name.
             For global SYSBACKUP, also specifies directory DN.
             Ignored, if input_file is specified,
    sysdg  - creates SYSDG entry (optional).
             Specifies if SYSDG user is password, externally or
             globally authenticated.
             For external SYSDG, also specifies external name.
             For global SYSDG, also specifies directory DN.
             Ignored, if input_file is specified,
    syskm  - creates SYSKM entry (optional).
             Specifies if SYSKM user is password, externally or
             globally authenticated.
             For external SYSKM, also specifies external name.
             For global SYSKM, also specifies directory DN.
            Ignored, if input_file is specified,
    describe
           - describes the properties of specified password file
             (required).


  There must be no spaces around the equal-to (=) character.
[oracle@rac1 dbs]$

GRID & RAC & LINUX TRICKS & TIPS & COMMANDS

To Switch to "/bin" directory directly :-

 cd $(dirname $(ps -ef | grep -i d.bin | grep -v grep | awk '{print $8}' | awk 'NR==1') )

--------------------------------------------------------------------------------------------------------------------

[oracle@rac1 ~]$ pwd
/home/oracle
[oracle@rac1 ~]$ ps -ef | grep -i d.bin
oracle      3572       1  1 13:13 ?        00:01:18 /u01/app/19c/grid/bin/ohasd.bin reboot
oracle      5088       1  1 13:13 ?        00:01:25 /u01/app/19c/grid/bin/oraagent.bin
oracle      5138       1  0 13:13 ?        00:00:30 /u01/app/19c/grid/bin/evmd.bin
oracle      5141       1  0 13:13 ?        00:00:00 /u01/app/19c/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
oracle      5311       1  0 13:13 ?        00:00:34 /u01/app/19c/grid/bin/cssdagent
oracle      5339    5138  0 13:13 ?        00:00:30 /u01/app/19c/grid/bin/evmlogger.bin -o /u01/app/19c/grid/log/[HOSTNAME]/evmd/evmlogger.info -l /u01/app/19c/grid/log/[HOSTNAME]/evmd/evmlogger.log
oracle      5372       1  0 13:13 ?        00:00:34 /u01/app/19c/grid/bin/ocssd.bin
oracle      9910    7034  0 14:29 pts/0    00:00:00 grep --color=auto -i d.bin
[oracle@rac1 ~]$
[oracle@rac1 ~]$
[oracle@rac1 ~]$ ps -ef | grep -i d.bin | awk '{print $8}'
/u01/app/19c/grid/bin/ohasd.bin
/u01/app/19c/grid/bin/oraagent.bin
/u01/app/19c/grid/bin/evmd.bin
/u01/app/19c/grid/bin/tnslsnr
/u01/app/19c/grid/bin/cssdagent
/u01/app/19c/grid/bin/evmlogger.bin
/u01/app/19c/grid/bin/ocssd.bin
grep
[oracle@rac1 ~]$
[oracle@rac1 ~]$
[oracle@rac1 ~]$ ps -ef | grep -i d.bin | awk '{print $8}' | awk 'NR==1'
/u01/app/19c/grid/bin/ohasd.bin
[oracle@rac1 ~]$
[oracle@rac1 ~]$
[oracle@rac1 ~]$
[oracle@rac1 ~]$ dirname $(ps -ef | grep -i d.bin | awk '{print $8}' | awk 'NR==1')
/u01/app/19c/grid/bin
[oracle@rac1 ~]$
[oracle@rac1 ~]$
[oracle@rac1 ~]$ cd $(dirname $(ps -ef | grep -i d.bin | awk '{print $8}' | awk 'NR==1'))
[oracle@rac1 bin]$
[oracle@rac1 bin]$ pwd
/u01/app/19c/grid/bin
--------------------------------------------------------------------------------------------------------------------------
ORACLE GRID '/etc'
oraInst.loc: This file is located in the /etc directory and is used to specify the location of the Oracle Inventory (Central Inventory) on the system. The Oracle Inventory stores information about Oracle installations, including Oracle Grid Infrastructure.

coraenv and oraenv: These are shell scripts located in /etc. They are used to set up the environment for different Oracle software installations, including Oracle Grid Infrastructure. The oraenv and coraenv scripts allow you to set the environment for a specific Oracle home or Grid Infrastructure home.

init. files*: In some cases, you might find init.* files in the /etc directory that are used to start Oracle Grid Infrastructure resources at system startup. For example, init.ohasd is used to start the Oracle High Availability Services daemon.

cron.d: You might find cron jobs related to Oracle Grid Infrastructure in the /etc/cron.d directory. These cron jobs are used to schedule tasks such as backups, maintenance, and monitoring.

udev Rules: On Linux systems, Oracle Grid Infrastructure may create udev rules for devices like Oracle ASM disks. These udev rules can be found in the /etc/udev/rules.d directory.

Network Configuration: Some network-related configuration files, such as /etc/hosts and /etc/resolv.conf, can be important for Oracle Grid Infrastructure to properly resolve hostnames and IP addresses.

System Configuration: Various system configuration files and settings in /etc may indirectly impact Oracle Grid Infrastructure, including the /etc/sysctl.conf file for kernel parameters, /etc/security/limits.conf for resource limits, and more.


Sunday, July 30, 2023

check Oracle database slow SQL Response


SET LINESIZE 200 PAGESIZE 50000
COL INST_ID FORMAT 999
COL "Response_Time (msecs)" FORMAT 999,999,999,999.99
COL BEGIN_TIME FORMAT A17
COL END_TIME FORMAT A17
SELECT TO_CHAR (BEGIN_TIME, 'DD-MON-YYYY HH24:MI') BEGIN_TIME,
TO_CHAR (END_TIME, 'DD-MON-YYYY HH24:MI') END_TIME,
INST_ID,
ROUND (VALUE * 10, 2) "Response_Time (msecs)"
FROM GV$SYSMETRIC
WHERE     1 = 1
AND METRIC_NAME = 'SQL Service Response Time'
ORDER BY INST_ID;

BEGIN_TIME        END_TIME          INST_ID Response_Time (msecs)                                                                                                                                       
----------------- ----------------- ------- ---------------------                                                                                                                                       

15-JUL-2023 01:05 15-JUL-2023 01:06       1                   .44
15-JUL-2023 01:04 15-JUL-2023 01:05       1                   .49
15-JUL-2023 01:03 15-JUL-2023 01:04       1                   .59
15-JUL-2023 01:02 15-JUL-2023 01:03       1                   .52
15-JUL-2023 01:01 15-JUL-2023 01:02       1                   .45
15-JUL-2023 01:00 15-JUL-2023 01:01       1                  1.07
15-JUL-2023 00:59 15-JUL-2023 01:00       1                   .58

You can also query for the minimum, average and maximum response time for the last minute:

SET LINESIZE 200 PAGESIZE 50000
COL BEGIN_TIME FORMAT A17
COL END_TIME FORMAT A17
COL INST_ID FORMAT 999
COL "Min Response Time (msecs)" FORMAT 999,999,999,999.99
COL "Avg Response Time (msecs)" FORMAT 999,999,999,999.99
COL "Max Response Time (msecs)" FORMAT 999,999,999,999.99

  SELECT TO_CHAR (BEGIN_TIME, 'DD-MON-YYYY HH24:MI') BEGIN_TIME,
         TO_CHAR (END_TIME, 'DD-MON-YYYY HH24:MI') END_TIME,
         INST_ID,
         ROUND (MINVAL * 10, 2) "Min Response Time (msecs)",
         ROUND (AVERAGE * 10, 2) "Avg Response Time (msecs)",
         ROUND (MAXVAL * 10, 2) "Max Response Time (msecs)"
    FROM GV$SYSMETRIC_SUMMARY
   WHERE     1 = 1
         AND METRIC_NAME = 'SQL Service Response Time'
ORDER BY INST_ID;
BEGIN_TIME        END_TIME          INST_ID Min Response Time (msecs) Avg Response Time (msecs) Max Response Time (msecs)
----------------- ----------------- ------- ------------------------- ------------------------- -------------------------
30-JUL-2023 20:12 30-JUL-2023 21:13       1                       .00                     17.65                     40.38
SET LINESIZE 200 PAGESIZE 50000
COL BEGIN_TIME FORMAT A17
COL END_TIME FORMAT A17
COL INST_ID FORMAT 999
COL "Response Time (msecs)" FORMAT 999,999,999,999.99

  SELECT TO_CHAR (BEGIN_TIME, 'DD-MON-YYYY HH24:MI') BEGIN_TIME,
         TO_CHAR (END_TIME, 'DD-MON-YYYY HH24:MI') END_TIME,
         INSTANCE_NUMBER INST_ID,
         ROUND (VALUE * 10, 2) "Response Time (msecs)"
    FROM DBA_HIST_SYSMETRIC_HISTORY
   WHERE 1 = 1 AND METRIC_NAME = 'SQL Service Response Time'
ORDER BY BEGIN_TIME DESC, INSTANCE_NUMBER;
BEGIN_TIME        END_TIME          INST_ID Response Time (msecs)                                                                                                                                       
----------------- ----------------- ------- --------------------- 
15-JUL-2023 01:03 15-JUL-2023 01:04 1 .59 15-JUL-2023 01:02 15-JUL-2023 01:03 1 .52 15-JUL-2023 01:01 15-JUL-2023 01:02 1 .45 15-JUL-2023 01:00 15-JUL-2023 01:01 1 1.07 15-JUL-2023 00:59 15-JUL-2023 01:00 1 .58
SET LINESIZE 200 PAGESIZE 50000
COL BEGIN_TIME FORMAT A17
COL END_TIME FORMAT A17
COL INST_ID FORMAT 999
COL "Response Time (msecs)" FORMAT 999,999,999,999.99

  SELECT TO_CHAR (BEGIN_TIME, 'DD-MON-YYYY HH24:MI') BEGIN_TIME,
         TO_CHAR (END_TIME, 'DD-MON-YYYY HH24:MI') END_TIME,
         INSTANCE_NUMBER INST_ID,
         ROUND (VALUE * 10, 2) "Response Time (msecs)"
    FROM DBA_HIST_SYSMETRIC_HISTORY
   WHERE 1 = 1 AND METRIC_NAME = 'SQL Service Response Time'
ORDER BY BEGIN_TIME DESC, INSTANCE_NUMBER;
SET LINESIZE 200 PAGESIZE 50000
COL BEGIN_TIME FORMAT A17
COL END_TIME FORMAT A17
COL INST_ID FORMAT 999
COL "Min Response Time (msecs)" FORMAT 999,999,999,999.99
COL "Avg Response Time (msecs)" FORMAT 999,999,999,999.99
COL "Max Response Time (msecs)" FORMAT 999,999,999,999.99

  SELECT TO_CHAR (BEGIN_TIME, 'DD-MON-YYYY HH24:MI') BEGIN_TIME,
         TO_CHAR (END_TIME, 'DD-MON-YYYY HH24:MI') END_TIME,
         INSTANCE_NUMBER INST_ID,
         ROUND (MINVAL * 10, 2) "Min Response Time (msecs)",
         ROUND (AVERAGE * 10, 2) "Avg Response Time (msecs)",
         ROUND (MAXVAL * 10, 2) "Max Response Time (msecs)"
    FROM DBA_HIST_SYSMETRIC_SUMMARY
   WHERE 1 = 1 AND METRIC_NAME = 'SQL Service Response Time'
ORDER BY BEGIN_TIME DESC, INSTANCE_NUMBER;

grep commands patterns and metacharacter classes In Linux escape "\" character importance

 


cat /etc/oratab | grep -e "^[\a-Az-Z0-9\]\{0,8\}\:*/[[:graph:]]*"


Hints:-

Always use caret "^" and "$" without escape "\"  like  "^[[:digit:]]"  or "$[[:digit:]]" .

To include forward search use "\+" or "*"  like "^[[:graph:]]\+" or "^[[:digit:]]*" .

unzip and zip files and tar files in linux

 unzip -o /path/to/source_zip_file.zip -d /path/to/destination

-o :- source_directory

-d :- destination_directory 


unzip 

-o /u01/software/LINUX.X64_19300_GRID_HOME.zip

-d /u01/app/grid





         

Saturday, July 29, 2023

OPATCH, OPATCHAUTO AND AUTOUPGRADE.JAR usage In Oracle Database

 Opatch :- 

a java based utility enables the application and rollback patches oracle software.

location:- $ORACLE_HOME/OPatch/

----------------------------------------------------------------------------------------------------------------

opatch prereq CheckSystemPatch -phBaseDir <path_to_patch>
opatch apply <path_to_patch>
opatchauto apply <path_to_patch> -oh <grid_oracle_home> -ocmrf <path_to_ocm_response_file>
opatch lsinventory
opatch lsinventory -patch_id
opatch rollback -id <patch_id>
opatch lsinventory | grep <patch_id>
opatch prereq CheckConflictAmongPatches -phBaseDir <path_to_patch>
------------------------------------------------------------------------------------------------------

Opatchauto :-

orchestration tool generates patching instruction specific to your target configuration then uses opatch to perform patching without user intervention.

location:- $GRID_HOME/OPatch/opatchauto

-----------------------------------------------------------------------------------------
opatchauto apply <path_to_patch> -analyze
opatchauto apply <path_to_patch>
Rolling Patch Apply :-
opatchauto apply <path_to_patch> -oh <grid_oracle_home> -ocmrf <path_to_ocm_response_file>
opatchauto apply <path_to_patch> -verify
opatchauto lspatches
opatchauto rollback -id <patch_id>
opatchauto lspatch <patch_id>
opatchauto prereq CheckConflictAmongPatches <path_to_patch>
--------------------------------------------------------------------------------------------------

autoupgrade.jar :-
automate upgrade of oracle database.
1) first install latest version oracle db software 
2) start 

location:- $ORACLE_HOME/jlib/autoupgrade.jar

cat config.properties
----------------------------------------------------------------------------------
# Source database details
source_home=/path/to/source/oracle_home
source_sid=SOURCE_SID
source_user=SYS
source_password=source_sys_password
source_sysdba_password=source_sysdba_password

# Target database details
target_home=/path/to/target/oracle_home
target_version=19.0.0

# AutoUpgrade behavior
auto_pfile=TRUE
compatible=19.0.0
timezone_upg=yes
datapatch=yes
upgrade_parallelism=4

# Log file locations
log_dir=/path/to/log/directory
log_file=autoupgrade.log

# Optional parameters
parameters=statistics_level=typical
---------------------------------------------------------------------------------------------------
java -jar autoupgrade.jar -config <path_to_config_file> -mode readyness
java -jar autoupgrade.jar -config <path_to_config_file> -mode prechecks
java -jar autoupgrade.jar -config <path_to_config_file> -mode analyze
Apply upgrades:-
java -jar autoupgrade.jar -config <path_to_config_file> -mode deploy
java -jar autoupgrade.jar -config <path_to_config_file> -mode fixups
java -jar autoupgrade.jar -config <path_to_config_file> -mode report
---------------------------------------------------------------------------------------------------

++++++++++++ Always use latest opatch from oracle support websites and Export Oracle environments before doing anything ++++++++++++++++++

always do after autoupgrades/ patching 

$ORACLE_HOME/OPatch/datapatch verbose

RAC SRVCTL & CRSCTL

 Stop DB

sudo -iu oracle

default :- srvctl stop database -d PUNEDB     ---------> will stop database on all nodes

srvctl stop database -d PUNEDB -o normal

srvctl stop database -d PUNEDB -o immediate

srvctl stop database -d PUNEDB -o transactional 

srvctl stop database -d PUNEDB -o abort 

START DB

sudo -iu oracle

default :- srvctl start database -d PUNEDB ----------------> will start database on all nodes

srvctl start database -d PUNEDB -o nomount

srvctl start database -d PUNEDB -o mount        --------> for standby db, backup task

srvctl start database -d PUNEDB -o open          ---------> default behaviour

STOP / START INSTANCE 

sudo -iu oracle

srvctl stop instance -d PUNEDB -i PUNE1

srvctl start instance -d PUNEDB -i PUNE2 


To Stop CLUSTERWARE / CRS :-

sudo -iu root

ps -ef | grep -i d.bin

cd ~/bin 

~/bin # ./crsctl disable crs 

~/bin # ./crsctl stop crs -f 


To Start CLUSTERWARE /CRS :-

sudo -iu root 

ps -ef | grep -i d.bin

cd ~/bin

~/bin # ./crsctl enable crs

~/bin # ./crsctl start crs 



Friday, July 28, 2023

Start & Stop MRP on Standby database

Stop log apply service (MRP) on standby :-

alter database recover managed standby database cancel;

shutdown immediate;

stop log shipping from primary and shutdown primary database:-

Note:- Run this on primary--> to get log_archive_dest location for standby db's please use below query:-

col dest_name for a30
col status for a10
col destination for a50
select dest_name,status,destination from gv$archive_dest_status where destination is not null;

then :-

show parameter log_archive_dest_state_&n; ------> n is number from above query 

alter system set log_archive_dest_state_&n='DEFER';

shutdown immediate;


To start primary database & enable log shipping use below steps:-

steps to be performed on PRIMARY DB:-

startup;

alter system set log_archive_dest_state_&n='ENABLE';

steps to be performed on STANDBY DB:-

startup nomount;

alter database mount standby database; 

alter database recover managed standby database disconnect from session;


--------- to check status of mrp on standby and (lgwr or lns) on Primary -----

on standby:-

SQL > ! ps -ef | grep -e "pmon\|tnslsnr\|crs\|PARAM\|mrp" | grep -v grep

or 

$ ps -ef | grep -e "pmon\|tnslsnr\|crs\|PARAM\|mrp" | grep -v grep

SQL> 


-------------------------- Final all in one query for MRP DR ARCHIVE LOG GAP --------------

select a.thread# thread,
 k.host_name,
 k.instance_name,
 m.process,
 m.status,
 a.arch_seq arch,
 b.appl_seq appl,
(a.arch_seq-b.appl_seq)
 difference from (select thread#, max(sequence#) 
as arch_seq from gv$archived_log where archived = 'YES' group by thread#) a,
 (select thread#, max(sequence#) as appl_seq from gv$archived_log where applied = 'YES' group by thread#) b,gv$instance k,gv$managed_standby m
 where a.thread# = b.thread# (+) and b.thread# = k.thread# (+) and m.thread#<>0  and m.process like '%MRP%' order by a.thread#, a.arch_seq, b.appl_seq;

----------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------
    THREAD HOST_NAME                 INSTANCE_NAME    PROCESS   STATUS             ARCH       APPL DIFFERENCE
---------- ---------------------------------------------------------------- ---------------- --------- ------------ ---------- ---------- ----------
         1 host1                                                          instance1        MRP0      APPLYING_LOG     418336     418336          0
         2 host2                                                          instance2        MRP0      APPLYING_LOG     512681     512681          0
         3 host3                                                          instance3        MRP0      APPLYING_LOG     564134     564134          0
         4 host4                                                          instance4        MRP0      APPLYING_LOG     549583     549583          0




**************** The Best Option is Search For Oracle Support Help ***************************************

OPEN STANDBY DB IN READONLY (ACTIVE DATAGUARD)

1. check status of dataguard
select name,open_mode from gv$dataguard;

NAME        OPEN_MODE
----------------------------------
PUNE            MOUNTED

2. Cancel MRP on standby db
alter database recover managed standby database cancel;

3. Open standby db in readonly mode:-
Hint:- db should be in mount mode already.
alter database open read only;

4. Start MRP with real-time log apply on standby db:-
alter database recover managed standby database using current logfile disconnect from session;

5. Verify the standby db status:-
select name, open_mode from gv$database;

NAME        OPEN_MODE
---------------------------------------------------
PUNE        READ ONLY WITH APPLY 

6. Check MRP process is running :-
select process, status, sequence# from gv$managed_standby where process like '%MRP%';

PROCESS        STATUS        SEQUENCE#
----------------------------------------------------
MRP0            APPLYING LOG        2000


=========================================================================

************************** If you need to do manual recovery ********************************
**copy archive logs from  primary db to standby db and perform below steps:-
alter database recover managed standby database cancel;
alter database register logfile  '/u01/oradata/redo03.log';
alter database recover managed standby database using current logfile disconnect from session;
alter database recover managed standby database disconnect from session;

check gap :-
SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE#
FROM V$ARCHIVE_GAP;

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


alter system suspend & alter system resume In Oracle Database

If the ALTER SYSTEM SUSPEND statement is entered on one system in an Oracle RAC configuration, then the internal locking mechanisms propagate the halt request across instances, thereby suspending I/O operations for all active instances in a given cluster."

 10:41:18 SQL> select database_status from v$instance;
DATABASE_STATUS
-----------------
SUSPENDED
Elapsed: 00:00:00.01
10:41:26 SQL>
10:41:27 SQL>
10:41:28 SQL>
10:41:28 SQL> alter system resume;
System altered.
Elapsed: 00:00:00.63
10:41:34 SQL>
10:41:35 SQL>
10:41:35 SQL> select database_status from v$instance;
DATABASE_STATUS
-----------------
ACTIVE
Elapsed: 00:00:00.01
10:41:43 SQL>

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...