Oracle and rman recovery catalog - oracle

I have been handed an oracle database (10.1.0.5.0) with no documentation and very little rman information and I need to change the existing the backup location drive for rman backups.
Before I do that I want to check if the database has a recovery catalog. How do I do this?
If no recovery catalog exists how to do I query existing script names and script content?

What platform are you on?
The CATALOG option will be on the RMAN command line or in the recovery script file. Just "grep" for catalog as a start.

Please check your RMAN backup log file. Where you will see where you are connecting to catalog or not.
The output will look like as below
Recovery Manager: Release 12.1.0.2.0 - Production on Thu May 2 08:03:55 2019
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
RMAN>
connected to recovery catalog database
recovery catalog schema release 12.02.00.01. is newer than RMAN release
Check your backup script where you will see where you are connected to RMAN Catalog or not
Please grep for "connect catalog"
$ cat script.sh | grep 'connect catalog'

Related

Connecting to oracle database using tnsname.ora with liquibase

I want to use liquibase to automate database deployments. Our setup is tnsnames.ora file is located on a shared drive \\shared\drive\path\tnsnames.ora
As per docs from liquibase, liquibase.properties files should look something like as below.
--driver=oracle.jdbc.OracleDriver
--classpath=ojdbc14.jar
--url="jdbc:oracle:thin:#<IP OR HOSTNAME>:<PORT>/<SERVICE NAME OR SID>"
--changeLogFile=db.changelog-1.0.xml
--username=<USERNAME>
--password=<PASSWORD>
Is there any way by which we can just specify <SERVICE NAME OR SID> which get the matching SERVICE NAME from tnsname.ora file located on the network share and connect to the required database ?
Have you tried using Liquibase built into SQLcl? SQLcl version 20.4 has Liquibase version 4.1.1 embedded within it so you can connect to the database using the same syntax that you would use for SQLPlus, then run your Liquibase commands from there.
C:\Users\ej>sql scott/tiger#tnsalias
SQLcl: Release 20.4 Production on Fri Mar 05 11:07:13 2021
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Last Successful login time: Fri Mar 05 2021 11:07:14 -05:00
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.6.0.0.0
SQL> lb version
Liquibase version: 4.1.1
Extension Version: 20.4.1.0
SQL> lb help
usage: lb COMMAND ...
Commands:
The following commands are available within the liquibase feature.
lb help COMMAND for command specific help
COMMAND
genobject Generate change log for a specific database object
genschema Generate changelogs and controller for connected schema
data Generate changelog for the data in tables
gencontrolfile Generate a blank controller.xml as a sample
update Updates database to current version
updatesql Generates SQL to update database to current version
rollback Rolls back the state requested
rollbacksql Writes SQL to roll back the database to the state requested
diff Writes description of differences between two databases to standard out.
dbdoc Generates Javadoc-like documentation based on current database and change log.
changelogsync Mark all changes as executed in the database.
clearchecksums Removes current checksums from database. On next update changesets that have already been
deployed will have their checksums recomputed, and changesets that have not been deployed will
be deployed.
listlocks Lists who currently has locks on the database changelog.
releaselocks Releases all locks on the database changelog.
status Outputs list of unrun change sets.
validate Checks the changelog for errors.
version Display product version information

ora-09925 unable to create audit trail file no such file or directory

I have just installed a oracle 12c 12.1.0 DB on a linux machine.
after completing the installation i tried to login to database as sysdba
[oracle#bjorn adump]$ sqlplus sys as sysdba/welcome
SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 12 16:41:17 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
Now i tried to startup the DB using below command
SQL> startup mount
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
and this error pop up !
my ENV variable are --
[oracle#bjorn adump]$ echo $ORACLE_BASE
/oracle
[oracle#bjorn adump]$ echo $ORACLE_HOME
/oracle/product/12.1.0/db_1
I have checked into pfile which is $ORACLE_HOME/dbs/init.ora
there is the entry for audit file
audit_file_dest="/oracle/admin/orcl/adump"
I also go to this location and check if the folder exists or nt but the folder was there and it aleady has some files in it like
orcl_m000_21634_20161012143245012051143795.aud
there are lots of file with names like this.
I gave permission to this folder
chmod -R 755 /oracle/admin/orcl/adump
tried creating a new file using
touch afile
and file get created.
It also got connect to the idle session but when i tried to do a startup the error pops up !
Please suggest what i am overlooking here which needs to be corrected.
Usually this could happen because:
AUDIT_FILE_DEST is not writable(chown +w $AUDIT_FILE_DEST)
$ORACLE_BASE/admin/$ORACLE_SID/adump exists and is not writable
$ORACLE_HOME/rdbms/audit is not writable
PS: Make sure to check permissions for the oracle user
Also please check for disk space availability
In our case, one of the drives in one of our 2-node RAC servers was failing - the reason why the OS (Linux) limited anyone's access, including root, to read-only.
The amber light was suppose to turn on but it didn't. It only turned on when we restarted that particular node.
You also have 3 things to verify:
- As already mentionned, check free space with df -have
- Check if the file system are Read/Write or read-only: cat /proc/mounts
- Finally, you can check free inodes space with df -i
Detailled information can be found here: https://www.oracle-scripts.net/unable-to-create-audit-trail-file-read-only-file-system/

is it possible to recover the Oracle Data Pump master table?

I'm trying to import a few files with a published Oracle Data Pump perl script: dumpinfo.pl
After successfully importing several dump files from the same export process, another file failed with:
# impdp system/****** DIRECTORY=RESTORE_DIR DUMPFILE=exp_%u.dmp PARALLEL=8
Import: Release 11.2.0.2.0 - Production on Mon Jul 7 11:40:37 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39059: dump file set is incomplete
ORA-39246: cannot locate master table within provided dump files
The script reports that it can't find a master table. Assuming that the master table is lost, there any mechanics for recover it?
Thanks...
ORA-39246 cannot locate master table within provided dump files
Cause: Check the export log file and make sure all of the files that
were exported are included in the current job. Action: A Data Pump
IMPORT or SQL_FILE operation was being performed but not all of the
files from the Data Pump export dump file set were included. In
particular, the dump file containing the export job's master table was
not provided.
Check that you have all dump files in that directory and they all are accessible to impdp utility. I got this error when our backup team has restored first five dmp files, and two last ones were missing.

Error in loading a data from the txt file to oracle table using sqlldr

my .ctl file is :
LOAD DATA
INFILE "C:\Users\nkb1\Desktop\fnames.txt"
INTO TABLE MDB.TEACHERS
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(first_name,last_name)
i am executing this from the windows command prompt as
sqlldr system#mdb/mdb control=C:\Users\nkb1\Desktop\load.ctl
and i am getting error like this.
C:\Users\nkb1>sqlldr system#mdb/mdb control=C:\Users\nkb1\Desktop\load.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Wed May 4 14:44:22 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL*Loader-704: Internal error: ulconnect: OCIEnvCreate [-1]
and i have set the ORACLE_HOME variable as C:\oracle\product\10.2.0\db_2 where the db stores
Bad news, this is a bug in 10.2.0.1.
Check Metalink document 361325.1 (hope you have access)!
Maybe you'll just have to grant additional privileges but it is possible that you'll need to apply the 10.2.0.3 patch set
I hit the same issue. Closed the command prompt.Opened one with Administrator Rights - Open CMD as Administrator.
That's it. This solved all the issues I had been facing.
If you have saved the SQLLOADER/SQLPLUS scripts as a batch file, then submit/open the batch file as administrator .
Hope this helps.

Error importing oracle dump

I am trying to import a dump into two schema in the same oracle DB.Following a workaround to do this.
I am trying to run the imp command with the INDEXFILE option to be able to modify the tablespace names in the sql. This is what I get :
E:\oracle_10_2\BIN>imp atlantis/atlantis#orcl file=ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp indexfile=index.sql full=y log=imp.log
Import: Release 10.2.0.1.0 - Production on Thu Mar 12 15:31:44 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Produc
tion
With the Partitioning, OLAP and Data Mining options
IMP-00002: failed to open ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp for read
Import file: EXPDAT.DMP >
Looked like a file permission issue to me so I tried changing it.
E:\oracle_10_2\BIN>cacls E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp /p atlantis:F
Are you sure (Y/N)?y
processed file: E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp
E:\oracle_10_2\BIN>cacls E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp
E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp CORP\atlantis:F
But the problem persists.
If you are using Oracle 10g consider using new export/import tool Oracle Data Pump in which you can use REMAP_TABLESPACE parameter.
Anyway, you missed the path of the exportfile (bassed on the commands fo give permissions). Then You wrote:
file=ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp
instead of
file=E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp
Then, the result export command to work is:
imp atlantis/atlantis#orcl file=E:\ABCD1_EXCLUDE_CLOB_TABS_BAK.dmp indexfile=index.sql full=y log=imp.log
Open window command line as administrator
imp user/pass#databasename(listenername) file='DMP path'
log=indexfile.log full=y;
Don't forget to add your database or listener name.

Resources