Home » SQL & PL/SQL » SQL & PL/SQL » How to check the name of the current database
How to check the name of the current database [message #9021] Mon, 13 October 2003 11:24 Go to next message
David Wong
Messages: 2
Registered: October 2003
Junior Member
Hi guys,
i am trying around oracle for the first time of my life.
I have managed to startup the database in sqlplus. The only question is which database has i started? The question is "is there anyway to findout from the sqlplus command line?"
And by the way, I am running oracle 9i in redhat linux9.
At the same time, I need to plan a hot backup from the linux server to a win2k server. Where and how can I get the tools and ways to do it?
Lastly, I also need to archive some unused data from the database to the win2k server to be stored in a tape drive daily to prevent using up the linux server 32GB hdd. Is there any archive options that are provided by oracle?

Btw, I really have alot of tears and fun installing this version to linux...haha..unforgettable experience....
Maybe the next thing I should do is to get a oracle certification ...

Thanks for your time/
David Wong
Re: How to check the name of the current database [message #9022 is a reply to message #9021] Mon, 13 October 2003 11:43 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
One way:

select name from v$database;
Re: How to check the name of the current database [message #9023 is a reply to message #9021] Mon, 13 October 2003 13:30 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
Select * from global_name;
Select instance_name from v$instance; to get the instance name.

You mean you want to perform hotbackups locally on Linux server and then move those backup files to a Win2K server periodically ? Use RMAN , bundled within Oracle for backup/recovery. You can use some backup management system/custom scripts to handle the backup files.

'Lastly,I also need to archive some unused data' ? You mean you want to archive & purge table data that is historic ? Partitioning,partition level export,move the dump to Win2k,drop partition is one way of doing things...but remember this frees up space within the tablespace only..and doesnt shrink the tablespace size itself (ie the datafiles that were allocated to the tablespace still occupy the same space in Linux as before). However you can allocate different tablespaces for different partitions and hence you can drop the tablespaces+datafiles to reclaim space , when you drop the partition.

You will need to refer to documentation for implemnting RMAN,Partitioning,exports etc..

-Thiru
Re: How to check the name of the current database [message #9024 is a reply to message #9023] Mon, 13 October 2003 19:38 Go to previous messageGo to next message
David Wong
Messages: 2
Registered: October 2003
Junior Member
Thanx Thiru for your partitioning method,
However, that'll only solve part of my problem as I need to archive and purge data from different tables (due to integrity dependency) selectively...Eg, all records of personnels that are already left a company/organization.

regards
David
Re: How to check the name of the current database [message #9034 is a reply to message #9024] Tue, 14 October 2003 08:33 Go to previous message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
Well,you could partition multiple tables using Range or List or a combination of them . Also consider exporting the set of related tables using QUERY exp parameter to filter the data out and then delete them. The space freed up in the tables will be reused most of the times. You could also perform online reorg of indexes or tables after a bulk purge,if needed.

-Thiru
Previous Topic: Features of Oracle and RDBMS
Next Topic: xml in Oracle 8
Goto Forum:
  


Current Time: Fri Apr 26 19:41:50 CDT 2024