Removing user-created datafile from SYSTEM tablespace in Oracle - oracle

While attempting to create a replacement tablespace for USER, I accidentally created a datafile in SYSTEM
Too many applications are using the database to bring down the entire database, and people will get hurt if these applications are not running.
Is there a way for me to remove the datafiles from the SYSTEM tablespace without bringing it down?
I tried:
ALTER TABLESPACE SYSTEM DROP DATAFILE 'path_here.dbf'
but get this error:
Error starting at line 1 in command:
alter tablespace system drop datafile 'path_here.dbf'
Error report:
SQL Error: ORA-01541: system tablespace cannot be brought offline; shut down if necessary
01541. 00000 - "system tablespace cannot be brought offline; shut down if necessary"
*Cause: Tried to bring system tablespace offline
*Action: Shutdown if necessary to do recovery

From the Oracle 11.1 documentation
You cannot drop datafiles in the SYSTEM tablespace.
However you can resize data files.

Related

how fix login oracle problem 'invalid username/password; logon denied' in oracle 18c

I installed Oracle18c XE and with SYS user I run these statements:
ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;
ALTER SESSION SET CONTAINER=XEPDB1;
Then iI create TableSpace
CREATE TABLESPACE A251_TABLESPACE DATAFILE 'a251_data.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 1G;
CREATE TEMPORARY TABLESPACE A251_TEMP_TABLESPACE TEMPFILE 'a251_data_temp.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE 1G;
And I created user ashmeta .
CREATE USER ashmeta IDENTIFIED BY ashmeta
DEFAULT TABLESPACE A251_TABLESPACE
TEMPORARY TABLESPACE A251_TEMP_TABLESPACE;
and I grant DBA to ashmeta.
So why when I want connect to this user do I see this error?
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
You are creating a local user in a PDB, so you can only connect to it via listener.
This can be achieved either by putting an entry into tnsnames.ora or by EZconnect. The latter does not need further configuration:
connect ashmeta/ashmeta#localhost:1521/XEPDB1
This works as long the database runs locally and the service name of the PDB is XEPDB1. If the database instance runs on a different host, use that hostname instead of localhost. The service name of the PDB you can find out by asking when connected to the PDB by issuing
show parameter service_names

Cannot start Oracle-XE 18c due to being full

I am unable to start a container inside oracel 18c xe , when using command "Alter Datbase Open" it gives error
"ORA-12954: The request exceeds the maximum allowed database size of 12 GB"
Upon searching internet i have found a way which says
"The only way was to append the XE datafiles in a "auxiliary" Oracle 18c home"
But i am unable to understnad how to mount only single tablespace from my xe database into Home version and remove not required stuff from the tablespace to free up space. Any help regarding this is appreciated
There is a bug in Oracle XE which allows a BigFile tablespace being created in a container DB and grow beyond the DB size limit imposed by Oracle Express Edition. The bug is fixed on version 19.1.0.
Unfortunately there is no workaround for this bug.
You might try to open the database with the problematic tablespace in OFFLINE and perform the following actions:
1.Start the database in mount state
SQL> STARTUP MOUNT
2.Put the tablespace in offline,
SQL> ALTER TABLESPACE xxxxx OFFLINE IMMEDIATE;
3.Open the database
SQL> ALTER DATABASE OPEN ;
In this status, the problematic tablespace is offline, so you can't access any element on it. Remove everything you don't need from other tablespaces ( USERS , etc) and resize others to a lower size ( UNDO , TEMP, SYSTEM ), if possible. Then, try also to resize the problematic datafile ( if the data is beyond the HWM it won't work ).
Finally, put the tablespace that was offline online again and see if the total size of the database is lower than the limit. Then try to open the database.

How to grant user space resource on the tablespace in oracle 12c

I had created a user in oracle 12c standard edition.
Now I tried to create a table using the username and password in sql developer, but I am getting the following error.
SQL Error: ORA-01950: no privileges on tablespace 'USERS'01950. 00000 - "no privileges on tablespace '%s'"
it had also show the cause and action which is as follows:
Cause: User does not have privileges to allocate an extent in the
specified tablespace.
Action: Grant the user the appropriate system privileges or grant the user
space resource on the tablespace.
can anyone please help me out in resolving this issue. my username is c##santh
You need to grant quota on the tablespace to the user. Tablespaces are a way of logically organising the disk space available for storage of data. Normally we would grant regular users a fixed amount of space, even in these days of "storage is cheap". For instance, this command will allow them to use 128 megabytes of storage on the USERS tablespace:
alter user c##santh quota 128M on users;
You use QUOTA UNLIMITED instead, which obviously imposes no limit on how much space the user can grab. Unlimited quota is good for an application owner schema.

How to start Oracle 12c database when table space file was accidentally deleted

I've accidentally deleted a tablespace file and now Oracle 12c will not open.
How can I remove this tablespace from oracle without the database being open?
If you have deleted the datafiles then you have to restore it from the physical backup if you don't want loose data.
Performing Complete Recovery of a Tablespace
The datafiles information is checked by Oracle during open database process. It means you can mount the database and make the datafile offline.
ALTER DATABASE DATAFILE 'path to datafile' OFFLINE;
ALTER DATABASE OPEN;
ALTER DATABASE DATAFILE '/u02/oracle/rbdb1/stuff01.dbf' OFFLINE;

Oracle DB: default Temp TableSpace

From Oracle Doc
"When the SYSTEM tablespace is locally managed, you must define at
least one default temporary tablespace when creating a database. A
locally managed SYSTEM tablespace cannot be used for default temporary
storage."
what is "SYSTEM tablespace is locally managed" ?
which is default temp table space system or temp ?
Thanks

Resources