Thursday, August 15, 2024

How to export table from MALLIK user in Oracle database?

How to export table from MALLIK user in Oracle database?

1. create directory inside database pointing to physical directory at OS level & grant read and write permission 

[oracle@oraclelab1 DUMP]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 6 08:44:29 2024
Version 19.17.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0

SQL> CREATE OR REPLACE DIRECTORY TEST_DIR AS '/u01/DUMP';

Directory created.

SQL> GRANT READ, WRITE ON DIRECTORY TEST_DIR TO system;

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0
[oracle@oraclelab1 DUMP]$

2. export table from Mallik user 

[oracle@oraclelab1 DUMP]$ expdp system/Mallik123 tables=MALLIK.STUDENT1 directory=TEST_DIR dumpfile=STUDENT.dmp logfile=expdpSTUDENT.log

Export: Release 19.0.0.0.0 - Production on Tue Aug 6 08:46:20 2024
Version 19.17.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Starting "SYSTEM"."SYS_EXPORT_TABLE_01":  system/******** tables=MALLIK.STUDENT1 directory=TEST_DIR dumpfile=STUDENT.dmp logfile=expdpSTUDENT.log
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "MALLIK"."STUDENT1"                         6.390 KB       2 rows
Master table "SYSTEM"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
  /u01/DUMP/STUDENT.dmp
Job "SYSTEM"."SYS_EXPORT_TABLE_01" successfully completed at Tue Aug 6 08:46:37 2024 elapsed 0 00:00:17

[oracle@oraclelab1 DUMP]$ ls -ltrh
total 180K
-rw-r-----. 1 oracle oinstall 176K Aug  6 08:46 STUDENT.dmp
-rw-r--r--. 1 oracle oinstall 1.1K Aug  6 08:46 expdpSTUDENT.log
[oracle@oraclelab1 DUMP]$

Thursday, August 8, 2024

Oracle On Windows - sysdba user is getting error ORA-01017: invalid username/password; logon denied

Oracle On Windows - sysdba user is getting error ORA-01017: invalid username/password; logon denied

Issue:
Windows administrator user is unable to connect to database as sysdba user using OS authentication

C:\Users\Administrator>set ORACLE_HOME=E:\app\mallik\product\19.0.0.0\dbhome_1
C:\Users\Administrator>set ORACLE_SID=ORA19C

C:\Users\Administrator>E:\app\mallik\product\19.0.0.0\dbhome_1\bin\sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jul 31 20:29:34 2024
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
C:\Users\Administrator>

Cause: 
Administrator user is not port of ORA_DBA group 


Solution or Fix:
Add administrator user to ORA_DBA group 

Edit local users and groups 
-> add administrator user to ORA_DBA group

Oracle On Windows - ORA-12560: TNS:protocol adapter error

Oracle On Windows - ORA-12560: TNS:protocol adapter error


Issue: 

Unable to connect to database getting error ORA-12560: TNS:protocol adapter error


C:\Users\Administrator>set ORACLE_HOME=E:\app\mallik\product\19.0.0.0\dbhome_1
C:\Users\Administrator>set ORACLE_SID=ORA19C

C:\Users\Administrator>E:\app\mallik\product\19.0.0.0\dbhome_1\bin\sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jul 31 23:00:31 2024
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle.  All rights reserved.

ERROR:
ORA-12560: TNS:protocol adapter error

Enter user-name:
ERROR:
ORA-12560: TNS:protocol adapter error

Enter user-name:
ERROR:
ORA-12560: TNS:protocol adapter error

SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
C:\Users\Administrator>

Cause:

Windows service will be down -  OracleServiceORA19C


Solution or Fix:

Verify the windows service status for Oracle and restart them 


Running SQL and O/S Commands Within RMAN

Running SQL and O/S Commands Within RMAN Sometimes you may want to run an SQL statement from within RMAN. Use RMAN’s sql command to do this....