Not able to open PDB database- Oracle standard edition - oracle

I am using Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit on which I am facing a problem while opening PDB database.
Error:
SQL> select CON_ID,DBID,NAME,OPEN_MODE from v$pdbs;
CON_ID DBID NAME OPEN_MOD
---------- ------------- ------------------- -----------------
2 11247382 PDB$SEED READ ONLY
3 3988395454 PDB_ORCL12C MOUNTED
SQL> ALTER PLUGGABLE DATABASE ALL OPEN;
ALTER PLUGGABLE DATABASE ALL OPEN
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01405: fetched column value is NULL
SQL> ALTER PLUGGABLE DATABASE pdb_orcl12c OPEN READ WRITE FORCE;
ALTER PLUGGABLE DATABASE pdb_orcl12c OPEN READ WRITE FORCE
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01405: fetched column value is NULL
I am using below-mentioned steps for oracle database creation which is working fine on Oracle enterprise edition.
http://dbarahul.blogspot.in/2017/02/manual-cdb-pdb-database-creation-steps.html
Please help me to resolve this issue on Oracle standard edition.

According to the My Oracle Support, the error has occurred due to Bug 21061354.
Solution is to apply patch 21061354.
Reference: Alter Pluggable Database Open Returns ORA-01405 (Doc ID 2193378.1)

Related

How to create a table in 18c express edition

I just finished installing oracle 18c express edition on windows 8 laptop. During the installations, I did not enter any user name. I entered my password though.
At the end of the installation, I get this screen:
I connected Oracle database using sql plus as follows:
SQL> / as sysdba
I also entered the following commands in sql plus and all have worked. I was just following youtube tutorial without understanding everything.
SQL>alter pluggable database all open;
SQL>alter pluggable database all save state ;
SQL>select name from v$pdbs;
SQL> connect sys/oracle#localhost:1521/XEPDB1 as sysdba;
SQL> alter user hr identified by hr;
SQL> alter user hr account unlock;
SQL>connect hr/hr#localhost:1521/XEPDB1;
SQL> select * from employees;
SQL> CREATE TABLE TEST1 (CUSID NUMBER(10) NOT NULL);
This is the first time I am doing it. I tried to connect to a database using SYS as the user name and the password but did not connect.
SQL> Enter user name: SYS;
Enter password: Welcome1
SYS - During the installation, it said sys, system, and pdbadmin accounts. So I assume sys could be one of the user names.
Password - I entered the same password I used at the time of installation. I can connect to the database using / as sysdba. But I am not sure what this code meaning and what the user name and password and what database it is trying to connect. What would be the database name, user name and password?
Update 1
I created a connection in sql developer. Below shows the connection properties.
I created a table(sqldev2) in sql developer, inserted rows, and selected the data just fine.
Next, I went to sql plus and tried to select the same data from sqldev2 table but it shows no rows selected. I am assuming sql plus and sql developer may be pointing to two different databases?
How can I tell which database I am connected using the sql developer?
How can I connect to the same database using the sql plus?
This way I can work on the same database using the sql plus and sql developer.
Update 2
In Eclipse IDE, I had this code to connect to database. After that, I created a table (testtble) in Eclipse.
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("Driver Loaded");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:#localhost:1521/xe", "sys as sysdba","pw");
In SQL Plus, I connected to the db using "/ as sysdba". After that, I also tried to select * from testtble but it shows no table. I am assuming sql plus might be pointing to something different than what I used in eclipse. How should I connect to the database from SQL plus so I could see the table "testtble" in sql plus?
To check in which pluggable database you are currently connected in SQL*Plus use:
show con_name
If you connect to Oracle using a connect string that is using a database service mapped to a pluggable database (PDB), you will be connected directly to the related PDB.
Try different connections strings and check with show con_name.

How to clone a pluggable database in Oracle

I'm new to Oracle's pluggable databases (we still use Oracle 11.2 at work). For a test of partitions and subpartitions, I'll need to create a couple of dozen tablespaces. I thought, I'd quickly clone my current database, do the tests, and drop the database afterwards.
I was able to clone the database:
CREATE PLUGGABLE DATABASE ora193p2 FROM ora193p1
FILE_NAME_CONVERT = (
'/opt/oracle/oradata/ORA193C/ORA193P1/',
'/opt/oracle/oradata/ORA193C/ORA193P2/');
Pluggable database ORA193P2 created.
but got an error ORA-01109: database not open when trying to connect to it.
I've tried to open it, but get an error message, too (ora193c is the name of the cdb):
ALTER DATABASE ora193p2 OPEN;
ORA-01509: specified name 'ORA193P2' does not match actual 'ORA193C'
I used the database from vagrant-boxes.
For pluggable databases you need to add key word pluggable database followed by pdb name
SQL> create pluggable database pdbclone from orclpdb;
Pluggable database created.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
4 PDBCLONE MOUNTED
SQL> alter pluggable database pdbclone open;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
4 PDBCLONE READ WRITE NO
SQL> alter pluggable database pdbclone save state;
Pluggable database altered.
From 12.1.0.2 onward, you can preserve the PDB startup state through CDB restart. The 12.1.0.2 patchset introduced SAVE STATE and DISCARD STATE options:
ALTER PLUGGABLE DATABASE pdb_name OPEN;
ALTER PLUGGABLE DATABASE pdb_name SAVE STATE;
To discard the saved state:
ALTER PLUGGABLE DATABASE pdb_name DISCARD STATE;
For 12.1.0.1 and before, you could create an after startup trigger:
CREATE OR REPLACE TRIGGER open_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
END open_pdbs;
/
It creates a after startup system level trigger in CDB.
See Oracle 12c Post Installation Mandatory Steps

oracle 12c - PDB altered with errors

I have Oracle 12c installed.
I have two schemas installed in the plaggable DB ORCLPDB.
I restarted the machine where both oracle and my application exist.
now when I'm trying to open the pluggable database ORCLPDB using the below query :
alter pluggable database orclpdb open;
I'm getting the following Warning:
Warning: PDB altered with errors.
when I run this query :
SELECT NAME,STATUS,MESSAGE FROM PDB_PLUG_IN_VIOLATIONS;
I get this entry :
Name Status MESSAGE
--------------------------------
ORCLPDB PENDING Sync PDB failed with ORA-65177 during 'ALTER USER user123 IDENTIFIED BY *'
where user123 is an essential user that I cannot get rid of.
when I restarted the server , there was a hanged database transaction in the application , so I'm suspecting that this is the reason why the pluggable database is not opening correctly.
any suggestion to solve this issue is appreciated.

ORA-03113 Error while opening the database

I am trying to restore a database. The job was hung do to some issue, so I have restarted the Oracle service (Windows). I'm now getting an error while connecting to DB:
ORA-03113 end-of-file on communication channel
Process ID :9716
Session ID: 237 serial number :5
How can I solve this error?
ORA-03113 is a generic error. Please read this excellent post here for some information as to the root cause analysis of this error.
As a workaround for your case, assuming you can afford to reset the logs, you can probably do an incomplete database recovery and then open the database with RESETLOGS option:
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE RECOVER DATABASE UNTIL CANCEL;
SQL> ALTER DATABASE RECOVER CANCEL;
SQL> ALTER DATABASE OPEN RESETLOGS;
try this
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE RECOVER DATABASE UNTIL CANCEL;
SQL> ALTER DATABASE OPEN RESETLOGS;
it helped to me.
SQL> STARTUP MOUNT;
SQL> ALTER DATABASE RECOVER DATABASE UNTIL CANCEL;
SQL> ALTER DATABASE OPEN RESETLOGS;

Oracle dba_data_files table doesn't exist

I've been trying to access the dba_data_files table to see whether the autoextend is turned on for my data files. However, even though I'm using Oracle 10g, this table seems to not exist:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from dba_data_files;
select * from dba_data_files
*
ERROR at line 1:
ORA-00942: table or view does not exist
Is there some other way to check and even change whether a data file for a particular tablespace has the autoextend option turned on?
You should make sure you're connecting with an account that has privileges to see this view - try the SYSTEM account if you have that password, otherwise have your DBA grant the SELECT_CATALOG_ROLE to the account you are using.
You should be able to do this through the oracle enterprise manager under Administration

Resources