Posts

ORA-02140: invalid tablespace name | Karan Rajpoot

                                                     ORA-02140: invalid tablespace name Error: -  ORA-02140: invalid tablespace name  Cause: - Tablespace name has not provided correctly while running the alter command Solution: - Use the correct tablespace name and again retry to execute alter command Command to check the tablespaces name: - select name from v$tablespace; Example: - SQL> alter tablespace user add datafile '/u01/app/oracle/oradata/prod/user02.dbf' ; alter tablespace user add datafile '/u01/app/oracle/oradata/prod/user02.dbf'                  * ERROR at line 1: ORA-02140: invalid tablespace name Note: - In the above command, tablespace name provided incorrectly, Correct tablespace name was  USERS. Now again rerun the command using correct tablespace name. Hope that will resolve your issue.  

How to Add, Resize, Drop and Rename of a datafile in Tablespace

Image
                                       How to Add, Resize, Drop and Rename a datafile in Tablespace In order to create a data file first, need to create a tablespace, To know how to create a tablespace  Click here To demonstrate, I will use USERS tablespace to Add,  Resize, Drop and Rename a data file. First, we can check how many data files are present under USERS tablespace through below command. Command: - select name from v$datafile; We can see from above output only a single data file is present under USERS tablespace. Addition of Datafile: - Command to add a datafile: - alter tablespace users add datafile '/u01/app/oracle/oradata/prod/users02.dbf' size 50m; The new data file has been added to my USERS tablespace. Resize of a Datafile: - Command to resize the datafile: - alter database datafile '/u01/app/oracle/oradata/prod/users02.dbf' resize 20m; Renaming of a Datafile: - We have a few steps to rename a data file: -

How to Create/Drop/Rename Tablespace in Oracle | Karan Rajpoot

Image
                                                            How to Add/Drop/Rename Tablespace in Oracle  Tablespace: - Tablespaces are the first level of logical origination in your database . Data for Oracle tables, indexes, etc is stored in data files, but never when an object is defined, the object is associated with a file directly. All the time the Oracle objects are located in the tablespaces. The tablespaces are logical concepts and each tablespace is in relation with one or more physical file. So, when an object is created in a tablespace, the data will be stored automatically in the files associated with that tablespace. In our database, we have several tablespaces which store our data: - 1) System Tablespace: - This tablespace is created automatically when the database is created. The SYSTEM tablespace is always online when the database is open. 2) Sysaux Tablespace: - Sysaux tablespace is also a mandatory tablespace and it is also created at the time of data

Oracle "Redo log Groups addition/deletion" | Karan Rajpoot

Image
                    Oracle "Redo log Groups addition/deletion" Step 1) To add redo log group first we will check the log groups, members details, location, and size. Example: - From the above output, we can see we have 3 groups and inside every group, we have 1 member each of size 50 MB and the location is /u01/app/oracle/oradata/karan/ Step 2) Now we will add one group and check the status of that group. Example: - Now again we can check the details of log groups and member. Now the 4th group and a member of 50 MB has been added successfully. Step 3) Now I will add one more member to the 4th log group. Example: - We can see from the above output that in group 4, now 2 members are there. Steps to drop the latest added group and member Note: - We cannot drop CURRENT members as shown in the above output, So I will add a new member in group 3 and then I will drop that member. Step 1)  Addition of new

How to do "Multiplexing of Control Files" through spfile ( server parameter file) in Oracle 11g

Image
Step 1)  To perform "Multiplexing of Control Files" through spfile ( server parameter file)" first we need to create spfile from pfile. Example to create spfile from pfile: -                                       Step 2) Copy the control files in physical location from 'cp' command. Note: - At present, I have 2 control files,  I will add one more Control files in the same location. Example: -  Now you can see from above output control04.ctl file has been physically added successfully under /u01/app/oracle/oradata/prod/control04.ctl location. Step 3)  Now you need to set the same through alter command. a)  first shut down the database                                          b)  Startup (Start the database through spfile)                                                                         Step 4) Now through SQL prompt alter the changes. Example: - Step 5) Now shutdown and start the database again and check

How to do "Multiplexing of Control Files" through pfile (parameter file) in Oracle 11g

Step 1) First step is to check how many control files are in IN USE. Example: - SQL> select name from v$controlfile; NAME -------------------------------------------------------------------------------- /u01/app/oracle/oradata/prod/control01.ctl /u01/app/oracle/fast_recovery_area/prod/control02.ctl Note: - As from the above output we can see 2 control files are in IN USE. Now I will add one more control file in /u01/app/oracle/oradata/prod location. Step 2)  Second step is to edit pfile which is under ORACLE_HOME/dbs location. Example: - prod.__pga_aggregate_target=339738624 prod.__sga_target=503316480 prod.__shared_io_pool_size=0 prod.__shared_pool_size=142606336 prod.__streams_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/prod/adump' *.audit_trail='db' *.compatible='11.2.0.4.0' *.control_files='/u01/app/oracle/oradata/prod/control01.ctl','/u01/app/oracle/fast_recovery_area/prod/control02.ctl', '/u01/a

How to resolve "TNS-12541 : TNS : no listener" error

Image
To resolve "TNS-12541: TNS: no listener" error we need to check whether our listener is up and running. Step 1) To check whether our listener is up or running, we need to run below command Command : - ps -ef | grep tns Example: - Note: - In this case, my listener is not started,  So I need to start my listener Step 2) To start the listener, we need to run below command Command : - lsnrctl start Example: - Step 3) Now again check the status of listener whether it is up and running, It should be up and running Command: - ps -ef | grep tns Example: - Note: - Now my listener is up and running properly