During RMAN backup, shutdown immediate database and facing error ORA-12514: TNS:listener? - oracle

I was taking an RMAN backup.
RMAN> SHUTDOWN IMMEDIATE;
After Shutdown Immediate i am not able to startup database.
I have tried
conn sys#databasename as sysdba
RMAN target sys#database
lsnrctl stop start status
But i am getting this error.
C:\Users\Umair>rman target sys#ora_prep
Recovery Manager: Release 12.1.0.2.0 - Production on Mon Jul 13 00:18:00 2020
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
target database Password:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Advice, please.Thank you.
Oracle 12.1.0
Windows 10

Static listener registration:
https://docs.oracle.com/en/database/oracle/oracle-database/18/spmss/adding-static-service-to-listener.html
https://support.oracle.com/knowledge/Oracle%20Database%20Products/2312510_1.html

Related

Reg: sysdba not logging, system user and other user connecting

Sysdba not logging other users are logging below, how to
fix it, able to login to other users successfully, please find below, only with sysdba not working
[oracle#dztupbin]$ ./sqlplus SYSTEM/"oracle"
SQL*Plus: Release 12.2.0.1.0 Production on Thu Apr 28 11:05:09 2022
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Thu Apr 28 2022 11:05:00 +01:00
Connected to:
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
[oracle#dztup bin]$ ./sqlplus SYSTEM/"oracle" as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Thu Apr 28 11:05:18 2022
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
sqlplus / as sysdba also giving same result:-
./sqlplus / as sysdba
ERROR:
ORA-01017: invalid username/password; logon denied
[oracle#dztup bin]$ ./sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Thu Apr 28 11:05:18 2022
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
I connected to sys user now:-
[oracle#dztup bin]$ ./sqlplus system/"oracle"
SQL*Plus: Release 12.2.0.1.0 Production on Thu Apr 28 13:25:51 2022
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Last Successful login time: Thu Apr 28 2022 13:25:15 +01:00
Connected to:
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
SQL> conn sys as sysdba
Enter password:
Connected.
SQL>
SQL>
SQL>
SQL> show user
USER is "SYS"
granted sysdba privilige to system user now able to connect:
but still sqlplus / as sysdba not working.
[oracle#dztup bin]$ ./sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Thu Apr 28 11:05:18 2022
Copyright (c) 1982, 2016, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
SYSDBA is a privilege, not a user. The SYSTEM account does not have SYSDBA privileges, by default. The only account with default SYSDBA privileges is SYS, which is usually authenticated locally by the operating system. e.g.:
sqlplus / as sysdba
If you have granted SYSDBA privileges to other users, then those users are authenticated against a separate password file when logging in with the SYSDBA role, and not the normal password hash. The password file is not updated automatically when the users' normal password is changed (as with ALTER USER x IDENTIFIED BY pass). To update the password in the password file you must re-grant SYSDBA privileges to the user; otherwise use the old password.

Restoring from Oracle RMAN backup fails about 60% of the time (noarchivelog mode)

I have a strange case where restoring a recently created Oracle RMAN backup sometimes works and at other times does not.
We use Oracle 12c. The database is running in noarchivelog mode.
Full story: We have a large CI setup, where a node can pick up a job, build itself from the repo and run tests. For some of the tests a database build is required. To speed the tests up we
First attempt to restore the database from the backup.
If that fails we then drop the database rebuild the shell and the data. Re-create the backup and then start the tests.
The idea of course is that most of the time restore will work, in reality restore works about 40% of the time, and at other times it fails and the database is rebuild. There does not seem to be any correlation between this happening and individual nodes, it works one time and then does not work.
We use the following script to backup
rman target=/ << EOF
RUN {
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
BACKUP DATABASE;
}
EXIT;
EOF
and the following to restore
rman target=/ << EOF
RUN {
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}
EXIT;
EOF
When things go badly it happens on the RECOVER step.
The errors are not always the same. Below are a few that I've seen
This one seems to be the most frequent recently
04:23:10 channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
04:23:10 Finished restore at 06-02-2017 04:23:10
04:23:10
04:23:10 Starting recover at 06-02-2017 04:23:10
04:23:10 using channel ORA_DISK_1
04:23:11
04:23:11 starting media recovery
04:23:11
04:23:11 archived log for thread 1 with sequence 52 is already on disk as file /oracle/oradata/DB1/redoDB11.log
04:23:11 archived log for thread 1 with sequence 53 is already on disk as file /oracle/oradata/DB1/redoDB12.log
04:23:11 archived log for thread 1 with sequence 54 is already on disk as file /oracle/oradata/DB1/redoDB13.log
04:23:11 RMAN-08187: WARNING: media recovery until SCN 1662458 complete
04:23:11 Finished recover at 06-02-2017 04:23:11
04:23:11
04:23:15 RMAN-00571: ===========================================================
04:23:15 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
04:23:15 RMAN-00571: ===========================================================
04:23:15 RMAN-03002: failure of sql statement command at 02/06/2017 04:23:14
04:23:15 ORA-01147: SYSTEM tablespace file 1 is offline
04:23:15 ORA-01110: data file 1: '/oracle/oradata/DB1/DB1_system.dbf'
04:23:15
04:23:15 RMAN>
04:23:15
04:23:15 Recovery Manager complete.
Another error
09:49:17 Finished restore at 27-01-2017 09:49:14
09:49:17
09:49:17 Starting recover at 27-01-2017 09:49:14
09:49:17 using channel ORA_DISK_1
09:49:17
09:49:17 starting media recovery
09:49:17
09:49:17 archived log for thread 1 with sequence 52 is already on disk as file /oracle/oradata/DB1/redoDB11.log
09:49:17 archived log for thread 1 with sequence 53 is already on disk as file /oracle/oradata/DB1/redoDB12.log
09:49:17 archived log for thread 1 with sequence 54 is already on disk as file /oracle/oradata/DB1/redoDB13.log
09:49:17 RMAN-08187: WARNING: media recovery until SCN 1755105 complete
09:49:17 Finished recover at 27-01-2017 09:49:15
09:49:17
09:49:17 RMAN-00571: ===========================================================
09:49:17 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
09:49:17 RMAN-00571: ===========================================================
09:49:17 RMAN-03002: failure of sql statement command at 01/27/2017 09:49:16
09:49:17 ORA-01147: SYSTEM tablespace file 1 is offline
09:49:17 ORA-01110: data file 1: '/oracle/oradata/DB1/DB1_system.dbf'
09:49:17
09:49:17 RMAN>
And one more
11:17:55 starting media recovery
11:17:55 media recovery failed
11:17:55 RMAN-00571: ===========================================================
11:17:55 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
11:17:55 RMAN-00571: ===========================================================
11:17:55 RMAN-03002: failure of recover command at 01/27/2017 11:17:55
11:17:55 ORA-00283: recovery session canceled due to errors
11:17:55 RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed
11:17:55 start until cancel
11:17:55 ORA-00283: recovery session canceled due to errors
11:17:55 ORA-16433: The database or pluggable database must be opened in read/write mode.
11:17:55
11:17:55 RMAN>
And another which is different from the above three, this one fails on RESTORE
09:14:11 Starting restore at 06-02-2017 09:14:11
09:14:11 allocated channel: ORA_DISK_1
09:14:11 channel ORA_DISK_1: SID=12 device type=DISK
09:14:12
09:14:12 creating datafile file number=1 name=/oracle/oradata/DB1/DB1_system.dbf
09:14:12 RMAN-00571: ===========================================================
09:14:12 RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
09:14:12 RMAN-00571: ===========================================================
09:14:12 RMAN-03002: failure of restore command at 02/06/2017 09:14:12
09:14:12 ORA-01180: can not create datafile 1
09:14:12 ORA-01110: data file 1: '/oracle/oradata/DB1/DB1_system.dbf'
09:14:12
09:14:12 RMAN>
Any help would be much appreciated. Thank you!
In order to understand why you are getting errors, it is important to understand what each one of those pieces mean from your script:
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
RESTORE DATABASE; copies the datafiles from your backup set back out to your database location. If the database was shutdown and consistent (was shutdown cleanly) when the backup was taken, then your backup is consistent.
RECOVER DATABASE; first attempts to make your backup consistent by applying backup archived redo logs, archived redo logs, and/or redo logs. Then, it will attempt to roll your database forward from the backup point in time until the most recent redo log. Since you are running in NOARCHIVELOG mode, this step will only produce errors like the ones you are seeing.
ALTER DATABASE OPEN RESETLOGS; brings your database on-line. RESETLOGS clears the redo logs and it is needed after an incomplete recovery (if the database couldn't roll forward and apply all of the redo from the backup archived logs, archived logs, and redo logs).
With this in mind, your script should look like the following:
RUN {
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
RESTORE DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}
As a side note, you should also configure an spfile+controlfile autobackup from RMAN. This backup is automatically taken whenever you backup your database.
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
As JSapkoka said, you should also restore the spfile and controlfile first as well, which, the full restore script would look something like:
RUN {
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'autobackup_format';
RESTORE SPFILE FROM AUTOBACKUP;
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
RESTORE CONTROLFILE FROM AUTOBACKUP;
ALTER DATABASE MOUNT;
RESTORE DATABASE;
ALTER DATABASE OPEN RESETLOGS;
}

protocol adapter Error in sql developer

C:\> lsnrctl status
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 24-AUG-2016 14:19:47
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 61: Unknown error

Error while duplicating Oracle database after failover, using 11.2.0.4

I've recently updated oracle from 11.2.0.1 to 11.2.0.4 and my redundant system is no longer able to recover from failover.
I'm using scripts both on primary and standby node to get back to a state where it is possible to install them as a redundant system again.
It is possible to run the reset script over and over again in all states exept after a failover is performed. The only change is the upgrade to 11.2.0.4. it worked like a charm in 11.2.0.1
I am using Data Guard Broker to maintan the redundancy.
The setup procedure is complicated and is hard to explain here, so I am just asking if someone have faced the same error, and might have a solution how to recover from such situation.
At least, this is the output where it fails:
(Backup step is performed prior to duplicate action)
2014-11-14 17:08:55 : Recovery Manager: Release 11.2.0.4.0 - Production on Fri Nov 14 17:08:48 2014
2014-11-14 17:08:55 : Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
2014-11-14 17:08:55 : connected to target database: REF15 (DBID=276671931)
2014-11-14 17:08:55 : RMAN> CONNECT AUXILIARY *
2014-11-14 17:08:55 : 2> RUN {
2014-11-14 17:08:55 : 3> SET UNTIL sequence = 159 thread = 1;
2014-11-14 17:08:55 : 4> ALLOCATE AUXILIARY CHANNEL CH1 TYPE DISK;
2014-11-14 17:08:55 : 5> DUPLICATE TARGET DATABASE FOR STANDBY NOFILENAMECHECK DORECOVER;
2014-11-14 17:08:56 : 6> RELEASE CHANNEL CH1;
2014-11-14 17:08:56 : 7> }
2014-11-14 17:08:56 : 8> exit;
2014-11-14 17:08:56 : connected to auxiliary database: REF15 (not mounted)
2014-11-14 17:08:56 : executing command: SET until clause
2014-11-14 17:08:56 : using target database control file instead of recovery catalog
2014-11-14 17:08:56 : allocated channel: CH1
2014-11-14 17:08:56 : channel CH1: SID=25 device type=DISK
2014-11-14 17:08:56 : Starting Duplicate Db at 14-NOV-14
2014-11-14 17:08:56 : released channel: CH1
2014-11-14 17:08:56 : RMAN-00571: ===========================================================
2014-11-14 17:08:56 : RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
2014-11-14 17:08:56 : RMAN-00571: ===========================================================
2014-11-14 17:08:56 : RMAN-03002: failure of Duplicate Db command at 11/14/2014 17:08:51
2014-11-14 17:08:56 : RMAN-05501: aborting duplication of target database
2014-11-14 17:08:56 : RMAN-20206: log sequence not found in the repository
2014-11-14 17:08:56 : Recovery Manager complete.
Thanks
Some LOG sequence hasn't been found. Given you request 159, it's that one, or lower.
How do you get that number ? The answer to that, may explain something already. Usuall, it's just a little too high.
Doesn't the ALERT tell you something more ? If you do restore, always have your alert tail-ed.
Here is a link to the DBA section where I found an answer to my question:
https://dba.stackexchange.com/questions/83704/error-while-duplicating-oracle-database-after-failover-using-11-2-0-4

Import terminated unsuccessfully - Oracle

I'm trying to import a dump file using imp command in oracle 10g. The following error message is displayed. Kindly assist
C:\Documents and Settings>imp 'rdata/rdata#nxtgen' file="D:\oracle\schema.dmp"
log=D:\oracle\schema.log full=y
Import: Release 10.2.0.1.0 - Production on Fri Jun 21 11:54:29 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
IMP-00058:
IMP-00000: Import terminated unsuccessfully
C:\Documents and Settings>

Resources